9template <
int dim,
typename PropertiesIndex>
12 Particles::ParticleHandler<dim> &particle_handler,
14 const double smallest_contact_search_criterion,
15 MPI_Comm &mpi_communicator,
16 std::vector<double> &displacement,
17 const bool parallel_update)
23 if (action_manager->check_contact_search())
26 double max_displacement = 0.;
27 bool contact_detection_step =
false;
30 for (
auto &particle : particle_handler)
32 auto particle_properties = particle.get_properties();
33 auto &particle_displacement = displacement[particle.get_local_index()];
36 particle_displacement +=
37 dt * sqrt(particle_properties[PropertiesIndex::v_x] *
38 particle_properties[PropertiesIndex::v_x] +
39 particle_properties[PropertiesIndex::v_y] *
40 particle_properties[PropertiesIndex::v_y] +
41 particle_properties[PropertiesIndex::v_z] *
42 particle_properties[PropertiesIndex::v_z]);
45 max_displacement = std::max(max_displacement, particle_displacement);
50 contact_detection_step = max_displacement > smallest_contact_search_criterion;
55 contact_detection_step =
56 Utilities::MPI::logical_or(contact_detection_step, mpi_communicator);
57 if (contact_detection_step)
58 action_manager->contact_detection_step();
64 Particles::ParticleHandler<2> &particle_handler,
66 const double smallest_contact_search_criterion,
67 MPI_Comm &mpi_communicator,
68 std::vector<double> &displacement,
69 const bool parallel_update);
73 Particles::ParticleHandler<3> &particle_handler,
75 const double smallest_contact_search_criterion,
76 MPI_Comm &mpi_communicator,
77 std::vector<double> &displacement,
78 const bool parallel_update);
82 Particles::ParticleHandler<2> &particle_handler,
84 const double smallest_contact_search_criterion,
85 MPI_Comm &mpi_communicator,
86 std::vector<double> &displacement,
87 const bool parallel_update);
91 Particles::ParticleHandler<3> &particle_handler,
93 const double smallest_contact_search_criterion,
94 MPI_Comm &mpi_communicator,
95 std::vector<double> &displacement,
96 const bool parallel_update);
100 Particles::ParticleHandler<2> &particle_handler,
102 const double smallest_contact_search_criterion,
103 MPI_Comm &mpi_communicator,
104 std::vector<double> &displacement,
105 const bool parallel_update);
110 Particles::ParticleHandler<2> &particle_handler,
112 const double smallest_contact_search_criterion,
113 MPI_Comm &mpi_communicator,
114 std::vector<double> &displacement,
115 const bool parallel_update);
119 Particles::ParticleHandler<3> &particle_handler,
121 const double smallest_contact_search_criterion,
122 MPI_Comm &mpi_communicator,
123 std::vector<double> &displacement,
124 const bool parallel_update);
129 Particles::ParticleHandler<3> &particle_handler,
131 const double smallest_contact_search_criterion,
132 MPI_Comm &mpi_communicator,
133 std::vector<double> &displacement,
134 const bool parallel_update);
140 const double smallest_contact_search_criterion,
147 if (!action_manager->check_solid_objects_enabled())
150 bool floating_mesh_requires_map =
false;
152 for (
unsigned int i_solid = 0; i_solid < solids.size(); ++i_solid)
154 double displacement =
155 solids[i_solid]->get_max_displacement_since_mapped();
156 floating_mesh_requires_map =
157 floating_mesh_requires_map ||
158 displacement > smallest_contact_search_criterion;
161 if (floating_mesh_requires_map)
162 action_manager->solid_objects_search_step();
167 const double smallest_contact_search_criterion,
172 const double smallest_contact_search_criterion,
static DEMActionManager * get_action_manager()
Getter of the unique instance of the DEMActionManager.
PropertiesIndex
Particle property indices for CFD-DEM multiphysics simulations.