4#ifndef lethe_periodic_boundaries_manipulator_h
5#define lethe_periodic_boundaries_manipulator_h
13#include <deal.II/distributed/tria.h>
15#include <deal.II/particles/particle_handler.h>
19#include <unordered_map>
61 const parallel::distributed::Triangulation<dim> &triangulation,
63 &periodic_boundaries_cells_information);
80 const Particles::ParticleHandler<dim> &particle_handler,
82 &periodic_boundaries_cells_information);
94 inline const Tensor<1, dim> &
101 Tensor<1, dim> zero_tensor;
126 inline const std::array<double, dim> &
145 typename Triangulation<dim>::cell_iterator cell,
146 const unsigned int face_id,
165 const bool &particles_in_pb0_cell,
166 typename Particles::ParticleHandler<dim>::particle_iterator_range
168 bool &particle_has_been_moved);
std::array< double, dim > periodic_offset_per_direction
Signed periodic distance associated with each periodic boundary pairs. The component d of this array ...
void compute_periodic_offset_per_direction()
Compute the signed periodic offset for every direction and store it in periodic_offset_per_direction.
bool periodic_boundaries_enabled
Flag for periodic boundary conditions in simulation. Useful to exit function when there are no period...
PeriodicBoundariesManipulator()
std::unordered_map< types::boundary_id, Tensor< 1, dim > > periodic_offsets
Map storing offset distance between periodic boundaries, keyed by the boundary ID (pb0)....
const Tensor< 1, dim > & get_periodic_offset_distance(const types::boundary_id boundary_id)
Return the periodic offset distance for a specific pb0 boundary ID. All pairs of cells on that pair o...
Parameters::PeriodicBoundaries periodic_boundaries
Periodic boundary pairs of the simulation. Each entry carries the neighbor boundary id of the pair an...
void get_periodic_boundaries_info(typename Triangulation< dim >::cell_iterator cell, const unsigned int face_id, periodic_boundaries_cells_info_struct< dim > &boundaries_information)
Get boundary information related to a face at a periodic boundary and store it in a periodic_boundari...
void 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_...
void set_periodic_boundaries_information(const Parameters::PeriodicBoundaries &periodic_boundaries)
Sets the periodic boundaries parameters.
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)
Check if particle is outside the cell, if so, modify the location of the particle using the relevant ...
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)
Moves particles crossing periodic boundaries (any side) particle_handler doesn't allow automated part...
const Parameters::PeriodicBoundaries & get_periodic_boundaries() const
Return the periodic boundary pairs, keyed by the principal periodic boundary id (periodic id 0).
const std::array< double, dim > & get_periodic_offset_per_direction() const
Return the signed periodic offset for every direction.
std::map< dealii::types::boundary_id, PeriodicBoundary > PeriodicBoundaries
The periodic boundary pairs of a simulation, keyed by the principal (first) boundary id of each pair.
std::unordered_multimap< types::global_cell_index, periodic_boundaries_cells_info_struct< dim > > periodic_boundaries_cells_info
Handle the information related to the periodic boundary cells which will be used for particle-wall co...