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