ABLATE Source Documentation  0.12.34
parsedSeries.hpp
1 #ifndef ABLATELIBRARY_PARSEDSERIES_HPP
2 #define ABLATELIBRARY_PARSEDSERIES_HPP
3 #include <muParser.h>
4 #include "formulaBase.hpp"
5 #include "parameters/parameters.hpp"
6 
7 namespace ablate::mathFunctions {
13 class ParsedSeries : public FormulaBase {
14  private:
15  // The local count for the series
16  mutable double i = 0;
17 
19  const int lowerBound;
20 
22  const int upperBound;
23 
24  private:
25  static PetscErrorCode ParsedPetscSeries(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar* u, void* ctx);
26 
27  public:
28  ParsedSeries(const ParsedSeries&) = delete;
29  void operator=(const ParsedSeries&) = delete;
30 
38  explicit ParsedSeries(std::string functionString, int lowerBound = 1, int upperBound = 1000, const std::shared_ptr<ablate::parameters::Parameters>& constants = {});
39 
40  double Eval(const double& x, const double& y, const double& z, const double& t) const override;
41 
42  double Eval(const double* xyz, const int& ndims, const double& t) const override;
43 
44  void Eval(const double& x, const double& y, const double& z, const double& t, std::vector<double>& result) const override;
45 
46  void Eval(const double* xyz, const int& ndims, const double& t, std::vector<double>& result) const override;
47 
48  void* GetContext() override { return this; }
49 
50  PetscFunction GetPetscFunction() override { return ParsedPetscSeries; }
51 };
52 } // namespace ablate::mathFunctions
53 
54 #endif // ABLATELIBRARY_PARSEDFUNCTION_HPP
Definition: formulaBase.hpp:14
double time
the time linked to the parser
Definition: formulaBase.hpp:27
Definition: parsedSeries.hpp:13
PetscFunction GetPetscFunction() override
Definition: parsedSeries.hpp:50
void * GetContext() override
Definition: parsedSeries.hpp:48
double Eval(const double &x, const double &y, const double &z, const double &t) const override
Definition: parsedSeries.cpp:21