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