3-D grid system data. More...
#include <Core/Grid/GridSystemData3.h>
Public Member Functions | |
GridSystemData3 () | |
Constructs empty grid system. More... | |
GridSystemData3 (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &origin) | |
Constructs a grid system with given resolution, grid spacing and origin. More... | |
GridSystemData3 (const GridSystemData3 &other) | |
Copy constructor. More... | |
virtual | ~GridSystemData3 () |
Destructor. More... | |
void | Resize (const Size3 &resolution, const Vector3D &gridSpacing, const Vector3D &origin) |
Resizes the whole system with given resolution, grid spacing, and origin. More... | |
Size3 | GetResolution () const |
Returns the resolution of the grid. More... | |
Vector3D | GetGridSpacing () const |
Return the grid spacing. More... | |
Vector3D | GetOrigin () const |
Returns the origin of the grid. More... | |
BoundingBox3D | GetBoundingBox () const |
Returns the bounding box of the grid. More... | |
size_t | AddScalarData (const ScalarGridBuilder3Ptr &builder, double initialVal=0.0) |
Adds a non-advectable scalar data grid by passing its builder and initial value. More... | |
size_t | AddVectorData (const VectorGridBuilder3Ptr &builder, const Vector3D &initialVal=Vector3D()) |
Adds a non-advectable vector data grid by passing its builder and initial value. More... | |
size_t | AddAdvectableScalarData (const ScalarGridBuilder3Ptr &builder, double initialVal=0.0) |
Adds an advectable scalar data grid by passing its builder and initial value. More... | |
size_t | AddAdvectableVectorData (const VectorGridBuilder3Ptr &builder, const Vector3D &initialVal=Vector3D()) |
Adds an advectable vector data grid by passing its builder and initial value. More... | |
const FaceCenteredGrid3Ptr & | GetVelocity () const |
Returns the velocity field. More... | |
size_t | GetVelocityIndex () const |
Returns the index of the velocity field. More... | |
const ScalarGrid3Ptr & | GetScalarDataAt (size_t idx) const |
Returns the non-advectable scalar data at given index. More... | |
const VectorGrid3Ptr & | GetVectorDataAt (size_t idx) const |
Returns the non-advectable vector data at given index. More... | |
const ScalarGrid3Ptr & | GetAdvectableScalarDataAt (size_t idx) const |
Returns the advectable scalar data at given index. More... | |
const VectorGrid3Ptr & | GetAdvectableVectorDataAt (size_t idx) const |
Returns the advectable vector data at given index. More... | |
size_t | GetNumberOfScalarData () const |
Returns the number of non-advectable scalar data. More... | |
size_t | GetNumberOfVectorData () const |
Returns the number of non-advectable vector data. More... | |
size_t | GetNumberOfAdvectableScalarData () const |
Returns the number of advectable scalar data. More... | |
size_t | GetNumberOfAdvectableVectorData () const |
Returns the number of advectable vector data. More... | |
void | Serialize (std::vector< uint8_t > *buffer) const override |
Serialize the data to the given buffer. More... | |
void | Deserialize (const std::vector< uint8_t > &buffer) override |
Serialize the data from the given buffer. More... | |
Detailed Description
3-D grid system data.
This class is the key data structure for storing grid system data. To represent a grid system for fluid simulation, velocity field is defined as a face-centered (MAC) grid by default. It can also have additional scalar or vector attributes by adding extra data layer.
Constructor & Destructor Documentation
◆ GridSystemData3() [1/3]
CubbyFlow::GridSystemData3::GridSystemData3 | ( | ) |
Constructs empty grid system.
◆ GridSystemData3() [2/3]
CubbyFlow::GridSystemData3::GridSystemData3 | ( | const Size3 & | resolution, |
const Vector3D & | gridSpacing, | ||
const Vector3D & | origin | ||
) |
Constructs a grid system with given resolution, grid spacing and origin.
This constructor builds the entire grid layers within the system. Note, the resolution is the grid resolution, not the data size of each grid. Depending on the layout of the grid, the data point may lie on different part of the grid (vertex, cell-center, or face-center), thus can have different array size internally. The resolution of the grid means the grid cell resolution.
- Parameters
-
[in] resolution The resolution. [in] gridSpacing The grid spacing. [in] origin The origin.
◆ GridSystemData3() [3/3]
CubbyFlow::GridSystemData3::GridSystemData3 | ( | const GridSystemData3 & | other | ) |
Copy constructor.
◆ ~GridSystemData3()
|
virtual |
Destructor.
Member Function Documentation
◆ AddAdvectableScalarData()
size_t CubbyFlow::GridSystemData3::AddAdvectableScalarData | ( | const ScalarGridBuilder3Ptr & | builder, |
double | initialVal = 0.0 |
||
) |
Adds an advectable scalar data grid by passing its builder and initial value.
This function adds a new scalar data grid. This layer is advectable, meaning that during the computation of fluid flow, this layer will follow the flow. For the future access of this layer, its index is returned.
- Parameters
-
[in] builder The grid builder. [in] initialVal The initial value.
- Returns
- Index of the data.
◆ AddAdvectableVectorData()
size_t CubbyFlow::GridSystemData3::AddAdvectableVectorData | ( | const VectorGridBuilder3Ptr & | builder, |
const Vector3D & | initialVal = Vector3D() |
||
) |
Adds an advectable vector data grid by passing its builder and initial value.
This function adds a new vector data grid. This layer is advectable, meaning that during the computation of fluid flow, this layer will follow the flow. For the future access of this layer, its index is returned.
- Parameters
-
[in] builder The grid builder. [in] initialVal The initial value.
- Returns
- Index of the data.
◆ AddScalarData()
size_t CubbyFlow::GridSystemData3::AddScalarData | ( | const ScalarGridBuilder3Ptr & | builder, |
double | initialVal = 0.0 |
||
) |
Adds a non-advectable scalar data grid by passing its builder and initial value.
This function adds a new scalar data grid. This layer is not advectable, meaning that during the computation of fluid flow, this layer won't follow the flow. For the future access of this layer, its index is returned.
- Parameters
-
[in] builder The grid builder. [in] initialVal The initial value.
- Returns
- Index of the data.
◆ AddVectorData()
size_t CubbyFlow::GridSystemData3::AddVectorData | ( | const VectorGridBuilder3Ptr & | builder, |
const Vector3D & | initialVal = Vector3D() |
||
) |
Adds a non-advectable vector data grid by passing its builder and initial value.
This function adds a new vector data grid. This layer is not advectable, meaning that during the computation of fluid flow, this layer won't follow the flow. For the future access of this layer, its index is returned.
- Parameters
-
[in] builder The grid builder. [in] initialVal The initial value.
- Returns
- Index of the data.
◆ Deserialize()
|
overridevirtual |
Serialize the data from the given buffer.
Implements CubbyFlow::Serializable.
◆ GetAdvectableScalarDataAt()
const ScalarGrid3Ptr& CubbyFlow::GridSystemData3::GetAdvectableScalarDataAt | ( | size_t | idx | ) | const |
Returns the advectable scalar data at given index.
◆ GetAdvectableVectorDataAt()
const VectorGrid3Ptr& CubbyFlow::GridSystemData3::GetAdvectableVectorDataAt | ( | size_t | idx | ) | const |
Returns the advectable vector data at given index.
◆ GetBoundingBox()
BoundingBox3D CubbyFlow::GridSystemData3::GetBoundingBox | ( | ) | const |
Returns the bounding box of the grid.
◆ GetGridSpacing()
Vector3D CubbyFlow::GridSystemData3::GetGridSpacing | ( | ) | const |
Return the grid spacing.
◆ GetNumberOfAdvectableScalarData()
size_t CubbyFlow::GridSystemData3::GetNumberOfAdvectableScalarData | ( | ) | const |
Returns the number of advectable scalar data.
◆ GetNumberOfAdvectableVectorData()
size_t CubbyFlow::GridSystemData3::GetNumberOfAdvectableVectorData | ( | ) | const |
Returns the number of advectable vector data.
◆ GetNumberOfScalarData()
size_t CubbyFlow::GridSystemData3::GetNumberOfScalarData | ( | ) | const |
Returns the number of non-advectable scalar data.
◆ GetNumberOfVectorData()
size_t CubbyFlow::GridSystemData3::GetNumberOfVectorData | ( | ) | const |
Returns the number of non-advectable vector data.
◆ GetOrigin()
Vector3D CubbyFlow::GridSystemData3::GetOrigin | ( | ) | const |
Returns the origin of the grid.
◆ GetResolution()
Size3 CubbyFlow::GridSystemData3::GetResolution | ( | ) | const |
Returns the resolution of the grid.
This function resizes the entire grid layers within the system. Note, the resolution is the grid resolution, not the data size of each grid. Depending on the layout of the grid, the data point may lie on different part of the grid (vertex, cell-center, or face-center), thus can have different array size internally. The resolution of the grid means the grid cell resolution.
- Returns
- Grid cell resolution.
◆ GetScalarDataAt()
const ScalarGrid3Ptr& CubbyFlow::GridSystemData3::GetScalarDataAt | ( | size_t | idx | ) | const |
Returns the non-advectable scalar data at given index.
◆ GetVectorDataAt()
const VectorGrid3Ptr& CubbyFlow::GridSystemData3::GetVectorDataAt | ( | size_t | idx | ) | const |
Returns the non-advectable vector data at given index.
◆ GetVelocity()
const FaceCenteredGrid3Ptr& CubbyFlow::GridSystemData3::GetVelocity | ( | ) | const |
Returns the velocity field.
This class has velocity field by default, and it is part of the advectable vector data list.
- Returns
- Pointer to the velocity field.
◆ GetVelocityIndex()
size_t CubbyFlow::GridSystemData3::GetVelocityIndex | ( | ) | const |
Returns the index of the velocity field.
This class has velocity field by default, and it is part of the advectable vector data list. This function returns the index of the velocity field from the list.
- Returns
- Index of the velocity field.
◆ Resize()
void CubbyFlow::GridSystemData3::Resize | ( | const Size3 & | resolution, |
const Vector3D & | gridSpacing, | ||
const Vector3D & | origin | ||
) |
Resizes the whole system with given resolution, grid spacing, and origin.
This function resizes the entire grid layers within the system. Note, the resolution is the grid resolution, not the data size of each grid. Depending on the layout of the grid, the data point may lie on different part of the grid (vertex, cell-center, or face-center), thus can have different array size internally. The resolution of the grid means the grid cell resolution.
- Parameters
-
[in] resolution The resolution. [in] gridSpacing The grid spacing. [in] origin The origin.
◆ Serialize()
|
overridevirtual |
Serialize the data to the given buffer.
Implements CubbyFlow::Serializable.
The documentation for this class was generated from the following file:
- Core/Grid/GridSystemData3.h