39 #include "base_data_package.h" 44 #include "all_geometries.h" 51 class SPHBodyRelation;
78 std::string body_name_;
83 bool is_domain_bounds_determined_;
94 std::string getBodyName();
96 Real getSPHBodyResolutionRef() {
return sph_adaptation_->ReferenceSpacing(); };
100 void setBodyDomainBounds(
const BoundingBox &body_domain_bounds);
101 BoundingBox getBodyDomainBounds();
102 BoundingBox getSPHSystemBounds();
106 template <
typename... ConstructorArgs>
107 LevelSetShape *defineComponentLevelSetShape(
const std::string &shape_name, ConstructorArgs &&...args)
109 ComplexShape *complex_shape = DynamicCast<ComplexShape>(
this,
body_shape_);
110 return complex_shape->defineLevelSetShape(
this, shape_name, std::forward<ConstructorArgs>(args)...);
113 template <
typename... ConstructorArgs>
114 LevelSetShape *defineBodyLevelSetShape(ConstructorArgs &&...args)
116 LevelSetShape *levelset_shape =
117 shape_ptr_keeper_.
resetPtr<LevelSetShape>(
this, *
body_shape_, std::forward<ConstructorArgs>(args)...);
119 return levelset_shape;
123 template <
class ParticleType = BaseParticles,
class MaterialType = BaseMaterial>
134 MaterialType *material = base_material_ptr_keeper_.
createPtr<MaterialType>(std::forward<ConstructorArgs>(args)...);
135 defineParticlesWithMaterial<ParticleType>(material);
140 template <
class ParticleGeneratorType,
typename... ConstructorArgs>
143 ParticleGeneratorType particle_generator(*
this, std::forward<ConstructorArgs>(args)...);
144 particle_generator.initializeGeometricVariables();
152 void allocateConfigurationMemoriesForBufferParticles();
154 template <
typename VariableType>
155 void addBodyStateForRecording(
const std::string &variable_name)
157 base_particles_->template addVariableToWrite<VariableType>(variable_name);
160 template <
class DerivedVariableMethod>
161 void addDerivedBodyStateForRecording()
163 base_particles_->template addDerivedVariableToWrite<DerivedVariableMethod>();
166 virtual void writeParticlesToVtuFile(std::ostream &output_file);
167 virtual void writeParticlesToVtpFile(std::ofstream &output_file);
168 virtual void writeParticlesToPltFile(std::ofstream &output_file);
169 virtual void writeSurfaceParticlesToVtuFile(std::ofstream &output_file, BodySurface &surface_particles);
170 virtual void writeParticlesToXmlForRestart(std::string &filefullpath);
171 virtual void readParticlesFromXmlForRestart(std::string &filefullpath);
172 virtual void writeToXmlForReloadParticle(std::string &filefullpath);
173 virtual void readFromXmlForReloadParticle(std::string &filefullpath);
174 virtual SPHBody *ThisObjectPtr() {
return this; };
194 bool use_split_cell_lists_;
203 void setUseSplitCellLists() { use_split_cell_lists_ =
true; };
204 bool getUseSplitCellLists() {
return use_split_cell_lists_; };
205 SplitCellLists &getSplitCellLists() {
return split_cell_lists_; };
209 virtual void sortParticleWithCellLinkedList();
210 virtual void updateCellLinkedList();
214 template <
class AdaptationType,
typename... ConstructorArgs>
215 void defineAdaptation(ConstructorArgs &&...args)
218 .
createPtr<AdaptationType>(
this, std::forward<ConstructorArgs>(args)...);
StdVec< ConcurrentCellLists > SplitCellLists
Definition: sph_data_containers.h:54
Base class for all adaptations. The base class defines essential global parameters. It is also used for single-resolution method. In the constructor parameter, system_refinement_ratio defines the relation between present resolution to the system reference resolution. The derived classes are defined for more complex adaptations.
Definition: adaptation.h:55
DerivedType * resetPtr(ConstructorArgs &&...args)
Definition: ownership.h:175
StdVec< SPHBodyRelation * > body_relations_
Definition: base_body.h:89
Particles with essential (geometric and kinematic) data. There are three types of particles, all par...
Definition: base_particles.h:81
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
BaseCellLinkedList * cell_linked_list_
Definition: base_body.h:198
virtual void initializeOtherVariables()
Definition: base_particles.cpp:39
BaseMaterial * base_material_
Definition: base_body.h:87
Base of all materials.
Definition: base_material.h:52
bool newly_updated_
Definition: base_body.h:79
Here gives the classes for managing cell linked lists. This is the basic class for building the parti...
void defineParticlesAndMaterial(ConstructorArgs &&...args)
Definition: base_body.h:132
void defineParticlesWithMaterial(MaterialType *material)
Definition: base_body.h:124
Adaptation defines the parameters for single or multi-resolution computations.
A wrapper to provide an ownership for a new derived object which previous often generated by new a ra...
Definition: ownership.h:90
Abstract class for mesh cell linked list.
Definition: cell_linked_list.h:69
The class for sorting particle according a given sequence.
Definition: particle_sorting.h:265
BoundingBox body_domain_bounds_
Definition: base_body.h:82
Here gives the classes for particle sorting.
void generateParticles(ConstructorArgs &&...args)
Definition: base_body.h:141
DerivedType * createPtr(ConstructorArgs &&...args)
Definition: ownership.h:95
virtual void assignBaseParticles(BaseParticles *base_particles) override
Definition: base_body.cpp:126
BaseType * movePtr(UniquePtr< BaseType > moved_unique_ptr)
Definition: ownership.h:110
A wrapper to provide an shared ownership for a new derived object which previous often generated by n...
Definition: ownership.h:170
Shape * body_shape_
Definition: base_body.h:67
virtual void assignBaseParticles(BaseParticles *base_particles)
Definition: base_material.cpp:13
Set up of basic data structure.
BaseParticles * base_particles_
Definition: base_body.h:88
SPHBody is a base body with basic data and functions. Its derived class can be a real fluid body...
Definition: base_body.h:61
virtual void assignBaseParticles(BaseParticles *base_particles)
Definition: base_body.cpp:40
The SPH system managing objects in the system level.
Definition: sph_system.h:46
SPHAdaptation * sph_adaptation_
Definition: base_body.h:86
Derived body with inner particle configuration or inner interactions. After construction, the particle and material must be specified.
Definition: base_body.h:182
Definition: solid_body_supplementary.cpp:9