1 #ifndef ABLATELIBRARY_CONSTANTVALUE_HPP
2 #define ABLATELIBRARY_CONSTANTVALUE_HPP
4 #include "mathFunction.hpp"
7 namespace ablate::mathFunctions {
11 const std::vector<double> value;
12 const bool uniformValue;
13 static PetscErrorCode ConstantValuePetscFunction(PetscInt dim, PetscReal time,
const PetscReal x[], PetscInt Nf, PetscScalar* u,
void* ctx);
14 static PetscErrorCode ConstantValueUniformPetscFunction(PetscInt dim, PetscReal time,
const PetscReal x[], PetscInt Nf, PetscScalar* u,
void* ctx);
23 [[nodiscard]]
double Eval(
const double& x,
const double& y,
const double& z,
const double& t)
const override;
25 double Eval(
const double* xyz,
const int& ndims,
const double& t)
const override;
27 void Eval(
const double& x,
const double& y,
const double& z,
const double& t, std::vector<double>& result)
const override;
29 void Eval(
const double* xyz,
const int& ndims,
const double& t, std::vector<double>& result)
const override;
31 PetscFunction
GetPetscFunction()
override {
return uniformValue ? ConstantValueUniformPetscFunction : ConstantValuePetscFunction; }
33 void*
GetContext()
override {
return (
void*)value.data(); }
Definition: constantValue.hpp:9
double Eval(const double &x, const double &y, const double &z, const double &t) const override
Definition: constantValue.cpp:31
PetscFunction GetPetscFunction() override
Definition: constantValue.hpp:31
void * GetContext() override
Definition: constantValue.hpp:33
Definition: mathFunction.hpp:13