CubbyFlow::CustomScalarField2 Class Referencefinal

2-D scalar field with custom field function. More...

#include <Core/Field/CustomScalarField2.h>

Inheritance diagram for CubbyFlow::CustomScalarField2:
CubbyFlow::ScalarField2 CubbyFlow::Field2

Classes

class  Builder
 Front-end to create CustomScalarField2 objects step by step. More...
 

Public Member Functions

 CustomScalarField2 (const std::function< double(const Vector2D &)> &customFunction, double derivativeResolution=1e-3)
 Constructs a field with given function. More...
 
 CustomScalarField2 (const std::function< double(const Vector2D &)> &customFunction, const std::function< Vector2D(const Vector2D &)> &customGradientFunction, double derivativeResolution=1e-3)
 Constructs a field with given field and gradient function. More...
 
 CustomScalarField2 (const std::function< double(const Vector2D &)> &customFunction, const std::function< Vector2D(const Vector2D &)> &customGradientFunction, const std::function< double(const Vector2D &)> &customLaplacianFunction)
 Constructs a field with given field, gradient, and Laplacian function. More...
 
double Sample (const Vector2D &x) const override
 Returns the sampled value at given position x. More...
 
std::function< double(const Vector2D &)> Sampler () const override
 Returns the sampler function. More...
 
Vector2D Gradient (const Vector2D &x) const override
 Returns the gradient vector at given position x. More...
 
double Laplacian (const Vector2D &x) const override
 Returns the Laplacian at given position x. More...
 
- Public Member Functions inherited from CubbyFlow::ScalarField2
 ScalarField2 ()
 Default constructor. More...
 
virtual ~ScalarField2 ()
 Default destructor. More...
 
- Public Member Functions inherited from CubbyFlow::Field2
 Field2 ()
 
virtual ~Field2 ()
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder for CustomScalarField2. More...
 

Detailed Description

2-D scalar field with custom field function.

Constructor & Destructor Documentation

◆ CustomScalarField2() [1/3]

CubbyFlow::CustomScalarField2::CustomScalarField2 ( const std::function< double(const Vector2D &)> &  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.

◆ CustomScalarField2() [2/3]

CubbyFlow::CustomScalarField2::CustomScalarField2 ( const std::function< double(const Vector2D &)> &  customFunction,
const std::function< Vector2D(const Vector2D &)> &  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.

◆ CustomScalarField2() [3/3]

CubbyFlow::CustomScalarField2::CustomScalarField2 ( const std::function< double(const Vector2D &)> &  customFunction,
const std::function< Vector2D(const Vector2D &)> &  customGradientFunction,
const std::function< double(const Vector2D &)> &  customLaplacianFunction 
)

Constructs a field with given field, gradient, and Laplacian function.

Member Function Documentation

◆ GetBuilder()

static Builder CubbyFlow::CustomScalarField2::GetBuilder ( )
static

Returns builder for CustomScalarField2.

◆ Gradient()

Vector2D CubbyFlow::CustomScalarField2::Gradient ( const Vector2D x) const
overridevirtual

Returns the gradient vector at given position x.

Reimplemented from CubbyFlow::ScalarField2.

◆ Laplacian()

double CubbyFlow::CustomScalarField2::Laplacian ( const Vector2D x) const
overridevirtual

Returns the Laplacian at given position x.

Reimplemented from CubbyFlow::ScalarField2.

◆ Sample()

double CubbyFlow::CustomScalarField2::Sample ( const Vector2D x) const
overridevirtual

Returns the sampled value at given position x.

Implements CubbyFlow::ScalarField2.

◆ Sampler()

std::function<double(const Vector2D&)> CubbyFlow::CustomScalarField2::Sampler ( ) const
overridevirtual

Returns the sampler function.

Reimplemented from CubbyFlow::ScalarField2.


The documentation for this class was generated from the following file: