Hi,
I am solving a set of nonlinear and steady equations.
1.
Following ex13,  I just create
LinearImplicitSystem & system =
equation_systems.add_system<LinearImplicitSystem>("axis");
is this correct? or should I creat something like:
NonlinearImplicitSystem & system =
equation_systems.add_system<LinearImplicitSystem>("axis"); ?

2. In ex13, I am not sure what the following code do. Are these the codes of
Newton's method for solving nonlinear equations? Usually, when choice
Newton's method, tangent stiffness matrix will be calcualated. But I can not
find the corresponding code for achieving this?  Thanks in advance for your
kind help.
*for* (*unsigned* *int* l=0; l<n_nonlinear_steps; ++l)
    {
      last_nonlinear_soln->zero();
      last_nonlinear_soln->add(*navier_stokes_system.solution);

      perf_log.start_event(*"linear solve"*);
      equation_systems.get_system(*"Navier-Stokes"*).solve();
      perf_log.stop_event(*"linear solve"*);

      last_nonlinear_soln->add (-1., *navier_stokes_system.solution);

      last_nonlinear_soln->close();

      *const* Real norm_delta = last_nonlinear_soln->l2_norm();

      *const* *unsigned* *int* n_linear_iterations =
navier_stokes_system.n_linear_iterations();

      *const* Real final_linear_residual =
navier_stokes_system.final_linear_residual();

      *std*::cout << *"Linear solver converged at step: "*
        << n_linear_iterations
        << *", final residual: "*
        << final_linear_residual
        << *"  Nonlinear convergence: ||u - u_old|| = "*
        << norm_delta
        << std::endl;

      *if* ((norm_delta < nonlinear_tolerance) &&
  (navier_stokes_system.final_linear_residual() < nonlinear_tolerance))
        {
  *std*::cout << *" Nonlinear solver converged at step "*
    << l
    << std::endl;
  *break*;
        }

      equation_systems.parameters.set<Real> (*"linear solver tolerance"*) =
        *Utility*::pow<2>(final_linear_residual);

    } *// end nonlinear loop
*
*
*
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to