13#ifndef dealii_nonlinear_h
14#define dealii_nonlinear_h
77template <
typename VectorType = Vector<
double>>
238#ifdef DEAL_II_TRILINOS_WITH_NOX
243 const Teuchos::RCP<Teuchos::ParameterList> ¶meters =
244 Teuchos::rcp(
new Teuchos::ParameterList));
251#ifdef DEAL_II_WITH_SUNDIALS
261#ifdef DEAL_II_WITH_PETSC
273 solve(VectorType &initial_guess_and_solution);
296 std::function<void(
const VectorType &src, VectorType &dst)>
residual;
348 void(
const VectorType &rhs, VectorType &dst,
const double tolerance)>
366#ifdef DEAL_II_WITH_SUNDIALS
373#ifdef DEAL_II_TRILINOS_WITH_NOX
377 Teuchos::rcp(
new Teuchos::ParameterList);
383#ifdef DEAL_II_WITH_PETSC
399template <
typename VectorType>
406#ifdef DEAL_II_WITH_SUNDIALS
433#ifdef DEAL_II_TRILINOS_WITH_NOX
435 Teuchos::ParameterList &Line_Search =
parameters_nox->sublist(
"Line Search");
436 Line_Search.set(
"Method",
"Full Step");
443#ifdef DEAL_II_WITH_PETSC
483template <
typename VectorType>
490template <
typename VectorType>
502template <
typename VectorType>
512template <
typename VectorType>
532#ifdef DEAL_II_TRILINOS_WITH_NOX
533template <
typename VectorType>
538 const Teuchos::RCP<Teuchos::ParameterList> ¶meters)
547#ifdef DEAL_II_WITH_SUNDIALS
548template <
typename VectorType>
559template <
typename VectorType>
565 ExcMessage(
"PETSc SNES requires you to use PETSc vectors."));
570#ifdef DEAL_II_WITH_PETSC
588 const double tolerance = 1e-6;
592 nonlinear_solver.
solve(initial_guess_and_solution);
598template <
typename VectorType>
601 VectorType &initial_guess_and_solution)
607#ifdef DEAL_II_WITH_PETSC
610#ifdef DEAL_II_TRILINOS_WITH_NOX
613#ifdef DEAL_II_WITH_SUNDIALS
624#ifdef DEAL_II_WITH_SUNDIALS
633 nonlinear_solver.
setup_jacobian = [&](
const VectorType ¤t_u,
634 const VectorType & ) {
640 nonlinear_solver.
solve(initial_guess_and_solution);
643 false,
ExcMessage(
"You do not have SUNDIALS configured with deal.II!"));
648#ifdef DEAL_II_TRILINOS_WITH_NOX
662 nonlinear_solver.
solve(initial_guess_and_solution);
665 false,
ExcMessage(
"You do not have Trilinos configured with deal.II"));
677 const std::string solvers =
""
678#ifdef DEAL_II_WITH_SUNDIALS
681#ifdef DEAL_II_TRILINOS_WITH_NOX
684#ifdef DEAL_II_WITH_PETSC
691 "Invalid nonlinear solver specified. "
692 "The solvers available in your installation are:\n" +
unsigned int anderson_subspace_size
SolutionStrategy strategy
AdditionalData(const SolverType &solver_type=automatic, const SolutionStrategy &strategy=linesearch, const unsigned int maximum_non_linear_iterations=200, const double function_tolerance=1e-8, const double relative_tolerance=1e-5, const double step_tolerance=0.0, const unsigned int anderson_subspace_size=0)
double function_tolerance
unsigned int maximum_non_linear_iterations
const double relative_tolerance
TrilinosWrappers::NOXSolver< VectorType >::AdditionalData additional_data_nox
void set_data(const AdditionalData &additional_data)
void solve_with_petsc(VectorType &initial_guess_and_solution)
void set_data(const typename PETScWrappers::NonlinearSolverData &additional_data)
SUNDIALS::KINSOL< VectorType >::AdditionalData additional_data_kinsol
std::function< void(const VectorType &src, VectorType &dst)> residual
std::function< void(VectorType &)> reinit_vector
AdditionalData additional_data
Teuchos::RCP< Teuchos::ParameterList > parameters_nox
PETScWrappers::NonlinearSolverData additional_data_petsc_snes
MPI_Comm mpi_communicator
void solve(VectorType &initial_guess_and_solution)
void select(const typename AdditionalData::SolverType &type)
NonlinearSolverSelector()
std::function< void(const VectorType ¤t_u)> setup_jacobian
std::function< void(const VectorType &rhs, VectorType &dst, const double tolerance)> solve_with_jacobian
std::function< void(const VectorType &src, VectorType &dst)> solve_with_jacobian
std::function< void(const VectorType &x, VectorType &res)> residual
unsigned int solve(VectorType &x)
std::function< void(const VectorType &x)> setup_jacobian
std::function< void(const VectorType ¤t_u, const VectorType ¤t_f)> setup_jacobian
unsigned int solve(VectorType &initial_guess_and_solution)
std::function< void(const VectorType &src, VectorType &dst)> residual
std::function< void(const VectorType &rhs, VectorType &dst, const double tolerance)> solve_with_jacobian
std::function< void(VectorType &)> reinit_vector
std::function< void(const VectorType &y, VectorType &x, const double tolerance)> solve_with_jacobian
std::function< void(const VectorType &u, VectorType &F)> residual
unsigned int solve(VectorType &solution)
std::function< void(const VectorType ¤t_u)> setup_jacobian
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)