FaceCenteredGrid.hpp
Go to the documentation of this file.
std::enable_if_t< M==3, double & > W(const Vector< size_t, N > &idx)
Returns w-value at given data point.
Definition: FaceCenteredGrid.hpp:127
Vector< size_t, N > USize() const
Returns data size of the u component.
void Fill(const Vector< double, N > &value, ExecutionPolicy policy=ExecutionPolicy::Parallel) override
Fills the grid with given value.
#define CUBBYFLOW_GRID_TYPE_NAME(DerivedClassName, N)
Definition: Grid.hpp:195
double & V(size_t i, Indices... indices)
Returns v-value at given data point.
Definition: FaceCenteredGrid.hpp:110
Vector< size_t, N > VSize() const
Returns data size of the v component.
double DivergenceAtCellCenter(const Vector< size_t, N > &idx) const
Returns divergence at cell-center location.
Vector< double, N > UOrigin() const
Returns u-data position for the grid point at (0, 0, ...).
Vector< size_t, N > DataSize(size_t i) const
Returns data size of the i-th component.
void OnResize(const Vector< size_t, N > &resolution, const Vector< double, N > &gridSpacing, const Vector< double, N > &origin, const Vector< double, N > &initialValue) final
Invoked when the resizing happens.
std::enable_if_t< M==3, ScalarDataView > WView()
Returns w data view.
Definition: FaceCenteredGrid.hpp:207
Vector< double, N > VOrigin() const
Returns v-data position for the grid point at (0, 0, ...).
std::function< Vector< double, N >const Vector< double, N > &)> Sampler() const override
Returns the sampler function.
double DivergenceAtCellCenter(size_t i, Indices... indices) const
Returns divergence at cell-center location.
Definition: FaceCenteredGrid.hpp:175
static Builder GetBuilder()
Returns builder fox FaceCenteredGrid.
std::enable_if_t< M==3, ConstScalarDataView > WView() const
Returns read-only w data view.
Definition: FaceCenteredGrid.hpp:214
Front-end to create FaceCenteredGrid objects step by step.
Definition: FaceCenteredGrid.hpp:443
double & V(const Vector< size_t, N > &idx)
Returns v-value at given data point.
std::shared_ptr< VectorGrid< N > > Clone() const override
Returns the copy of the grid instance.
GetCurl< N >::Type CurlAtCellCenter(const Vector< size_t, N > &idx) const
Returns curl at cell-center location.
double & U(const Vector< size_t, N > &idx)
Returns u-value at given data point.
Definition: IterationUtils.hpp:92
void ParallelForEachUIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each u-data point in parallel.
Abstract base class for N-D vector grid builder.
Definition: VectorGrid.hpp:117
std::shared_ptr< FaceCenteredGrid3 > FaceCenteredGrid3Ptr
Shared pointer type for the FaceCenteredGrid3.
Definition: FaceCenteredGrid.hpp:437
std::enable_if_t< M==3, double & > W(size_t i, Indices... indices)
Returns w-value at given data point.
Definition: FaceCenteredGrid.hpp:135
void Swap(Grid< N > *other) override
Swaps the contents with the given other grid.
std::enable_if_t< M==3, Vector< size_t, N > > WSize() const
Returns data size of the w component.
Definition: FaceCenteredGrid.hpp:250
Definition: Matrix.hpp:27
std::enable_if_t< M==3, const double & > W(const Vector< size_t, N > &idx) const
Returns w-value at given data point.
Definition: FaceCenteredGrid.hpp:143
std::enable_if_t< M==3, GridDataPositionFunc< N > > WPosition() const
Returns function object that maps w data point to its actual position.
Definition: FaceCenteredGrid.hpp:233
static std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), D > MakeConstant(ValueType val)
Makes a static matrix with constant entries.
Definition: MatrixDenseBase-Impl.hpp:152
const double & U(size_t i, Indices... indices) const
Returns u-value at given data point.
Definition: FaceCenteredGrid.hpp:100
GridDataPositionFunc< N > DataPosition(size_t i) const
Returns function object that maps data point to its actual position.
Definition: pybind11Utils.hpp:20
void ForEachUIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each u-data point.
std::enable_if_t< M==3, void > ParallelForEachWIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each w-data point parallelly.
Definition: FaceCenteredGrid.hpp:374
Definition: Array-Impl.hpp:19
std::enable_if_t< M==3, const double & > W(size_t i, Indices... indices) const
Returns w-value at given data point.
Definition: FaceCenteredGrid.hpp:151
double & U(size_t i, Indices... indices)
Returns u-value at given data point.
Definition: FaceCenteredGrid.hpp:90
Abstract base class for N-D vector grid structure.
Definition: VectorGrid.hpp:22
void ForEachVIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each v-data point.
void GetData(Array1< double > &data) const override
Fetches the data into a continuous linear array.
GetCurl< N >::Type CurlAtCellCenter(size_t i, Indices... indices) const
Returns curl at cell-center location.
Definition: FaceCenteredGrid.hpp:187
GridDataPositionFunc< N > UPosition() const
Returns function object that maps u data point to its actual position.
N-D face-centered (a.k.a MAC or staggered) grid.
Definition: FaceCenteredGrid.hpp:31
Definition: Grid.hpp:23
void ParallelForEachIndex(const Vector< IndexType, N > &begin, const Vector< IndexType, N > &end, const Func &func, ExecutionPolicy policy)
Definition: IterationUtils-Impl.hpp:98
std::enable_if_t< M==3, Vector< double, N > > WOrigin() const
Returns w-data position for the grid point at (0, 0, ...).
Definition: FaceCenteredGrid.hpp:281
std::shared_ptr< FaceCenteredGrid2 > FaceCenteredGrid2Ptr
Shared pointer type for the FaceCenteredGrid2.
Definition: FaceCenteredGrid.hpp:434
void Set(const FaceCenteredGrid &other)
Sets the contents with the given other grid.
void SetData(const ConstArrayView1< double > &data) override
Sets the data from a continuous linear array.
void ParallelForEachVIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each v-data point in parallel.
std::enable_if_t< M==3, void > ForEachWIndex(const std::function< void(const Vector< size_t, N > &)> &func) const
Invokes the given function func for each w-data point.
Definition: FaceCenteredGrid.hpp:358
Vector< double, N > DataOrigin(size_t i) const
Returns i-th data position for the grid point at (0, 0, ...).
const double & V(size_t i, Indices... indices) const
Returns v-value at given data point.
Definition: FaceCenteredGrid.hpp:120
GridDataPositionFunc< N > VPosition() const
Returns function object that maps v data point to its actual position.
~FaceCenteredGrid() override=default
Default virtual destructor.
void ForEachIndex(const Vector< IndexType, N > &begin, const Vector< IndexType, N > &end, const Func &func)
Definition: IterationUtils-Impl.hpp:51
Vector< double, N > Sample(const Vector< double, N > &x) const override
Returns sampled value at given position x.
Vector< double, N > ValueAtCellCenter(size_t i, Indices... indices) const
Returns interpolated value at cell center.
Definition: FaceCenteredGrid.hpp:163
GetCurl< N >::Type Curl(const Vector< double, N > &x) const override
Returns curl at given position x.
Vector< double, N > ValueAtCellCenter(const Vector< size_t, N > &idx) const
Returns interpolated value at cell center.
Definition: VectorField.hpp:23
FaceCenteredGrid & operator=(const FaceCenteredGrid &other)
Copy assignment operator.
double Divergence(const Vector< double, N > &x) const override
Returns divergence at given position x.