24#ifndef DUMUX_PNM_NEWTON_SOLVER_HH
25#define DUMUX_PNM_NEWTON_SOLVER_HH
39template<
class Assembler,
class LinearSolver,
40 template<
class,
class>
class NewtonConsistencyChecks = TwoPNewtonConsistencyChecks>
47 using ParentType::ParentType;
61 auto& gridVariables = this->
assembler().gridVariables();
62 auto& invasionState = gridVariables.gridFluxVarsCache().invasionState();
63 switchedInLastIteration_ = invasionState.update(uCurrentIter, gridVariables.curGridVolVars(), gridVariables.gridFluxVarsCache());
69 NewtonConsistencyChecks<typename Assembler::GridVariables, SolutionVector> checks;
70 checks.performChecks(gridVariables, uCurrentIter, this->
assembler().prevSol());
81 if (switchedInLastIteration_)
94 auto& gridVariables = this->
assembler().gridVariables();
95 gridVariables.gridFluxVarsCache().invasionState().reset();
104 auto& gridVariables = this->
assembler().gridVariables();
105 gridVariables.gridFluxVarsCache().invasionState().advance();
109 bool switchedInLastIteration_{
false};
Definition: discretization/porenetwork/fvelementgeometry.hh:33
const Assembler & assembler() const
Access the assembler.
Definition: common/pdesolver.hh:121
An implementation of a Newton solver.
Definition: nonlinear/newtonsolver.hh:216
virtual void newtonFail(Variables &u)
Called if the Newton method broke down. This method is called after newtonEnd()
Definition: nonlinear/newtonsolver.hh:735
virtual void newtonEndStep(Variables &vars, const SolutionVector &uLastIter)
Indicates that one Newton iteration was finished.
Definition: nonlinear/newtonsolver.hh:638
typename Backend::DofVector SolutionVector
Definition: nonlinear/newtonsolver.hh:221
virtual bool newtonConverged() const
Returns true if the error of the solution is below the tolerance.
Definition: nonlinear/newtonsolver.hh:685
A two-phase PNM specific newton solver.
Definition: porenetwork/2p/newtonsolver.hh:42
bool newtonConverged() const final
Returns true if the current solution can be considered to be accurate enough. We enforce an additiona...
Definition: porenetwork/2p/newtonsolver.hh:79
void newtonFail(SolutionVector &u) final
Called if the Newton method broke down. This method is called after newtonEnd() and resets the invasi...
Definition: porenetwork/2p/newtonsolver.hh:91
void newtonSucceed() final
Called if the Newton method ended successfully This method is called after newtonEnd() and advances t...
Definition: porenetwork/2p/newtonsolver.hh:102
void newtonEndStep(SolutionVector &uCurrentIter, const SolutionVector &uLastIter) final
Called after each Newton update.
Definition: porenetwork/2p/newtonsolver.hh:55
Reference implementation of a Newton solver.