AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
ProblemStatBase.hpp
1 
6 #pragma once
7 
8 #include <string>
9 
10 #include "Flag.hpp"
11 
12 namespace AMDiS
13 {
14  // Flags for controling which part of the problem should be initialized
15 
16  // For all problems
17  const Flag INIT_FE_SPACE = 0x01L;
18  const Flag INIT_MESH = 0x02L;
19  const Flag CREATE_MESH = 0x04L;
20  const Flag INIT_SYSTEM = 0x08L;
21  const Flag INIT_SOLVER = 0x10L;
22  const Flag INIT_ESTIMATOR = 0x20L;
23  const Flag INIT_MARKER = 0x40L;
24  const Flag INIT_ADAPT = 0x80L;
25  const Flag INIT_FILEWRITER = 0x100L;
26  const Flag INIT_GLOBAL_REFINES = 0x1000L;
27 
28  // For time dependent problems
29  const Flag INIT_INITIAL_PROBLEM = 0x200L;
30  const Flag INIT_UH_OLD = 0x400L;
31 
32  // For non linear problems
33  const Flag INIT_UPDATER = 0x800L;
34  const Flag INIT_NONLIN_SOLVER = 0x1000L;
35 
36  // Combined Flags
37  const Flag INIT_NOTHING = 0x00L;
38  const Flag INIT_ALL = INIT_FE_SPACE | INIT_MESH | CREATE_MESH | INIT_SYSTEM |
39  INIT_SOLVER | INIT_ESTIMATOR | INIT_MARKER |
40  INIT_ADAPT | INIT_FILEWRITER | INIT_INITIAL_PROBLEM |
41  INIT_UH_OLD | INIT_UPDATER | INIT_NONLIN_SOLVER ;
42 
43  const Flag MESH_ADAPTED = 1;
44 
45  // forward declaration
46  class AdaptInfo;
47 
59  {
60  public:
61  virtual ~ProblemStatBase() = default;
62 
64  virtual Flag markElements(AdaptInfo& adaptInfo) = 0;
65 
71  virtual void buildAfterAdapt(AdaptInfo& adaptInfo, Flag flag,
72  bool assembleMatrix, bool assembleVector) = 0;
73 
75  virtual Flag adaptGrid(AdaptInfo& adaptInfo) = 0;
76 
79  virtual Flag globalCoarsen(int n) = 0;
80 
83  virtual Flag globalRefine(int n) = 0;
84 
103  virtual void solve(AdaptInfo& adaptInfo,
104  bool createMatrixData = true,
105  bool storeMatrixData = false) = 0;
106 
112  virtual void estimate(AdaptInfo& adaptInfo) = 0;
113 
115  virtual std::string const& name() const = 0;
116  };
117 
118 } // end namespace AMDiS
The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal...
Definition: Flag.hpp:13
virtual void estimate(AdaptInfo &adaptInfo)=0
A posteriori error estimation of the calculated solution. Should store a local error estimation at ea...
virtual Flag adaptGrid(AdaptInfo &adaptInfo)=0
Refinement/coarsening of the grid.
virtual std::string const & name() const =0
Returns the name of the problem.
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
virtual void buildAfterAdapt(AdaptInfo &adaptInfo, Flag flag, bool assembleMatrix, bool assembleVector)=0
Assembling of system matrices and vectors after coarsening. By the last two parameters, assembling can be restricted to either matrices or vectors only.
virtual Flag globalRefine(int n)=0
virtual Flag globalCoarsen(int n)=0
Interface for time independent problems. Concrete problems must override all pure virtual methods...
Definition: ProblemStatBase.hpp:58
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:25
virtual Flag markElements(AdaptInfo &adaptInfo)=0
Marks mesh elements for refinement and coarsening.
virtual void solve(AdaptInfo &adaptInfo, bool createMatrixData=true, bool storeMatrixData=false)=0
Solves the assembled system. The result is an approximative solution. The last two boolean arguments ...