    

 ## On this page

  

 

 # IRockyContactDataRecorder Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__contact__data__recorder__api_8h_source.xhtml">rocky_contact_data_recorder_api.h</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

void [enable\_contact\_scalar](#a36e9b7b9de7b99a0e4c6ca703fc7fb5d) (ContactScalar scalar, RecordingScope scope) int [get\_contact\_scalar\_index](#a5ebed1613189e54bf4c202b5ec9553b8) (ContactScalar scalar, RecordingScope scope) <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockyContactDataRecorder.xhtml">IRockyContactDataRecorder</a>` is an interface to the internal entity that records relevant collision data during the contact calculations. The data is stored in contact scalars in order to make it available to collision statistics modules for later processing. The methods in `<a class="el" href="structIRockyContactDataRecorder.xhtml">IRockyContactDataRecorder</a>` allows a custom module to enable the physical magnitudes that must be recorded and to retrieve the indices of the contact scalars in which they will be stored.



## Member Function Documentation

<a id="a36e9b7b9de7b99a0e4c6ca703fc7fb5d" name="a36e9b7b9de7b99a0e4c6ca703fc7fb5d"></a>## [◆ ](#a36e9b7b9de7b99a0e4c6ca703fc7fb5d)enable\_contact\_scalar()

 void IRockyContactDataRecorder::enable\_contact\_scalar  ( ContactScalar *scalar*,    RecordingScope *scope* )

This method allows a module to select which physical magnitudes associated to acollision must be recorded into contact scalars. The magnitudes available for recording are listed below. For a description of how these magnitudes are computed internally, please refer to the DEM Technical Manual.Parameters scalarAn enum key indicating the physical magnitude that must be recorded. The currently available magnitudes are:  
`csDuration`: The duration of a collision.  
`csImpactVelocityNormal`: The normal component of the impact velocity, i.e. the contact relative velocity at the moment a collision starts.  
`csImpactVelocityTangential`: The tangential component of the impact velocity, i.e. the contact relative velocity at the moment a collision starts.  
`csWorkDissipation`: The energy dissipated during an entire collision.  
`csWorkImpact`: The work made by the normal contact force during the loading phase of a collision.  
`csWorkShear`: The work made by the tangential contact force during an entire collision.  
`csEnergyTransfer`: The energy transferred to a particle by a moving boundary during a collision at a particle-to-boundary contact.  
`csImpulseNormal`: The impulse of the normal contact force during an entire collision.  
`csImpulseTangential`: The impulse of the tangential contact force during an entire collision.  
`csImpulseX`: The impulse of the x-component of the contact force.  
`csImpulseY`: The impulse of the y-component of the contact force.  
`csImpulseZ`: The impulse of the z-component of the contact force.  
`csSlindingDistance`: The sliding distance during an entire collision.  
scopeAn enum key indicating if the collision data will be recorded at particle-to-particle contacts, particle-to-geometry-triangle contacts or both. The valid keys are:  
`rsParticleParticle` Record data only at particle-to-particle contacts.  
`rsParticleTriangle` Record data only at particle-to-geometry-triangle contacts.  
`rsBoth` Record data at both particle-to-particle and particle-to-geometry-triangle contacts. 



<a id="a5ebed1613189e54bf4c202b5ec9553b8" name="a5ebed1613189e54bf4c202b5ec9553b8"></a>## [◆ ](#a5ebed1613189e54bf4c202b5ec9553b8)get\_contact\_scalar\_index()

 int IRockyContactDataRecorder::get\_contact\_scalar\_index  ( ContactScalar *scalar*,    RecordingScope *scope* )

ReturnsThe index that identifies a specific contact scalar where collision data will be stored. This index will be available only after the setup phase has concluded.Parameters scalarSee description on `enable_contact_scalar`scopeAn enum key indicating the index of which contact type will be returned. The valid keys are:  
`rsParticleParticle` Return the index of a particle contact scalar.  
`rsParticleTriangle` Return the index of a triangle contact scalar.