![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <periodic_boundaries_manipulator.h>
Public Member Functions | |
| PeriodicBoundariesManipulator () | |
| void | set_periodic_boundaries_information (const Parameters::PeriodicBoundaries &periodic_boundaries) |
| void | map_periodic_cells (const parallel::distributed::Triangulation< dim > &triangulation, typename DEM::dem_data_structures< dim >::periodic_boundaries_cells_info &periodic_boundaries_cells_information) |
| bool | execute_particles_displacement (const Particles::ParticleHandler< dim > &particle_handler, const typename DEM::dem_data_structures< dim >::periodic_boundaries_cells_info &periodic_boundaries_cells_information) |
| const Tensor< 1, dim > & | get_periodic_offset_distance (const types::boundary_id boundary_id) |
| const Parameters::PeriodicBoundaries & | get_periodic_boundaries () const |
| const std::array< double, dim > & | get_periodic_offset_per_direction () const |
Private Member Functions | |
| void | get_periodic_boundaries_info (typename Triangulation< dim >::cell_iterator cell, const unsigned int face_id, periodic_boundaries_cells_info_struct< dim > &boundaries_information) |
| void | check_and_move_particles (const periodic_boundaries_cells_info_struct< dim > &boundaries_cells_content, const bool &particles_in_pb0_cell, typename Particles::ParticleHandler< dim >::particle_iterator_range &particles_in_cell, bool &particle_has_been_moved) |
| void | compute_periodic_offset_per_direction () |
Private Attributes | |
| bool | periodic_boundaries_enabled |
| Parameters::PeriodicBoundaries | periodic_boundaries |
| std::unordered_map< types::boundary_id, Tensor< 1, dim > > | periodic_offsets |
| std::array< double, dim > | periodic_offset_per_direction {} |
This class corresponds to a manipulator of the particles crossing periodic cells in DEM. It maps cell information of the pairs of periodic cells and manipulate the particles' location when they cross periodic boundaries, i.e. when a particle cross a periodic boundary (0 or 1) its location is modified with the offset between faces of periodic cells on periodic boundaries.
Definition at line 36 of file periodic_boundaries_manipulator.h.
| PeriodicBoundariesManipulator< dim >::PeriodicBoundariesManipulator | ( | ) |
Definition at line 23 of file periodic_boundaries_manipulator.cc.
References periodic_boundaries_enabled.
|
private |
Check if particle is outside the cell, if so, modify the location of the particle using the relevant periodic offset for the boundary.
| [in] | boundaries_cells_content | Reference to the object with periodic boundary information. |
| [in] | particles_in_pb0_cell | If the particles are linked to a cell on the periodic boundary 0 (true) or the periodic boundary 1 (false). |
| [in,out] | particles_in_cell | Iterator to the particles in cell. |
| [out] | particle_has_been_moved | Flag the particle has been moved to the other periodic cell. |
Definition at line 194 of file periodic_boundaries_manipulator.cc.
References periodic_boundaries_cells_info_struct< dim >::boundary_id, periodic_boundaries_cells_info_struct< dim >::normal_vector, periodic_boundaries_cells_info_struct< dim >::periodic_normal_vector, periodic_offsets, periodic_boundaries_cells_info_struct< dim >::point_on_face, and periodic_boundaries_cells_info_struct< dim >::point_on_periodic_face.
|
private |
Compute the signed periodic offset for every direction and store it in periodic_offset_per_direction.
Definition at line 278 of file periodic_boundaries_manipulator.cc.
References periodic_offset_per_direction, and periodic_offsets.
| bool PeriodicBoundariesManipulator< dim >::execute_particles_displacement | ( | const Particles::ParticleHandler< dim > & | particle_handler, |
| const typename DEM::dem_data_structures< dim >::periodic_boundaries_cells_info & | periodic_boundaries_cells_information ) |
Moves particles crossing periodic boundaries (any side) particle_handler doesn't allow automated particle displacement since it is not linked to triangulation and its periodic mapping.
| [in,out] | particle_handler | Particle handler of particles located in boundary cells. |
| [in] | periodic_boundaries_cells_information | Map of information of the pair of cells on periodic boundaries. |
Definition at line 300 of file periodic_boundaries_manipulator.cc.
References check_and_move_particles(), and periodic_boundaries_enabled.
|
inline |
Return the periodic boundary pairs, keyed by the principal periodic boundary id (periodic id 0).
Definition at line 115 of file periodic_boundaries_manipulator.h.
References periodic_boundaries.
|
private |
Get boundary information related to a face at a periodic boundary and store it in a periodic_boundaries_cells_info_struct object.
| [in] | cell | Current cell on boundary. |
| [in] | face_id | Face located on boundary. |
| [out] | boundaries_information | Reference to the object with periodic boundary information. |
Definition at line 75 of file periodic_boundaries_manipulator.cc.
References periodic_boundaries_cells_info_struct< dim >::boundary_id, periodic_boundaries_cells_info_struct< dim >::cell, periodic_boundaries_cells_info_struct< dim >::normal_vector, periodic_boundaries_cells_info_struct< dim >::periodic_cell, periodic_boundaries_cells_info_struct< dim >::periodic_normal_vector, periodic_boundaries_cells_info_struct< dim >::point_on_face, and periodic_boundaries_cells_info_struct< dim >::point_on_periodic_face.
|
inline |
Return the periodic offset distance for a specific pb0 boundary ID. All pairs of cells on that pair of periodic boundaries are assumed to have the same offset. If no periodic offset has been identified for the boundary id, a zero tensor is inserted as a default value.
| [in] | boundary_id | ID of the boundary to query. |
Definition at line 95 of file periodic_boundaries_manipulator.h.
References periodic_offsets.
|
inline |
Return the signed periodic offset for every direction.
Definition at line 127 of file periodic_boundaries_manipulator.h.
References periodic_offset_per_direction.
| void PeriodicBoundariesManipulator< dim >::map_periodic_cells | ( | const parallel::distributed::Triangulation< dim > & | triangulation, |
| typename DEM::dem_data_structures< dim >::periodic_boundaries_cells_info & | periodic_boundaries_cells_information ) |
Execute the mapping of the cells on periodic boundaries and store information in periodic_boundaries_cells_information.
| [in] | triangulation | Triangulation. |
| [out] | periodic_boundaries_cells_information | Map (multimap) of information of the pair of cells on periodic boundaries. |
Definition at line 115 of file periodic_boundaries_manipulator.cc.
References periodic_boundaries_cells_info_struct< dim >::cell, compute_periodic_offset_per_direction(), get_periodic_boundaries_info(), periodic_boundaries, periodic_boundaries_enabled, periodic_offsets, periodic_boundaries_cells_info_struct< dim >::point_on_face, and periodic_boundaries_cells_info_struct< dim >::point_on_periodic_face.
| void PeriodicBoundariesManipulator< dim >::set_periodic_boundaries_information | ( | const Parameters::PeriodicBoundaries & | periodic_boundaries | ) |
Sets the periodic boundaries parameters.
| [in] | periodic_boundaries | Periodic boundary pairs of the simulation, keyed by the principal periodic boundary id (periodic id 0). |
Definition at line 29 of file periodic_boundaries_manipulator.cc.
References DEMActionManager::get_action_manager(), periodic_boundaries, periodic_boundaries_enabled, periodic_offsets, and DEMActionManager::set_periodic_boundaries_enabled().
|
private |
Periodic boundary pairs of the simulation. Each entry carries the neighbor boundary id of the pair and the direction of periodicity, which is normal to the periodic boundaries. Keys of this map are the principal periodic boundary ids (periodic id 0).
Definition at line 189 of file periodic_boundaries_manipulator.h.
|
private |
Flag for periodic boundary conditions in simulation. Useful to exit function when there are no periodic boundaries.
Definition at line 181 of file periodic_boundaries_manipulator.h.
|
private |
Signed periodic distance associated with each periodic boundary pairs. The component d of this array returns the distance, in absolute value, between the two boundaries facing in that d direction (x,y,z). If the associated d direction is not periodic, the array returns a 0. This array is used by the particle-particle fine search to find the nearest periodic image of a particle.
Definition at line 207 of file periodic_boundaries_manipulator.h.
|
private |
Map storing offset distance between periodic boundaries, keyed by the boundary ID (pb0). It is calculated from the first pair of cells on periodic boundaries, so all pairs of cells on a given peridodic boundary are assumed to have the same offset.
Definition at line 197 of file periodic_boundaries_manipulator.h.