6 #include <amdis/AdaptInfo.hpp> 7 #include <amdis/Flag.hpp> 8 #include <amdis/Initfile.hpp> 9 #include <amdis/ProblemIterationInterface.hpp> 10 #include <amdis/ProblemStatBase.hpp> 14 template <
class ProblemType>
19 using Problem = ProblemType;
21 using SolutionVector =
typename Problem::SolutionVector;
44 msg(
"{:>5} | {:>12} | {:>8} | {:>8} ",
"iter.",
"error",
"red.",
"tol");
46 msg(
"{:5d} | {:12.5e} | {:->8} | {:8.2} ",
49 msg(
"{:5d} | {:12.5e} | {:8.2e} | {:8.2} ",
58 assert(n == 0);
return *
prob_;
72 std::string
const&
name()
const override {
return name_; }
86 template <
class Range = void,
class... Indices>
120 double errOld_ = -1.0;
125 #include <amdis/nonlin/NewtonIteration.inc.hpp> int norm_
Type of norm to use for estimating the error.
Definition: NewtonIteration.hpp:116
NewtonIteration(std::string name, Problem &prob)
Constructs a nonlinear iteration scheme.
Definition: NewtonIteration.hpp:25
std::string const & name() const override
Returns the name of the problem.
Definition: NewtonIteration.hpp:72
Interface for master problems needed by the adaption loop. A master problem can handle one single or ...
Definition: ProblemIterationInterface.hpp:29
The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal...
Definition: Flag.hpp:13
double spaceTolerance(Key key) const
Returns spaceTolerance.
Definition: AdaptInfo.hpp:404
Definition: FieldMatVec.hpp:12
auto stepSolution(Indices... ii) const
Return a const view to a stepSolution component.
Definition: NewtonIteration.hpp:87
std::shared_ptr< SolutionVector const > stepSolutionVector() const
Returns const-ref of stepSolution_.
Definition: NewtonIteration.hpp:76
Definition: AdaptBase.hpp:6
void endIteration(AdaptInfo &adaptInfo) override
Implementation of ProblemIterationInterface::endIteration.
Definition: NewtonIteration.hpp:42
static std::optional< T > get(std::string const &key)
Get parameter-values from parameter-tree.
Definition: Initfile.hpp:25
ProblemStatBase & problem([[maybe_unused]] std::string const &name) override
Returns the problem with the given name.
Definition: NewtonIteration.hpp:65
Interface for time independent problems. Concrete problems must override all pure virtual methods...
Definition: ProblemStatBase.hpp:58
int numProblems() const override
Implementation of ProblemIterationInterface::numProblems.
Definition: NewtonIteration.hpp:62
std::string name_
Name of the newton problem, used to access initfile parameters.
Definition: NewtonIteration.hpp:94
int spaceIteration() const
Returns spaceIteration_.
Definition: AdaptInfo.hpp:165
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:25
Flag oneIteration(AdaptInfo &adaptInfo, Flag toDo) override
Implementation of ProblemIterationInterface::oneIteration.
Definition: NewtonIteration.inc.hpp:9
void beginIteration(AdaptInfo &) override
Implementation of ProblemIterationInterface::beginIteration.
Definition: NewtonIteration.hpp:36
Definition: NewtonIteration.hpp:15
ProblemStatBase & problem([[maybe_unused]] int n=0) override
Returns problemStat.
Definition: NewtonIteration.hpp:56
int buildCycle_
Build matrix every i'th iteration.
Definition: NewtonIteration.hpp:108
Problem * prob_
Problem containing the Jacobian operators and objective function.
Definition: NewtonIteration.hpp:97
std::shared_ptr< SolutionVector > stepSolution_
Solution of the update step.
Definition: NewtonIteration.hpp:100