Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
data_containers.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2022-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_data_containers_h
5#define lethe_data_containers_h
6
7#include <core/utilities.h>
8
10#include <dem/contact_info.h>
11
12#include <deal.II/base/tensor.h>
13
14#include <deal.II/distributed/tria.h>
15
16#include <deal.II/particles/particle_iterator.h>
17
18#include <unordered_map>
19#include <vector>
20
21#pragma GCC diagnostic push
22#pragma GCC diagnostic ignored "-Wmissing-braces"
24#pragma GCC diagnostic pop
25
26/**
27 * @brief This namespace defines all the data containers and required operations on
28 * these containers for the DEM solver. At the moment, only overloaded operators
29 * are here, but eventually all the data containers of the DEM solver will be
30 * moved here
31 */
32namespace DEM
33{
34 /**
35 * @brief Defined global face id as a type to ensure that we know what the
36 * structures use as index. This is more verbose than unsigned int
37 */
38 using global_face_id = unsigned int;
39
40 using namespace dealii;
41
42
43
44 /**
45 * @brief DEM data structure containers
46 * To improve readability of containers, there's a simple description above
47 * all declarations which follow these representation :
48 * <> : map or unordered map or unordered multimap
49 * () : tuple or pair
50 * [] : vector
51 */
52 template <int dim>
54 {
55 // <particle id, particle iterator>
57 ankerl::unordered_dense::map<types::particle_index,
58 Particles::ParticleIterator<dim>>;
59
60 // <particle id, line info>
62 std::unordered_map<types::particle_index,
64
65 // <particle id, point info>
67 std::unordered_map<types::particle_index,
69
70 // <particle id, line info>
72 std::unordered_map<types::particle_index,
74
75 // <particle id, (particle iterator, point)>
77 std::unordered_map<types::particle_index,
79
80 // <particle id, <global face id, particle iterator>>
81 using particle_floating_wall_candidates = ankerl::unordered_dense::map<
82 types::particle_index,
83 std::unordered_map<global_face_id, Particles::ParticleIterator<dim>>>;
84
85 // <particle id, <global_face_id, (particle iterator, tensor, point,
86 // boundary id, cell id)>>
87 using particle_wall_candidates = ankerl::unordered_dense::map<
88 types::particle_index,
89 ankerl::unordered_dense::map<global_face_id,
90 std::tuple<Particles::ParticleIterator<dim>,
91 Tensor<1, dim>,
92 Point<dim>,
94
95 // <particle id, <global_face_id, particle-wall info>>
96 using particle_wall_in_contact = ankerl::unordered_dense::map<
97 types::particle_index,
98 ankerl::unordered_dense::map<global_face_id,
100
101 // <particle id, particle-particle info>
103 ankerl::unordered_dense::map<types::particle_index,
105
106 // <particle id, periodic particle-particle info>
107 using periodic_particle_contact_info = ankerl::unordered_dense::
108 map<types::particle_index, periodic_particle_particle_contact_info<dim>>;
109
110 // Value stored per "particle one" in the adjacency containers below. The
111 // iterator to particle one is shared by all its contacts, so it is stored
112 // once here instead of being duplicated in every particle-particle contact
113 // info. second_particles maps uses each particle two id (key)
114 // to access the contact info (value) between particle one and two.
115 // (particle one iterator, <particle id, particle-particle info>)
117 {
118 Particles::ParticleIterator<dim> particle_one;
120 };
121
122 // Periodic counterpart of adjacent_particle_pairs_value.
123 // (particle one iterator, <particle id, periodic particle-particle info>)
129
130 // <particle id, (particle one iterator, <particle id, particle-particle
131 // info>)>
133 ankerl::unordered_dense::map<types::particle_index,
135
136 // <particle id, (particle one iterator, <particle id, periodic
137 // particle-particle info>)>
139 ankerl::unordered_dense::map<types::particle_index,
141
142 // <cell iterator, <particle id, particle iterator>>
144 std::map<typename Triangulation<dim - 1, dim>::active_cell_iterator,
145 ankerl::unordered_dense::map<types::particle_index,
146 Particles::ParticleIterator<dim>>,
148
149 // <cell iterator, <particle id, particle-wall info>>
151 std::map<typename Triangulation<dim - 1, dim>::active_cell_iterator,
152 ankerl::unordered_dense::map<types::particle_index,
155
156 // [<cell iterator, <particle id, particle iterator>>]
158 std::vector<particle_floating_wall_from_mesh_candidates>;
159
160 // [cell iterator]
162 std::vector<typename Triangulation<dim - 1, dim>::active_cell_iterator>;
163
164 // <cell iterator, [cell iterator]>
166 std::map<typename Triangulation<dim - 1, dim>::active_cell_iterator,
169
170 // [<cell iterator, <particle id, particle-wall info>>]
172 std::vector<particle_triangle_cell_from_mesh_potentially_in_contact>;
173
174 // <particle id, [particle id]>
176 ankerl::unordered_dense::map<types::particle_index,
177 std::vector<types::particle_index>>;
178
179 // [[cell iterator]]
180 using cells_neighbor_list = std::vector<
181 std::vector<typename Triangulation<dim>::active_cell_iterator>>;
182
183 // [[(background cell iterator, solid surface cell iterator)]]
184 using solid_surfaces_mesh_information = std::vector<std::vector<
185 std::pair<typename Triangulation<dim>::active_cell_iterator,
186 typename Triangulation<dim - 1, dim>::active_cell_iterator>>>;
187
188 // [[(background cell iterator, solid volume cell iterator)]]
189 using solid_volumes_mesh_info = std::vector<std::vector<
190 std::pair<typename Triangulation<dim>::active_cell_iterator,
191 typename Triangulation<dim, dim>::active_cell_iterator>>>;
192
193 // <cell id, [cell iterator]>
194 using cells_total_neighbor_list = ankerl::unordered_dense::map<
195 types::global_cell_index,
196 std::vector<typename Triangulation<dim>::active_cell_iterator>>;
197
198 // <global_face_id, (tensor, point)>
200 ankerl::unordered_dense::map<global_face_id,
201 std::pair<Tensor<1, 3>, Point<3>>>;
202
203 // <unsigned int, <global_face_id, tensor>>
205 ankerl::unordered_dense::map<unsigned int,
206 std::map<types::boundary_id, Tensor<1, 3>>>;
207
208 // [cell iterators]
210 std::vector<typename Triangulation<dim>::active_cell_iterator>;
211
212 // [cell iterators]
213 using cell_set =
214 std::set<typename Triangulation<dim>::active_cell_iterator>;
215
216 // <cell id, periodic cells info>
218 std::unordered_multimap<types::global_cell_index,
220
221 // <cell id, integer value>
223 ankerl::unordered_dense::map<types::global_cell_index, unsigned int>;
224 };
225
226} // namespace DEM
227#endif
This namespace defines all the data containers and required operations on these containers for the DE...
unsigned int global_face_id
Defined global face id as a type to ensure that we know what the structures use as index....
DEM data structure containers To improve readability of containers, there's a simple description abov...
std::map< typename Triangulation< dim - 1, dim >::active_cell_iterator, ankerl::unordered_dense::map< types::particle_index, Particles::ParticleIterator< dim > >, cut_cell_comparison< dim > > particle_floating_wall_from_mesh_candidates
ankerl::unordered_dense::map< types::particle_index, ankerl::unordered_dense::map< global_face_id, particle_wall_contact_info< dim > > > particle_wall_in_contact
ankerl::unordered_dense::map< types::global_cell_index, unsigned int > cell_index_int_map
ankerl::unordered_dense::map< types::particle_index, std::unordered_map< global_face_id, Particles::ParticleIterator< dim > > > particle_floating_wall_candidates
ankerl::unordered_dense::map< types::particle_index, Particles::ParticleIterator< dim > > particle_index_iterator_map
std::vector< std::vector< std::pair< typename Triangulation< dim >::active_cell_iterator, typename Triangulation< dim - 1, dim >::active_cell_iterator > > > solid_surfaces_mesh_information
ankerl::unordered_dense::map< types::particle_index, particle_particle_contact_info< dim > > particle_contact_info
ankerl::unordered_dense::map< unsigned int, std::map< types::boundary_id, Tensor< 1, 3 > > > vector_on_boundary
ankerl::unordered_dense::map< types::particle_index, periodic_adjacent_particle_pairs_value > periodic_adjacent_particle_pairs
std::map< typename Triangulation< dim - 1, dim >::active_cell_iterator, ankerl::unordered_dense::map< types::particle_index, particle_wall_contact_info< dim > >, cut_cell_comparison< dim > > particle_triangle_cell_from_mesh_potentially_in_contact
std::vector< std::vector< typename Triangulation< dim >::active_cell_iterator > > cells_neighbor_list
ankerl::unordered_dense:: map< types::particle_index, periodic_particle_particle_contact_info< dim > > periodic_particle_contact_info
ankerl::unordered_dense::map< global_face_id, std::pair< Tensor< 1, 3 >, Point< 3 > > > boundary_points_and_normal_vectors
std::vector< particle_triangle_cell_from_mesh_potentially_in_contact > particle_floating_mesh_potentially_in_contact
std::unordered_multimap< types::global_cell_index, periodic_boundaries_cells_info_struct< dim > > periodic_boundaries_cells_info
std::unordered_map< types::particle_index, particle_line_contact_info< dim > > particle_line_candidates
ankerl::unordered_dense::map< types::global_cell_index, std::vector< typename Triangulation< dim >::active_cell_iterator > > cells_total_neighbor_list
std::unordered_map< types::particle_index, particle_line_contact_info< dim > > particle_line_in_contact
std::vector< std::vector< std::pair< typename Triangulation< dim >::active_cell_iterator, typename Triangulation< dim, dim >::active_cell_iterator > > > solid_volumes_mesh_info
ankerl::unordered_dense::map< types::particle_index, std::vector< types::particle_index > > particle_particle_candidates
std::set< typename Triangulation< dim >::active_cell_iterator > cell_set
std::vector< particle_floating_wall_from_mesh_candidates > particle_floating_mesh_candidates
std::map< typename Triangulation< dim - 1, dim >::active_cell_iterator, triangulation_cell_vector, cut_cell_comparison< dim > > triangulation_cell_map
ankerl::unordered_dense::map< types::particle_index, ankerl::unordered_dense::map< global_face_id, std::tuple< Particles::ParticleIterator< dim >, Tensor< 1, dim >, Point< dim >, global_face_id > > > particle_wall_candidates
std::unordered_map< types::particle_index, particle_point_contact_info< dim > > particle_point_candidates
ankerl::unordered_dense::map< types::particle_index, adjacent_particle_pairs_value > adjacent_particle_pairs
std::vector< typename Triangulation< dim >::active_cell_iterator > cell_vector
std::unordered_map< types::particle_index, particle_point_contact_info< dim > > particle_point_in_contact
std::vector< typename Triangulation< dim - 1, dim >::active_cell_iterator > triangulation_cell_vector
Handle information related to the calculation of the particle-line contact forces.
Handle the information related to the calculation of the particle-particle contact force....
Handle information related to the calculation of the particle-point contact forces.
Handle the information related to the calculation of the particle-wall contact forces.
Handle the information related to the periodic boundary cells which will be used for particle-wall co...