R-Shape / Polyhedra¶
This page describes the concepts used to build simulations with R-shape (sphero-polyhedron) particles.
Overview¶
The polyhedra of exaDEM are sphero-polyhedra: vertices are treated as spheres and edges as cylinders. exaDEM
reuses many features of the Rockable DEM code developed at CNRS
(quick start), in particular a Shape class, which stores the
geometry of a polyhedron (vertices, edges, faces and Minkowski radius), and an interaction class describing the
contacts between polyhedra. The sphero-polyhedron approach can also represent complex non-convex particles such as
hexapods.
Shape¶
The Shape class stores the vertices, edges and faces of a polyhedron, plus data used to speed up the
computations, such as an OBB (Oriented Bounding Box) per element. exaDEM provides operators around this class,
for example to read .shp files (the Rockable format) or to export a shape to .vtk for visualization.
| Property | Attribute | Description |
|---|---|---|
| Vertices | m_vertices |
list of the vertices |
| Edges | m_edges |
list of the edges |
| Faces | m_faces |
list of the faces |
| Minkowski radius | m_radius |
radius of the vertices |
| Volume | m_volume |
volume of the polyhedron |
| Inertia coefficient | m_inertia_on_mass |
inertia divided by the mass |
| Name | m_name |
name of the shape (default "undefined") |
| OBB | obb |
oriented bounding box of the polyhedron |
| Vertex OBBs | m_obb_vertices |
one OBB per vertex (only for big shapes) |
| Edge OBBs | m_obb_edges |
one OBB per edge |
| Face OBBs | m_obb_faces |
one OBB per face |
Note
Each OBB is enlarged by the Minkowski radius of the shape.
Large shapes
All the shapes are stored in a shared list, and the cutoff radius of the simulation is deduced from the largest
shape. A too large cutoff radius drastically reduces performance: do not add very large shapes with
read_shape_file, define them as drivers instead.
<
name Octahedron
radius 0.1
preCompDone y
nv 6
0.2310789034541148 -0.2310789034541148 0.0
0.2310789034541148 0.2310789034541148 0.0
0.0 0.0 0.32679491924311227
-0.2310789034541148 -0.2310789034541148 0.0
-0.2310789034541148 0.2310789034541148 0.0
0.0 0.0 -0.32679491924311227
ne 12
0 1
2 1
2 0
0 3
2 3
3 4
4 2
4 1
5 0
5 1
5 4
5 3
nf 8
3 0 1 2
3 2 3 4
3 1 2 4
3 0 2 3
3 0 5 1
3 0 5 3
3 3 5 4
3 4 5 1
obb.extent 0.33107890345411484 0.33107890345411484 0.4267949192431123
obb.e1 1.0 0.0 0.0
obb.e2 0.0 1.0 0.0
obb.e3 0.0 0.0 1.0
obb.center 0.0 0.0 0.0
position 0.0 0.0 0.0
orientation 1.0 0.0 0.0 0.0
volume 0.16666666666666666
I/m 0.04999999999999999 0.04999999999999999 0.04999999999999999
>
<
name alpha1
radius 0.5
preCompDone y
nv 1
0 0 0
ne 0
nf 0
obb.extent 0.5 0.5 0.5
obb.e1 1 0 0
obb.e2 0 1 0
obb.e3 0 0 1
obb.center 0 0 0
volume 0.523598775598299
I/m 0.1 0.1 0.1
>
Using a spherical shape in a polyhedron simulation instead of a sphere simulation is about 2 to 3 times slower in our benchmarks, due to unnecessary computations such as applying an orientation to a single vertex.
read_shape_file¶
Reads the shapes of a .shp file and adds them to the shape list.
| Parameter | Description |
|---|---|
filename |
input file (.shp) |
scale_factor |
rescales the shapes (optional) |
rename |
renames the shapes (optional) |
See Shapes for all its parameters and the rescale shape example.
Basic shapes¶
exaDEM provides basic shapes that do not need a shape file.
| Operator | Parameters | Description |
|---|---|---|
add_sphere |
name (default sphere), minkowski |
adds a sphere to the shape list |
add_cube |
length, name (default cube), minkowski |
adds a cube to the shape list |
add_rice |
length, name (default rice), minkowski |
adds a rice-shaped particle to the shape list |
Interactions¶
The exaDEM::Interaction class models a contact between two polyhedra, or between a polyhedron and a driver. It
identifies the two elements involved and the kind of contact between them.
Note
This section describes how interactions are identified and stored. The contact laws (hooke, hertz,
cohesive, dmt) and their parameters are described in Force Field.
Attributes
- \(id_i\) and \(id_j\): ids of both polyhedra;
- \(cell_i\) and \(cell_j\): indices of the cells containing the polyhedra;
- \(p_i\) and \(p_j\): positions of the polyhedra in their cells;
- \(sub_i\) and \(sub_j\): index of the vertex, edge or face of each polyhedron involved in the interaction;
type: type of interaction (see the glossary below);frictionandmoment: storage used by the contact law.
Note
When the interaction is between a polyhedron and a driver, particle \(j\) locates the driver: \(cell_j\) is the index
of the driver and, for drivers with a shape (RShapeDriver), \(sub_j\) stores the index of the vertex, edge or face.
| Value | Type | Description |
|---|---|---|
| 0 | Vertex - Vertex | two vertices of two polyhedra |
| 1 | Vertex - Edge | a vertex and an edge of two polyhedra |
| 2 | Vertex - Face | a vertex and a face of two polyhedra |
| 3 | Edge - Edge | two edges of two polyhedra |
| 4 | Vertex - Cylinder | a vertex of a polyhedron and a cylinder |
| 5 | Vertex - Surface | a vertex of a polyhedron and a rigid surface or wall |
| 6 | Vertex - Ball | a vertex of a polyhedron and a ball |
| 7 | Vertex - Vertex (driver) | a vertex of a polyhedron and a vertex of an RShape driver |
| 8 | Vertex - Edge (driver) | a vertex of a polyhedron and an edge of an RShape driver |
| 9 | Vertex - Face (driver) | a vertex of a polyhedron and a face of an RShape driver |
| 10 | Edge - Edge (driver) | an edge of a polyhedron and an edge of an RShape driver |
| 11 | Vertex (driver) - Edge | a vertex of an RShape driver and an edge of a polyhedron |
| 12 | Vertex (driver) - Face | a vertex of an RShape driver and a face of a polyhedron |
| 13 | Inner bond | bond inside a grain made of fragments, see Fragmentation |
The interactions are the unit of intra-node parallelization, on CPU and GPU. They are built by nbh_polyhedron
and processed by contact_polyhedron.
Grid of interactions. Interactions are stored in a grid of cells (an Array of Structures of Arrays): each cell
holds a GridExtraDynamicDataStorageT, essentially a vector of Interactions paired with a vector of particle
information. This layout makes it easy to migrate the interactions between MPI processes for the interactions that
stay active from one time step to the next. See src/interaction/include/exaDEM/interaction/grid_cell_interaction.hpp
and the extra_storage package of exaNBody.
Classifier. To make the GPU kernels more efficient, exaDEM also sorts the interactions by type into a
Structure of Arrays, the Classifier, so that each kernel launch handles a single interaction type, which reduces the
divergence between GPU threads. Interactions are moved into it (classify_interactions) and back to the grid
(unclassify_interactions) only when the data actually changes (migration between cells, I/O); otherwise they stay
classified from one time step to the next. Using the classifier is the default strategy for spheres and polyhedra.
See Views, Interactions & Classifier.
Vertex data layout¶
Polyhedron vertices are stored in a separate grid structure, CellVertexField (a grid of VertexFields),
reallocated by the compute_vertices operator:
compute_vertices¶
Computes the vertices of every polyhedron.
| Parameter | Default | Description |
|---|---|---|
resize_vertex |
true |
resizes the vertex storage to the current data |
minimize_memory_footprint |
false |
sizes the storage of each cell to the largest number of vertices of its shapes, useful when a few particles have many more vertices than the others |