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.

The flags for particle body force are as follows:
  • particleOfInterest

    Indicates whether the plugin wishes to use the particle of interest feature and call the processParticleOfInterest() function.

  • isThreadSafe

    Indicates whether the plugin wants to register or receive custom property data.

  • libraryProvidesGpuSource

    Indicates whether the plugin will get the GPU source code from the library instead of the .cu file

  • usesCustomProperties

    Indicates whether the plugin wants to register or receive custom property data.

  • pluginGUIEnabled

    Indicates whether the plugin supports custom dialog settings from the UI.

The flags for contact models are as follows:
  • isThreadSafe

    Indicates whether the plugin wants to register or receive custom property data.

  • usesCustomProperties

    Indicates whether the plugin wants to register or receive custom property data.

  • libraryProvidesGpuSource

    Indicates whether the plugin will get the GPU source code from the library instead of the .cu file

  • pluginGUIEnabled

    Indicates whether the plugin supports custom dialog settings from the UI.

  • usesContactFactor

    Indicates 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.

  • usesCoordinationNumber

    Indicates 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 the SDiscreteElement parameters.

  • deformationEnabled

    Indicates whether the plugin wishes to enable deformation. This will call the calculateTriangleDeformation function.

  • includeZeroForceTriangles

    Indicates whether the plugin wishes to call the calculateTriangleDeformation function even if there are no force applied to a triangle.

  • preserveContactEnabled

    Indicates 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() or preservePGContact().

The flags for the solver are as follows:
  • eCpu

    Indicates that the plugin is supported on the CPU solver.

  • eCuda

    Indicates that the plugin is supported on the CUDA solver.

The flags for particle shape are as follows:
  • eMultiSphere

    Indicates that the plugin supports the use of Multi-Sphere particles.

  • eSpheroCylinder

    Indicates that the plugin supports the use of Sphero-Cylinder particles.

  • ePolyhedral

    Indicates that the plugin supports the use of Polyhedral particles

Examples

This section provides short examples of setup functions using flags to enable different functionality in the plugin.
Note: To reference 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.
To do this, add the line ‘using namespace NApiPbf;’ to the particle body force plugin header file as follows:


Add the line ‘using namespace NApiPbf;’ to the contact model plugin header file as follows:


  1. For a contact model plugin that uses the CUDA solver, for every particle shape and custom properties, use the setup flags as follows:


  2. 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: