1 #ifndef ABLATELIBRARY_LINEARFUNCTION_FUNCTION_HPP
2 #define ABLATELIBRARY_LINEARFUNCTION_FUNCTION_HPP
4 #include "formulaBase.hpp"
6 namespace ablate::mathFunctions {
13 std::shared_ptr<MathFunction> startFunction;
14 std::shared_ptr<MathFunction> endFunction;
19 static PetscErrorCode LinearFunctionPetscFunction(PetscInt dim, PetscReal time,
const PetscReal x[], PetscInt Nf, PetscScalar* u,
void* ctx);
30 inline static double Interpolate(
double x,
double x0,
double x1,
double y0,
double y1) {
37 return y0 + (x - x0) * (y1 - y0) / (x1 - x0);
49 inline double DetermineDirectionValue(
double x,
double y,
double z)
const {
74 explicit LinearFunction(std::shared_ptr<MathFunction> startFunction, std::shared_ptr<MathFunction> endFunction,
double start,
double end,
int dir);
76 double Eval(
const double& x,
const double& y,
const double& z,
const double& t)
const override;
78 double Eval(
const double* xyz,
const int& ndims,
const double& t)
const override;
80 void Eval(
const double& x,
const double& y,
const double& z,
const double& t, std::vector<double>& result)
const override;
82 void Eval(
const double* xyz,
const int& ndims,
const double& t, std::vector<double>& result)
const override;
Definition: linearFunction.hpp:11
double Eval(const double &x, const double &y, const double &z, const double &t) const override
Definition: linearFunction.cpp:10
void * GetContext() override
Definition: linearFunction.hpp:84
PetscFunction GetPetscFunction() override
Definition: linearFunction.hpp:86
Definition: mathFunction.hpp:13