Developer Guide¶
hippoLBM is an application of the onika runtime: plugins of small operators, composed in YAML.
hippoLBM/
├── CMakeLists.txt # find_package(onika), plugins, executable wrapper, tests
├── include/hippoLBM/ # shared headers
│ ├── compute/ # parallel_for helpers, reductions
│ └── core/ # Point3D, Box3D, enums (FLUID_CELL, WALL_CELL, ...)
├── src/ # one plugin per directory, one operator per file
│ ├── grid/ # hippo_grid: domain, LBM parameters, fields, traversals, ghosts, initial conditions
│ ├── collision/ # hippo_collision: macro_variables, bgk, mrt, streaming
│ ├── bcs/ # hippo_bcs: bounce-back, neumann, rho, lid_driven_cavity, cavity_z_*
│ ├── obstacle/ # hippo_object: obstacle registration, update, bounce-back
│ ├── prepro/ # hippo_prepro: init_couette, init_double_couette
│ ├── couette/ # hippo_couette (optional): bgk_couette_relax, macro_variables_couette_relax
│ ├── io/ # hippo_io: ParaView, log, checkpoint / restart
│ └── check/ # hippo_check: profiles, check_macro_quantities
├── data/config/ # default configuration (main-config.msp, config_*.msp)
├── example/ # example decks (tutorials) and STL files
├── regression-test/ # ctest decks and data
├── perf/ # benchmark decks
└── script/ # post-processing scripts (profiles, vorticity)
- Tests — regression tests and CI
- Coding rules — style, naming, contributions
Writing an operator¶
An operator is a class deriving from onika::scg::OperatorNode, with typed slots declared by ADD_SLOT, a
documentation() string and an execute() method; it is registered in a plugin with
OperatorNodeFactory::instance()->register_factory. Most hippoLBM operators are templated on the lattice size Q
and registered with make_variant_operator:
Kernels are functors with ONIKA_HOST_DEVICE_FUNC operators, launched with parallel_for on a Box3D or on a
list of indices (traversals); a ParallelForFunctorTraits specialization with CudaCompatible = true makes them
run on the GPU. Fatal errors must call MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE), not std::exit, so that no MPI
rank is left hanging.
Regenerating the operator list¶
The Exhaustive Operator List is generated from the ADD_SLOT declarations of the
sources and the --help output of each operator, with the script scripts/gen_operators.py of this documentation
repository: