ABLATE Source Documentation  0.12.34
mathFunction.hpp
1 #ifndef ABLATELIBRARY_MATHFUNCTION_HPP
2 #define ABLATELIBRARY_MATHFUNCTION_HPP
3 #include <petsc.h>
4 #include <vector>
5 
6 namespace ablate::mathFunctions {
7 
8 typedef PetscErrorCode (*PetscFunction)(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar* u, void* ctx);
9 
13 class MathFunction {
14  public:
23  [[nodiscard]] virtual double Eval(const double& x, const double& y, const double& z, const double& t) const = 0;
24 
32  [[nodiscard]] virtual double Eval(const double* xyz, const int& ndims, const double& t) const = 0;
33 
42  virtual void Eval(const double& x, const double& y, const double& z, const double& t, std::vector<double>& result) const = 0;
43 
51  virtual void Eval(const double* xyz, const int& ndims, const double& t, std::vector<double>& result) const = 0;
52 
57  virtual PetscFunction GetPetscFunction() = 0;
58 
63  virtual void* GetContext() = 0;
64 
68  virtual ~MathFunction() = default;
69 };
70 } // namespace ablate::mathFunctions
71 #endif // ABLATELIBRARY_MATHFUNCTION_HPP
Definition: mathFunction.hpp:13
virtual double Eval(const double &x, const double &y, const double &z, const double &t) const =0
virtual void Eval(const double &x, const double &y, const double &z, const double &t, std::vector< double > &result) const =0
virtual double Eval(const double *xyz, const int &ndims, const double &t) const =0
virtual void Eval(const double *xyz, const int &ndims, const double &t, std::vector< double > &result) const =0
virtual PetscFunction GetPetscFunction()=0