24 #ifndef __NONLINEAR_VARIATIONAL_SOLVER_H 25 #define __NONLINEAR_VARIATIONAL_SOLVER_H 27 #include <dolfin/nls/NonlinearProblem.h> 28 #include <dolfin/nls/NewtonSolver.h> 29 #include <dolfin/nls/PETScSNESSolver.h> 30 #include "NonlinearVariationalProblem.h" 31 #include "SystemAssembler.h" 52 std::pair<std::size_t, bool>
solve();
59 p.
add(
"symmetric",
false);
60 p.
add(
"print_rhs",
false);
61 p.
add(
"print_matrix",
false);
63 std::set<std::string> nonlinear_solvers = {
"newton"};
64 std::string default_nonlinear_solver =
"newton";
69 nonlinear_solvers.insert(
"snes");
72 p.
add(
"nonlinear_solver", default_nonlinear_solver, nonlinear_solvers);
85 NonlinearDiscreteProblem(
86 std::shared_ptr<const NonlinearVariationalProblem> problem,
87 std::shared_ptr<const NonlinearVariationalSolver> solver);
90 ~NonlinearDiscreteProblem();
101 std::shared_ptr<const NonlinearVariationalProblem> _problem;
102 std::shared_ptr<const NonlinearVariationalSolver> _solver;
107 std::shared_ptr<NonlinearVariationalProblem> _problem;
110 std::shared_ptr<NonlinearDiscreteProblem> nonlinear_problem;
113 std::shared_ptr<NewtonSolver> newton_solver;
117 std::shared_ptr<PETScSNESSolver> snes_solver;
Common base class for DOLFIN variables.
Definition: Variable.h:35
NonlinearVariationalSolver(std::shared_ptr< NonlinearVariationalProblem > problem)
Create nonlinear variational solver for given problem.
Definition: NonlinearVariationalSolver.cpp:39
void add(std::string key)
Definition: Parameters.h:128
Definition: NonlinearVariationalSolver.h:39
Definition: NonlinearProblem.h:36
std::pair< std::size_t, bool > solve()
Definition: NonlinearVariationalSolver.cpp:46
Definition: Parameters.h:94
static Parameters default_parameters()
Definition: NewtonSolver.cpp:45
This class defines a common interface for matrices.
Definition: GenericMatrix.h:46
static Parameters default_parameters()
Default parameter values.
Definition: PETScSNESSolver.cpp:83
This class defines a common interface for vectors.
Definition: GenericVector.h:47
static Parameters default_parameters()
Default parameter values.
Definition: NonlinearVariationalSolver.h:55