ABLATE Source Documentation  0.12.34
fieldFunction.hpp
1 #ifndef ABLATELIBRARY_FIELDFUNCTION_HPP
2 #define ABLATELIBRARY_FIELDFUNCTION_HPP
3 #include <memory>
4 #include <string>
5 #include "domain/region.hpp"
6 #include "mathFunctions/mathFunction.hpp"
7 
8 namespace ablate::mathFunctions {
13  private:
14  const std::shared_ptr<mathFunctions::MathFunction> solutionField;
15  const std::shared_ptr<mathFunctions::MathFunction> timeDerivative;
16  const std::string fieldName;
17  const std::shared_ptr<ablate::domain::Region> region;
18 
19  public:
20  /*
21  * Public constructor for field functions that has both
22  */
23  FieldFunction(std::string fieldName, std::shared_ptr<mathFunctions::MathFunction> solutionField, std::shared_ptr<mathFunctions::MathFunction> timeDerivative = {},
24  std::shared_ptr<ablate::domain::Region> region = nullptr);
25 
30  [[nodiscard]] const std::string& GetName() const { return fieldName; }
31 
36  [[nodiscard]] bool HasSolutionField() const { return solutionField != nullptr; }
37 
42  mathFunctions::MathFunction& GetSolutionField() { return *solutionField; }
43 
48  [[nodiscard]] std::shared_ptr<mathFunctions::MathFunction> GetFieldFunction() const { return solutionField; }
49 
54  [[nodiscard]] bool HasTimeDerivative() const { return timeDerivative != nullptr; }
55 
60  mathFunctions::MathFunction& GetTimeDerivative() { return *timeDerivative; }
61 
66  [[nodiscard]] std::shared_ptr<mathFunctions::MathFunction> GetTimeDerivativeFunction() const { return timeDerivative; }
67 
72  [[nodiscard]] const std::shared_ptr<ablate::domain::Region>& GetRegion() const { return region; }
73 };
74 } // namespace ablate::mathFunctions
75 #endif // ABLATELIBRARY_FIELDFUNCTION_HPP
Definition: fieldFunction.hpp:12
std::shared_ptr< mathFunctions::MathFunction > GetTimeDerivativeFunction() const
Definition: fieldFunction.hpp:66
bool HasTimeDerivative() const
Definition: fieldFunction.hpp:54
const std::string & GetName() const
Definition: fieldFunction.hpp:30
bool HasSolutionField() const
Definition: fieldFunction.hpp:36
mathFunctions::MathFunction & GetSolutionField()
Definition: fieldFunction.hpp:42
const std::shared_ptr< ablate::domain::Region > & GetRegion() const
Definition: fieldFunction.hpp:72
std::shared_ptr< mathFunctions::MathFunction > GetFieldFunction() const
Definition: fieldFunction.hpp:48
mathFunctions::MathFunction & GetTimeDerivative()
Definition: fieldFunction.hpp:60
Definition: mathFunction.hpp:13