libgran documentation Help

Overview

libgran is a C++ template library for Discrete Element Method (DEM) simulations. It targets static modularity - an approach where different modules involved in a simulation, like the integrator and the inter-particle force models, are assembled at compile time. These semantics are achieved through the extensive use of templates. The main advantage of static modularity is that the compiler has more information about the simulation that is going to be run, thus allowing it to optimize generated code more radically.

Libgran has several built-in force models, such as Van der Waals attraction and contact friction force and is designed to be easily extensible with custom models.

libgran architecture

Each libgran simulation is initialized and driven by a program that specializes and creates instances of libgran's templates. In particular, the driver program has to initialize three components:

A typical simulation workflow involving these components is illustrated in the diagram below:

Driver programForce functor containerStep handlerGranular systemloop[Add up contributions from other particles]loop[Integrate each particle]loop[Perform time stepping]Initialize the force functorsInitialize the step handlerInitialize the granular systemcall do_step(dt)call operator ()Return computed accelerationIncrement position and velocityDriver programForce functor containerStep handlerGranular system
Last modified: 08 November 2024