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

#include <ray_tracing.h>

Classes

struct  neighbor_list_types

Public Member Functions

 RayTracingSolver (RayTracingSolverParameters< dim > &parameters, DEMSolverParameters< dim > &dem_parameters)
void solve ()

Private Types

using local_neighbor_list = typename neighbor_list_types::local
using ghost_neighbor_list = typename neighbor_list_types::ghost

Private Member Functions

void setup_parameters ()
std::shared_ptr< Insertion< dim, DEMProperties::PropertiesIndex > > set_particle_insertion_type ()
void setup_background_dofs ()
void load_balance ()
void insert_particles_and_photons ()
void write_output_results (const std::vector< Point< dim > > &points)
void finish_simulation (const std::vector< Point< 3 > > &intersection_points)
template<typename NeighborListType>
void find_intersection (NeighborListType &cell_list, ankerl::unordered_dense::map< types::particle_index, std::tuple< double, Point< dim >, Particles::ParticleIterator< dim > > > &photon_intersection_points_map)

Static Private Member Functions

static void print_insertion_info (const unsigned int &inserted_photon, const ConditionalOStream &pcout)

Private Attributes

MPI_Comm mpi_communicator
const unsigned int n_mpi_processes
const unsigned int this_mpi_process
ConditionalOStream pcout
const RayTracingSolverParameters< dim > parameters
const DEMSolverParameters< dim > dem_parameters
parallel::distributed::Triangulation< dim > triangulation
MappingQGeneric< dim > mapping
Particles::ParticleHandler< dim, dim > particle_handler
Particles::ParticleHandler< dim, dim > photon_handler
TimerOutput computing_timer
DEMActionManager * action_manager
LagrangianLoadBalancing< dim, DEMProperties::PropertiesIndex > load_balancing
DoFHandler< dim > background_dh
std::shared_ptr< SimulationControl > simulation_control
std::shared_ptr< Insertion< dim, DEMProperties::PropertiesIndex > > particle_insertion_object
double displacement_distance
local_neighbor_list cells_local_neighbor_list
ghost_neighbor_list cells_ghost_neighbor_list

Detailed Description

template<int dim>
class RayTracingSolver< dim >

Solver that uses ray tracing to find intersection points between photons and particles.

Template Parameters
dimAn integer that denotes the number of spatial dimensions.

Definition at line 24 of file ray_tracing.h.

Member Typedef Documentation

◆ ghost_neighbor_list

template<int dim>
using RayTracingSolver< dim >::ghost_neighbor_list = typename neighbor_list_types::ghost
private

Definition at line 237 of file ray_tracing.h.

◆ local_neighbor_list

template<int dim>
using RayTracingSolver< dim >::local_neighbor_list = typename neighbor_list_types::local
private

Definition at line 236 of file ray_tracing.h.

Constructor & Destructor Documentation

◆ RayTracingSolver()

template<int dim>
RayTracingSolver< dim >::RayTracingSolver ( RayTracingSolverParameters< dim > & parameters,
DEMSolverParameters< dim > & dem_parameters )

Member Function Documentation

◆ find_intersection()

template<int dim>
template<typename NeighborListType>
void RayTracingSolver< dim >::find_intersection ( NeighborListType & cell_list,
ankerl::unordered_dense::map< types::particle_index, std::tuple< double, Point< dim >, Particles::ParticleIterator< dim > > > & photon_intersection_points_map )
private

Execute the ray tracing algorithm to find intersection points between photons and particles.

Template Parameters
NeighborListTypeType of the data structure containing the neighboring cells.
Parameters
[in]cell_listData structure containing the local or ghost neighboring cell to each local cell in the triangulation.
[in,out]photon_intersection_points_mapA map containing information about each intersection point found during the ray tracing. The key of the map is the particle index of the photon. The value is a tuple containing the distance between the initial location of the photon and the intersection point, the intersection point and an iterator to the photon that needs to be removed.

Definition at line 482 of file ray_tracing.cc.

References displacement_distance, DEM::DEMProperties::dp, LetheGridTools::find_line_sphere_intersection(), particle_handler, and photon_handler.

◆ finish_simulation()

template<int dim>
void RayTracingSolver< dim >::finish_simulation ( const std::vector< Point< 3 > > & intersection_points)
private

Execute the last post-processing at the end of the simulation and output test results if necessary.

Parameters
[in]intersection_pointsVector of points containing every intersection between photons and particles.

Definition at line 451 of file ray_tracing.cc.

References computing_timer, Parameters::Timer::end, mpi_communicator, parameters, and pcout.

◆ insert_particles_and_photons()

template<int dim>
void RayTracingSolver< dim >::insert_particles_and_photons ( )
private

Insert particles and photons at the beginning of a ray tracing simulation.

Definition at line 210 of file ray_tracing.cc.

References create_random_number_container(), dem_parameters, n_mpi_processes, parameters, particle_handler, particle_insertion_object, pcout, photon_handler, print_insertion_info(), this_mpi_process, and triangulation.

◆ load_balance()

template<int dim>
void RayTracingSolver< dim >::load_balance ( )
private

Check if a load balancing is required according to the load balancing method and perform it if necessary.

Definition at line 138 of file ray_tracing.cc.

References action_manager, cells_ghost_neighbor_list, cells_local_neighbor_list, computing_timer, find_cell_neighbors(), load_balancing, mpi_communicator, particle_handler, pcout, photon_handler, setup_background_dofs(), and triangulation.

◆ print_insertion_info()

template<int dim>
void RayTracingSolver< dim >::print_insertion_info ( const unsigned int & inserted_photon,
const ConditionalOStream & pcout )
staticprivate

Print information about the photons that have been inserted during an insertion time step.

Parameters
[in]inserted_photonNumber of inserted photon at the start of the simulation.
[in]pcoutPrinting in parallel

Definition at line 197 of file ray_tracing.cc.

References announce_string(), and pcout.

◆ set_particle_insertion_type()

template<int dim>
std::shared_ptr< Insertion< dim, DEMProperties::PropertiesIndex > > RayTracingSolver< dim >::set_particle_insertion_type ( )
private

Set the insertion method. Supported insertion method are list and file.

Returns
The pointer to the particle insertion object.

Definition at line 94 of file ray_tracing.cc.

References dem_parameters, parameters, and triangulation.

◆ setup_background_dofs()

template<int dim>
void RayTracingSolver< dim >::setup_background_dofs ( )
private

Set up the background degree of freedom used for parallel grid output or mapping of periodic dofs when using periodic boundaries.

Definition at line 130 of file ray_tracing.cc.

References background_dh.

◆ setup_parameters()

template<int dim>
void RayTracingSolver< dim >::setup_parameters ( )
private

◆ solve()

◆ write_output_results()

template<int dim>
void RayTracingSolver< dim >::write_output_results ( const std::vector< Point< dim > > & points)
private

Generate the output file of the particle ray tracing in parallel.

Parameters
[in]pointsVector of points containing every intersection points between photons and particles.

Definition at line 404 of file ray_tracing.cc.

References computing_timer, create_output_folder(), mapping, mpi_communicator, parameters, this_mpi_process, and triangulation.

Member Data Documentation

◆ action_manager

template<int dim>
DEMActionManager* RayTracingSolver< dim >::action_manager
private

The action manager that manages the actions triggered by events.

Definition at line 190 of file ray_tracing.h.

◆ background_dh

template<int dim>
DoFHandler<dim> RayTracingSolver< dim >::background_dh
private

The background degree of freedom handler uses for parallel grid processing.

Definition at line 201 of file ray_tracing.h.

◆ cells_ghost_neighbor_list

template<int dim>
ghost_neighbor_list RayTracingSolver< dim >::cells_ghost_neighbor_list
private

Ghost neighbor list.

Definition at line 243 of file ray_tracing.h.

◆ cells_local_neighbor_list

template<int dim>
local_neighbor_list RayTracingSolver< dim >::cells_local_neighbor_list
private

Local neighbor list.

Definition at line 240 of file ray_tracing.h.

◆ computing_timer

template<int dim>
TimerOutput RayTracingSolver< dim >::computing_timer
private

The timer that keeps track of the time spent in some functions. Currently, the only function for which timing is monitored is load balancing.

Definition at line 185 of file ray_tracing.h.

◆ dem_parameters

template<int dim>
const DEMSolverParameters<dim> RayTracingSolver< dim >::dem_parameters
private

DEM parameters needed for some functions related to the DEM particles.

Definition at line 158 of file ray_tracing.h.

◆ displacement_distance

template<int dim>
double RayTracingSolver< dim >::displacement_distance
private

The reference displacement distance used to move the photons during each pseudo time step.

Definition at line 218 of file ray_tracing.h.

◆ load_balancing

template<int dim>
LagrangianLoadBalancing<dim, DEMProperties::PropertiesIndex> RayTracingSolver< dim >::load_balancing
private

The load balancing handler.

Definition at line 195 of file ray_tracing.h.

◆ mapping

template<int dim>
MappingQGeneric<dim> RayTracingSolver< dim >::mapping
private

The polynomial mapping. The mapping is first order in DEM simulations.

Definition at line 168 of file ray_tracing.h.

◆ mpi_communicator

template<int dim>
MPI_Comm RayTracingSolver< dim >::mpi_communicator
private

The MPI communicator used for the parallel simulation.

Definition at line 132 of file ray_tracing.h.

◆ n_mpi_processes

template<int dim>
const unsigned int RayTracingSolver< dim >::n_mpi_processes
private

The number of MPI processes used for the parallel simulation.

Definition at line 137 of file ray_tracing.h.

◆ parameters

template<int dim>
const RayTracingSolverParameters<dim> RayTracingSolver< dim >::parameters
private

The parameters of the Ray Tracing simulation.

Definition at line 153 of file ray_tracing.h.

◆ particle_handler

template<int dim>
Particles::ParticleHandler<dim, dim> RayTracingSolver< dim >::particle_handler
private

The particle handler that manages the particles.

Definition at line 173 of file ray_tracing.h.

◆ particle_insertion_object

template<int dim>
std::shared_ptr<Insertion<dim, DEMProperties::PropertiesIndex> > RayTracingSolver< dim >::particle_insertion_object
private

The particle insertion object.

Definition at line 212 of file ray_tracing.h.

◆ pcout

template<int dim>
ConditionalOStream RayTracingSolver< dim >::pcout
private

The output stream used for the parallel simulation, only used by the process 0.

Definition at line 148 of file ray_tracing.h.

◆ photon_handler

template<int dim>
Particles::ParticleHandler<dim, dim> RayTracingSolver< dim >::photon_handler
private

The photon handler that manages the photons.

Definition at line 178 of file ray_tracing.h.

◆ simulation_control

template<int dim>
std::shared_ptr<SimulationControl> RayTracingSolver< dim >::simulation_control
private

The simulation control (DEM Transient).

Definition at line 206 of file ray_tracing.h.

◆ this_mpi_process

template<int dim>
const unsigned int RayTracingSolver< dim >::this_mpi_process
private

The rank of the current MPI process.

Definition at line 142 of file ray_tracing.h.

◆ triangulation

template<int dim>
parallel::distributed::Triangulation<dim> RayTracingSolver< dim >::triangulation
private

The distributed triangulation used for the DEM simulation.

Definition at line 162 of file ray_tracing.h.


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