AdaptInstationary implements the adaptive procedure for time dependent problems (see ProblemInstat). It contains a pointer to a ProblemInstat object. More...
#include <AdaptInstationary.hpp>
Inherits AdaptBase.
Public Member Functions | |
AdaptInstationary (std::string const &name, ProblemIterationInterface &problemStat, AdaptInfo &info, ProblemTimeInterface &problemInstat, AdaptInfo &initialInfo) | |
void | setStrategy (int strategy) |
Sets strategy to aStrategy. | |
int | strategy () const |
Returns strategy. | |
int | adapt () override |
Implementation of AdaptBase::adapt() More... | |
Public Member Functions inherited from AdaptBase | |
AdaptBase (std::string const &name, ProblemIterationInterface *problemIteration, AdaptInfo &adaptInfo, ProblemTimeInterface *problemTime=nullptr, AdaptInfo *initialAdaptInfo=nullptr) | |
Constructor. | |
virtual | ~AdaptBase ()=default |
Destructor. | |
virtual int | adapt ()=0 |
Pure virtual method. Must be overloaded by sub classes to perform a concrete adaption loop. More... | |
std::string const & | name () const |
Returns name. | |
ProblemIterationInterface * | problemIteration () const |
Returns problemIteration. | |
void | setProblemIteration (ProblemIterationInterface *problemIteration) |
AdaptInfo & | adaptInfo () const |
Returns adaptInfo. | |
ProblemTimeInterface * | problemTime () const |
Returns problemTime. | |
void | setProblemTime (ProblemTimeInterface *problemTime) |
AdaptInfo & | initialAdaptInfo () const |
Returns initialAdaptInfo. | |
Protected Member Functions | |
virtual void | oneTimestep () |
Implements one (maybe adaptive) timestep. Both the explicit and the implicit time strategy are implemented. The semi-implicit strategy is only a special case of the implicit strategy with a limited number of iterations (exactly one). The routine uses the parameter strategy to select the strategy: strategy 0: Explicit strategy, strategy 1: Implicit strategy. | |
virtual void | explicitTimeStrategy () |
Implements the explit time strategy. Used by oneTimestep(). | |
virtual void | implicitTimeStrategy () |
Implements the implicit time strategy. Used by oneTimestep(). | |
void | simpleAdaptiveTimeStrategy () |
This iteration strategy allows the timestep and the mesh to be adapted after each timestep solution. There are no inner loops for mesh adaption and no refused timesteps. | |
Protected Attributes | |
int | strategy_ = 0 |
Strategy for choosing one timestep. | |
double | timeDelta1_ = 0.7071 |
Parameter \( \delta_1 \) used in time step reduction. | |
double | timeDelta2_ = 1.4142 |
Parameter \( \delta_2 \) used in time step enlargement. | |
bool | breakWhenStable_ = false |
bool | fixedTimestep_ |
min-timestep == max-timestep | |
Protected Attributes inherited from AdaptBase | |
std::string | name_ |
Name of the adaption loop. | |
ProblemIterationInterface * | problemIteration_ |
Problem iteration interface. | |
AdaptInfo & | adaptInfo_ |
Main adapt info. | |
ProblemTimeInterface * | problemTime_ |
problem time interface | |
AdaptInfo * | initialAdaptInfo_ |
Adapt info for initial adapt. Will be given to problemTime->solveInitialProblem(). | |
AdaptInstationary implements the adaptive procedure for time dependent problems (see ProblemInstat). It contains a pointer to a ProblemInstat object.
AdaptInstationary | ( | std::string const & | name, |
ProblemIterationInterface & | problemStat, | ||
AdaptInfo & | info, | ||
ProblemTimeInterface & | problemInstat, | ||
AdaptInfo & | initialInfo | ||
) |
Creates a AdaptInstationary object with the given name for the time dependent problem problemInstat.
References AdaptBase::adaptInfo_, AdaptInstationary::breakWhenStable_, AdaptInstationary::fixedTimestep_, Initfile::get(), AdaptInfo::maxTimestep(), AdaptInfo::minTimestep(), AdaptBase::name_, AdaptInstationary::strategy_, AdaptInstationary::timeDelta1_, and AdaptInstationary::timeDelta2_.
|
overridevirtual |
Implementation of AdaptBase::adapt()
Implements AdaptBase.
References AdaptBase::adaptInfo_, AdaptInstationary::breakWhenStable_, ProblemTimeInterface::closeTimestep(), AdaptBase::initialAdaptInfo_, ProblemTimeInterface::initTimestep(), AdaptInfo::maxTimestep(), AdaptInfo::minTimestep(), AdaptInstationary::oneTimestep(), AdaptBase::problemTime_, AdaptInfo::reachedEndTime(), AdaptInfo::setStartTime(), ProblemTimeInterface::setTime(), AdaptInfo::setTime(), ProblemTimeInterface::solveInitialProblem(), AdaptInfo::startTime(), AdaptInfo::timestep(), AdaptInfo::timestepNumber(), and ProblemTimeInterface::transferInitialSolution().
|
protected |
If this parameter is 1 and the instationary problem is stable, hence the number of solver iterations to solve the problem is zero, the adaption loop will stop.
Referenced by AdaptInstationary::AdaptInstationary(), and AdaptInstationary::adapt().