Jet
v1.3.3
|
3-D grid system data. More...
#include <jet/grid_system_data3.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 | resolution () const |
Returns the resolution of the grid. More... | |
Vector3D | gridSpacing () const |
Return the grid spacing. More... | |
Vector3D | origin () const |
Returns the origin of the grid. More... | |
BoundingBox3D | boundingBox () 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 & | velocity () const |
Returns the velocity field. More... | |
size_t | velocityIndex () const |
Returns the index of the velocity field. More... | |
const ScalarGrid3Ptr & | scalarDataAt (size_t idx) const |
Returns the non-advectable scalar data at given index. More... | |
const VectorGrid3Ptr & | vectorDataAt (size_t idx) const |
Returns the non-advectable vector data at given index. More... | |
const ScalarGrid3Ptr & | advectableScalarDataAt (size_t idx) const |
Returns the advectable scalar data at given index. More... | |
const VectorGrid3Ptr & | advectableVectorDataAt (size_t idx) const |
Returns the advectable vector data at given index. More... | |
size_t | numberOfScalarData () const |
Returns the number of non-advectable scalar data. More... | |
size_t | numberOfVectorData () const |
Returns the number of non-advectable vector data. More... | |
size_t | numberOfAdvectableScalarData () const |
Returns the number of advectable scalar data. More... | |
size_t | numberOfAdvectableVectorData () 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... | |
![]() | |
Serializable ()=default | |
virtual | ~Serializable ()=default |
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.
jet::GridSystemData3::GridSystemData3 | ( | ) |
Constructs empty grid system.
jet::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.
[in] | resolution | The resolution. |
[in] | gridSpacing | The grid spacing. |
[in] | origin | The origin. |
jet::GridSystemData3::GridSystemData3 | ( | const GridSystemData3 & | other | ) |
Copy constructor.
|
virtual |
Destructor.
size_t jet::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.
[in] | builder | The grid builder. |
[in] | initialVal | The initial value. |
size_t jet::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.
[in] | builder | The grid builder. |
[in] | initialVal | The initial value. |
size_t jet::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.
[in] | builder | The grid builder. |
[in] | initialVal | The initial value. |
size_t jet::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.
[in] | builder | The grid builder. |
[in] | initialVal | The initial value. |
const ScalarGrid3Ptr& jet::GridSystemData3::advectableScalarDataAt | ( | size_t | idx | ) | const |
Returns the advectable scalar data at given index.
const VectorGrid3Ptr& jet::GridSystemData3::advectableVectorDataAt | ( | size_t | idx | ) | const |
Returns the advectable vector data at given index.
BoundingBox3D jet::GridSystemData3::boundingBox | ( | ) | const |
Returns the bounding box of the grid.
|
overridevirtual |
Serialize the data from the given buffer.
Implements jet::Serializable.
Vector3D jet::GridSystemData3::gridSpacing | ( | ) | const |
Return the grid spacing.
size_t jet::GridSystemData3::numberOfAdvectableScalarData | ( | ) | const |
Returns the number of advectable scalar data.
size_t jet::GridSystemData3::numberOfAdvectableVectorData | ( | ) | const |
Returns the number of advectable vector data.
size_t jet::GridSystemData3::numberOfScalarData | ( | ) | const |
Returns the number of non-advectable scalar data.
size_t jet::GridSystemData3::numberOfVectorData | ( | ) | const |
Returns the number of non-advectable vector data.
Vector3D jet::GridSystemData3::origin | ( | ) | const |
Returns the origin of the grid.
void jet::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.
[in] | resolution | The resolution. |
[in] | gridSpacing | The grid spacing. |
[in] | origin | The origin. |
Size3 jet::GridSystemData3::resolution | ( | ) | 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.
const ScalarGrid3Ptr& jet::GridSystemData3::scalarDataAt | ( | size_t | idx | ) | const |
Returns the non-advectable scalar data at given index.
|
overridevirtual |
Serialize the data to the given buffer.
Implements jet::Serializable.
const VectorGrid3Ptr& jet::GridSystemData3::vectorDataAt | ( | size_t | idx | ) | const |
Returns the non-advectable vector data at given index.
const FaceCenteredGrid3Ptr& jet::GridSystemData3::velocity | ( | ) | const |
Returns the velocity field.
This class has velocify field by default, and it is part of the advectable vector data list.
size_t jet::GridSystemData3::velocityIndex | ( | ) | const |
Returns the index of the velocity field.
This class has velocify 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.