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

Defining a mesh cell linked list for a body. The meshes for all bodies share the same global coordinates. More...

#include <cell_linked_list.h>

Inherits SPH::BaseCellLinkedList, and SPH::Mesh.

Public Member Functions

 CellLinkedList (BoundingBox tentative_bounds, Real grid_spacing, RealBody &real_body, SPHAdaptation &sph_adaptation)
 
void allocateMeshDataMatrix ()
 
void deleteMeshDataMatrix ()
 
virtual void assignBaseParticles (BaseParticles *base_particles) override
 
void clearCellLists ()
 
void UpdateCellListData ()
 
virtual void UpdateCellLists () override
 
void insertACellLinkedParticleIndex (size_t particle_index, const Vecd &particle_position) override
 
void InsertACellLinkedListDataEntry (size_t particle_index, const Vecd &particle_position) override
 
virtual ListData findNearestListDataEntry (const Vecd &position) override
 
virtual void computingSequence (StdLargeVec< size_t > &sequence) override
 
virtual void tagBodyPartByCell (CellLists &cell_lists, std::function< bool(Vecd, Real)> &check_included) override
 
virtual void tagBodyDomainBoundingCells (StdVec< CellLists > &cell_lists, BoundingBox &body_domain_bounds, int axis) override
 
virtual void tagMirrorBoundingCells (CellLists &cell_lists, BoundingBox &body_domain_bounds, int axis, bool positive) override
 
virtual void writeMeshFieldToPlt (std::ofstream &output_file) override
 
template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation >
void searchNeighborsByParticles (size_t total_real_particles, BaseParticles &source_particles, ParticleConfiguration &particle_configuration, GetParticleIndex &get_particle_index, GetSearchDepth &get_search_depth, GetNeighborRelation &get_neighbor_relation)
 
template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation , typename PartParticleCheck >
void searchNeighborPartsByParticles (size_t total_real_particles, BaseParticles &source_particles, ParticleConfiguration &particle_configuration, GetParticleIndex &get_particle_index, GetSearchDepth &get_search_depth, GetNeighborRelation &get_neighbor_relation, PartParticleCheck &part_check)
 
MeshDataMatrix< CellListgetCellLists () const
 
- Public Member Functions inherited from SPH::BaseCellLinkedList
 BaseCellLinkedList (RealBody &real_body, SPHAdaptation &sph_adaptation)
 
- Public Member Functions inherited from SPH::BaseMeshField
 BaseMeshField (const std::string &name)
 
std::string Name ()
 
- Public Member Functions inherited from SPH::Mesh
 Mesh (BoundingBox tentative_bounds, Real grid_spacing, size_t buffer_width)
 
 Mesh (Vecd mesh_lower_bound, Vecu number_of_cells, Real grid_spacing)
 
Vecu NumberOfCells ()
 
size_t MeshBufferSize ()
 
virtual Real DataSpacing ()
 
- 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)
 

Protected Member Functions

virtual void updateSplitCellLists (SplitCellLists &split_cell_lists) override
 
- Protected Member Functions inherited from SPH::BaseCellLinkedList
virtual void clearSplitCellLists (SplitCellLists &split_cell_lists)
 
- Protected Member Functions inherited from SPH::Mesh
void copyMeshProperties (Mesh *another_mesh)
 

Protected Attributes

MeshDataMatrix< CellListcell_linked_lists_
 
- Protected Attributes inherited from SPH::BaseCellLinkedList
RealBodyreal_body_
 
Kernelkernel_
 
BaseParticlesbase_particles_
 
- Protected Attributes inherited from SPH::BaseMeshField
std::string name_
 
- Protected Attributes inherited from SPH::Mesh
size_t buffer_width_
 
Vecu number_of_cells_
 
- Protected Attributes inherited from SPH::BaseMesh
Vecd mesh_lower_bound_
 
Real grid_spacing_
 
Vecu number_of_grid_points_
 

Detailed Description

Defining a mesh cell linked list for a body. The meshes for all bodies share the same global coordinates.

Member Function Documentation

◆ allocateMeshDataMatrix()

void SPH::CellLinkedList::allocateMeshDataMatrix ( )

allocate memories for addresses of data packages.

◆ assignBaseParticles()

void SPH::CellLinkedList::assignBaseParticles ( BaseParticles base_particles)
overridevirtual

