SPHinXsys  alpha version
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE > Class Template Reference

Abstract base class for a data package whose data are defined on the grids of a small mesh patch. note tha ADDRS_SIZE = PKG_SIZE + 2 * pkg_addrs_buffer_; Also note that, while the mesh lower bound locates the first data address, the data lower bound locates the first data. More...

#include <mesh_with_data_packages.h>

Inherits SPH::BaseDataPackage, and SPH::BaseMesh.

Classes

struct  assignPackageDataAddress
 
struct  initializePackageDataAddress
 

Public Types

template<typename DataType >
using PackageData = PackageDataMatrix< DataType, PKG_SIZE >
 
template<typename DataType >
using PackageDataAddress = PackageDataMatrix< DataType *, ADDRS_SIZE >
 
template<typename DataType >
using PackageTemporaryData = PackageDataMatrix< DataType, ADDRS_SIZE >
 

Public Member Functions

constexpr int PackageSize ()
 
constexpr int AddressSize ()
 
constexpr int AddressBufferWidth ()
 
constexpr int OperationUpperBound ()
 
Vecd DataLowerBound ()
 
void initializePackageGeometry (const Vecd &pkg_lower_bound, Real data_spacing)
 
template<typename DataType >
DataType probeDataPackage (PackageDataAddress< DataType > &pkg_data_addrs, const Vecd &position)
 
template<typename InDataType , typename OutDataType >
void computeGradient (PackageDataAddress< InDataType > &in_pkg_data_addrs, PackageDataAddress< OutDataType > out_pkg_data_addrs, Real dt=0.0)
 
template<typename InDataType , typename OutDataType >
void computeNormalizedGradient (PackageDataAddress< InDataType > &in_pkg_data_addrs, PackageDataAddress< OutDataType > out_pkg_data_addrs, Real dt=0.0)
 
void initializeSingularDataAddress ()
 
void assignAllPackageDataAddress (const Vecu &addrs_index, GridDataPackage *src_pkg, const Vecu &data_index)
 
- Public Member Functions inherited from SPH::BaseMesh
 BaseMesh (Vecu number_of_grid_points)
 
 BaseMesh (Vecd mesh_lower_bound, Real grid_spacing, Vecu number_of_grid_points)
 
 BaseMesh (BoundingBox tentative_bounds, Real grid_spacing, size_t buffer_width)
 
Vecd MeshLowerBound ()
 
Real GridSpacing ()
 
Vecu NumberOfGridPoints ()
 
Vecu NumberOfGridPointsFromNumberOfCells (const Vecu &number_of_cells)
 
Vecu NumberOfCellsFromNumberOfGridPoints (const Vecu &number_of_grid_points)
 
Vecd GridPositionFromCellPosition (const Vecd &cell_position)
 
Vecu CellIndexFromPosition (const Vecd &position)
 
Vecd CellPositionFromIndex (const Vecu &cell_index)
 
Vecd GridPositionFromIndex (const Vecu &grid_index)
 
Vecu transfer1DtoMeshIndex (const Vecu &number_of_mesh_indexes, size_t i)
 
size_t transferMeshIndexTo1D (const Vecu &number_of_mesh_indexes, const Vecu &mesh_index)
 
size_t MortonCode (const size_t &i)
 
size_t transferMeshIndexToMortonOrder (const Vecu &mesh_index)
 

Public Attributes

GeneralDataAssemble< PackageData > all_pkg_data_
 
GeneralDataAssemble< PackageDataAddress > all_pkg_data_addrs_
 
- Public Attributes inherited from SPH::BaseDataPackage
Vecu pkg_index_
 
bool is_inner_pkg_
 

Protected Member Functions

template<typename DataType >
void registerPackageData (PackageData< DataType > &pkg_data, PackageDataAddress< DataType > &pkg_data_addrs)
 
template<typename DataType >
DataType CornerAverage (PackageDataAddress< DataType > &pkg_data_addrs, Veci addrs_index, Veci corner_direction)
 

Protected Attributes

DataAssembleOperation< initializePackageDataAddressinitialize_pkg_data_addrs_
 
DataAssembleOperation< assignPackageDataAddressassign_pkg_data_addrs_
 
- Protected Attributes inherited from SPH::BaseMesh
Vecd mesh_lower_bound_
 
Real grid_spacing_
 
Vecu number_of_grid_points_
 

Detailed Description

template<int PKG_SIZE, int ADDRS_SIZE>
class SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >

Abstract base class for a data package whose data are defined on the grids of a small mesh patch. note tha ADDRS_SIZE = PKG_SIZE + 2 * pkg_addrs_buffer_; Also note that, while the mesh lower bound locates the first data address, the data lower bound locates the first data.

Member Typedef Documentation

◆ PackageTemporaryData

template<int PKG_SIZE, int ADDRS_SIZE>
template<typename DataType >
using SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::PackageTemporaryData = PackageDataMatrix<DataType, ADDRS_SIZE>

Matrix data for temporary usage. Note that it is array with ADDRS_SIZE.

Member Function Documentation

◆ computeGradient()

template<int PKG_SIZE, int ADDRS_SIZE>
template<typename InDataType , typename OutDataType >
void SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::computeGradient ( PackageDataAddress< InDataType > &  in_pkg_data_addrs,
PackageDataAddress< OutDataType >  out_pkg_data_addrs,
Real  dt = 0.0 
)

This function compute gradient transform within data package

◆ computeNormalizedGradient()

template<int PKG_SIZE, int ADDRS_SIZE>
template<typename InDataType , typename OutDataType >
void SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::computeNormalizedGradient ( PackageDataAddress< InDataType > &  in_pkg_data_addrs,
PackageDataAddress< OutDataType >  out_pkg_data_addrs,
Real  dt = 0.0 
)

This function compute normalized gradient transform within data package

◆ CornerAverage()

template<int PKG_SIZE, int ADDRS_SIZE>
template<typename DataType >
DataType SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::CornerAverage ( PackageDataAddress< DataType > &  pkg_data_addrs,
Veci  addrs_index,
Veci  corner_direction 
)
protected

obtain averaged value at a corner of a data cell

◆ DataLowerBound()

template<int PKG_SIZE, int ADDRS_SIZE>
Vecd SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::DataLowerBound ( )
inline

lower bound coordinate for the data as reference

◆ initializePackageGeometry()

template<int PKG_SIZE, int ADDRS_SIZE>
void SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::initializePackageGeometry ( const Vecd &  pkg_lower_bound,
Real  data_spacing 
)
inline

initialize package mesh geometric information.

◆ probeDataPackage()

template<int PKG_SIZE, int ADDRS_SIZE>
template<class DataType >
DataType SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::probeDataPackage ( PackageDataAddress< DataType > &  pkg_data_addrs,
const Vecd &  position 
)

This function probes by applying bi and tri-linear interpolation within the package.

◆ registerPackageData()

template<int PKG_SIZE, int ADDRS_SIZE>
template<typename DataType >
void SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >::registerPackageData ( PackageData< DataType > &  pkg_data,
PackageDataAddress< DataType > &  pkg_data_addrs 
)
inlineprotected

register a variable defined in a class (can be non-particle class)


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