SPHinXsys  alpha version
Public Member Functions | Protected Attributes | List of all members
SPH::BaseMesh Class Reference

Base class for all structured meshes which may be grid or cell based. The basic properties of the mesh, such as lower bound, grid spacing and number of grid points may be determined by the derived class. Note that there is no mesh-based data defined here. More...

#include <base_mesh.h>

Inherited by SPH::GridDataPackage< 4, 6 >, SPH::GridDataPackage< PKG_SIZE, ADDRS_SIZE >, and SPH::Mesh.

Public Member Functions

 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)
 

Protected Attributes

Vecd mesh_lower_bound_
 
Real grid_spacing_
 
Vecu number_of_grid_points_
 

Detailed Description

Base class for all structured meshes which may be grid or cell based. The basic properties of the mesh, such as lower bound, grid spacing and number of grid points may be determined by the derived class. Note that there is no mesh-based data defined here.

Member Function Documentation

◆ GridPositionFromIndex()

Vecd SPH::BaseMesh::GridPositionFromIndex ( const Vecu grid_index)

Note that, the lower corner grid of a cell has the same index as the cell.

◆ MortonCode()

size_t SPH::BaseMesh::MortonCode ( const size_t i)

converts mesh index into a Morton order. Interleave a 10 bit number in 32 bits, fill one bit and leave the other 2 as zeros https://stackoverflow.com/questions/18529057/ produce-interleaving-bit-patterns-morton-keys-for-32-bit-64-bit-and-128bit

◆ transferMeshIndexToMortonOrder()

size_t SPH::BaseMesh::transferMeshIndexToMortonOrder ( const Vecu mesh_index)

This function converts mesh index into a Morton order.

Member Data Documentation

◆ grid_spacing_

Real SPH::BaseMesh::grid_spacing_
protected

grid_spacing

◆ mesh_lower_bound_

Vecd SPH::BaseMesh::mesh_lower_bound_
protected

mesh lower bound as reference coordinate

◆ number_of_grid_points_

Vecu SPH::BaseMesh::number_of_grid_points_
protected

number of grid points by dimension


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