CollocatedVectorGrid2.h
Go to the documentation of this file.
2-D read-only array accessor class.
Definition: ArrayAccessor2.h:261
void ForEachDataPointIndex(const std::function< void(size_t, size_t)> &func) const
Invokes the given function func for each data point.
void SetCollocatedVectorGrid(const CollocatedVectorGrid2 &other)
Sets the data storage and predefined samplers with given grid.
DataPositionFunc GetDataPosition() const
Returns the function that maps data point to its position.
Abstract base class for 2-D vector grid structure.
Definition: VectorGrid2.h:19
Vector2D Sample(const Vector2D &x) const override
Returns sampled value at given position x.
virtual Size2 GetDataSize() const =0
Returns the actual data point size.
Abstract base class for 2-D collocated vector grid structure.
Definition: CollocatedVectorGrid2.h:19
void SetData(const std::vector< double > &data) override
Sets the data from a continuous linear array.
void ParallelForEachDataPointIndex(const std::function< void(size_t, size_t)> &func) const
Invokes the given function func for each data point in parallel.
void GetData(std::vector< double > *data) const override
Fetches the data into a continuous linear array.
CollocatedVectorGrid2()
Constructs an empty grid.
VectorDataAccessor GetDataAccessor()
Returns the read-write data array accessor.
void SwapCollocatedVectorGrid(CollocatedVectorGrid2 *other)
Swaps the data storage and predefined samplers with given grid.
Definition: pybind11Utils.h:24
const Vector2D & operator()(size_t i, size_t j) const
Returns the grid data at given data point.
double Divergence(const Vector2D &x) const override
Returns divergence at given position x.
double DivergenceAtDataPoint(size_t i, size_t j) const
Returns divergence at data point location.
std::function< Vector2D(const Vector2D &)> Sampler() const override
Returns the sampler function.
ConstVectorDataAccessor GetConstDataAccessor() const
Returns the read-only data array accessor.
std::shared_ptr< CollocatedVectorGrid2 > CollocatedVectorGrid2Ptr
Shared pointer for the CollocatedVectorGrid2 type.
Definition: CollocatedVectorGrid2.h:125
2-D linear array sampler class.
Definition: ArraySamplers2.h:78
double CurlAtDataPoint(size_t i, size_t j) const
Returns curl at data point location.
virtual ~CollocatedVectorGrid2()
Default destructor.
virtual Vector2D GetDataOrigin() const =0
Returns data position for the grid point at (0, 0).
std::function< Vector2D(size_t, size_t)> DataPositionFunc
Function type for mapping data index to actual position.
Definition: Grid2.h:34
double Curl(const Vector2D &x) const override
Returns curl at given position x.