N-D scalar field with custom field function. More...
#include <Core/Field/CustomScalarField.hpp>
Classes | |
class | Builder |
Front-end to create CustomScalarField objects step by step. More... | |
Public Member Functions | |
CustomScalarField (std::function< double(const Vector< double, N > &)> customFunction, double derivativeResolution=1e-3) | |
Constructs a field with given function. More... | |
CustomScalarField (std::function< double(const Vector< double, N > &)> customFunction, std::function< Vector< double, N >(const Vector< double, N > &)> customGradientFunction, double derivativeResolution=1e-3) | |
Constructs a field with given field and gradient function. More... | |
CustomScalarField (std::function< double(const Vector< double, N > &)> customFunction, std::function< Vector< double, N >(const Vector< double, N > &)> customGradientFunction, std::function< double(const Vector< double, N > &)> customLaplacianFunction) | |
Constructs a field with given field, gradient, and Laplacian function. More... | |
double | Sample (const Vector< double, N > &x) const override |
Returns the sampled value at given position x . More... | |
std::function< double(const Vector< double, N > &)> | Sampler () const override |
Returns the sampler function. More... | |
Vector< double, N > | Gradient (const Vector< double, N > &x) const override |
Returns the gradient vector at given position x . More... | |
double | Laplacian (const Vector< double, N > &x) const override |
Returns the Laplacian at given position x . More... | |
Public Member Functions inherited from CubbyFlow::ScalarField< N > | |
ScalarField ()=default | |
Default constructor. More... | |
~ScalarField () override=default | |
Default destructor. More... | |
ScalarField (const ScalarField &)=default | |
Default copy constructor. More... | |
ScalarField (ScalarField &&) noexcept=default | |
Default move constructor. More... | |
ScalarField & | operator= (const ScalarField &)=default |
Default copy assignment operator. More... | |
ScalarField & | operator= (ScalarField &&) noexcept=default |
Default move assignment operator. More... | |
Public Member Functions inherited from CubbyFlow::Field< N > | |
Field ()=default | |
Default constructor. More... | |
virtual | ~Field ()=default |
Default virtual destructor. More... | |
Field (const Field &)=default | |
Default copy constructor. More... | |
Field (Field &&) noexcept=default | |
Default move constructor. More... | |
Field & | operator= (const Field &)=default |
Default copy assignment operator. More... | |
Field & | operator= (Field &&) noexcept=default |
Default move assignment operator. More... | |
Static Public Member Functions | |
static Builder | GetBuilder () |
Returns builder for CustomScalarField. More... | |
Detailed Description
template<size_t N>
class CubbyFlow::CustomScalarField< N >
N-D scalar field with custom field function.
Constructor & Destructor Documentation
◆ CustomScalarField() [1/3]
CubbyFlow::CustomScalarField< N >::CustomScalarField | ( | std::function< double(const Vector< double, N > &)> | customFunction, |
double | derivativeResolution = 1e-3 |
||
) |
Constructs a field with given function.
This constructor creates a field with user-provided function object. To compute derivatives, such as gradient and Laplacian, finite differencing is used. Thus, the differencing resolution also can be provided as the last parameter.
◆ CustomScalarField() [2/3]
CubbyFlow::CustomScalarField< N >::CustomScalarField | ( | std::function< double(const Vector< double, N > &)> | customFunction, |
std::function< Vector< double, N >(const Vector< double, N > &)> | customGradientFunction, | ||
double | derivativeResolution = 1e-3 |
||
) |
Constructs a field with given field and gradient function.
This constructor creates a field with user-provided field and gradient function objects. To compute Laplacian, finite differencing is used. Thus, the differencing resolution also can be provided as the last parameter.
◆ CustomScalarField() [3/3]
CubbyFlow::CustomScalarField< N >::CustomScalarField | ( | std::function< double(const Vector< double, N > &)> | customFunction, |
std::function< Vector< double, N >(const Vector< double, N > &)> | customGradientFunction, | ||
std::function< double(const Vector< double, N > &)> | customLaplacianFunction | ||
) |
Constructs a field with given field, gradient, and Laplacian function.
Member Function Documentation
◆ GetBuilder()
|
static |
Returns builder for CustomScalarField.
◆ Gradient()
|
overridevirtual |
Returns the gradient vector at given position x
.
Reimplemented from CubbyFlow::ScalarField< N >.
◆ Laplacian()
|
overridevirtual |
Returns the Laplacian at given position x
.
Reimplemented from CubbyFlow::ScalarField< N >.
◆ Sample()
|
overridevirtual |
Returns the sampled value at given position x
.
Implements CubbyFlow::ScalarField< N >.
◆ Sampler()
|
overridevirtual |
Returns the sampler function.
Reimplemented from CubbyFlow::ScalarField< N >.
The documentation for this class was generated from the following file:
- Core/Field/CustomScalarField.hpp