|
dune-pdelab 2.8
|
Loading...
Searching...
No Matches
solver/newton.hh
Go to the documentation of this file.
34 dwarn << "WARNING: Newton needed to override your choice to reuse the linear system in order to work!" << std::endl;
105 Dune::PDELab::set_shifted_dofs(_gridOperator.localAssembler().trialConstraints(), 0.0, dirichletValues);
107 Dune::PDELab::set_constrained_dofs(_gridOperator.localAssembler().trialConstraints(), 0.0, solution);
109 Dune::PDELab::copy_constrained_dofs(_gridOperator.localAssembler().trialConstraints(), dirichletValues, solution);
123 // corner case: ForceIteration==true. Use _minLinearReduction when initial defect is less than AbsoluteLimit.
124 if (not _fixedLinearReduction && !(_result.iterations==0 && _result.first_defect<_absoluteLimit)){
347 Dune::PDELab::set_shifted_dofs(_gridOperator.localAssembler().trialConstraints(), 0.0, dirichletValues);
349 Dune::PDELab::set_constrained_dofs(_gridOperator.localAssembler().trialConstraints(), 0.0, solution);
351 Dune::PDELab::copy_constrained_dofs(_gridOperator.localAssembler().trialConstraints(), dirichletValues, solution);
508 _hangingNodeModifications = parameterTree.get("HangingNodeModifications", _hangingNodeModifications);
533 lineSearchTree["MaxIterations"] = std::to_string(parameterTree.get("LineSearchMaxIterations", 10));
534 lineSearchTree["DampingFactor"] = std::to_string(parameterTree.get("LineSearchDampingFactor", 0.5));
535 lineSearchTree["AcceptBest"] = std::to_string(parameterTree.get("LineSearchAcceptBest", false));
iterator end()
#define DUNE_THROW(E, m)
DWarnType dwarn
void set_constrained_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
construct constraints from given boundary condition function
Definition constraints.hh:796
void set_shifted_dofs(const CG &cg, typename XG::ElementType x, XG &xg)
Definition constraints.hh:1014
void copy_constrained_dofs(const CG &cg, const XG &xgin, XG &xgout)
Definition constraints.hh:936
STL namespace.
Definition adaptivity.hh:29
std::shared_ptr< LineSearchInterface< typename Solver::Domain > > createLineSearch(Solver &solver, LineSearchStrategy strategy)
fectory function to create an instace of a line-search
Definition linesearch.hh:254
@ hackbuschReusken
std::enable_if< std::is_base_of< impl::WrapperBase, T >::value, Native< T > & >::type native(T &t)
Definition backend/interface.hh:192
T real_type
std::string get(const std::string &key, const std::string &defaultValue) const
ParameterTree & sub(const std::string &sub)
bool hasSub(const std::string &sub) const
Dune::PDELab::Backend::Matrix< MB, Domain, Range, JF > Jacobian
The type of the jacobian.
Definition gridoperatorutilities.hh:72
Dune::PDELab::Backend::Vector< GFSV, RF > Range
The type of the range (residual).
Definition gridoperatorutilities.hh:65
Dune::PDELab::Backend::Vector< GFSU, DF > Domain
The type of the domain (solution).
Definition gridoperatorutilities.hh:58
Abstract base class describing the line search interface.
Definition linesearch.hh:15
Newton solver for solving non-linear problems.
Definition solver/newton.hh:64
typename GridOperator::Traits::Jacobian Jacobian
Type of the Jacobian matrix.
Definition solver/newton.hh:79
NewtonMethod(const GridOperator &gridOperator, LinearSolver &linearSolver, const ParameterTree ¶meterTree)
Construct Newton passing a parameter tree.
Definition solver/newton.hh:619
void setMinLinearReduction(Real minLinearReduction)
Set the minimal reduction in the linear solver.
Definition solver/newton.hh:447
void setTerminate(std::shared_ptr< TerminateInterface > terminate)
Set the termination criterion.
Definition solver/newton.hh:541
Real getAbsoluteLimit() const
Definition solver/newton.hh:403
bool keepMatrix() const
Return whether the jacobian matrix is kept across calls to apply().
Definition solver/newton.hh:428
unsigned int getVerbosityLevel() const
Get verbosity level.
Definition solver/newton.hh:380
std::shared_ptr< TerminateInterface > getTerminate() const
Return a pointer to the stored termination criterion.
Definition solver/newton.hh:547
typename GridOperator::Traits::Domain Domain
Type of the domain (solution)
Definition solver/newton.hh:73
void setParameters(const ParameterTree ¶meterTree)
Interpret a parameter tree as a set of options for the newton solver.
Definition solver/newton.hh:502
virtual void prepareStep(Domain &solution)
Definition solver/newton.hh:98
void setHangingNodeModifications(bool b)
Does the problem have hanging nodes.
Definition solver/newton.hh:421
void setFixedLinearReduction(bool fixedLinearReduction)
Set wether to use a fixed reduction in the linear solver.
Definition solver/newton.hh:457
std::shared_ptr< LineSearch > getLineSearch() const
Return a pointer to the stored line search.
Definition solver/newton.hh:562
void discardMatrix()
Discard the stored Jacobian matrix.
Definition solver/newton.hh:434
GridOperator_ GridOperator
Type of the grid operator.
Definition solver/newton.hh:67
void setLineSearch(std::shared_ptr< LineSearch > lineSearch)
Set the line search.
Definition solver/newton.hh:556
void setReduction(Real reduction)
Set reduction Newton needs to achieve.
Definition solver/newton.hh:386
typename Dune::FieldTraits< typename Domain::ElementType >::real_type Real
Number type.
Definition solver/newton.hh:82
void setKeepMatrix(bool b)
Set whether the jacobian matrix should be kept across calls to apply().
Definition solver/newton.hh:409
LinearSolver_ LinearSolver
Type of the linear solver.
Definition solver/newton.hh:70
void setUseMaxNorm(bool b)
Set whether to use the maximum norm for stopping criteria.
Definition solver/newton.hh:415
typename GridOperator::Traits::Range Range
Type of the range (residual)
Definition solver/newton.hh:76
void setAbsoluteLimit(Real absoluteLimit)
Set absolute convergence limit.
Definition solver/newton.hh:398
virtual void updateDefect(Domain &solution)
Update _residual and defect in _result.
Definition solver/newton.hh:342
void printParameters(const std::string &_name="NewtonMethod") const
Output NewtonMethod parameters.
Definition solver/newton.hh:572
virtual void apply(Domain &solution)
Solve the nonlinear problem using solution as initial guess and for storing the result.
Definition solver/newton.hh:177
PDESolverResult< Real > Result
Type of results.
Definition solver/newton.hh:85
NewtonMethod(const GridOperator &gridOperator, LinearSolver &linearSolver)
Construct Newton using default parameters with default parameters.
Definition solver/newton.hh:606
void setReassembleThreshold(Real reassembleThreshold)
Set a threshold, when the linear operator is reassembled.
Definition solver/newton.hh:468
void setVerbosityLevel(unsigned int verbosity)
Set how much output you get.
Definition solver/newton.hh:371
Real getReduction() const
Get reduction.
Definition solver/newton.hh:392
int linear_solver_iterations
Definition solver/utility.hh:14
double linear_solver_time
Definition solver/utility.hh:13
T count(T... args)
T declval(T... args)
T endl(T... args)
T scientific(T... args)
T max(T... args)
T min(T... args)
T pow(T... args)
T reset(T... args)
T setprecision(T... args)
T setw(T... args)
T to_string(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8