1 #ifndef ABLATELIBRARY_PEAK_FUNTION_HPP
2 #define ABLATELIBRARY_PEAK_FUNTION_HPP
4 #include "formulaBase.hpp"
6 namespace ablate::mathFunctions {
13 const std::vector<double> startValue;
14 const std::vector<double> peakValue;
15 const std::vector<double> endValue;
21 static PetscErrorCode PeakPetscFunction(PetscInt dim, PetscReal time,
const PetscReal x[], PetscInt Nf, PetscScalar* u,
void* ctx);
34 inline static double Interpolate(
double x,
double xS,
double xP,
double xE,
double yS,
double yP,
double yE) {
40 return yS + (x - xS) * (yP - yS) / (xP - xS);
42 return yP + (x - xP) * (yE - yP) / (xE - xP);
55 inline double DetermineDirectionValue(
double x,
double y,
double z)
const {
70 void operator=(
const Peak&) =
delete;
80 explicit Peak(std::vector<double> startValue, std::vector<double> peakValue, std::vector<double> endValue,
double start,
double peak,
double end,
int dir);
82 double Eval(
const double& x,
const double& y,
const double& z,
const double& t)
const override;
84 double Eval(
const double* xyz,
const int& ndims,
const double& t)
const override;
86 void Eval(
const double& x,
const double& y,
const double& z,
const double& t, std::vector<double>& result)
const override;
88 void Eval(
const double* xyz,
const int& ndims,
const double& t, std::vector<double>& result)
const override;
Definition: mathFunction.hpp:13
PetscFunction GetPetscFunction() override
Definition: peak.hpp:92
void * GetContext() override
Definition: peak.hpp:90
double Eval(const double &x, const double &y, const double &z, const double &t) const override
Definition: peak.cpp:18