AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
StandardProblemIteration.hpp
1#pragma once
2
3#include <string>
4
5#include "ProblemIterationInterface.hpp"
6
7namespace AMDiS
8{
9 // forward declarations
10 class AdaptInfo;
11 class Flag;
12 class ProblemStatBase;
13
16 : public virtual ProblemIterationInterface
17 {
18 public:
21 : problem_(prob)
22 {}
23
25 void beginIteration(AdaptInfo& adaptInfo) override;
26
28 Flag oneIteration(AdaptInfo& adaptInfo, Flag toDo) override;
29
31 void endIteration(AdaptInfo& adaptInfo) override;
32
34 std::string const& name() const override;
35
36 int numProblems() const override
37 {
38 return 1;
39 }
40
42 ProblemStatBase& problem(int number = 0) override;
43
45 ProblemStatBase& problem(std::string const& name) override;
46
47 protected:
49 Flag buildAndAdapt(AdaptInfo& adaptInfo, Flag toDo);
50
51 protected:
54 };
55
56
58
70 template <class Model>
73 {
74 template <class Self>
75 static ProblemStatBase& asProblemStatBase(Self& self)
76 {
77 Model& model = static_cast<Model&>(self);
78 return dynamic_cast<ProblemStatBase&>(model);
79 }
80
81 public:
83 : StandardProblemIteration(asProblemStatBase(*this))
84 {}
85
87 : StandardProblemIteration(asProblemStatBase(*this))
88 {}
89
91 : StandardProblemIteration(asProblemStatBase(*this))
92 {}
93 };
94
95
96} // end namespace AMDiS
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:26
The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal...
Definition: Flag.hpp:14
Interface for master problems needed by the adaption loop. A master problem can handle one single or ...
Definition: ProblemIterationInterface.hpp:30
Interface for time independent problems. Concrete problems must override all pure virtual methods....
Definition: ProblemStatBase.hpp:59
StandardProblemIteration when derived from ProblemStat.
Definition: StandardProblemIteration.hpp:73
A master problem for a single non coupled problem.
Definition: StandardProblemIteration.hpp:17
ProblemStatBase & problem(int number=0) override
Return the managed ProblemStat problem, by number.
Definition: StandardProblemIteration.cpp:11
StandardProblemIteration(ProblemStatBase &prob)
constructor
Definition: StandardProblemIteration.hpp:20
ProblemStatBase & problem_
The problem to solve.
Definition: StandardProblemIteration.hpp:53
void beginIteration(AdaptInfo &adaptInfo) override
Implementation of ProblemIterationIterface::beginIteration()
Definition: StandardProblemIteration.cpp:25
int numProblems() const override
Returns number of managed problems.
Definition: StandardProblemIteration.hpp:36
std::string const & name() const override
Returns the name of the problem.
Definition: StandardProblemIteration.cpp:82
void endIteration(AdaptInfo &adaptInfo) override
Implementation of ProblemIterationInterface::endIteration()
Definition: StandardProblemIteration.cpp:52
Flag buildAndAdapt(AdaptInfo &adaptInfo, Flag toDo)
Nested assemblage and mesh adaption.
Definition: StandardProblemIteration.cpp:62
Flag oneIteration(AdaptInfo &adaptInfo, Flag toDo) override
Implementation of ProblemIterationInterface::oneIteration()
Definition: StandardProblemIteration.cpp:35