29 #ifndef GENERAL_BOUNDING_H 30 #define GENERAL_BOUNDING_H 61 Vecd periodic_translation_;
62 StdVec<CellLists> bound_cells_;
63 void setPeriodicTranslation(
BoundingBox &body_domain_bounds,
int axis_direction);
72 Vecd &periodic_translation_;
73 StdVec<CellLists> &bound_cells_;
75 virtual void checkLowerBound(
size_t index_i, Real dt = 0.0);
76 virtual void checkUpperBound(
size_t index_i, Real dt = 0.0);
80 StdVec<CellLists> &bound_cells,
RealBody &real_body,
int axis_direction)
82 bound_cells_(bound_cells){};
85 virtual void exec(Real dt = 0.0)
override;
86 virtual void parallel_exec(Real dt = 0.0)
override;
96 Vecd &periodic_translation_;
97 StdVec<CellLists> &bound_cells_;
99 virtual void checkLowerBound(
ListData &list_data, Real dt = 0.0) = 0;
100 virtual void checkUpperBound(
ListData &list_data, Real dt = 0.0) = 0;
104 StdVec<CellLists> &bound_cells,
RealBody &real_body,
int axis_direction)
106 bound_cells_(bound_cells){};
112 virtual void exec(Real dt = 0.0)
override;
113 virtual void parallel_exec(Real dt = 0.0)
override {
exec(); };
144 StdVec<CellLists> &bound_cells,
RealBody &real_body,
int axis_direction)
145 :
PeriodicCondition(periodic_translation, bound_cells, real_body, axis_direction){};
152 bounding_(this->periodic_translation_, this->bound_cells_, real_body, axis_direction),
153 update_cell_linked_list_(this->periodic_translation_, this->bound_cells_, real_body, axis_direction){};
157 PeriodicCellLinkedList update_cell_linked_list_;
169 StdVec<CellLists> bound_cells_;
174 StdVec<CellLists> &bound_cells_;
176 virtual void checkLowerBound(
size_t index_i, Real dt = 0.0);
177 virtual void checkUpperBound(
size_t index_i, Real dt = 0.0);
182 bound_cells_(bound_cells)
184 checking_bound_ = positive ? std::bind(&OpenBoundaryConditionInAxisDirection::ParticleTypeTransfer::checkUpperBound,
this, _1, _2)
185 : std::bind(&OpenBoundaryConditionInAxisDirection::ParticleTypeTransfer::checkLowerBound,
this, _1, _2);
192 virtual void exec(Real dt = 0.0)
override;
193 virtual void parallel_exec(Real dt = 0.0)
override {
exec(); };
200 ParticleTypeTransfer particle_type_transfer;
216 StdVec<IndexVector> ghost_particles_;
225 StdVec<IndexVector> &ghost_particles_;
226 virtual void setupDynamics(Real dt = 0.0)
override;
232 StdVec<IndexVector> &ghost_particles,
RealBody &real_body,
int axis_direction)
233 :
PeriodicBounding(periodic_translation, bound_cells, real_body, axis_direction),
234 ghost_particles_(ghost_particles){};
250 StdVec<IndexVector> &ghost_particles_;
251 void checkLowerBound(
size_t index_i, Real dt = 0.0)
override;
252 void checkUpperBound(
size_t index_i, Real dt = 0.0)
override;
256 StdVec<IndexVector> &ghost_particles,
RealBody &real_body,
int axis_direction)
257 : PeriodicBounding(periodic_translation, bound_cells, real_body, axis_direction),
258 ghost_particles_(ghost_particles){};
261 virtual void exec(Real dt = 0.0)
override;
262 virtual void parallel_exec(Real dt = 0.0)
override;
268 bounding_(this->periodic_translation_, this->bound_cells_, real_body, axis_direction),
269 ghost_creation_(this->periodic_translation_, this->bound_cells_, this->ghost_particles_, real_body, axis_direction),
270 ghost_update_(this->periodic_translation_, this->bound_cells_, this->ghost_particles_, real_body, axis_direction)
272 ghost_particles_.resize(2);
278 CreatPeriodicGhostParticles ghost_creation_;
279 UpdatePeriodicGhostParticles ghost_update_;
298 virtual void checkLowerBound(
size_t index_i, Real dt = 0.0);
299 virtual void checkUpperBound(
size_t index_i, Real dt = 0.0);
303 void mirrorInAxisDirection(
size_t particle_index_i, Vecd body_bound,
int axis_direction);
308 virtual void exec(Real dt = 0.0)
override;
309 virtual void parallel_exec(Real dt = 0.0)
override;
320 virtual void setupDynamics(Real dt = 0.0)
override { ghost_particles_.clear(); };
326 RealBody &real_body,
int axis_direction,
bool positive);
340 void checkLowerBound(
size_t index_i, Real dt = 0.0)
override;
341 void checkUpperBound(
size_t index_i, Real dt = 0.0)
override;
346 RealBody &real_body,
int axis_direction,
bool positive);
349 virtual void exec(Real dt = 0.0)
override;
350 virtual void parallel_exec(Real dt = 0.0)
override;
361 virtual void exec(Real dt = 0.0)
override{};
362 virtual void parallel_exec(Real dt = 0.0)
override{};
365 #endif //GENERAL_BOUNDING_H virtual void parallel_exec(Real dt=0.0) override
Definition: general_bounding.h:329
virtual void exec(Real dt=0.0) override
Definition: general_bounding.cpp:53
virtual void exec(Real dt=0.0) override
Definition: general_bounding.cpp:111
Real cut_off_radius_max_
Definition: general_bounding.h:48
update ghost particles in an axis direction
Definition: general_bounding.h:247
the state of a ghost particle updated according to its corresponding real particle ...
Definition: general_bounding.h:336
StdVec< size_t > IndexVector
Definition: sph_data_containers.h:37
virtual void setupDynamics(Real dt=0.0) override
Definition: general_bounding.h:320
create ghost particles in an axis direction
Definition: general_bounding.h:222
This is the particle dynamics aplliable for all type bodies.
StdLargeVec< CellList * > CellLists
Definition: sph_data_containers.h:46
The method imposing periodic boundary condition in an axis direction by using ghost particles...
Definition: general_bounding.h:213
Bounding particle position in a axis direction. The axis_direction must be 0, 1 for 2d and 0...
Definition: general_bounding.h:41
virtual void exec(Real dt=0.0) override
Definition: general_bounding.cpp:188
Periodic bounding particle position in an axis direction.
Definition: general_bounding.h:69
virtual void checkLowerBound(size_t index_i, Real dt=0.0) override
Definition: general_bounding.cpp:219
Definition: general_bounding.h:136
Abstract class for mesh cell linked list.
Definition: cell_linked_list.h:69
const int axis_
Definition: general_bounding.h:44
virtual void parallel_exec(Real dt=0.0) override
Definition: general_bounding.h:240
virtual void exec(Real dt=0.0) override
Definition: general_bounding.h:361
Definition: general_bounding.h:294
implement periodic condition in an axis direction
Definition: general_bounding.h:93
std::pair< size_t, Vecd > ListData
Definition: sph_data_containers.h:42
virtual void exec(Real dt=0.0) override
Definition: general_bounding.cpp:421
Base class for two different type periodic boundary conditions.
Definition: general_bounding.h:58
virtual void checkUpperBound(ListData &list_data, Real dt=0.0) override
Definition: general_bounding.cpp:135
ghost particle created according to its corresponding real particle
Definition: general_bounding.h:316
virtual void exec(Real dt=0.0) override
Definition: general_bounding.cpp:349
virtual void checkLowerBound(size_t index_i, Real dt=0.0) override
Definition: general_bounding.cpp:377
Periodic boundary condition in an axis direction.
In open boundary case, we transfer fluid particles to buffer particles at outlet. ...
Definition: general_bounding.h:166
virtual void checkUpperBound(size_t index_i, Real dt=0.0) override
Definition: general_bounding.cpp:234
BoundingBox body_domain_bounds_
Definition: general_bounding.h:45
Mirror bounding particle position and velocity in an axis direction Note that, currently, this class is not for mirror condition in combined directions, such as mirror condition in both x and y directions.
Definition: general_bounding.h:288
virtual void checkUpperBound(size_t index_i, Real dt=0.0) override
Definition: general_bounding.cpp:393
std::function< void(size_t, Real)> ParticleFunctor
Definition: base_particle_dynamics.h:49
Derived body with inner particle configuration or inner interactions. After construction, the particle and material must be specified.
Definition: base_body.h:182
virtual void checkLowerBound(ListData &list_data, Real dt=0.0) override
Definition: general_bounding.cpp:148
The method imposing periodic boundary condition in an axis direction. It includes two different steps...
Definition: general_bounding.h:129
Definition: solid_body_supplementary.cpp:9
Definition: general_bounding.h:171
The base class for all particle dynamics This class contains the only two interface functions availab...
Definition: base_particle_dynamics.h:145