> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IRockyContact Struct Reference

`#include <rocky_contact_api.hpp>`

## Public Member Functions

| Type | Name |
| - | - |
| ROCKY\_FUNCTIONS [IRockyMaterial](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterial.md) | [get\_home\_material](#ae1890c831f2bb90143d3459352dee316) () const |
| ROCKY\_FUNCTIONS [IRockyMaterial](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterial.md) | [get\_near\_material](#a8ec1a085944bc63f455c4007531aea61) () const |
| ROCKY\_FUNCTIONS [IRockyMaterialInteraction](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterialInteraction.md) | [get\_material\_interaction](#aff52effeb3fe2a5015ac05022df63731) () const |
| ROCKY\_FUNCTIONS int | [get\_material\_interaction\_index](#ab05070dcc53936225c506abfc2645ff4) () const |
| ROCKY\_FUNCTIONS [IRockyParticle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle.md) | [get\_home\_particle](#aed9e6fcfa92276bc514e21564f0603fb) () const |
| ROCKY\_FUNCTIONS int | [get\_home\_particle\_group\_index](#a2cd1c1e40befd0cf6910d663432c3695) () const |
| ROCKY\_FUNCTIONS [IRockyParticle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle.md) | [get\_near\_particle](#a6c85a39640365d283d22437792c51f0f) () const |
| ROCKY\_FUNCTIONS int | [get\_near\_particle\_group\_index](#a244d24fa1cc78a23d6f4553d5797ab0b) () const |
| ROCKY\_FUNCTIONS [IRockyGeometryTriangle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyGeometryTriangle.md) | [get\_near\_triangle](#aa2479a695d48de98b5caf29d52134b8a) () const |
| ROCKY\_FUNCTIONS int | [get\_near\_geometry\_index](#a3f551f05cfe40b8c6b95b3df8a311ca4) () const |
| ROCKY\_FUNCTIONS bool | [is\_particle\_particle\_contact](#a0a27611118aab7a27fb6c1e53939cba1) () const |
| ROCKY\_FUNCTIONS bool | [is\_particle\_triangle\_contact](#a9de7fba112ea033f15e8ee1fb0305960) () const |
| ROCKY\_FUNCTIONS bool | [is\_frictional](#ae83dc410da7f54a0badbfb0c75fdaa4b) () const |
| ROCKY\_FUNCTIONS bool | [is\_adhesive](#a46453e5b227065edb55c7b67177584f9) () const |
| ROCKY\_FUNCTIONS double | [get\_previous\_overlap](#ab6c8fca161c75cf870eb059f9ed3b11c) () const |
| ROCKY\_FUNCTIONS double | [get\_overlap](#a26aef3fac3655fe686283be4bd2fe7f0) () const |
| ROCKY\_FUNCTIONS double3 | [get\_normal\_unit\_vector](#a04a9d6e5ba1478bc00d4955bcaa1a2fd) () const |
| ROCKY\_FUNCTIONS double3 | [get\_contact\_position](#aafeae8748cf36743d08f4570b198f001) () const |
| ROCKY\_FUNCTIONS double | [get\_scale\_factor](#ad0940d0dcefd839aaba3770689a034bb) () const |
| ROCKY\_FUNCTIONS bool | [just\_started\_frictional](#ab280ec2c5bc3fe90ca4822939514d3b5) () const |
| ROCKY\_FUNCTIONS bool | [just\_started\_adhesive](#a33e06ba2b8ca80ff15946ac27885dbd7) () const |
| ROCKY\_FUNCTIONS bool | [just\_finished\_frictional](#afbda49c86a367e9a4f20492ff5007333) () const |
| ROCKY\_FUNCTIONS bool | [just\_finished\_adhesive](#a52439d8dd07c36c9475eb248d7dcb38e) () const |
| ROCKY\_FUNCTIONS bool | [is\_loading](#a395c9be7e50adea7317a808279faec0c) () const |
| ROCKY\_FUNCTIONS bool | [is\_unloading](#abe5cd05335fe5264bc05d9808b23a9fe) () const |
| ROCKY\_FUNCTIONS bool | [is\_positive\_oriented](#a79c5a7fb09b962d62eefe61f27cddcd7) () const |
| ROCKY\_FUNCTIONS double | [get\_current\_time](#a6cc48e3759e515587e236d283d904f00) () const |
| ROCKY\_FUNCTIONS double | [get\_timestep](#a4cc9eb65e78d4eb4cbe34bb7c7baf85d) () const |
| ROCKY\_FUNCTIONS [IRockyContactScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalars.md) | [get\_particle\_contact\_scalars](#af937221f53319cd4a30871829e3cc7e0) () const |
| ROCKY\_FUNCTIONS [IRockyContactScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalars.md) | [get\_triangle\_contact\_scalars](#ab14e84d2a580a95b2fbcb3d1f5c92a25) () const |
| ROCKY\_FUNCTIONS double | [get\_home\_stiffness](#a1816640d165bb54d339ee9aaf2873046) () const |
| ROCKY\_FUNCTIONS double | [get\_near\_stiffness](#aa49e3ddd3916fabf25a90e8fefb5cc4c) () const |
| ROCKY\_FUNCTIONS double | [get\_equivalent\_stiffness](#aa373c6f200518285d6bb85817d12ccae) () const |
| ROCKY\_FUNCTIONS double | [get\_home\_stiffness\_fraction](#aff778f8122d9ea2f81da59e1ff279b45) () const |
| ROCKY\_FUNCTIONS double | [get\_reduced\_young\_modulus](#acc8512372077732bfe12aa3483f2e35b) () const |
| ROCKY\_FUNCTIONS double | [get\_equivalent\_mass](#ae4f9b67c0a4577089b37854e9fa5fe9b) () const |
| ROCKY\_FUNCTIONS double | [get\_equivalent\_radius](#a473c87b27145d22e24f15e67ab160d89) () const |
| ROCKY\_FUNCTIONS double | [get\_normal\_contact\_force](#a9e085d9bb5684b5d34c33525bb1d021c) () const |
| ROCKY\_FUNCTIONS double3 | [get\_tangential\_contact\_force](#aca5aae0a4d0c2033bbad4da067657704) () const |
| ROCKY\_FUNCTIONS double3 | [calculate\_relative\_velocity](#af05c086a0b75c761b13fa744061789e4) () const |
| ROCKY\_FUNCTIONS double | [get\_restitution\_coefficient](#a6e335a5d032dded094c6b36ad5ea23c1) () const |
| ROCKY\_FUNCTIONS void | [set\_restitution\_coefficient](#ad5f45118ba3d4bdedd2194640fc4c79d) (double value) |
| ROCKY\_FUNCTIONS double | [get\_dynamic\_friction\_coefficient](#a00daba07ec1b0b1df0be1e8d761a408e) () const |
| ROCKY\_FUNCTIONS void | [set\_dynamic\_friction\_coefficient](#aaa4594d0c921983edc1d1033661c6500) (double value) |
| ROCKY\_FUNCTIONS double | [get\_static\_friction\_coefficient](#a9b6c747c62166e351d363d693e18c46a) () const |
| ROCKY\_FUNCTIONS void | [set\_static\_friction\_coefficient](#a5a3233239461058a2f33a9f49494666c) (double value) |
| ROCKY\_FUNCTIONS double | [get\_sliding\_distance](#afe041153be8e43d3e5d7c7a500a49501) () const |
| ROCKY\_FUNCTIONS bool | [get\_is\_sliding\_marker](#a1acfe6d4f8e36c9fd417a658aac1c041) () const |
| ROCKY\_FUNCTIONS double | [get\_normal\_relative\_velocity](#a379476b7b01576be8fc0eb3f0dde7a1e) () const |
| ROCKY\_FUNCTIONS double3 | [get\_tangential\_relative\_velocity](#a9fab3f0e6f78ea64e96209fbbd540b85) () const |
| ROCKY\_FUNCTIONS double | [get\_normal\_adhesion\_force](#a21587a9de6f69f4af1d215c3879fca66) () const |
| ROCKY\_FUNCTIONS double3 | [get\_tangential\_adhesion\_force](#a20d7ffad55e1c1c28c848eb3b09c41f2) () const |
| ROCKY\_FUNCTIONS double3 | [get\_previous\_normal\_vector](#afa684887b3dcfad056850ccfdf399ec3) () const |
| ROCKY\_FUNCTIONS double3 | [get\_previous\_moment\_vector](#a4d10fc8ec36500e0a8f6673f3e7628fd) () const |
| ROCKY\_FUNCTIONS void | [set\_previous\_moment\_vector](#a302215189897e9ad39f8d7a3ff571d6c) (double3 value) |

## Detailed Description

[`IRockyContact`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContact) is an interface for the internal contact object in Rocky. A contact object is the code representation of the relationship between two particles or between a particle and a geometry triangle that have a force interaction at a given time. In the first case, it will be a *particle-to-particle contact* (sometimes abbreviated to particle-contact), whereas in the latter case, it will be a *particle-to-triangle contact* (sometimes abbreviated to triangle-contact).

A contact in which there exists an actual overlap between the entities is referred to as a *frictional contact*. If an adhesive model is active, an adhesive force might exist even if the entities are not physically touching each other. In that case, an *adhesive contact* will be established between those entities.

In a particle-to-particle contact, one of the particles is identified as *home* particle, whereas the other is identified as *near* particle. There is no special rule for labeling particles in this type of contacts, any of the two particles can be labeled as *home* or *near*. On the other hand, in a particle-to-triangle contact, the particle is always referred to as *home* particle, while the triangle is referred to as *near* triangle. Whenever it is necessary to distinguish between two contacting entities, the prefixes *home* and *near* are used in the associated method names. The normal unit vector associated to a contact is always constructed pointing to the home particle.

Contact scalars are special variables that store values per contact that are preserved between time iterations. The preservation of those values is guaranteed during the whole lifetime of a contact. Internally, contact scalars are stored separately for particle-to-particle contacts and for particle-to-triangle contacts. In order to differentiate them, the former are named *particle contact scalars*, whereas the latter are named *triangle contact scalars*

## Member Function Documentation

### calculate\_relative\_velocity()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::calculate_relative_velocity() const
```

**This method will calculate the relative velocity vector at the contact point.**

This relative velocity is defined as the difference between the velocities of points located at the *home* particle and the *near* particle or geometry, both coincident instantaneously with the contact point.

> [!WARNING]
>
> Since this calculation can be costly, modules that need values of this relative velocity may alternatively enable the storage of its normal and tangential components. These components are calculated internally by Rocky during the contact force calculation stage, but discarded afterwards. However, by using the [`IRockyContactScalarsModel::enable_storage_normal_relative_velocity`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a30a72264168db13de798df7cdff440c5) and [`IRockyContactScalarsModel::enable_storage_tangential_relative_velocity`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#ad8ba6db25bce594fbb62b415b0634a95) methods, a module can activate the storage of those components in order to make them available at any point during a time iteration. \\

**Returns**

The current relative velocity vector between two contacting particles or a particle and a geometry, at the contact point. \


### get\_contact\_position()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_contact_position() const
```

**Returns**

The Cartesian coordinates of the point at which the contact force is applied.

### get\_current\_time()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_current_time() const
```

**Returns**

The current simulation time.

### get\_dynamic\_friction\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_dynamic_friction_coefficient() const
```

**Returns**

The value of the coefficient of dynamic or kinetic friction associated to the contact. If this coefficient is defined as a variable property and its value is specified by a custom module, this method will return that value. Otherwise, it will return the value set through the Rocky UI for the corresponding material interaction.

### get\_equivalent\_mass()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_equivalent_mass() const
```

**Returns**

The value of the equivalent or effective mass for the contact. For more details, please refer to the DEM Technical Manual.

### get\_equivalent\_radius()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_equivalent_radius() const
```

**Returns**

The value of the equivalent or effective radius for the contact. For more details, please refer to the DEM Technical Manual.

### get\_equivalent\_stiffness()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_equivalent_stiffness() const
```

**Returns**

The value of the equivalent stiffness for the contact. The returned value is already multiplied by the numerical softening factor, which is commonly used as a practical way of increasing the simulation timestep. For more details, please refer to the DEM Technical Manual.

### get\_home\_material()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyMaterial IRockyContact::get_home_material() const
```

**Returns**

An [`IRockyMaterial`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterial) object that gives access to the values of physical properties associated to the material from which particle labeled as *home* is made.

### get\_home\_particle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticle IRockyContact::get_home_particle() const
```

**Returns**

An [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle) object representing the *home* particle. This object gives access to several instantaneous properties associated to that particle.

### get\_home\_particle\_group\_index()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyContact::get_home_particle_group_index() const
```

**Returns**

The index that uniquely identifies the particle group to which the home particle belongs.

### get\_home\_stiffness()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_home_stiffness() const
```

**Returns**

The value of the stiffness associated to the *home* particle. For more details about the definition of this parameter, refer to the DEM Technical Manual. The returned value is already multiplied by the numerical softening factor, which is commonly used as a practical way of increasing the simulation timestep. For more details, please refer to the DEM Technical Manual.

### get\_home\_stiffness\_fraction()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_home_stiffness_fraction() const
```

**Returns**

The fraction of the stiffness of the near entity to the sum of the stiffnesses of both entities in a contact. This fraction is used when splitting the work made by the contact force between the two contacting entities. For more details, please refer to the DEM Technical Manual.

### get\_is\_sliding\_marker()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::get_is_sliding_marker() const
```

**Returns**

The value of the sliding marker registered during the most recent calculation of the tangential component of the contact force. This value will be available only if its storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_is_sliding_marker`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a2a383fbe3de38c7aab855c0b775a293b) method. A segmentation fault will occur otherwise.

### get\_material\_interaction()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyMaterialInteraction IRockyContact::get_material_interaction() const
```

**Returns**

An [`IRockyMaterialInteraction`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterialInteraction) object that gives access to the values of physical properties associated to the material interaction that corresponds to the contact.

### get\_material\_interaction\_index()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyContact::get_material_interaction_index() const
```

**Returns**

The internal index of the material interaction associated to the contact. Every pair of materials defined in a project has a unique index associated to it. Both built-in and custom material interactions are stored internally using the same indexes.

### get\_near\_geometry\_index()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyContact::get_near_geometry_index() const
```

**Returns**

The internal index that uniquely identifies the geometry to which belongs the geometry triangle in a particle-to-triangle contact.

### get\_near\_material()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyMaterial IRockyContact::get_near_material() const
```

**Returns**

An [`IRockyMaterial`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyMaterial) object that gives access to the values of physical properties associated to the material from which the *near* particle or triangle is made.

### get\_near\_particle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticle IRockyContact::get_near_particle() const
```

**Returns**

An [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle) object representing the *near* particle in a particle-to-triangle contact. This object gives access to several instantaneous properties associated to that particle.

### get\_near\_particle\_group\_index()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyContact::get_near_particle_group_index() const
```

**Returns**

The index that uniquely identifies the particle group to which the near particle belongs, in a particle-to-particle contact.

### get\_near\_stiffness()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_near_stiffness() const
```

**Returns**

The value of the stiffness associated to the *near* particle or the *near* triangle, depending on the contact type. The returned value is already multiplied by the numerical softening factor, which is commonly used as a practical way of increasing the simulation timestep. For more details, please refer to the DEM Technical Manual.

### get\_near\_triangle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyGeometryTriangle IRockyContact::get_near_triangle() const
```

**Returns**

An [`IRockyGeometryTriangle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyGeometryTriangle) object representing the *near* geometry triangle in a particle-to-triangle contact. This object gives access to some geometric properties associated to that triangle.

### get\_normal\_adhesion\_force()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_normal_adhesion_force() const
```

**Returns**

The value of the normal component of the adhesion force calculated during the last adhesion force calculation stage executed. This value will be available only if its storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_normal_adhesion_force`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a0b773628077520e21f189ab64b8b1e69) method. A segmentation fault will occur otherwise.

### get\_normal\_contact\_force()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_normal_contact_force() const
```

**Returns**

The value of the normal component of the contact force, calculated according to the active normal contact force model. Depending on the point from where this function is called, a different force value can be returned. If called from `ROCKY_PLUGIN_PRE_FORCE_ON_CONTACTS`, the returned value will correspond to the normal force component calculated during the previous timestep. On the other hand, if called from `ROCKY_PLUGIN_POST_FORCE_ON_CONTACTS`, the value will be the recently calculated normal force component for the current timestep. Moreover, this function is not supposed to be called from `ROCKY_PLUGIN_NORMAL_FORCE_ON_CONTACTS`, since this hook is meant to be used to calculate and set the normal force component for the contact.

### get\_normal\_relative\_velocity()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_normal_relative_velocity() const
```

**Returns**

The value of the normal component of the contact's relative velocity calculated during the last contact force calculation stage executed. This value will be available only if its storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_normal_relative_velocity`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a30a72264168db13de798df7cdff440c5) method. A segmentation fault will occur otherwise.

### get\_normal\_unit\_vector()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_normal_unit_vector() const
```

**Returns**

The unit normal vector in Cartesian coordinates. Conventionally, this vector is oriented always pointing to the *home* particle.

### get\_overlap()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_overlap() const
```

**Returns**

The value of the current overlap, which is the small distance that a particle overlaps with another particle or a boundary, measured in the normal direction. In contact models, it is taken as a measurement of the total deformation of the contacting entities at any given time during a collision. Therefore, it is usually the main input parameter for calculating the normal contact force. For adhesive contacts in which physical contact has not been reached yet, this function will return a negative value. In this case, the absolute value of the overlap can be interpreted as the gap between the interacting entities, measured in the direction defined by the normal unit vector. It is common for adhesive forces to be functions of this gap distance.

### get\_particle\_contact\_scalars()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyContactScalars IRockyContact::get_particle_contact_scalars() const
```

**Returns**

An [`IRockyContactScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalars) object that gives access to all particle-to-particle contact scalars defined in the project.

### get\_previous\_moment\_vector()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_previous_moment_vector() const
```

**Returns**

The value the previous rolling resistance moment stored by a custom module that implements a custom rolling resistance model. This moment will be available only if a corresponding scalar was enabled by using the [`IRockyContactScalarsModel::enable_previous_moment_vector`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#ab2927b1c13fc4325a5bd28ba97e15230) method and the module explicitly stored its value in the previous iteration, by using the [`IRockyContact::set_previous_moment_vector`](#a302215189897e9ad39f8d7a3ff571d6c) method.

### get\_previous\_normal\_vector()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_previous_normal_vector() const
```

**Returns**

The value of the contact's normal unit vector recorded during the previous time iteration. This value will be available only if its automatic storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_previous_normal_vector`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a36a468305e9a49ba36de61846260c1f1) method. A segmentation fault will occur otherwise.

### get\_previous\_overlap()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_previous_overlap() const
```

**Returns**

The value of the overlap corresponding to the previous timestep.

### get\_reduced\_young\_modulus()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_reduced_young_modulus() const
```

**Returns**

The value of the reduced Young's modulus. This property is usually used in the Hertzian contact model and models derived from it. The returned value is already multiplied by the numerical softening factor, which is commonly used as a practical way of increasing the simulation timestep. For more details, please refer to the DEM Technical Manual.

### get\_restitution\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_restitution_coefficient() const
```

**Returns**

The value of the coefficient of restitution associated to the contact. If the restitution coefficient is a variable property specified by a custom module, this method will return that value. Otherwise, it will return the value set through the Rocky UI for the corresponding material interaction.

### get\_scale\_factor()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_scale_factor() const
```

**Returns**

The value of the scale factor, which is a reduction factor of the contact force attributed to an individual contact, in cases when multiple contacts points arise simultaneously between two entities. This factor is used also within collision statistics modules for determining the number of collisions based on the number of contacts registered, in cases when each collision has associated multiple contact points.

### get\_sliding\_distance()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_sliding_distance() const
```

**Returns**

The value of the sliding distance calculated during the most recent simulation timestep. The value of this distance will be available only if its storage was enabled during the setup of the module by using the [`IRockyContactScalarsModel::enable_storage_sliding_distance`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a8e8fb75a47341a734ee04707a58f658f) method. A segmentation fault will occur otherwise.

### get\_static\_friction\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_static_friction_coefficient() const
```

**Returns**

The value of the coefficient of static friction associated to the contact. If this coefficient is defined as a variable property and its value is specified by a custom module, this method will return that value. Otherwise, it will return the value set through the Rocky UI for the corresponding material interaction.

### get\_tangential\_adhesion\_force()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_tangential_adhesion_force() const
```

**Returns**

The value of the tangential component of the adhesion force calculated during the last adhesion force calculation stage executed. This value will be available only if its storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_tangential_adhesion_force`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#ab390c75dee689878d04d1db89be3fb95) method. A segmentation fault will occur otherwise.

### get\_tangential\_contact\_force()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_tangential_contact_force() const
```

**Returns**

The tangential component of the contact force as a vector in Cartesian coordinates, calculated according to the active tangential contact force model. Conventionally, the returned tangential force is the one whose orientation coincides with the tangential force acting on the home particle. \
&#x20;If called from `ROCKY_PLUGIN_PRE_FORCE_ON_CONTACTS`, the returned value will correspond to the tangential force component calculated during the previous timestep. On the other hand, if called from `ROCKY_PLUGIN_POST_FORCE_ON_CONTACTS` or from other hooks executed after that point, the value will be the recently calculated tangential force component for the current timestep. Moreover, this function is not supposed to be called from `ROCKY_PLUGIN_TANGENTIAL_FORCE_ON_CONTACTS`, since this hook is meant to be used to calculate and set the tangential force component for the contact. For tangential force models other than the Linear Spring Coulomb Limit and Mindlin-Deresiewicz models, the storage of this force must be enabled explicitly by using the [`IRockyContactScalarsModel::enable_storage_tangential_contact_force`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#a5a65f842ce3bea36ee46b346a2741911) method.

### get\_tangential\_relative\_velocity()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyContact::get_tangential_relative_velocity() const
```

**Returns**

The value of the tangential component of the contact's relative velocity calculated during the last contact force calculation stage executed. This value will be available only if its storage was enabled by using the [`IRockyContactScalarsModel::enable_storage_tangential_relative_velocity`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#ad8ba6db25bce594fbb62b415b0634a95) method. A segmentation fault will occur otherwise.

### get\_timestep()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyContact::get_timestep() const
```

**Returns**

The magnitude of the simulation timestep.

### get\_triangle\_contact\_scalars()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyContactScalars IRockyContact::get_triangle_contact_scalars() const
```

**Returns**

An [`IRockyContactScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalars) object that gives access to all particle-to-triangle contact scalars defined in the project.

### is\_adhesive()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_adhesive() const
```

**Returns**

True if the contact is adhesive, which is the case for all contacts if an adhesive force model is active in the project. The method returns false, otherwise.

### is\_frictional()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_frictional() const
```

**Returns**

True if the contact is frictional, that is, the contacting entities are touching each other. The method returns false, otherwise.

### is\_loading()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_loading() const
```

**Returns**

True if the contact is in a loading period (overlap increasing), false otherwise.

### is\_particle\_particle\_contact()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_particle_particle_contact() const
```

**Returns**

True if the contact is a particle-to-particle contact, false otherwise.

### is\_particle\_triangle\_contact()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_particle_triangle_contact() const
```

**Returns**

True if the contact is a particle-to-triangle contact, false otherwise.

### is\_positive\_oriented()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_positive_oriented() const
```

**Returns**

True if the topological orientation of the contact coincides with the conventional positive orientation.

### is\_unloading()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::is_unloading() const
```

**Returns**

True if the contact is in a unloading period (overlap decreasing), false otherwise.

### just\_finished\_adhesive()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::just_finished_adhesive() const
```

**Returns**

True if the contact is adhesive and it has finished (the gap distance between the contacting entities became larger than the adhesive distance) at the current timestep.

> [!WARNING]
>
> This method will work properly only if called within the `ROCKY_PLUGIN_POST_FORCE_ON_FINISHED_CONTACTS` hook.

### just\_finished\_frictional()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::just_finished_frictional() const
```

**Returns**

True if the contact is frictional and it has finished (the contacting entities stopped touching each other) at the current timestep.

> [!WARNING]
>
> This method will work properly only if called within the `ROCKY_PLUGIN_POST_FORCE_ON_FINISHED_CONTACTS` hook.

### just\_started\_adhesive()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::just_started_adhesive() const
```

**Returns**

True if the contact is adhesive and it has begun at the current timestep, false otherwise.

### just\_started\_frictional()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyContact::just_started_frictional() const
```

**Returns**

True if the contact is frictional and it has begun at the current timestep, false otherwise.

### set\_dynamic\_friction\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyContact::set_dynamic_friction_coefficient(double value)
```

**This method sets the value of the coefficient of dynamic friction at a frictional**

contact. It can be used only if that coefficient was defined as a variable property in the module's specification file. It is important to note that the value of this coefficient must be set at the beginning of a contact, before the stage of contact forces calculation. Otherwise, the value set by this method will not be used in that calculation, causing undefined behavior in the collisions.

**Parameters**

| Name | Description |
| - | - |
| value | The value of the coefficient of dynamic friction that must be used in the contact. |

### set\_previous\_moment\_vector()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyContact::set_previous_moment_vector(double3 value)
```

**This method allows a module implementing a custom rolling resistance model**

to store the value of the rolling resistance moment for availability in the next time iteration. It can be used only if the corresponding contact scalar was enabled by using the [`IRockyContactScalarsModel::enable_previous_moment_vector`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyContactScalarsModel#ab2927b1c13fc4325a5bd28ba97e15230) method. The difference of the contact scalar that stores this moment in relation to a regular contact scalar is that the orientation of the stored vector is always preserved, regardless of possible internal changes in the topology of the contact.

**Parameters**

| Name | Description |
| - | - |
| value | The value of the rolling resistance moment just calculated. |

### set\_restitution\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyContact::set_restitution_coefficient(double value)
```

**This method sets the value of the coefficient of restitution for a collision.**

It can be used only if the coefficient of restitution was defined as a variable property in the module's specification file. It is important to note that the value of the restitution coefficient must be set at the beginning of a contact, before the stage of contact forces calculation. Otherwise, the value set by this method will not be used in that calculation, causing unphysical behavior in the collisions.

**Parameters**

| Name | Description |
| - | - |
| value | The value of the coefficient of restitution that must be used in the contact. |

### set\_static\_friction\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyContact::set_static_friction_coefficient(double value)
```

**This method sets the value of the coefficient of static friction at a frictional contact.**

It can be used only if that coefficient was defined as a variable property in the module's specification file. It is important to note that the value of this coefficient must be set at the beginning of a contact, before the stage of contact forces calculation. Otherwise, the value set by this method will not be used in that calculation, causing unphysical behavior in the collisions.

**Parameters**

| Name | Description |
| - | - |
| value | The value of the coefficient of static friction that must be used in the contact. |
