#include <TimeStepControl.hpp>

Inheritance diagram for Opm::PIDAndIterationCountTimeStepControl:
Inheritance graph

Public Member Functions

 PIDAndIterationCountTimeStepControl (const int target_iterations=20, const double decayDampingFactor=1.0, const double growthDampingFactor=1.0/1.2, const double tol=1e-3, const double minTimeStepBasedOnIterations=0., const bool verbose=false)
 constructor More...
 
double computeTimeStepSize (const double dt, const int iterations, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer &) const override
 
bool timeStepAccepted (const double, const double) const override
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
bool operator== (const PIDAndIterationCountTimeStepControl &) const
 
bool operator== (const PIDTimeStepControl &) const
 

Static Public Member Functions

static PIDAndIterationCountTimeStepControl serializationTestObject ()
 

Static Public Attributes

static constexpr TimeStepControlType Type = TimeStepControlType::PIDAndIterationCount
 

Protected Attributes

const int target_iterations_
 
const double decayDampingFactor_
 
const double growthDampingFactor_
 
const double minTimeStepBasedOnIterations_
 
const double tol_ = 1e-3
 
std::vector< double > errors_ {}
 
const bool verbose_ = false
 

Detailed Description

PID controller based adaptive time step control as above that also takes an target iteration into account.

Constructor & Destructor Documentation

◆ PIDAndIterationCountTimeStepControl()

Opm::PIDAndIterationCountTimeStepControl::PIDAndIterationCountTimeStepControl ( const int  target_iterations = 20,
const double  decayDampingFactor = 1.0,
const double  growthDampingFactor = 1.0/1.2,
const double  tol = 1e-3,
const double  minTimeStepBasedOnIterations = 0.,
const bool  verbose = false 
)
explicit

constructor

Parameters
target_iterationsnumber of desired iterations per time step
toltolerance for the relative changes of the numerical solution to be accepted in one time step (default is 1e-3)
verboseif true get some output (default = false)

Member Function Documentation

◆ computeTimeStepSize()

double Opm::PIDAndIterationCountTimeStepControl::computeTimeStepSize ( const double  dt,
const int  iterations,
const RelativeChangeInterface relativeChange,
const AdaptiveSimulatorTimer  
) const
overridevirtual

compute new time step size suggestions based on the PID controller

Parameters
dttime step size used in the current step
iterationsnumber of iterations used (linear/nonlinear)
timeErrorobject to compute || u^n+1 - u^n || / || u^n+1 ||
Returns
suggested time step size for the next step

Reimplemented from Opm::PIDTimeStepControl.

◆ operator==() [1/2]

bool Opm::PIDAndIterationCountTimeStepControl::operator== ( const PIDAndIterationCountTimeStepControl ) const

◆ operator==() [2/2]

bool Opm::PIDTimeStepControl::operator== ( const PIDTimeStepControl ) const
inherited

◆ serializationTestObject()

static PIDAndIterationCountTimeStepControl Opm::PIDAndIterationCountTimeStepControl::serializationTestObject ( )
static

◆ serializeOp()

template<class Serializer >
void Opm::PIDAndIterationCountTimeStepControl::serializeOp ( Serializer &  serializer)
inline

◆ timeStepAccepted()

bool Opm::PIDAndIterationCountTimeStepControl::timeStepAccepted ( const double  error,
const double  timeStepJustCompleted 
) const
inlineoverridevirtual

For the general 3rd order controller, the internal shifting of errors and time steps happens here, and hence this method needs to be called for (after) each time step

Reimplemented from Opm::PIDTimeStepControl.

Member Data Documentation

◆ decayDampingFactor_

const double Opm::PIDAndIterationCountTimeStepControl::decayDampingFactor_
protected

Referenced by serializeOp().

◆ errors_

std::vector< double > Opm::PIDTimeStepControl::errors_ {}
mutableprotectedinherited

◆ growthDampingFactor_

const double Opm::PIDAndIterationCountTimeStepControl::growthDampingFactor_
protected

Referenced by serializeOp().

◆ minTimeStepBasedOnIterations_

const double Opm::PIDAndIterationCountTimeStepControl::minTimeStepBasedOnIterations_
protected

Referenced by serializeOp().

◆ target_iterations_

const int Opm::PIDAndIterationCountTimeStepControl::target_iterations_
protected

Referenced by serializeOp().

◆ tol_

const double Opm::PIDTimeStepControl::tol_ = 1e-3
protectedinherited

◆ Type

constexpr TimeStepControlType Opm::PIDAndIterationCountTimeStepControl::Type = TimeStepControlType::PIDAndIterationCount
staticconstexpr

◆ verbose_

const bool Opm::PIDTimeStepControl::verbose_ = false
protectedinherited

The documentation for this class was generated from the following file: