![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <ray_tracing.h>
Classes | |
| struct | neighbor_list_types |
Public Member Functions | |
| RayTracingSolver (RayTracingSolverParameters< dim > ¶meters, 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 |
Solver that uses ray tracing to find intersection points between photons and particles.
| dim | An integer that denotes the number of spatial dimensions. |
Definition at line 24 of file ray_tracing.h.
|
private |
Definition at line 237 of file ray_tracing.h.
|
private |
Definition at line 236 of file ray_tracing.h.
| RayTracingSolver< dim >::RayTracingSolver | ( | RayTracingSolverParameters< dim > & | parameters, |
| DEMSolverParameters< dim > & | dem_parameters ) |
Definition at line 18 of file ray_tracing.cc.
References background_dh, computing_timer, dem_parameters, displacement_distance, mapping, mpi_communicator, n_mpi_processes, parameters, particle_handler, pcout, photon_handler, this_mpi_process, and triangulation.
|
private |
Execute the ray tracing algorithm to find intersection points between photons and particles.
| NeighborListType | Type of the data structure containing the neighboring cells. |
| [in] | cell_list | Data structure containing the local or ghost neighboring cell to each local cell in the triangulation. |
| [in,out] | photon_intersection_points_map | A 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.
|
private |
Execute the last post-processing at the end of the simulation and output test results if necessary.
| [in] | intersection_points | Vector 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.
|
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.
|
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.
|
staticprivate |
Print information about the photons that have been inserted during an insertion time step.
| [in] | inserted_photon | Number of inserted photon at the start of the simulation. |
| [in] | pcout | Printing in parallel |
Definition at line 197 of file ray_tracing.cc.
References announce_string(), and pcout.
|
private |
Set the insertion method. Supported insertion method are list and file.
Definition at line 94 of file ray_tracing.cc.
References dem_parameters, parameters, and triangulation.
|
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.
|
private |
Set the parameters for the ray tracing.
Definition at line 54 of file ray_tracing.cc.
References action_manager, announce_string(), DEMActionManager::get_action_manager(), load_balancing, n_mpi_processes, parameters, pcout, photon_handler, simulation_control, and triangulation.
| void RayTracingSolver< dim >::solve | ( | ) |
Calls all the necessary functions to set parameters, solve the intersection points between the photons and the particles, and finish the simulation.
Definition at line 664 of file ray_tracing.cc.
References action_manager, cells_ghost_neighbor_list, cells_local_neighbor_list, dem_parameters, displacement_distance, find_cell_neighbors(), find_intersection(), finish_simulation(), insert_particles_and_photons(), load_balance(), parameters, particle_handler, particle_insertion_object, pcout, photon_handler, read_mesh_and_manifolds(), set_particle_insertion_type(), setup_parameters(), simulation_control, triangulation, and write_output_results().
|
private |
Generate the output file of the particle ray tracing in parallel.
| [in] | points | Vector 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.
|
private |
The action manager that manages the actions triggered by events.
Definition at line 190 of file ray_tracing.h.
|
private |
The background degree of freedom handler uses for parallel grid processing.
Definition at line 201 of file ray_tracing.h.
|
private |
Ghost neighbor list.
Definition at line 243 of file ray_tracing.h.
|
private |
Local neighbor list.
Definition at line 240 of file ray_tracing.h.
|
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.
|
private |
DEM parameters needed for some functions related to the DEM particles.
Definition at line 158 of file ray_tracing.h.
|
private |
The reference displacement distance used to move the photons during each pseudo time step.
Definition at line 218 of file ray_tracing.h.
|
private |
The load balancing handler.
Definition at line 195 of file ray_tracing.h.
|
private |
The polynomial mapping. The mapping is first order in DEM simulations.
Definition at line 168 of file ray_tracing.h.
|
private |
The MPI communicator used for the parallel simulation.
Definition at line 132 of file ray_tracing.h.
|
private |
The number of MPI processes used for the parallel simulation.
Definition at line 137 of file ray_tracing.h.
|
private |
The parameters of the Ray Tracing simulation.
Definition at line 153 of file ray_tracing.h.
|
private |
The particle handler that manages the particles.
Definition at line 173 of file ray_tracing.h.
|
private |
The particle insertion object.
Definition at line 212 of file ray_tracing.h.
|
private |
The output stream used for the parallel simulation, only used by the process 0.
Definition at line 148 of file ray_tracing.h.
|
private |
The photon handler that manages the photons.
Definition at line 178 of file ray_tracing.h.
|
private |
The simulation control (DEM Transient).
Definition at line 206 of file ray_tracing.h.
|
private |
The rank of the current MPI process.
Definition at line 142 of file ray_tracing.h.
|
private |
The distributed triangulation used for the DEM simulation.
Definition at line 162 of file ray_tracing.h.