31 #ifndef BASE_BODY_PART_H 32 #define BASE_BODY_PART_H 49 : sph_body_(&sph_body), body_part_name_(body_part_name){};
52 SPHBody *getSPHBody() {
return sph_body_; };
53 std::string BodyPartName() {
return body_part_name_; };
57 std::string body_part_name_;
70 :
BodyPart(sph_body, body_part_name), base_particles_(sph_body.base_particles_),
71 body_part_bounds_(Vecd(0), Vecd(0)), body_part_bounds_set_(false){};
74 void setBodyPartBounds(BoundingBox bbox)
76 body_part_bounds_ = bbox;
77 body_part_bounds_set_ =
true;
80 BoundingBox getBodyPartBounds()
82 if (!body_part_bounds_set_)
83 std::cout <<
"WARNING: the body part bounds are not set for BodyPartByParticle." << std::endl;
84 return body_part_bounds_;
88 BaseParticles *base_particles_;
89 BoundingBox body_part_bounds_;
90 bool body_part_bounds_set_;
92 typedef std::function<void(size_t)> TaggingParticleMethod;
93 void tagParticles(TaggingParticleMethod &tagging_particle_method);
106 :
BodyPart(real_body, body_part_name), cell_linked_list_(real_body.cell_linked_list_){};
110 BaseCellLinkedList *cell_linked_list_;
111 typedef std::function<bool(Vecd, Real)> TaggingCellMethod;
112 void tagCells(TaggingCellMethod &tagging_cell_method);
125 Shape &body_part_shape_;
131 void tagByContain(
size_t particle_index);
145 Real particle_spacing_min_;
146 void tagNearSurface(
size_t particle_index);
160 Real thickness_threshold_;
161 void tagSurfaceLayer(
size_t particle_index);
174 Shape &body_part_shape_;
180 bool checkNotFar(Vecd cell_position, Real threshold);
205 bool checkNearSurface(Vecd cell_position, Real threshold);
212 template <
class BodyRegionType>
219 :
BodyRegionType(real_body, aligned_box_ptr), aligned_box_(*aligned_box_ptr.get()){};
226 #endif // BASE_BODY_PART_H
A body part with a collection of cell lists.
Definition: base_body_part.h:100
A body part with the collection of particles at surface of a body.
Definition: base_body_part.h:138
StdVec< size_t > IndexVector
Definition: sph_data_containers.h:37
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
A body part with a collection of particles.
Definition: base_body_part.h:64
StdLargeVec< CellList * > CellLists
Definition: sph_data_containers.h:46
A body part with the collection of particles within by a prescribed shape.
Definition: base_body_part.h:119
A body part with the cell lists within a prescribed shape.
Definition: base_body_part.h:168
A wrapper to provide an ownership for a new derived object which previous often generated by new a ra...
Definition: ownership.h:90
An auxillary class for SPHBody to indicate a part of the body.
Definition: base_body_part.h:45
This is the base classes of SPH bodies. The real body is for that with cell linked list and the ficti...
IndexVector body_part_particles_
Definition: base_body_part.h:67
Used to describe a bounding box in which the plane vertical to axis direction is aligned to a planar ...
Definition: complex_shape.h:68
A shape using level set to define geometry.
Definition: level_set_shape.h:46
A body part with the cell lists near the surface of a prescribed shape.
Definition: base_body_part.h:187
A template body part with the collection of particles within by an AlignedBoxShape.
Definition: base_body_part.h:213
A wrapper to provide an shared ownership for a new derived object which previous often generated by n...
Definition: ownership.h:170
A body part with the collection of particles within the surface layers of a body. ...
Definition: base_body_part.h:153
CellLists body_part_cells_
Definition: base_body_part.h:103
SPHBody is a base body with basic data and functions. Its derived class can be a real fluid body...
Definition: base_body.h:61
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