Use Custom Particle Properties

Custom particle properties are stored in arrays that match the particle data array.

During the simulation, there are two methods available for interaction with the custom properties, the getValueForProperty and the setValueForProperty methods. These methods can be used between simulation-steps to retrieve and update the custom properties. The specific custom properties are accessed using their unique property index.

Following the same procedure as for getting particle data, you must allocate an array equal to the total number of particles in the simulation times the number of elements for the property before using getValueForProperty method.

Note: You must delete the allocated array when it is no longer required.

When custom property data is returned from EDEM, it is returned in an order that matches the particle data as described in the Retrieving Particle Data from EDEM section.

Important: The particle data and custom property data must be retrieved after any new simulation-step and after any updates.

Custom properties with more than one element have the elements stored sequentially, in the same manner as the force and torque arrays. Therefore, a two element property for a single particle type simulation would be structured as follows.

The following diagram represents the particle data array for a custom property.


A value for a custom property is set by creating an array following the structure described. It is then possible to update the custom property values in EDEM using the setValueForCustomProp method. You must then delete the array that they have created when the update is complete.