Skip to content

Particle Fields

This page covers the field operators of exaDEM: the unified set_fields operator (spheres and polyhedra), the operators for all particle types, and the operators specific to polyhedra.

set_fields

Warning

set_fields accepts many combinations of parameters, and not all of them have been tested. If a combination gives unexpected results, please report it.

Parameter Type Description
polyhedra bool required: true for polyhedra, false for spheres
type vector<string> required: particle type names
density vector<double> densities, default 1
radius vector<double> radii, default 0.5 for spheres; do not set it for polyhedra
velocity vector<Vec3d> velocities, default [0,0,0]
sigma_velocity vector<double> standard deviation of a normal perturbation of the velocity, none by default
angular_velocity vector<Vec3d> angular velocities, default [0,0,0]
sigma_angular_velocity vector<double> standard deviation of a normal perturbation of the angular velocity, none by default
quaternion vector<Quaternion> orientations, default [w = 1, 0, 0, 0]
random_quaternion vector<bool> random orientations, default false
group vector<uint32_t> group of each type (same order as type), default 0

All the vectors follow the order of type. The random values are generated from the particle id: they do not depend on the number of MPI processes nor on the order of the types.

Note

For spheres, call the particle_type operator first to create the map of the type names used by set_fields.

group (since exaDEM 1.2.3)

The group field selects the set of contact parameters of the multi-material operators (multimat_contact_params, drivers_contact_params, inner_bond_params). Before 1.2.3, the particle type itself was used. With groups, several types can share the same contact parameters, decoupling the shape (type) from the contact law (group). See Multi-material. Groups can be (re)assigned later with set_group.

- particle_type:
   type: [ Sphere1, Sphere2 ]
- lattice:
   structure: BCC
   types: [ Sphere1, Sphere2 ]
   size: [ 1.0, 1.0, 1.0 ]
- set_fields:
   polyhedra: false
   type:           [ Sphere1, Sphere2 ]
   group:          [       0,       1 ]
   radius:         [     0.5,    0.25 ]
   density:        [    0.02,    0.01 ]
   velocity:       [ [0,0,0], [0,0,0] ]
   sigma_velocity: [    0.01,    0.01 ]
- read_shape_file:
   filename: alpha3.shp
- read_shape_file:
   filename: octahedron.shp
- lattice:
    structure: BCC
    types: [ alpha3, Octahedron ]
    size: [ 1.5, 1.5, 1.5 ]
    repeats: [ 30, 30, 30 ]
    enlarge_bounds: 0.0 m
- set_fields:
   polyhedra: true
   type:              [  alpha3, Octahedron ]
   group:             [       0,          1 ]
   velocity:          [ [0,0,0],    [0,0,0] ]
   sigma_velocity:    [     0.1,        0.1 ]
   random_quaternion: [    true,       true ]

The previous implementation is still available as set_fields_deprecated.

Operators for all particles

These operators modify fields, mainly at initialization.

Operator Parameters Description
set_densities_multiple_materials densities (vector<double>) one density per particle type; the mass is deduced from the density and the radius
set_density density (double) the same density for every particle
set_homothety homothety (double) the same homothety (scale factor) for every particle
set_type type (uint32_t) the same type for every particle
set_material_properties type, rad, density, quat radius, density and orientation in one call
set_quaternion quat, random (default false) the same orientation for every particle, or a random one
set_radius rad (double) the same radius for every particle
set_radius_multiple_materials radius (vector<double>) one radius per particle type
set_rand_vrot_arot var_vrot, var_arot (variances, default 0), mean_vrot, mean_arot (default [0,0,0]) angular velocity and acceleration drawn from a normal distribution
set_rand_velocity var (variance, default 0), mean (default [0,0,0]) velocity drawn from a normal distribution
update_inertia recomputes the inertia from the mass and the radius (\(0.4\,m\,r^2\))
set_group type, group; output n_groups assigns the group of each particle from its type (since 1.2.3)

Note

The region slot restricts set_homothety, set_type, set_quaternion, set_rand_velocity, set_material_properties, set_radius and update_inertia to a spatial area.

1
2
3
4
5
6
7
8
9
- set_radius:
   rad: 0.5
- set_quaternion
- set_rand_velocity:
   var: 0.1
   mean: [0.0, 0.0, 0.0]
- set_density:
   density: 0.02
- set_rand_vrot_arot

set_group

set_group (since exaDEM 1.2.3) assigns the group field of every particle according to its type, for example to redefine the groups after set_fields without redefining the other fields.

Parameter Type Description
type vector<string> required: particle type names
group vector<uint32_t> required: group of each type (same order as type)
n_groups uint32_t (output) number of groups (largest group index + 1), read by multimat_contact_params, drivers_contact_params and check_group_completeness
1
2
3
4
5
6
7
8
9
init_polyhedra:
  - set_group:
     type:  [ alpha3, Octahedron, Cube ]
     group: [      0,          1,    0 ]

init_spheres:
  - set_group:
     type:  [ Sphere1, Sphere2, Sphere3 ]
     group: [       0,       1,       0 ]

See Add your own field operator to write a new field operator.

Operators for polyhedra

These operators use the data of the shapes.

Operator Parameters Description
density_from_shape density mass from the volume of the shape and the density
inertia_from_shape inertia from the shape constant I/m and the mass
radius_from_shape cutoff radius of each particle from its shape

Note

radius_from_shape accepts the region slot.