4#ifndef lethe_collision_log_data_h
5#define lethe_collision_log_data_h
11#include <deal.II/base/tensor.h>
12#include <deal.II/base/types.h>
68 const types::boundary_id boundary_id,
72 start_log = it->second;
84 const types::boundary_id boundary_id)
const
120 const std::list<collision_event<dim>> &
141 if constexpr (dim == 3)
142 return particle->get_location();
144 if constexpr (dim == 2)
158 Tensor<1, 3> vector_c;
159 vector_c = ((vector_a * vector_b) / (vector_b.norm_square())) * vector_b;
174template <
int dim,
typename PropertiesIndex>
179 &particle_wall_pairs_in_contact,
180 const double current_time,
194 const MPI_Comm &mpi_communicator);
Class that stores all the completed collision events.
void add_event(const collision_event< dim > &event)
Add a completed event to the log.
std::list< collision_event< dim > > events
const std::list< collision_event< dim > > & get_events() const
Retrieve the list of all completed collision events.
Handles all the parameters declared in the parameter handler file.
Class managing the ongoing collisions.
bool is_in_collision(const unsigned int particle_id, const types::boundary_id boundary_id) const
Check whether the particle is currently in a collision.
std::map< std::pair< unsigned int, types::boundary_id >, collision_log< dim > > ongoing_collisions
void end_collision(const unsigned int particle_id, const types::boundary_id boundary_id, collision_log< dim > &start_log)
End a collision for a particle. Retrieve the start log and remove the particle from the ongoing colli...
void start_collision(const collision_log< dim > &log)
Start logging a collision for a particle. If the particle is already present in the log,...
void log_collision_data(const DEMSolverParameters< dim > ¶meters, typename DEM::dem_data_structures< dim >::particle_wall_in_contact &particle_wall_pairs_in_contact, const double current_time, OngoingCollisionLog< dim > &ongoing_collision_log, CompletedCollisionLog< dim > &collision_event_log)
Logs the particle-wall contact statistics.
void write_collision_stats(const DEMSolverParameters< dim > ¶meters, const CompletedCollisionLog< dim > &collision_event_log, const MPI_Comm &mpi_communicator)
Writes the collision statistics to a file.
Tensor< 1, 3 > find_projection(const Tensor< 1, 3 > &vector_a, const Tensor< 1, 3 > &vector_b)
This function is used to find the projection of vector_a on vector_b.
Point< 3 > get_location(const Particles::ParticleIterator< dim > &particle)
Get the 3d location of the particle.
ankerl::unordered_dense::map< types::particle_index, ankerl::unordered_dense::map< global_face_id, particle_wall_contact_info< dim > > > particle_wall_in_contact
Struct storing a full collision event (start and end).
collision_log< dim > start_log
collision_log< dim > end_log
Struct to store information about a particle-wall collision moment.
types::boundary_id boundary_id
Tensor< 1, dim > velocity
Point< 3 > point_nd_to_3d(const Point< dim > &point)