AMDiS  0.1
The Adaptive Multi-Dimensional Simulation Toolbox
AdaptInfo Class Reference

Holds adapt parameters and infos about the problem. More...

#include <AdaptInfo.hpp>

Classes

class  ScalContent
 Stores adapt infos for a scalar problem or for one component of a vector valued problem. More...
 

Public Types

using Key = std::string
 

Public Member Functions

 AdaptInfo (std::string const &name)
 Constructor.
 
virtual ~AdaptInfo ()=default
 Destructor.
 
void reset ()
 Resets all variables to zero (or something equivalent)
 
virtual bool spaceToleranceReached () const
 Returns whether space tolerance is reached.
 
virtual bool spaceToleranceReached (Key key) const
 Returns whether space tolerance of component associated with key is reached.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
bool spaceToleranceReached (const TP &tp) const
 
virtual bool timeToleranceReached () const
 Returns whether time tolerance is reached.
 
virtual bool timeToleranceReached (Key key) const
 Returns whether time tolerance of component associated with key is reached.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
bool timeToleranceReached (const TP &tp) const
 
virtual bool timeErrorLow () const
 Returns whether time error is under its lower bound.
 
double timeEstCombined (Key key) const
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeEstCombined (const TP &tp) const
 
void printTimeErrorLowInfo () const
 Print debug information about time error and its bound.
 
int spaceIteration () const
 Returns spaceIteration_.
 
void setSpaceIteration (int it)
 Sets spaceIteration_.
 
int maxSpaceIteration () const
 Returns maxSpaceIteration_.
 
void maxSpaceIteration (int it)
 Sets maxSpaceIteration_.
 
void incSpaceIteration ()
 Increments spaceIteration_ by 1;.
 
void setTimestepIteration (int it)
 Sets timestepIteration_.
 
int timestepIteration () const
 Returns timestepIteration_.
 
void incTimestepIteration ()
 Increments timestepIteration_ by 1;.
 
int maxTimestepIteration () const
 Returns maxTimestepIteration_.
 
void setMaxTimestepIteration (int it)
 Sets maxTimestepIteration.
 
void setTimeIteration (int it)
 Sets timeIteration_.
 
int timeIteration () const
 Returns timeIteration_.
 
void incTimeIteration ()
 Increments timesIteration_ by 1;.
 
int maxTimeIteration () const
 Returns maxTimeIteration_.
 
void setMaxTimeIteration (int it)
 Sets maxTimeIteration_.
 
int timestepNumber () const
 Returns timestepNumber_.
 
void setTimestepNumber (int num)
 Sets timestepNumber.
 
int numberOfTimesteps () const
 Returns nTimesteps_.
 
void setNumberOfTimesteps (int num)
 Sets nTimesteps.
 
void incTimestepNumber ()
 Increments timestepNumber_ by 1;.
 
void setEstSum (double e, Key key)
 Sets est_sum.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void setEstSum (double e, const TP &tp)
 
void setEstMax (double e, Key key)
 Sets est_max.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void setEstMax (double e, const TP &tp)
 
void setTimeEstMax (double e, Key key)
 Sets est_max.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void setTimeEstMax (double e, const TP &tp)
 
void setTimeEstSum (double e, Key key)
 Sets est_t_sum.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void setTimeEstSum (double e, const TP &tp)
 
double estSum (Key key) const
 Returns est_sum.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double estSum (const TP &tp)
 
double estTSum (Key key) const
 Returns est_t_sum.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double estTSum (const TP &tp)
 
double estMax (Key key) const
 Returns est_max.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double estMax (const TP &tp)
 
double timeEstMax (Key key) const
 Returns est_max.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeEstmax (const TP &tp)
 
double timeEstSum (Key key) const
 Returns est_t_sum.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeEstSum (const TP &tp)
 
double timeEst () const
 Returns timeEst_ the estimated overall time error.
 
void setTimeEst (double value)
 
double spaceTolerance (Key key) const
 Returns spaceTolerance.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double spaceTolerance (const TP &tp)
 
void setSpaceTolerance (Key key, double tol)
 Sets spaceTolerance.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void setSpaceTolerance (const TP &tp, double tol)
 
double timeTolerance (Key key) const
 Returns timeTolerance.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeTolerance (const TP &tp)
 
double timeRelativeTolerance (Key key) const
 Returns timeRelativeTolerance.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeRelativeTolerance (const TP &tp)
 
double setTime (double t)
 Sets time_.
 
double const & time () const
 Gets time_.
 
