AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
ProblemInstatBase.hpp
1#pragma once
2
3#include <string>
4
5#include "ProblemTimeInterface.hpp"
6
7namespace AMDiS
8{
9 // forward declarations
10 class AdaptInfo;
11 class ProblemStatBase;
12
20 : public virtual ProblemTimeInterface
21 {
22 public:
24 ProblemInstatBase(std::string const& name)
26 , name_(name)
27 {}
28
30 ProblemInstatBase(std::string const& name,
31 ProblemStatBase& initialProblem)
33 , name_(name)
34 , initialProblem_(&initialProblem)
35 {}
36
38 ~ProblemInstatBase() override = default;
39
41 void setTime(AdaptInfo& adaptInfo) override;
42
44 void solveInitialProblem(AdaptInfo& adaptInfo) override;
45
47 virtual std::string const& name() const
48 {
49 return name_;
50 }
51
54 double const& time() const
55 {
56 return time_;
57 }
58
61 double const& tau() const&
62 {
63 return tau_;
64 }
65
68 double const& invTau() const
69 {
70 return invTau_;
71 }
72
73 protected:
75 std::string name_;
76
79
81 double time_ = 0.0;
82
84 double tau_ = 1.0;
85
87 double invTau_ = 1.0;
88 };
89
90} // end namespace AMDiS
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:26
Base class for ProblemInstat.
Definition: ProblemInstatBase.hpp:21
ProblemInstatBase(std::string const &name, ProblemStatBase &initialProblem)
Constructor. Stores a pointer to the provided initialProblem.
Definition: ProblemInstatBase.hpp:30
double tau_
Timestep, set from adaptInfo.timestep()
Definition: ProblemInstatBase.hpp:84
double const & tau() const &
Definition: ProblemInstatBase.hpp:61
double time_
The current time, set from adaptInfo.time()
Definition: ProblemInstatBase.hpp:81
double invTau_
1 / timestep, calculated after timestep is set
Definition: ProblemInstatBase.hpp:87
std::string name_
Name of the instationary problem.
Definition: ProblemInstatBase.hpp:75
void solveInitialProblem(AdaptInfo &adaptInfo) override
Implementation of ProblemTimeInterface::solveInitialProblem().
Definition: ProblemInstatBase.cpp:20
~ProblemInstatBase() override=default
Destructor.
virtual std::string const & name() const
Return the name of the instationary problem name_.
Definition: ProblemInstatBase.hpp:47
void setTime(AdaptInfo &adaptInfo) override
Implementation of ProblemTimeInterface::setTime().
Definition: ProblemInstatBase.cpp:12
double const & time() const
Definition: ProblemInstatBase.hpp:54
ProblemInstatBase(std::string const &name)
Constructor.
Definition: ProblemInstatBase.hpp:24
double const & invTau() const
Definition: ProblemInstatBase.hpp:68
ProblemStatBase * initialProblem_
An initialization problem solved in solveInitialProblem(). non-owning pointer.
Definition: ProblemInstatBase.hpp:78
Interface for time independent problems. Concrete problems must override all pure virtual methods....
Definition: ProblemStatBase.hpp:59
Interface for time dependent problems. Concrete problems must override all pure virtual methods.
Definition: ProblemTimeInterface.hpp:15