34 #if defined(LIBMESH_HAVE_PETSC) || defined(LIBMESH_TRILINOS_HAVE_NOX) 36 std::unique_ptr<NonlinearSolver<T>>
40 switch (solver_package)
43 #ifdef LIBMESH_HAVE_PETSC 45 return libmesh_make_unique<PetscNonlinearSolver<T>>(s);
46 #endif // LIBMESH_HAVE_PETSC 48 #if defined(LIBMESH_TRILINOS_HAVE_NOX) && defined(LIBMESH_TRILINOS_HAVE_EPETRA) 50 return libmesh_make_unique<NoxNonlinearSolver<T>>(s);
54 libmesh_error_msg(
"ERROR: Unrecognized solver package: " << solver_package);
58 #else // LIBMESH_HAVE_PETSC || LIBMESH_TRILINOS_HAVE_NOX 61 std::unique_ptr<NonlinearSolver<T>>
64 libmesh_not_implemented_msg(
"ERROR: libMesh was compiled without nonlinear solver support");
74 libmesh_error_msg(
"Preconditioner must be attached before the solver is initialized!");
76 _preconditioner = preconditioner;
82 _solver_configuration = &solver_configuration;
void attach_preconditioner(Preconditioner< T > *preconditioner)
void set_solver_configuration(SolverConfiguration &solver_configuration)
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
static std::unique_ptr< NonlinearSolver< T > > build(sys_type &s, const SolverPackage solver_package=libMesh::default_solver_package())