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

The tree is composed of a root (the first branch) and other branch generated sequentially. More...

#include <complex_body.h>

Inherits SPH::SecondaryStructure, and SPH::RealBody.

Classes

class  Branch
 Each branch (except the root) has a parent and several children, and geometric information. It is a realized edge and has multi inner particles. The first is the last particle from the parent or root, and the last is the first particle of all its child branches. Many connected branches compose a tree. More...
 

Public Member Functions

 TreeBody (SPHSystem &sph_system, SharedPtr< Shape > shape_ptr)
 
BranchcreateANewBranch (size_t parent_id)
 
size_t BranchLocation (size_t particle_idx)
 
BranchLastBranch ()
 
virtual void buildParticleConfiguration (ParticleConfiguration &particle_configuration) override
 
size_t ContainerSize ()
 
- Public Member Functions inherited from SPH::RealBody
 RealBody (SPHSystem &sph_system, SharedPtr< Shape > shape_ptr)
 
void setUseSplitCellLists ()
 
bool getUseSplitCellLists ()
 
SplitCellListsgetSplitCellLists ()
 
virtual void assignBaseParticles (BaseParticles *base_particles) override
 
virtual void sortParticleWithCellLinkedList ()
 
virtual void updateCellLinkedList ()
 
template<class AdaptationType , typename... ConstructorArgs>
void defineAdaptation (ConstructorArgs &&...args)
 
- Public Member Functions inherited from SPH::SPHBody
 SPHBody (SPHSystem &sph_system, SharedPtr< Shape > shape_ptr)
 
std::string getBodyName ()
 
SPHSystemgetSPHSystem ()
 
Real getSPHBodyResolutionRef ()
 
void setNewlyUpdated ()
 
void setNotNewlyUpdated ()
 
bool checkNewlyUpdated ()
 
void setBodyDomainBounds (const BoundingBox &body_domain_bounds)
 
BoundingBox getBodyDomainBounds ()
 
BoundingBox getSPHSystemBounds ()
 
template<typename... ConstructorArgs>
LevelSetShapedefineComponentLevelSetShape (const std::string &shape_name, ConstructorArgs &&...args)
 
template<typename... ConstructorArgs>
LevelSetShapedefineBodyLevelSetShape (ConstructorArgs &&...args)
 
template<class ParticleType = BaseParticles, class MaterialType = BaseMaterial>
void defineParticlesWithMaterial (MaterialType *material)
 
template<class ParticleType = BaseParticles, class MaterialType = BaseMaterial, typename... ConstructorArgs>
void defineParticlesAndMaterial (ConstructorArgs &&...args)
 
template<class ParticleGeneratorType , typename... ConstructorArgs>
void generateParticles (ConstructorArgs &&...args)
 
void allocateConfigurationMemoriesForBufferParticles ()
 
template<typename VariableType >
void addBodyStateForRecording (const std::string &variable_name)
 
template<class DerivedVariableMethod >
void addDerivedBodyStateForRecording ()
 
virtual void writeParticlesToVtuFile (std::ostream &output_file)
 
virtual void writeParticlesToVtpFile (std::ofstream &output_file)
 
virtual void writeParticlesToPltFile (std::ofstream &output_file)
 
virtual void writeSurfaceParticlesToVtuFile (std::ofstream &output_file, BodySurface &surface_particles)
 
virtual void writeParticlesToXmlForRestart (std::string &filefullpath)
 
virtual void readParticlesFromXmlForRestart (std::string &filefullpath)
 
virtual void writeToXmlForReloadParticle (std::string &filefullpath)
 
virtual void readFromXmlForReloadParticle (std::string &filefullpath)
 
virtual SPHBodyThisObjectPtr ()
 

Public Attributes

StdVec< Branch * > branches_
 
IndexVector branch_locations_
 
size_t last_branch_id_
 
Branchroot_
 
- Public Attributes inherited from SPH::RealBody
ParticleSorting particle_sorting_
 
BaseCellLinkedListcell_linked_list_
 
- Public Attributes inherited from SPH::SPHBody
Shapebody_shape_
 
SPHAdaptationsph_adaptation_
 
BaseMaterialbase_material_
 
BaseParticlesbase_particles_
 
StdVec< SPHBodyRelation * > body_relations_
 

Additional Inherited Members

- Protected Attributes inherited from SPH::SPHBody
UniquePtrKeeper< SPHAdaptationsph_adaptation_ptr_keeper_
 
SPHSystemsph_system_
 
std::string body_name_
 
bool newly_updated_
 
BoundingBox body_domain_bounds_
 
bool is_domain_bounds_determined_
 

Detailed Description

The tree is composed of a root (the first branch) and other branch generated sequentially.

Member Function Documentation

◆ buildParticleConfiguration()

void SPH::TreeBody::buildParticleConfiguration ( ParticleConfiguration particle_configuration)
overridevirtual

First branch Note that the first branch has only one particle. Find the neighbors in child branch, the first branch only have one child, id = 1.

Build configuration.



Second branch. The second branch has special parent branch, branch 0, consisting only one point. The child branch are two normal branch.

Other branches. They are may normal branch (fully growed, has child and parent) or non-fully growed branch

This branch is fully growed.
This branch is not fully growed.

Implements SPH::SecondaryStructure.

Member Data Documentation

◆ branch_locations_

IndexVector SPH::TreeBody::branch_locations_

in which branch are the particles located

◆ branches_

StdVec<Branch *> SPH::TreeBody::branches_

Container of all branches


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