Skip to content

Building blocks

Operators

An operator is a small C++ component that does one thing: create particles on a lattice, set their radius, compute the contact forces, move a driver, write a file... Each operator has typed slots: its inputs and outputs.

$ exaDEM --help set_radius
Operator    : set_radius

Description :
        This operator sets the radius value for every particles.

        YAML example:

          - set_radius:
             rad: 0.5

Slots       :
  grid
    flow IN/OUT
    type Grid<soatl::FieldIds<vx,vy,vz,ax,ay,az,mass,homothety,radius,orient,mom,vrot,arot,inertia,id,type,group,stress>>
  rad
    flow IN
    type double
    desc default radius value for all particles
  region
    flow IN
    type ParticleRegionCSG
  ...

Slots are connected by name: when domain outputs the domain slot and lattice fills the grid slot, every later operator with a domain or grid input reads these values. You never wire operators by hand.

Batches

A YAML list of operators is a batch: the operators run in order. A batch can be given a name and used as an operator itself:

init_fields:              # a batch named init_fields ...
  - set_radius:
     rad: 0.5
  - set_density:
     density: 0.02

input_data:               # the hook input_data ...
  - init_rcb_grid
  - lattice:
     structure: SC
     types: [ 0 ]
     size: [ 1.0, 1.0, 1.0 ]
  - init_fields           # ... calls the batch init_fields

Batches can also loop (loop: true with a condition slot) or run conditionally (condition: with a boolean slot). The DEM time loop compute_loop is such a batch.

Setting slot values

A slot value is given in YAML under the operator name:

1
2
3
4
- register_cylinder:
   id: 0
   state: {center: [10, 10, 10], axis: [1, 0, 1], radius: 10}
   params: { motion_type: STATIONARY }

Values not given keep the default of the operator (see exaDEM --help <operator>). Required slots must be set, or be produced by an earlier operator.

Regions

Many operators take an optional region slot to act only on the particles of a spatial area. Regions are declared once in particle_regions (boxes, quadrics, ...) and combined with and, or, not:

particle_regions:
  - CYL1:
      quadric:
        shape: cyly
        transform:
          - scale: [ 9.5, 1, 9.5 ]
          - translate: [ 10, 0, 10 ]
  - BOX:
      bounds: [ [0, 0, 18], [20, 7.5, 20] ]

input_data:
  - lattice:
     structure: SC
     types: [ 0 ]
     size: [ 1.0, 1.0, 1.0 ]
     region: CYL1 and BOX