CustomVectorField2.h
Go to the documentation of this file.
2-D vector field with custom field function.
Definition: CustomVectorField2.h:17
Vector2D Sample(const Vector2D &x) const override
Returns the sampled value at given position x.
CustomVectorField2 Build() const
Builds CustomVectorField2.
Builder & WithDerivativeResolution(double resolution)
Returns builder with derivative resolution.
static Builder GetBuilder()
Returns builder fox CustomVectorField2.
Builder & WithFunction(const std::function< Vector2D(const Vector2D &)> &func)
Returns builder with field function.
Builder & WithCurlFunction(const std::function< double(const Vector2D &)> &func)
Returns builder with curl function.
Definition: pybind11Utils.h:24
Front-end to create CustomVectorField2 objects step by step.
Definition: CustomVectorField2.h:81
CustomVectorField2(const std::function< Vector2D(const Vector2D &)> &customFunction, double derivativeResolution=1e-3)
Constructs a field with given function.
std::function< Vector2D(const Vector2D &)> Sampler() const override
Returns the sampler function.
Builder & WithDivergenceFunction(const std::function< double(const Vector2D &)> &func)
Returns builder with divergence function.
double Divergence(const Vector2D &x) const override
Returns the divergence at given position x.
std::shared_ptr< CustomVectorField2 > CustomVectorField2Ptr
Shared pointer type for the CustomVectorField2.
Definition: CustomVectorField2.h:76
CustomVectorField2Ptr MakeShared() const
Builds shared pointer of CustomVectorField2 instance.
double Curl(const Vector2D &x) const override
Returns the curl at given position x.