CubbyFlow::CustomVectorField2 Class Referencefinal

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

#include <Core/Field/CustomVectorField2.h>

Inheritance diagram for CubbyFlow::CustomVectorField2:
CubbyFlow::VectorField2 CubbyFlow::Field2

Classes

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

Public Member Functions

 CustomVectorField2 (const std::function< Vector2D(const Vector2D &)> &customFunction, double derivativeResolution=1e-3)
 Constructs a field with given function. More...
 
 CustomVectorField2 (const std::function< Vector2D(const Vector2D &)> &customFunction, const std::function< double(const Vector2D &)> &customDivergenceFunction, double derivativeResolution=1e-3)
 Constructs a field with given field and gradient function. More...
 
 CustomVectorField2 (const std::function< Vector2D(const Vector2D &)> &customFunction, const std::function< double(const Vector2D &)> &customDivergenceFunction, const std::function< double(const Vector2D &)> &customCurlFunction)
 Constructs a field with given field, gradient, and Laplacian function. More...
 
Vector2D Sample (const Vector2D &x) const override
 Returns the sampled value at given position x. More...
 
double Divergence (const Vector2D &x) const override
 Returns the divergence at given position x. More...
 
double Curl (const Vector2D &x) const override
 Returns the curl at given position x. More...
 
std::function< Vector2D(const Vector2D &)> Sampler () const override
 Returns the sampler function. More...
 
- Public Member Functions inherited from CubbyFlow::VectorField2
 VectorField2 ()
 Default constructor. More...
 
virtual ~VectorField2 ()
 Default destructor. More...
 
- Public Member Functions inherited from CubbyFlow::Field2
 Field2 ()
 
virtual ~Field2 ()
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox CustomVectorField2. More...
 

Detailed Description

2-D vector field with custom field function.

Constructor & Destructor Documentation

◆ CustomVectorField2() [1/3]

CubbyFlow::CustomVectorField2::CustomVectorField2 ( const std::function< Vector2D(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.

◆ CustomVectorField2() [2/3]

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

◆ CustomVectorField2() [3/3]

CubbyFlow::CustomVectorField2::CustomVectorField2 ( const std::function< Vector2D(const Vector2D &)> &  customFunction,
const std::function< double(const Vector2D &)> &  customDivergenceFunction,
const std::function< double(const Vector2D &)> &  customCurlFunction 
)

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

Member Function Documentation

◆ Curl()

double CubbyFlow::CustomVectorField2::Curl ( const Vector2D x) const
overridevirtual

Returns the curl at given position x.

Reimplemented from CubbyFlow::VectorField2.

◆ Divergence()

double CubbyFlow::CustomVectorField2::Divergence ( const Vector2D x) const
overridevirtual

Returns the divergence at given position x.

Reimplemented from CubbyFlow::VectorField2.

◆ GetBuilder()

static Builder CubbyFlow::CustomVectorField2::GetBuilder ( )
static

Returns builder fox CustomVectorField2.

◆ Sample()

Vector2D CubbyFlow::CustomVectorField2::Sample ( const Vector2D x) const
overridevirtual

Returns the sampled value at given position x.

Implements CubbyFlow::VectorField2.

◆ Sampler()

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

Returns the sampler function.

Reimplemented from CubbyFlow::VectorField2.


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