A module for creating contact models on the fly for LIGGGHTS

Created on July 1, 2016

Author: Andrew Abi-Mansour

This is the:

██████╗ ██╗   ██╗ ██████╗ ██████╗  █████╗ ███╗   ██╗
██╔══██╗╚██╗ ██╔╝██╔════╝ ██╔══██╗██╔══██╗████╗  ██║
██████╔╝ ╚████╔╝ ██║  ███╗██████╔╝███████║██╔██╗ ██║
██╔═══╝   ╚██╔╝  ██║   ██║██╔══██╗██╔══██║██║╚██╗██║
██║        ██║   ╚██████╔╝██║  ██║██║  ██║██║ ╚████║
╚═╝        ╚═╝    ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝

DEM simulation and analysis toolkit,

Core developer and main author: Andrew Abi-Mansour,

PyGran is open-source, distributed under the terms of the GNU Public License, version 2 or later. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of the GNU General Public License along with PyGran. If not, see . See also top-level README and LICENSE files.



Generates a c++ header file for a contact model and compiles it during runtime.

simulation.PyGranSim.model_liggghts._find_number_models(src_dir, mtype='normal')[source]

Finds the total number of contact models available in the liggghts src dir

@src_dir: directory to search the contact model header files in @[mtype]: ‘normal’ (default) or ‘tangential’ contact models to search for


Generates a c++ header file for a contact model and compiles it during runtime.

  • stiffness (str) – analytical form of the stiffness = force / deltan

  • viscosity (str) – analytical form of the viscosity term (force = viscosity * vn).

Material parameters that can be used: Yeff: effective Young’s modulus Geff: effective Shear modulus meff: effective mass reff: effective radius charVel: characteristic impact velocity restLog: log of the coefficient of restitution deltan: normal displacement vn: velocity of the normal displacement kn: stiffness PI: constant (3.14 …)


register(name=’my_model’, stiffness = ‘6./15.*sqrt(reff)*(Yeff)*pow(15.*meff*charVel*charVel/(16.*sqrt(reff)*Yeff),0.2)’, viscosity = ‘sqrt(4.*meff*kn*restLogChosen*restLogChosen/(restLogChosen*restLogChosen+PI*PI))’)

produces a template header file for the spring-dashpot model called ‘my_model’.