EDEM API Flags
The EDEM API allows the author to enable or disable certain API functionalities through the use of flags in the setup function of either the Contact Model or Particle Body Force interface classes. As an API Author, you can use these flags to potentially save on memory or reduce processing time, as well as to prevent bugs or crashes caused by running with solvers or particle shapes that the API is not designed for. Flags are available for particle body force, contact models, solvers, and particle shapes.
particleOfInterestIndicates whether the plugin wishes to use the particle of interest feature and call the
processParticleOfInterest()function.isThreadSafeIndicates whether the plugin wants to register or receive custom property data.
libraryProvidesGpuSourceIndicates whether the plugin will get the GPU source code from the library instead of the
.cufileusesCustomPropertiesIndicates whether the plugin wants to register or receive custom property data.
pluginGUIEnabledIndicates whether the plugin supports custom dialog settings from the UI.
isThreadSafeIndicates whether the plugin wants to register or receive custom property data.
usesCustomPropertiesIndicates whether the plugin wants to register or receive custom property data.
libraryProvidesGpuSourceIndicates whether the plugin will get the GPU source code from the library instead of the
.cufilepluginGUIEnabledIndicates whether the plugin supports custom dialog settings from the UI.
usesContactFactorIndicates whether the plugin wishes to use contact factor. The Contact factor is the number of contacts between two particles or between one particle and different mesh elements belonging to the same plane. Contact factor can be used to solve the Multi-Sphere particle oversampling problem. If enabled, the contact factor will be calculated in EDEM and passed to the
calculateForce(...)method.usesCoordinationNumberIndicates whether the plugin wishes to use coordination number. The number of Particle-to-Particle connections that a particle has is known as its coordination number. This is only valid in the Particle-Particle contact model chain. If enabled, coordination number will be calculated in EDEM and passed to the
calculateForce(...)method, as part of theSDiscreteElementparameters.deformationEnabledIndicates whether the plugin wishes to enable deformation. This will call the
calculateTriangleDeformationfunction.includeZeroForceTrianglesIndicates whether the plugin wishes to call the
calculateTriangleDeformationfunction even if there are no force applied to a triangle.preserveContactEnabledIndicates whether the plugin will use the Preserve Contact feature. The Preserve Contact feature will allow the plugin to mark contacts as 'preserved'. These contacts will not be discarded if they are not in contact anymore. contacts can be marked as preserved from the Contact manager using the functions
preservePPContact()orpreservePGContact().
eCpuIndicates that the plugin is supported on the CPU solver.
eCudaIndicates that the plugin is supported on the CUDA solver.
eMultiSphereIndicates that the plugin supports the use of Multi-Sphere particles.
eSpheroCylinderIndicates that the plugin supports the use of Sphero-Cylinder particles.
ePolyhedralIndicates that the plugin supports the use of Polyhedral particles
Examples
NApiHelpers::CFlags as shown in the examples, the header
file for the plugin must use the NApiPbf namespace for
particle body force plugins, and the NApiCm namespace for
contact model plugins. using namespace NApiPbf;’ to the particle
body force plugin header file as follows:
using namespace NApiPbf;’ to the contact model plugin
header file as follows:
- For a contact model plugin that uses the CUDA solver, for every particle
shape and custom properties, use the setup flags as follows:

- For a particle body force plugin that uses the CPU solver, the Multi-Sphere
particle shape, and the plugin GUI, and calls the particle of interest
function, use the setup flags as follows:
