Skip to content

Simulation Graph

exaDEM is based on the operator execution system of exaNBody: the default configuration (data/config/main-config.msp and the files it includes) defines a complete DEM simulation, and a deck only fills or overrides some of its blocks (see Configuration files).

exaDEM graph
Main operators of exaDEM 1.2.2. Violet: polyhedra variant only. Blue: numerical scheme.

Main blocks

Block Role Filled by the deck
global global parameters, see Global control partially
io_tree output directories (io_config) optional
drivers init_drivers, setup_drivers, backup_drivers setup_drivers
domain simulation box and grid yes
particle_regions spatial regions optional
input_data particle creation and initialization yes
first_iteration first force computation, dt_critical, first log and ParaView output no
compute_loop the time loop: start_iteration, numerical_scheme, end_iteration no
compute_force forces and moments, called by the numerical scheme yes
analyses analyses run every simulation_analyses_frequency steps optional
add_generated_particles particle generator run every simulation_generator_frequency steps optional
driver_motion_policy changes of driver motion types optional
simulation_epilog final state no

Particle variants

The particle configuration file must be included at the top of the deck:

config_spheres.msp
######### SPHERE mode ####################

######### Move Particles ###################

save_shapes: nop

chunk_neighbors_impl:
  - chunk_neighbors_contact
  - nbh_sphere
  - update_interaction_ghost
  - classify_interactions

check_cell_size: check_sphere_cell_size

migrate_particles:
  - migrate_cell_particles_interaction
  - rebuild_amr
  - backup_r

cost_model: dem_cost_model

move_particles_extra_data: move_particles_interaction

reorder_extra_data: nop

### IO
write_dump_particle_op: write_dump_particle_interaction
particle_write_paraview_generic: write_paraview_generic_fields
contact_network: dump_contact_network
config_polyhedra.msp
######### POLYHEDRA mode ####################

save_shapes: write_shape_file
do_update_persistent_interactions_if_required: nop # overight if config_fragmentation is included

evaluate_particle_displ:
  rebind: { threshold: max_displ , result: particle_displ }
  body: 
    - vertex_displ_over

chunk_neighbors_impl:
  - chunk_neighbors_contact
  - do_update_persistent_interactions_if_required
  - nbh_polyhedron
  - update_interaction_ghost
#  - check_owner_partner_ghosts
  - classify_interactions
#  - check_owner_partner_ghosts

check_cell_size: check_polyhedra_cell_size

migrate_particles:
  - migrate_cell_particles_interaction
  - rebuild_amr
  - backup_dem

cost_model: dem_cost_model

move_particles_extra_data: move_particles_interaction

compute_new_vertices: 
  - compute_vertices:
     resize_vertex: true
compute_fast_vertices: 
  - compute_vertices:
     resize_vertex: false

reorder_extra_data: nop

### IO
particle_write_paraview_generic:
  - write_paraview_polyhedra_pvtu
  - write_paraview_obb_particles

# read_dump_particle_interaction [input file]
write_dump_particle_op: write_dump_particle_interaction

contact_network: dump_contact_network

config_fragmentation.msp replaces config_polyhedra.msp for fragmentation, and config_barostat.msp is added after it for the barostat.

Default configuration

