AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
ProblemIterationInterface.hpp
1#pragma once
2
3#include <string>
4
5#include "Flag.hpp"
6
7namespace AMDiS
8{
9 class AdaptInfo;
10 class ProblemStatBase;
11
12 const Flag BUILD = 1; // Assemble vectors and matrices
13 const Flag BUILD_RHS = 2; // Assemble rhs vectors only
14 const Flag ADAPT = 4; // Run adaption procedure
15 const Flag SOLVE = 8; // Solve system
16 const Flag SOLVE_RHS = 16; // Solve system, where only rhs vectors have changed
17 const Flag ESTIMATE = 32; // Estimate error
18 const Flag MARK = 64; // Mark elements
19
20 const Flag FULL_ITERATION = BUILD | ADAPT | SOLVE | ESTIMATE | MARK;
21 const Flag NO_ADAPTION = BUILD | SOLVE | ESTIMATE;
22
30 {
31 public:
32 virtual ~ProblemIterationInterface() = default;
33
35 virtual void beginIteration(AdaptInfo&) { /* by default, do nothing */ }
36
42 virtual Flag oneIteration(AdaptInfo& adaptInfo, Flag toDo = FULL_ITERATION) = 0;
43
45 virtual void endIteration(AdaptInfo&) { /* by default, do nothing */ }
46
48 virtual int numProblems() const = 0;
49
54 virtual ProblemStatBase& problem(int number = 0) = 0;
55
57 virtual ProblemStatBase& problem(std::string const& name) = 0;
58
60 virtual std::string const& name() const = 0;
61 };
62
63} // 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
virtual void beginIteration(AdaptInfo &)
Called before each adaption loop iteration.
Definition: ProblemIterationInterface.hpp:35
virtual std::string const & name() const =0
Returns the name of the problem.
virtual Flag oneIteration(AdaptInfo &adaptInfo, Flag toDo=FULL_ITERATION)=0
Determines the execution order of the single adaption steps. If adapt is true, mesh adaption will be ...
virtual ProblemStatBase & problem(int number=0)=0
Returns the problem with the given number. If only one problem is managed by this master problem,...
virtual void endIteration(AdaptInfo &)
Called after each adaption loop iteration.
Definition: ProblemIterationInterface.hpp:45
virtual int numProblems() const =0
Returns number of managed problems.
virtual ProblemStatBase & problem(std::string const &name)=0
Returns the problem with the given name.
Interface for time independent problems. Concrete problems must override all pure virtual methods....
Definition: ProblemStatBase.hpp:59