64 std::array<std::array<double,2>,3>
domain;
78 const std::array<int,3>&
getSize()
const {
return n; }
103 void read(std::istream& in);
113 std::array<std::unique_ptr<ChebyshevFunc>,3>
f;
122 bool isZero()
const override {
return !
f[0] ||
f[0]->isZero(); }
140 std::vector<std::unique_ptr<ChebyshevFunc>>
f;
149 bool isZero()
const override {
return f.empty(); }
General functions with arbitrary argument and value type.
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
Spatial tensor-valued functions.
A scalar-valued spatial function, chebyshev polynomials.
Definition: Chebyshev.h:61
Real evaluateTP(const Vec3 &X, const std::array< Func, 3 > &funcs) const
Performs the actual tensor-product evaluation.
Definition: Chebyshev.C:109
void read(std::istream &in)
Reads input from a stream.
Definition: Chebyshev.C:89
std::vector< Real > coefs
Function coefficients.
Definition: Chebyshev.h:62
const std::vector< Real > & getCoefs() const
Returns a const reference to the coefficients.
Definition: Chebyshev.h:76
std::array< int, 3 > n
Number of coefficients.
Definition: Chebyshev.h:63
std::array< std::array< double, 2 >, 3 > domain
Physical domain.
Definition: Chebyshev.h:64
bool isZero() const override
Returns whether the function is identically zero or not.
Definition: Chebyshev.h:73
Real deriv(const Vec3 &X, int c) const override
Returns a first-derivative of the function.
Definition: Chebyshev.C:139
Real dderiv(const Vec3 &X, int c, int c2) const override
Returns a second-derivative of the function.
Definition: Chebyshev.C:153
Real evaluate(const Vec3 &X) const override
Evaluates the function at point X.
Definition: Chebyshev.C:102
ChebyshevFunc(const std::string &input, bool file)
The constructor initializes the function parameters from a file.
Definition: Chebyshev.C:73
const std::array< int, 3 > & getSize() const
Returns the number of polynomials in each parameter direction.
Definition: Chebyshev.h:78
A tensor-valued spatial function, chebyshev polynomials.
Definition: Chebyshev.h:139
std::vector< std::unique_ptr< ChebyshevFunc > > f
Vector of components.
Definition: Chebyshev.h:140
std::vector< Real > evalGradient(const Vec3 &) const override
Returns the gradient of the function as a 1D array.
Definition: Chebyshev.C:239
ChebyshevTensorFunc(const std::vector< std::string > &input, bool file)
The constructor initializes the function parameters from files.
Definition: Chebyshev.C:216
std::vector< Real > evalHessian(const Vec3 &) const override
Returns the hessian of the function as a 1D array.
Definition: Chebyshev.C:252
Tensor evaluate(const Vec3 &X) const override
Evaluates the function at point X.
Definition: Chebyshev.C:226
bool isZero() const override
Returns whether the function is identically zero or not.
Definition: Chebyshev.h:149
A vector-valued spatial function, chebyshev polynomials.
Definition: Chebyshev.h:112
bool isZero() const override
Returns whether the function is identically zero or not.
Definition: Chebyshev.h:122
std::array< std::unique_ptr< ChebyshevFunc >, 3 > f
Functions.
Definition: Chebyshev.h:113
Vec3 evaluate(const Vec3 &X) const override
Evaluates the function at point X.
Definition: Chebyshev.C:185
std::vector< Real > evalGradient(const Vec3 &) const override
Returns the gradient of the function as a 1D array.
Definition: Chebyshev.C:191
ChebyshevVecFunc(const std::vector< std::string > &input, bool file)
The constructor initializes the function parameters from files.
Definition: Chebyshev.C:175
std::vector< Real > evalHessian(const Vec3 &X) const override
Returns the hessian of the function as a 1D array.
Definition: Chebyshev.C:203
Scalar-valued unary function of a spatial point.
Definition: Function.h:193
Tensor-valued unary function of a spatial point.
Definition: TensorFunction.h:27
Simple class for representing a non-symmetric second-order tensor.
Definition: Tensor.h:28
Simple class for representing a point in 3D space.
Definition: Vec3.h:27
Vector-valued unary function of a spatial point.
Definition: Function.h:242
Evaluation of Chebyshev polynomials.
Definition: Chebyshev.h:30
Real evalDer2(int polnum, Real xi)
Evaluates the first derivative of a 1D Chebyshev polynomial of second kind.
Definition: Chebyshev.C:53
Real evalDer1(int polnum, Real xi)
Evaluates the first derivative of a 1D Chebyshev polynomial of first kind.
Definition: Chebyshev.C:44
Real evalPol2(int polnum, Real xi)
Evaluates a 1D Chebyshev polynomial of second kind.
Definition: Chebyshev.C:33
Real evalPol1(int polnum, Real xi)
Evaluates a 1D Chebyshev polynomial of first kind.
Definition: Chebyshev.C:22
Real eval2Der1(int polnum, Real xi)
Evaluates the second derivative of a 1D Chebyshev polynomial of first kind.
Definition: Chebyshev.C:59
Struct defining function and weight in one direction.
Definition: Chebyshev.h:93
std::function< Real(int, Real)> f
Function to evaluate.
Definition: Chebyshev.h:94
double w
Weight.
Definition: Chebyshev.h:95