main-config.msp
print_logo_banner:
  profiling: false
  body:
    - message: |

        _______________  ___  _____  ________  ___________   _____   
        \_   _____/\   \/  / /  _  \ \______ \ \_   _____/  /     \  
         |    __)_  \     / /  /_\  \ |    |  \ |    __)_  /  \ /  \ 
         |        \ /     \/    |    \|    `   \|        \/    Y    \
        /_______  //___/\  \____|__  /_______  /_______  /\____|__  /
                \/       \_/       \/        \/        \/         \/ 


includes:
  - config_defaults.msp
  - config_debug.msp
  - config_move_particles.msp
  - config_numerical_schemes.msp
  - config_globals.msp
  - config_iteration_log.msp
  - config_start_iteration.msp
  - config_analyses.msp
  - config_driver_extractor.msp
  - config_iteration_dump.msp
  - config_paraview.msp
  - config_stress_tensor.msp
  - config_end_iteration.msp
  - config_input.msp
  - config_dt_critical.msp
  - config_cell_projection.msp
  - config_check_input_data.msp

# usually outputs ParticleSpecies type to a slot named species, in case the data reader doesn't provide species description
reduce_species_after_read: nop

############### compute loop stop condition #############
compute_loop_stop:
  profiling: false
  rebind: { end_at: simulation_end_iteration , result: compute_loop_continue }
  body:
    - sim_continue

# executing potential sub nodes initializes rcut_max
# won't actually compute anything since grid is empty at this time
init_rcut_max:
  profiling: false
  body:
    - dem_rcut_max
    - nbh_dist:        # compute neighborhood distance in grid space (nbh_dist),
        verbose: false # also computes maximum particle move tolerance in grid space (max_displ)
    - check_rcut

setup_drivers: nop
init_particle_regions: nop

first_iteration:
  - init_particle_regions
  - init_particles
  - reset_force_moment
  - compute_force
#  - force_to_accel
  - dt_critical
  - default_thermodynamic_state
  - default_print_thermodynamic_state: { lb_flag: false , move_flag: false , print_header: true }
  - dump_data_paraview
  - next_time_step

# does nothing, just placeholders
compute_loop_prolog: nop
compute_loop_epilog: nop
init_prolog: nop
init_epilog: nop

compute_force:
  - message: "calcul force"

hw_device_init:
  - mpi_comm_world
  - init_cuda

hw_device_finalize:
  - finalize_cuda

simulation_epilog:
  - default_thermodynamic_state
  - final_dump


compute_loop:
  loop: true
  #unroll: 4
  name: loop
  condition: compute_loop_continue
  body:
    - start_iteration
    - compute_loop_prolog
    - numerical_scheme
    - end_iteration
    - compute_loop_epilog
    - next_time_step
    - compute_loop_stop

# You can tune the output directories here:
io_tree:
  - io_config
# default
#  - io_config:
#     dir_name: "ExaDEMOutputDir"
#     log_name: "log.txt"
#     avg_stress_tensor_name: "AvgStressTensor.txt"
#     interaction_basename: "InteractionOutputDir-"      

# Add your drivers by overriding setup_drivers
setup_drivers: nop
drivers:
  - init_drivers
  - setup_drivers
  - backup_drivers
  - driver_vertices:
     force_host: true

update_ghost_config:
  verbose: true
  update_ghost_config:
    gpu_buffer_pack: true
    async_buffer_pack: true
    staging_buffer: false
    serialize_pack_send: true
    wait_all: false

######## simulation program description #################
simulation:
  name: sim
  body:
    - print_logo_banner
    - hw_device_init   # provides MPI_COMM_WORLD as a default communicator
    - global
    - update_ghost_config
    - io_tree
    - drivers
    - domain
    - init_prolog
    - grid_flavor
    - particle_regions
    - input_data
    - check_input_data
    - init_rcut_max
    - init_prolog
    - grid_post_processing
    - print_domain
    - print_drivers
    - driver_extractor_summary
    - save_shapes
    - performance_adviser: { verbose: true }
    - init_epilog
    - first_iteration
    - compute_loop
    - simulation_epilog
    - hw_device_finalize
config_globals.msp
############ some global properties ############


# default global values
global:
  dt: 1.0e-4 s
  rcut_inc: 0.0 m   # additional distance so that we d'ont have to rebuild neighbor list each time step
  compute_loop_continue: true
  simulation_end_iteration: 10000
  simulation_log_frequency: 10
  simulation_load_balance_frequency: 10000
  simulation_dump_frequency: 1000         # 0 means no dump at all
  simulation_dump_thermo_frequency: -1
  simulation_generator_frequency: -1
  simulation_analyses_frequency: -1
  simulation_driver_extractor_frequency: 100 
  timestep: 0
  physical_time: 0.
  enable_domain_extension: true
  enable_load_balance: true
  enable_task_graph: false
  #amr_z_curve: false
  enable_grid_compact: true
  enable_contact_network: false
  trigger_generator: false
  analysis_interaction_dump_frequency: -1 
  analysis_dump_stress_tensor_frequency: -1
  active_interaction_checker: false
  dump_broken_interface: false

# default grid variant we use
grid_flavor: grid_flavor_dem

# default domain parameters
domain:
  grid_dims: [ 0 , 0 , 0 ] # deduced from cell_size
  cell_size: 0.0 m # deduced from max rcut (a.k.a. output slot ghost_dist from nbh_dist node)

#particle_regions: []