CubbyFlow::CustomVectorField< N > Class Template Referencefinal

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

#include <Core/Field/CustomVectorField.hpp>

Inheritance diagram for CubbyFlow::CustomVectorField< N >:
CubbyFlow::VectorField< N > CubbyFlow::Field< N >

Classes

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

Public Member Functions

 CustomVectorField (std::function< Vector< double, N >(const Vector< double, N > &)> customFunction, double derivativeResolution=1e-3)
 Constructs a field with given function. More...
 
 CustomVectorField (std::function< Vector< double, N >(const Vector< double, N > &)> customFunction, std::function< double(const Vector< double, N > &)> customDivergenceFunction, double derivativeResolution=1e-3)
 Constructs a field with given field and gradient function. More...
 
 CustomVectorField (std::function< Vector< double, N >(const Vector< double, N > &)> customFunction, std::function< double(const Vector< double, N > &)> customDivergenceFunction, std::function< typename GetCurl< N >::Type(const Vector< double, N > &)> customCurlFunction)
 Constructs a field with given field, gradient, and Laplacian function. More...
 
Vector< double, N > Sample (const Vector< double, N > &x) const override
 Returns the sampled value at given position x. More...
 
double Divergence (const Vector< double, N > &x) const override
 Returns the divergence at given position x. More...
 
GetCurl< N >::Type Curl (const Vector< double, N > &x) const override
 Returns the curl at given position x. More...
 
std::function< Vector< double, N >const Vector< double, N > &)> Sampler () const override
 Returns the sampler function. More...
 
- Public Member Functions inherited from CubbyFlow::VectorField< N >
 VectorField ()=default
 Default constructor. More...
 
 ~VectorField () override=default
 Default destructor. More...
 
 VectorField (const VectorField &)=default
 Default copy constructor. More...
 
 VectorField (VectorField &&) noexcept=default
 Default move constructor. More...
 
VectorFieldoperator= (const VectorField &)=default
 Default copy assignment operator. More...
 
VectorFieldoperator= (VectorField &&) 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...
 
Fieldoperator= (const Field &)=default
 Default copy assignment operator. More...
 
Fieldoperator= (Field &&) noexcept=default
 Default move assignment operator. More...
 

Static Public Member Functions

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

Detailed Description

template<size_t N>
class CubbyFlow::CustomVectorField< N >

N-D vector field with custom field function.

Constructor & Destructor Documentation

◆ CustomVectorField() [1/3]

template<size_t N>
CubbyFlow::CustomVectorField< N >::CustomVectorField ( std::function< Vector< double, N >(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.

◆ CustomVectorField() [2/3]

template<size_t N>
CubbyFlow::CustomVectorField< N >::CustomVectorField ( std::function< Vector< double, N >(const Vector< double, N > &)>  customFunction,
std::function< double(const Vector< double, N > &)>  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.

◆ CustomVectorField() [3/3]

template<size_t N>
CubbyFlow::CustomVectorField< N >::CustomVectorField ( std::function< Vector< double, N >(const Vector< double, N > &)>  customFunction,
std::function< double(const Vector< double, N > &)>  customDivergenceFunction,
std::function< typename GetCurl< N >::Type(const Vector< double, N > &)>  customCurlFunction 
)

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

Member Function Documentation

◆ Curl()

template<size_t N>
GetCurl<N>::Type CubbyFlow::CustomVectorField< N >::Curl ( const Vector< double, N > &  x) const
overridevirtual

Returns the curl at given position x.

Reimplemented from CubbyFlow::VectorField< N >.

◆ Divergence()

template<size_t N>
double CubbyFlow::CustomVectorField< N >::Divergence ( const Vector< double, N > &  x) const
overridevirtual

Returns the divergence at given position x.

Reimplemented from CubbyFlow::VectorField< N >.

◆ GetBuilder()

template<size_t N>
static Builder CubbyFlow::CustomVectorField< N >::GetBuilder ( )
static

Returns builder for CustomVectorField.

◆ Sample()

template<size_t N>
Vector<double, N> CubbyFlow::CustomVectorField< N >::Sample ( const Vector< double, N > &  x) const
overridevirtual

Returns the sampled value at given position x.

Implements CubbyFlow::VectorField< N >.

◆ Sampler()

template<size_t N>
std::function<Vector<double, N>const Vector<double, N>&)> CubbyFlow::CustomVectorField< N >::Sampler ( ) const
overridevirtual

Returns the sampler function.

Reimplemented from CubbyFlow::VectorField< N >.


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