Assign base particles to the mesh cell linked list, and is important because particles are not defined in the constructor.

Implements SPH::BaseCellLinkedList.

◆ computingSequence()

void SPH::CellLinkedList::computingSequence ( StdLargeVec< size_t > &  sequence)
overridevirtual

computing the sequence which indicate the order of sorted particle data

Implements SPH::BaseCellLinkedList.

◆ deleteMeshDataMatrix()

void SPH::CellLinkedList::deleteMeshDataMatrix ( )

delete memories for addresses of data packages.

◆ findNearestListDataEntry()

ListData SPH::CellLinkedList::findNearestListDataEntry ( const Vecd &  position)
overridevirtual

find the nearest list data entry

Implements SPH::BaseCellLinkedList.

◆ InsertACellLinkedListDataEntry()

void SPH::CellLinkedList::InsertACellLinkedListDataEntry ( size_t  particle_index,
const Vecd &  particle_position 
)
overridevirtual

Insert a cell-linked_list entry of the index and particle position pair.

Implements SPH::BaseCellLinkedList.

◆ insertACellLinkedParticleIndex()

void SPH::CellLinkedList::insertACellLinkedParticleIndex ( size_t  particle_index,
const Vecd &  particle_position 
)
overridevirtual

Insert a cell-linked_list entry to the concurrent index list.

Implements SPH::BaseCellLinkedList.

◆ searchNeighborPartsByParticles()

template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation , typename PartParticleCheck >
void SPH::CellLinkedList::searchNeighborPartsByParticles ( size_t  total_real_particles,
BaseParticles source_particles,
ParticleConfiguration particle_configuration,
GetParticleIndex &  get_particle_index,
GetSearchDepth &  get_search_depth,
GetNeighborRelation &  get_neighbor_relation,
PartParticleCheck &  part_check 
)

generalized particle search algorithm for searching body part

◆ searchNeighborsByParticles()

template<typename GetParticleIndex , typename GetSearchDepth , typename GetNeighborRelation >
void SPH::CellLinkedList::searchNeighborsByParticles ( size_t  total_real_particles,
BaseParticles source_particles,
ParticleConfiguration particle_configuration,
GetParticleIndex &  get_particle_index,
GetSearchDepth &  get_search_depth,
GetNeighborRelation &  get_neighbor_relation 
)

generalized particle search algorithm

◆ tagBodyDomainBoundingCells()

void SPH::CellLinkedList::tagBodyDomainBoundingCells ( StdVec< CellLists > &  cell_lists,
BoundingBox body_domain_bounds,
int  axis 
)
overridevirtual

Tag domain bounding cells in an axis direction, called by domain bounding classes

Implements SPH::BaseCellLinkedList.

◆ tagBodyPartByCell()

void SPH::CellLinkedList::tagBodyPartByCell ( CellLists cell_lists,
std::function< bool(Vecd, Real)> &  check_included 
)
overridevirtual

Tag body part by cell, call by body part

Implements SPH::BaseCellLinkedList.

◆ tagMirrorBoundingCells()

void SPH::CellLinkedList::tagMirrorBoundingCells ( CellLists cell_lists,
BoundingBox body_domain_bounds,
int  axis,
bool  positive 
)
overridevirtual

Tag mirror bounding cells, called by mirror boundary condition

Implements SPH::BaseCellLinkedList.

◆ UpdateCellLists()

void SPH::CellLinkedList::UpdateCellLists ( )
overridevirtual

update the cell lists

Implements SPH::BaseCellLinkedList.

◆ updateSplitCellLists()

void SPH::CellLinkedList::updateSplitCellLists ( SplitCellLists split_cell_lists)
overrideprotectedvirtual

update split particle list in this mesh

Implements SPH::BaseCellLinkedList.

◆ writeMeshFieldToPlt()

void SPH::CellLinkedList::writeMeshFieldToPlt ( std::ofstream &  output_file)
overridevirtual

output mesh data for Tecplot visualization

Implements SPH::BaseMeshField.

Member Data Documentation

◆ cell_linked_lists_

MeshDataMatrix<CellList> SPH::CellLinkedList::cell_linked_lists_
protected

The array for of mesh cells, i.e. mesh data. Within each cell, a list is saved with the indexes of particles.


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