Jet  v1.3.3
Public Member Functions | List of all members
jet::GridSystemData3 Class Reference

3-D grid system data. More...

#include <jet/grid_system_data3.h>

Inheritance diagram for jet::GridSystemData3:
jet::Serializable

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 FaceCenteredGrid3Ptrvelocity () const
 Returns the velocity field. More...
 
size_t velocityIndex () const
 Returns the index of the velocity field. More...
 
const ScalarGrid3PtrscalarDataAt (size_t idx) const
 Returns the non-advectable scalar data at given index. More...
 
const VectorGrid3PtrvectorDataAt (size_t idx) const
 Returns the non-advectable vector data at given index. More...
 
const ScalarGrid3PtradvectableScalarDataAt (size_t idx) const
 Returns the advectable scalar data at given index. More...
 
const VectorGrid3PtradvectableVectorDataAt (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...
 
- Public Member Functions inherited from jet::Serializable
 Serializable ()=default
 
virtual ~Serializable ()=default
 

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]

jet::GridSystemData3::GridSystemData3 ( )

Constructs empty grid system.

◆ GridSystemData3() [2/3]

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.

Parameters
[in]resolutionThe resolution.
[in]gridSpacingThe grid spacing.
[in]originThe origin.

◆ GridSystemData3() [3/3]

jet::GridSystemData3::GridSystemData3 ( const GridSystemData3 other)

Copy constructor.

◆ ~GridSystemData3()

virtual jet::GridSystemData3::~GridSystemData3 ( )
virtual

Destructor.

Member Function Documentation

◆ addAdvectableScalarData()

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.

Parameters
[in]builderThe grid builder.
[in]initialValThe initial value.
Returns
Index of the data.

◆ addAdvectableVectorData()

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.

Parameters
[in]builderThe grid builder.
[in]initialValThe initial value.
Returns
Index of the data.

◆ addScalarData()

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.

Parameters
[in]builderThe grid builder.
[in]initialValThe initial value.
Returns
Index of the data.

◆ addVectorData()

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.

Parameters
[in]builderThe grid builder.
[in]initialValThe initial value.
Returns
Index of the data.

◆ advectableScalarDataAt()

const ScalarGrid3Ptr& jet::GridSystemData3::advectableScalarDataAt ( size_t  idx) const

Returns the advectable scalar data at given index.

◆ advectableVectorDataAt()

const VectorGrid3Ptr& jet::GridSystemData3::advectableVectorDataAt ( size_t  idx) const

Returns the advectable vector data at given index.

◆ boundingBox()

BoundingBox3D jet::GridSystemData3::boundingBox ( ) const

Returns the bounding box of the grid.

◆ deserialize()

void jet::GridSystemData3::deserialize ( const std::vector< uint8_t > &  buffer)
overridevirtual

Serialize the data from the given buffer.

Implements jet::Serializable.

◆ gridSpacing()

Vector3D jet::GridSystemData3::gridSpacing ( ) const

Return the grid spacing.

◆ numberOfAdvectableScalarData()

size_t jet::GridSystemData3::numberOfAdvectableScalarData ( ) const

Returns the number of advectable scalar data.

◆ numberOfAdvectableVectorData()

size_t jet::GridSystemData3::numberOfAdvectableVectorData ( ) const

Returns the number of advectable vector data.

◆ numberOfScalarData()

size_t jet::GridSystemData3::numberOfScalarData ( ) const

Returns the number of non-advectable scalar data.

◆ numberOfVectorData()

size_t jet::GridSystemData3::numberOfVectorData ( ) const

Returns the number of non-advectable vector data.

◆ origin()

Vector3D jet::GridSystemData3::origin ( ) const

Returns the origin of the grid.

◆ resize()

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.

Parameters
[in]resolutionThe resolution.
[in]gridSpacingThe grid spacing.
[in]originThe origin.

◆ resolution()

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.

Returns
Grid cell resolution.

◆ scalarDataAt()

const ScalarGrid3Ptr& jet::GridSystemData3::scalarDataAt ( size_t  idx) const

Returns the non-advectable scalar data at given index.

◆ serialize()

void jet::GridSystemData3::serialize ( std::vector< uint8_t > *  buffer) const
overridevirtual

Serialize the data to the given buffer.

Implements jet::Serializable.

◆ vectorDataAt()

const VectorGrid3Ptr& jet::GridSystemData3::vectorDataAt ( size_t  idx) const

Returns the non-advectable vector data at given index.

◆ velocity()

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.

Returns
Pointer to the velocity field.

◆ velocityIndex()

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.

Returns
Index of the velocity field.

The documentation for this class was generated from the following file: