AMDiS  2.10
The Adaptive Multi-Dimensional Simulation Toolbox
AdaptInstationary.hpp
1 #pragma once
2 
3 // std c++ headers
4 #include <string>
5 
6 // AMDiS includes
7 #include "AdaptBase.hpp"
8 
9 namespace AMDiS
10 {
11  // forward declarations
12  class AdaptInfo;
13  class ProblemIterationInterface;
14  class ProblemTimeInterface;
15 
23  : public AdaptBase
24  {
25  public:
28  AdaptInstationary(std::string const& name,
29  ProblemIterationInterface& problemStat,
30  AdaptInfo& info,
31  ProblemTimeInterface& problemInstat,
32  AdaptInfo& initialInfo);
33 
36  {
38  }
39 
41  int strategy() const
42  {
43  return strategy_;
44  }
45 
47  int adapt() override;
48 
49  protected:
59  virtual void oneTimestep();
60 
62  virtual void explicitTimeStrategy();
63 
65  virtual void implicitTimeStrategy();
66 
73 
74  protected:
76  int strategy_ = 0;
77 
79  double timeDelta1_ = 0.7071;
80 
82  double timeDelta2_ = 1.4142;
83 
86  bool breakWhenStable_ = false;
87 
90  };
91 
92 } // end namespace AMDiS
bool fixedTimestep_
min-timestep == max-timestep
Definition: AdaptInstationary.hpp:89
virtual void implicitTimeStrategy()
Implements the implicit time strategy. Used by oneTimestep().
Definition: AdaptInstationary.cpp:57
virtual void explicitTimeStrategy()
Implements the explit time strategy. Used by oneTimestep().
Definition: AdaptInstationary.cpp:31
Interface for master problems needed by the adaption loop. A master problem can handle one single or ...
Definition: ProblemIterationInterface.hpp:29
double timeDelta1_
Parameter used in time step reduction.
Definition: AdaptInstationary.hpp:79
void simpleAdaptiveTimeStrategy()
This iteration strategy allows the timestep and the mesh to be adapted after each timestep solution...
Definition: AdaptInstationary.cpp:146
AdaptInstationary(std::string const &name, ProblemIterationInterface &problemStat, AdaptInfo &info, ProblemTimeInterface &problemInstat, AdaptInfo &initialInfo)
Definition: AdaptInstationary.cpp:15
void setStrategy(int strategy)
Sets strategy to aStrategy.
Definition: AdaptInstationary.hpp:35
Definition: AdaptBase.hpp:6
double timeDelta2_
Parameter used in time step enlargement.
Definition: AdaptInstationary.hpp:82
std::string const & name() const
Returns name.
Definition: AdaptBase.hpp:40
AdaptInstationary implements the adaptive procedure for time dependent problems (see ProblemInstat)...
Definition: AdaptInstationary.hpp:22
virtual void oneTimestep()
Implements one (maybe adaptive) timestep. Both the explicit and the implicit time strategy are implem...
Definition: AdaptInstationary.cpp:175
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:25
Interface for time dependent problems. Concrete problems must override all pure virtual methods...
Definition: ProblemTimeInterface.hpp:14
int adapt() override
Implementation of AdaptBase::adapt()
Definition: AdaptInstationary.cpp:200
int strategy_
Strategy for choosing one timestep.
Definition: AdaptInstationary.hpp:76
int strategy() const
Returns strategy.
Definition: AdaptInstationary.hpp:41
Interface for adaption loops.
Definition: AdaptBase.hpp:14
bool breakWhenStable_
Definition: AdaptInstationary.hpp:86