24#ifndef DUMUX_PNM_NEWTON_SOLVER_HH
25#define DUMUX_PNM_NEWTON_SOLVER_HH
39template<
class Assembler,
class LinearSolver,
44 using SolutionVector =
typename Assembler::ResidualType;
47 using ParentType::ParentType;
56 const SolutionVector &uLastIter)
final
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};
Consistency checks for the PNM two-phase model.
const Scalar PengRobinsonMixture< Scalar, StaticParameters >::u
Definition pengrobinsonmixture.hh:167
Definition discretization/porenetwork/fvelementgeometry.hh:33
const Assembler & assembler() const
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:734
virtual void newtonEndStep(Variables &vars, const SolutionVector &uLastIter)
Indicates that one Newton iteration was finished.
Definition nonlinear/newtonsolver.hh:637
virtual bool newtonConverged() const
Returns true if the error of the solution is below the tolerance.
Definition nonlinear/newtonsolver.hh:684
Consistency checks for the PNM two-phase model.
Definition newtonconsistencychecks.hh:72
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.