ScalarGrid3.h
Go to the documentation of this file.
106 void Fill(const std::function<double(const Vector3D&)>& func, ExecutionPolicy policy = ExecutionPolicy::Serial);
125 void ParallelForEachDataPointIndex(const std::function<void(size_t, size_t, size_t)>& func) const;
virtual ScalarGrid3Ptr Build(const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &gridOrigin, double initialVal) const =0
Returns 3-D scalar grid with given parameters.
double LaplacianAtDataPoint(size_t i, size_t j, size_t k) const
Returns the Laplacian at given data point.
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
ScalarDataAccessor GetDataAccessor()
Returns the read-write data array accessor.
void ForEachDataPointIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each data point.
virtual Vector3D GetDataOrigin() const =0
Returns the origin of the grid data.
void SwapScalarGrid(ScalarGrid3 *other)
Swaps the data storage and predefined samplers with given grid.
void SetData(const std::vector< double > &data) override
Sets the data from a continuous linear array.
std::function< double(const Vector3D &)> Sampler() const override
Returns the sampler function.
std::shared_ptr< ScalarGrid3 > ScalarGrid3Ptr
Shared pointer for the ScalarGrid3 type.
Definition: ScalarGrid3.h:179
const double & operator()(size_t i, size_t j, size_t k) const
Returns the grid data at given data point.
Abstract base class for 3-D scalar grid builder.
Definition: ScalarGrid3.h:182
void Serialize(std::vector< uint8_t > *buffer) const override
Serializes the grid instance to the output buffer.
double Laplacian(const Vector3D &x) const override
Returns the Laplacian at given position x.
ConstScalarDataAccessor GetConstDataAccessor() const
Returns the read-only data array accessor.
DataPositionFunc GetDataPosition() const
Returns the function that maps data point to its position.
Definition: pybind11Utils.h:24
void Fill(double value, ExecutionPolicy policy=ExecutionPolicy::Parallel)
Fills the grid with given value.
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.
void Resize(size_t resolutionX, size_t resolutionY, size_t resolutionZ, double gridSpacingX=1.0, double gridSpacingY=1.0, double gridSpacingZ=1.0, double originX=0.0, double originY=0.0, double originZ=0.0, double initialValue=0.0)
Resizes the grid using given parameters.
std::shared_ptr< ScalarGridBuilder3 > ScalarGridBuilder3Ptr
Shared pointer for the ScalarGridBuilder3 type.
Definition: ScalarGrid3.h:200
Abstract base class for 3-D scalar grid structure.
Definition: ScalarGrid3.h:21
Vector3D GradientAtDataPoint(size_t i, size_t j, size_t k) const
Returns the gradient vector at given data point.
void Deserialize(const std::vector< uint8_t > &buffer) override
Deserializes the input buffer to the grid instance.
void GetData(std::vector< double > *data) const override
Fetches the data into a continuous linear array.
void SetScalarGrid(const ScalarGrid3 &other)
Sets the data storage and predefined samplers with given grid.
virtual std::shared_ptr< ScalarGrid3 > Clone() const =0
Returns the copy of the grid instance.
virtual Size3 GetDataSize() const =0
Returns the size of the grid data.
Vector3D Gradient(const Vector3D &x) const override
Returns the gradient vector at given position x.
double Sample(const Vector3D &x) const override
Returns the sampled value at given position x.
3-D linear array sampler class.
Definition: ArraySamplers3.h:78