Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
PeriodicBoundariesManipulator< dim > Class Template Reference

#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 {}

Detailed Description

template<int dim>
class PeriodicBoundariesManipulator< dim >

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.

Note
Currently the code only supports periodic boundaries that are parallel and aligned with an axis of the domain (e.g., x axis).

Definition at line 36 of file periodic_boundaries_manipulator.h.

Constructor & Destructor Documentation

◆ PeriodicBoundariesManipulator()

template<int dim>
PeriodicBoundariesManipulator< dim >::PeriodicBoundariesManipulator ( )

Definition at line 23 of file periodic_boundaries_manipulator.cc.

References periodic_boundaries_enabled.

Member Function Documentation

◆ check_and_move_particles()

template<int dim>
void PeriodicBoundariesManipulator< dim >::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 )
private

Check if particle is outside the cell, if so, modify the location of the particle using the relevant periodic offset for the boundary.

Parameters
[in]boundaries_cells_contentReference to the object with periodic boundary information.
[in]particles_in_pb0_cellIf the particles are linked to a cell on the periodic boundary 0 (true) or the periodic boundary 1 (false).
[in,out]particles_in_cellIterator to the particles in cell.
[out]particle_has_been_movedFlag 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.

◆ compute_periodic_offset_per_direction()

template<int dim>
void PeriodicBoundariesManipulator< dim >::compute_periodic_offset_per_direction ( )
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.

◆ execute_particles_displacement()

template<int dim>
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.

Parameters
[in,out]particle_handlerParticle handler of particles located in boundary cells.
[in]periodic_boundaries_cells_informationMap of information of the pair of cells on periodic boundaries.
Returns
Flag if at least one particle has been moved to the other periodic cell.

Definition at line 300 of file periodic_boundaries_manipulator.cc.

References check_and_move_particles(), and periodic_boundaries_enabled.

◆ get_periodic_boundaries()

template<int dim>
const Parameters::PeriodicBoundaries & PeriodicBoundariesManipulator< dim >::get_periodic_boundaries ( ) const
inline

Return the periodic boundary pairs, keyed by the principal periodic boundary id (periodic id 0).

Returns
Map of periodic boundary pairs keyed by principal periodic boundary id.

Definition at line 115 of file periodic_boundaries_manipulator.h.

References periodic_boundaries.

◆ get_periodic_boundaries_info()

template<int dim>
void PeriodicBoundariesManipulator< dim >::get_periodic_boundaries_info ( typename Triangulation< dim >::cell_iterator cell,
const unsigned int face_id,
periodic_boundaries_cells_info_struct< dim > & boundaries_information )
private

◆ get_periodic_offset_distance()

template<int dim>
const Tensor< 1, dim > & PeriodicBoundariesManipulator< dim >::get_periodic_offset_distance ( const types::boundary_id boundary_id)
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.

Parameters
[in]boundary_idID of the boundary to query.
Returns
Offset distance between periodic boundaries.

Definition at line 95 of file periodic_boundaries_manipulator.h.

References periodic_offsets.

◆ get_periodic_offset_per_direction()

template<int dim>
const std::array< double, dim > & PeriodicBoundariesManipulator< dim >::get_periodic_offset_per_direction ( ) const
inline

Return the signed periodic offset for every direction.

Returns
Array whose component d is the signed periodic offsets of the domain along direction d if d is periodic, or 0 otherwise.

Definition at line 127 of file periodic_boundaries_manipulator.h.

References periodic_offset_per_direction.

◆ map_periodic_cells()

template<int dim>
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.

Parameters
[in]triangulationTriangulation.
[out]periodic_boundaries_cells_informationMap (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.

◆ set_periodic_boundaries_information()

template<int dim>
void PeriodicBoundariesManipulator< dim >::set_periodic_boundaries_information ( const Parameters::PeriodicBoundaries & periodic_boundaries)

Sets the periodic boundaries parameters.

Parameters
[in]periodic_boundariesPeriodic 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().

Member Data Documentation

◆ periodic_boundaries

template<int dim>
Parameters::PeriodicBoundaries PeriodicBoundariesManipulator< dim >::periodic_boundaries
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.

◆ periodic_boundaries_enabled

template<int dim>
bool PeriodicBoundariesManipulator< dim >::periodic_boundaries_enabled
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.

◆ periodic_offset_per_direction

template<int dim>
std::array<double, dim> PeriodicBoundariesManipulator< dim >::periodic_offset_per_direction {}
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.

◆ periodic_offsets

template<int dim>
std::unordered_map<types::boundary_id, Tensor<1, dim> > PeriodicBoundariesManipulator< dim >::periodic_offsets
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.


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