FaceCenteredGrid3.h
Go to the documentation of this file.
163 void Fill(const std::function<Vector3D(const Vector3D&)>& func, ExecutionPolicy policy = ExecutionPolicy::Parallel) override;
Builder & WithInitialValue(const Vector3D &initialVal)
Returns builder with initial value.
void ForEachVIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each v-data point.
FaceCenteredGrid3 & operator=(const FaceCenteredGrid3 &other)
Sets the contents with the given other grid.
std::function< Vector3D(size_t, size_t, size_t)> DataPositionFunc
Function type for mapping data index to actual position.
Definition: Grid3.h:34
void ParallelForEachVIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each v-data point in parallel.
3-D read-only array accessor class.
Definition: ArrayAccessor3.h:269
Abstract base class for 3-D vector grid builder.
Definition: VectorGrid3.h:93
Vector3D GetWOrigin() const
Returns w-data position for the grid point at (0, 0, 0).
Vector3D GetVOrigin() const
Returns v-data position for the grid point at (0, 0, 0).
double & GetU(size_t i, size_t j, size_t k)
Returns u-value at given data point.
double & GetV(size_t i, size_t j, size_t k)
Returns v-value at given data point.
double Divergence(const Vector3D &x) const override
Returns divergence at given position x.
void ForEachUIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each u-data point.
FaceCenteredGrid3 Build() const
Builds CellCenteredScalarGrid3 instance.
Front-end to create CellCenteredScalarGrid3 objects step by step.
Definition: FaceCenteredGrid3.h:281
ConstScalarDataAccessor GetWConstAccessor() const
Returns read-only w data accessor.
Builder & WithGridSpacing(const Vector3D &gridSpacing)
Returns builder with grid spacing.
void ParallelForEachWIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each w-data point in parallel.
3-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid3.h:25
std::shared_ptr< FaceCenteredGrid3 > FaceCenteredGrid3Ptr
Shared pointer type for the FaceCenteredGrid3.
Definition: FaceCenteredGrid3.h:276
DataPositionFunc GetWPosition() const
Returns function object that maps w data point to its actual position.
void ParallelForEachUIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each u-data point in parallel.
Vector3D Sample(const Vector3D &x) const override
Returns sampled value at given position x.
void Set(const FaceCenteredGrid3 &other)
Sets the contents with the given other grid.
void OnResize(const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &origin, const Vector3D &initialValue) final
Invoked when the resizing happens.
Vector3D ValueAtCellCenter(size_t i, size_t j, size_t k) const
Returns interpolated value at cell center.
Definition: pybind11Utils.h:24
double & GetW(size_t i, size_t j, size_t k)
Returns w-value at given data point.
void Fill(const Vector3D &value, ExecutionPolicy policy=ExecutionPolicy::Parallel) override
Fills the grid with given value.
ConstScalarDataAccessor GetVConstAccessor() const
Returns read-only v data accessor.
FaceCenteredGrid3Ptr MakeShared() const
Builds shared pointer of FaceCenteredGrid3 instance.
void Swap(Grid3 *other) override
Swaps the contents with the given other grid.
void SetData(const std::vector< double > &data) override
Sets the data from a continuous linear array.
Vector3D CurlAtCellCenter(size_t i, size_t j, size_t k) const
Returns curl at cell-center location.
Vector3D Curl(const Vector3D &x) const override
Returns curl at given position x.
Builder & WithResolution(const Size3 &resolution)
Returns builder with resolution.
DataPositionFunc GetUPosition() const
Returns function object that maps u data point to its actual position.
DataPositionFunc GetVPosition() const
Returns function object that maps v data point to its actual position.
void ForEachWIndex(const std::function< void(size_t, size_t, size_t)> &func) const
Invokes the given function func for each w-data point.
std::function< Vector3D(const Vector3D &)> Sampler() const override
Returns the sampler function.
Builder & WithOrigin(const Vector3D &gridOrigin)
Returns builder with grid origin.
Vector3D GetUOrigin() const
Returns u-data position for the grid point at (0, 0, 0).
std::shared_ptr< VectorGrid3 > VectorGrid3Ptr
Shared pointer for the VectorGrid3 type.
Definition: VectorGrid3.h:90
ConstScalarDataAccessor GetUConstAccessor() const
Returns read-only u data accessor.
void GetData(std::vector< double > *data) const override
Fetches the data into a continuous linear array.
Abstract base class for 3-D vector grid structure.
Definition: VectorGrid3.h:19
static Builder GetBuilder()
Returns builder fox FaceCenteredGrid3.
std::shared_ptr< VectorGrid3 > Clone() const override
Returns the copy of the grid instance.
3-D linear array sampler class.
Definition: ArraySamplers3.h:78
double DivergenceAtCellCenter(size_t i, size_t j, size_t k) const
Returns divergence at cell-center location.