    

 ## On this page

  

 

 # Structure IRockyContactDataRecorder

 Last update: 09.03.2026 

<a id="structIRockyContactDataRecorder"></a>

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")![](https://img.shields.io/badge/-public-brightgreen "public")

**\#include &lt;rocky\_contact\_data\_recorder\_api.h&gt;**

`<a href="structIRockyContactDataRecorder.md#structIRockyContactDataRecorder">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 href="structIRockyContactDataRecorder.md#structIRockyContactDataRecorder">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.

## Members

- [enable\_contact\_scalar](structIRockyContactDataRecorder.md#structIRockyContactDataRecorder_1a36e9b7b9de7b99a0e4c6ca703fc7fb5d)
- [get\_contact\_scalar\_index](structIRockyContactDataRecorder.md#structIRockyContactDataRecorder_1a5ebed1613189e54bf4c202b5ec9553b8)

## Public functions

### Function enable\_contact\_scalar

<a id="structIRockyContactDataRecorder_1a36e9b7b9de7b99a0e4c6ca703fc7fb5d"></a>

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
void IRockyContactDataRecorder::enable_contact_scalar(ContactScalar scalar, RecordingScope scope)

```

**This method allows a module to select which physical magnitudes associated to a**:

collision 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**:

- **scalar**: An 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.
- **scope**: An 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.

**Parameters**:

- ContactScalar **scalar**
- RecordingScope **scope**

**Return type**: void

### Function get\_contact\_scalar\_index

<a id="structIRockyContactDataRecorder_1a5ebed1613189e54bf4c202b5ec9553b8"></a>

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
int IRockyContactDataRecorder::get_contact_scalar_index(ContactScalar scalar, RecordingScope scope)

```

**Returns**:

The 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**:

- **scalar**: See description on `enable_contact_scalar`
- **scope**: An 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.

**Parameters**:

- ContactScalar **scalar**
- RecordingScope **scope**

**Return type**: int