AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
AdaptBase.hpp
1#pragma once
2
3// std c++ headers
4#include <string>
5
6namespace AMDiS
7{
8 // forward declarations
9 class AdaptInfo;
10 class ProblemIterationInterface;
11 class ProblemTimeInterface;
12
15 {
16 public:
18 AdaptBase(std::string const& name,
22 AdaptInfo* initialAdaptInfo = nullptr)
23 : name_(name)
28 {}
29
31 virtual ~AdaptBase() = default;
32
37 virtual int adapt() = 0;
38
40 std::string const& name() const
41 {
42 return name_;
43 }
44
47 {
48 return problemIteration_;
49 }
50
52 void setProblemIteration(ProblemIterationInterface* problemIteration)
53 {
55 }
56
59 {
60 return adaptInfo_;
61 }
62
65 {
66 return problemTime_;
67 }
68
70 void setProblemTime(ProblemTimeInterface* problemTime)
71 {
73 }
74
77 {
78 return *initialAdaptInfo_;
79 }
80
81 protected:
83 std::string name_;
84
87
90
93
99 };
100
101} // end namespace AMDiS
Interface for adaption loops.
Definition: AdaptBase.hpp:15
virtual int adapt()=0
Pure virtual method. Must be overloaded by sub classes to perform a concrete adaption loop.
AdaptInfo & adaptInfo_
Main adapt info.
Definition: AdaptBase.hpp:89
std::string const & name() const
Returns name.
Definition: AdaptBase.hpp:40
AdaptInfo * initialAdaptInfo_
Adapt info for initial adapt. Will be given to problemTime->solveInitialProblem().
Definition: AdaptBase.hpp:98
ProblemTimeInterface * problemTime() const
Returns problemTime.
Definition: AdaptBase.hpp:64
std::string name_
Name of the adaption loop.
Definition: AdaptBase.hpp:83
ProblemIterationInterface * problemIteration_
Problem iteration interface.
Definition: AdaptBase.hpp:86
AdaptInfo & adaptInfo() const
Returns adaptInfo.
Definition: AdaptBase.hpp:58
ProblemTimeInterface * problemTime_
problem time interface
Definition: AdaptBase.hpp:92
AdaptBase(std::string const &name, ProblemIterationInterface *problemIteration, AdaptInfo &adaptInfo, ProblemTimeInterface *problemTime=nullptr, AdaptInfo *initialAdaptInfo=nullptr)
Constructor.
Definition: AdaptBase.hpp:18
virtual ~AdaptBase()=default
Destructor.
ProblemIterationInterface * problemIteration() const
Returns problemIteration.
Definition: AdaptBase.hpp:46
AdaptInfo & initialAdaptInfo() const
Returns initialAdaptInfo.
Definition: AdaptBase.hpp:76
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:26
Interface for master problems needed by the adaption loop. A master problem can handle one single or ...
Definition: ProblemIterationInterface.hpp:30
Interface for time dependent problems. Concrete problems must override all pure virtual methods.
Definition: ProblemTimeInterface.hpp:15