double setTimestep (double t)
 Sets timestep_.
 
double const & timestep () const
 Gets timestep_.
 
void setLastProcessedTimestep (double t)
 
double lastProcessedTimestep () const
 
bool reachedEndTime () const
 
void setMinTimestep (double t)
 Sets minTimestep_.
 
double minTimestep () const
 Gets minTimestep_.
 
void maxTimestep (double t)
 Sets maxTimestep_.
 
double maxTimestep () const
 Gets maxTimestep_.
 
void setStartTime (double time)
 Sets startTime_ = time.
 
void setEndTime (double time)
 Sets endTime_ = time.
 
double startTime () const
 Returns startTime_.
 
double endTime () const
 Returns endTime_.
 
double timeErrLow (Key key) const
 Returns timeErrLow.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
double timeErrLow (const TP &tp)
 
bool isCoarseningAllowed (Key key) const
 Returns whether coarsening is allowed or not.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
bool isCoarseningAllowed (const TP &tp)
 
bool isRefinementAllowed (Key key) const
 Returns whether coarsening is allowed or not.
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
bool isRefinementAllowed (const TP &tp)
 
void allowRefinement (bool allow, Key key)
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void allowRefinement (bool allow, const TP &tp)
 
void allowCoarsening (bool allow, Key key)
 
template<class TP , REQUIRES(Concepts::PreTreePath< TP >) >
void allowCoarsening (bool allow, const TP &tp)
 
int size () const
 
void setSolverIterations (int it)
 
int solverIterations () const
 
void setMaxSolverIterations (int it)
 
int maxSolverIterations () const
 
void setSolverTolerance (double tol)
 
double solverTolerance () const
 
void setSolverResidual (double res)
 
double solverResidual () const
 
void setGlobalTimeTolerance (double tol)
 
double globalTimeTolerance () const
 
void resetTimeValues (double newTimeStep, double newStartTime, double newEndTime)
 Resets timestep, current time and time boundaries without any check. Is used by the parareal algorithm.
 

Protected Attributes

std::string name_
 Name.
 
int spaceIteration_ = -1
 Current space iteration.
 
int maxSpaceIteration_ = -1
 maximal allowed number of iterations of the adaptive procedure; if maxIteration <= 0, no iteration bound is used
 
int timestepIteration_ = 0
 Current timestep iteration.
 
int maxTimestepIteration_ = 30
 Maximal number of iterations for choosing a timestep.
 
int timeIteration_ = 0
 Current time iteration.
 
int maxTimeIteration_ = 30
 Maximal number of time iterations.
 
double time_ = 0.0
 Actual time, end of time interval for current time step.
 
double startTime_ = 0.0
 Initial time.
 
double endTime_ = 1.0
 Final time.
 
double timestep_ = 0.0
 Time step size to be used.
 
double lastProcessedTimestep_ = 0.0
 Last processed time step size of finished iteration.
 
double minTimestep_ = std::sqrt(std::numeric_limits<double>::epsilon())
 Minimal step size.
 
double maxTimestep_ = std::sqrt(std::numeric_limits<double>::max())
 Maximal step size.
 
int timestepNumber_ = 0
 Number of current time step.
 
int nTimesteps_ = 0
 Per default this value is 0 and not used. If it is set to a non-zero value, the computation of the stationary problem is done nTimesteps times with a fixed timestep.
 
int solverIterations_ = 0
 number of iterations needed of linear or nonlinear solver
 
int maxSolverIterations_ = 0
 maximal number of iterations needed of linear or nonlinear solver
 
double solverTolerance_ = 1.e-8
 
double solverResidual_ = 0.0
 
double globalTimeTolerance_ = 1.0
 tolerance for the overall time error
 
std::map< Key, ScalContentscalContents_
 Scalar adapt infos.
 
double timeEst_ = 0.0
 overall time error estimate
 

Detailed Description

Holds adapt parameters and infos about the problem.

Member Function Documentation

◆ reachedEndTime()

bool reachedEndTime ( ) const
inline

Returns true, if the end time is reached and no more timestep computations must be done.

References AdaptInfo::nTimesteps_, and AdaptInfo::timestepNumber_.

Referenced by AdaptInstationary::adapt().

◆ timeEstCombined()

double timeEstCombined ( Key  key) const
inline

Returns the time estimation as a combination of maximal and integral time error

References AdaptInfo::printTimeErrorLowInfo().

Referenced by AdaptInfo::printTimeErrorLowInfo(), AdaptInfo::timeErrorLow(), and AdaptInfo::timeToleranceReached().


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