    

 ## On this page

  

 

 # IRockyContact Struct Reference

 Last update: 17.07.2025 

`#include <<a class="el" href="rocky__contact__api_8hpp_source.xhtml">rocky_contact_api.hpp</a>>`

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

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

`<a class="el" href="structIRockyContact.xhtml">IRockyContact</a>` 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

<a id="af05c086a0b75c761b13fa744061789e4" name="af05c086a0b75c761b13fa744061789e4"></a>## [◆ ](#af05c086a0b75c761b13fa744061789e4)calculate\_relative\_velocity()

 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.AttentionSince 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a30a72264168db13de798df7cdff440c5">IRockyContactScalarsModel::enable_storage_normal_relative_velocity</a>` and `<a class="el" href="structIRockyContactScalarsModel.xhtml#ad8ba6db25bce594fbb62b415b0634a95">IRockyContactScalarsModel::enable_storage_tangential_relative_velocity</a>` methods, a module can activate the storage of those components in order to make them available at any point during a time iteration.   
ReturnsThe current relative velocity vector between two contacting particles or a particle and a geometry, at the contact point.   




<a id="aafeae8748cf36743d08f4570b198f001" name="aafeae8748cf36743d08f4570b198f001"></a>## [◆ ](#aafeae8748cf36743d08f4570b198f001)get\_contact\_position()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_contact\_position  ( )  const

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



<a id="a6cc48e3759e515587e236d283d904f00" name="a6cc48e3759e515587e236d283d904f00"></a>## [◆ ](#a6cc48e3759e515587e236d283d904f00)get\_current\_time()

 ROCKY\_FUNCTIONS double IRockyContact::get\_current\_time  ( )  const

ReturnsThe current simulation time. 



<a id="a00daba07ec1b0b1df0be1e8d761a408e" name="a00daba07ec1b0b1df0be1e8d761a408e"></a>## [◆ ](#a00daba07ec1b0b1df0be1e8d761a408e)get\_dynamic\_friction\_coefficient()

 ROCKY\_FUNCTIONS double IRockyContact::get\_dynamic\_friction\_coefficient  ( )  const

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



<a id="ae4f9b67c0a4577089b37854e9fa5fe9b" name="ae4f9b67c0a4577089b37854e9fa5fe9b"></a>## [◆ ](#ae4f9b67c0a4577089b37854e9fa5fe9b)get\_equivalent\_mass()

 ROCKY\_FUNCTIONS double IRockyContact::get\_equivalent\_mass  ( )  const

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



<a id="a473c87b27145d22e24f15e67ab160d89" name="a473c87b27145d22e24f15e67ab160d89"></a>## [◆ ](#a473c87b27145d22e24f15e67ab160d89)get\_equivalent\_radius()

 ROCKY\_FUNCTIONS double IRockyContact::get\_equivalent\_radius  ( )  const

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



<a id="aa373c6f200518285d6bb85817d12ccae" name="aa373c6f200518285d6bb85817d12ccae"></a>## [◆ ](#aa373c6f200518285d6bb85817d12ccae)get\_equivalent\_stiffness()

 ROCKY\_FUNCTIONS double IRockyContact::get\_equivalent\_stiffness  ( )  const

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



<a id="ae1890c831f2bb90143d3459352dee316" name="ae1890c831f2bb90143d3459352dee316"></a>## [◆ ](#ae1890c831f2bb90143d3459352dee316)get\_home\_material()

 ROCKY\_FUNCTIONS [IRockyMaterial](structIRockyMaterial.xhtml) IRockyContact::get\_home\_material  ( )  const

ReturnsAn `<a class="el" href="structIRockyMaterial.xhtml">IRockyMaterial</a>` object that gives access to the values of physical properties associated to the material from which particle labeled as *home* is made. 



<a id="aed9e6fcfa92276bc514e21564f0603fb" name="aed9e6fcfa92276bc514e21564f0603fb"></a>## [◆ ](#aed9e6fcfa92276bc514e21564f0603fb)get\_home\_particle()

 ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) IRockyContact::get\_home\_particle  ( )  const

ReturnsAn `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` object representing the *home* particle. This object gives access to several instantaneous properties associated to that particle. 



<a id="a2cd1c1e40befd0cf6910d663432c3695" name="a2cd1c1e40befd0cf6910d663432c3695"></a>## [◆ ](#a2cd1c1e40befd0cf6910d663432c3695)get\_home\_particle\_group\_index()

 ROCKY\_FUNCTIONS int IRockyContact::get\_home\_particle\_group\_index  ( )  const

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



<a id="a1816640d165bb54d339ee9aaf2873046" name="a1816640d165bb54d339ee9aaf2873046"></a>## [◆ ](#a1816640d165bb54d339ee9aaf2873046)get\_home\_stiffness()

 ROCKY\_FUNCTIONS double IRockyContact::get\_home\_stiffness  ( )  const

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



<a id="aff778f8122d9ea2f81da59e1ff279b45" name="aff778f8122d9ea2f81da59e1ff279b45"></a>## [◆ ](#aff778f8122d9ea2f81da59e1ff279b45)get\_home\_stiffness\_fraction()

 ROCKY\_FUNCTIONS double IRockyContact::get\_home\_stiffness\_fraction  ( )  const

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



<a id="a1acfe6d4f8e36c9fd417a658aac1c041" name="a1acfe6d4f8e36c9fd417a658aac1c041"></a>## [◆ ](#a1acfe6d4f8e36c9fd417a658aac1c041)get\_is\_sliding\_marker()

 ROCKY\_FUNCTIONS bool IRockyContact::get\_is\_sliding\_marker  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a2a383fbe3de38c7aab855c0b775a293b">IRockyContactScalarsModel::enable_storage_is_sliding_marker</a>` method. A segmentation fault will occur otherwise. 



<a id="aff52effeb3fe2a5015ac05022df63731" name="aff52effeb3fe2a5015ac05022df63731"></a>## [◆ ](#aff52effeb3fe2a5015ac05022df63731)get\_material\_interaction()

 ROCKY\_FUNCTIONS [IRockyMaterialInteraction](structIRockyMaterialInteraction.xhtml) IRockyContact::get\_material\_interaction  ( )  const

ReturnsAn `<a class="el" href="structIRockyMaterialInteraction.xhtml">IRockyMaterialInteraction</a>` object that gives access to the values of physical properties associated to the material interaction that corresponds to the contact. 



<a id="ab05070dcc53936225c506abfc2645ff4" name="ab05070dcc53936225c506abfc2645ff4"></a>## [◆ ](#ab05070dcc53936225c506abfc2645ff4)get\_material\_interaction\_index()

 ROCKY\_FUNCTIONS int IRockyContact::get\_material\_interaction\_index  ( )  const

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



<a id="a3f551f05cfe40b8c6b95b3df8a311ca4" name="a3f551f05cfe40b8c6b95b3df8a311ca4"></a>## [◆ ](#a3f551f05cfe40b8c6b95b3df8a311ca4)get\_near\_geometry\_index()

 ROCKY\_FUNCTIONS int IRockyContact::get\_near\_geometry\_index  ( )  const

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



<a id="a8ec1a085944bc63f455c4007531aea61" name="a8ec1a085944bc63f455c4007531aea61"></a>## [◆ ](#a8ec1a085944bc63f455c4007531aea61)get\_near\_material()

 ROCKY\_FUNCTIONS [IRockyMaterial](structIRockyMaterial.xhtml) IRockyContact::get\_near\_material  ( )  const

ReturnsAn `<a class="el" href="structIRockyMaterial.xhtml">IRockyMaterial</a>` object that gives access to the values of physical properties associated to the material from which the *near* particle or triangle is made. 



<a id="a6c85a39640365d283d22437792c51f0f" name="a6c85a39640365d283d22437792c51f0f"></a>## [◆ ](#a6c85a39640365d283d22437792c51f0f)get\_near\_particle()

 ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) IRockyContact::get\_near\_particle  ( )  const

ReturnsAn `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` object representing the *near* particle in a particle-to-triangle contact. This object gives access to several instantaneous properties associated to that particle. 



<a id="a244d24fa1cc78a23d6f4553d5797ab0b" name="a244d24fa1cc78a23d6f4553d5797ab0b"></a>## [◆ ](#a244d24fa1cc78a23d6f4553d5797ab0b)get\_near\_particle\_group\_index()

 ROCKY\_FUNCTIONS int IRockyContact::get\_near\_particle\_group\_index  ( )  const

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



<a id="aa49e3ddd3916fabf25a90e8fefb5cc4c" name="aa49e3ddd3916fabf25a90e8fefb5cc4c"></a>## [◆ ](#aa49e3ddd3916fabf25a90e8fefb5cc4c)get\_near\_stiffness()

 ROCKY\_FUNCTIONS double IRockyContact::get\_near\_stiffness  ( )  const

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



<a id="aa2479a695d48de98b5caf29d52134b8a" name="aa2479a695d48de98b5caf29d52134b8a"></a>## [◆ ](#aa2479a695d48de98b5caf29d52134b8a)get\_near\_triangle()

 ROCKY\_FUNCTIONS [IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml) IRockyContact::get\_near\_triangle  ( )  const

ReturnsAn `<a class="el" href="structIRockyGeometryTriangle.xhtml">IRockyGeometryTriangle</a>` object representing the *near* geometry triangle in a particle-to-triangle contact. This object gives access to some geometric properties associated to that triangle. 



<a id="a21587a9de6f69f4af1d215c3879fca66" name="a21587a9de6f69f4af1d215c3879fca66"></a>## [◆ ](#a21587a9de6f69f4af1d215c3879fca66)get\_normal\_adhesion\_force()

 ROCKY\_FUNCTIONS double IRockyContact::get\_normal\_adhesion\_force  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a0b773628077520e21f189ab64b8b1e69">IRockyContactScalarsModel::enable_storage_normal_adhesion_force</a>` method. A segmentation fault will occur otherwise. 



<a id="a9e085d9bb5684b5d34c33525bb1d021c" name="a9e085d9bb5684b5d34c33525bb1d021c"></a>## [◆ ](#a9e085d9bb5684b5d34c33525bb1d021c)get\_normal\_contact\_force()

 ROCKY\_FUNCTIONS double IRockyContact::get\_normal\_contact\_force  ( )  const

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



<a id="a379476b7b01576be8fc0eb3f0dde7a1e" name="a379476b7b01576be8fc0eb3f0dde7a1e"></a>## [◆ ](#a379476b7b01576be8fc0eb3f0dde7a1e)get\_normal\_relative\_velocity()

 ROCKY\_FUNCTIONS double IRockyContact::get\_normal\_relative\_velocity  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a30a72264168db13de798df7cdff440c5">IRockyContactScalarsModel::enable_storage_normal_relative_velocity</a>` method. A segmentation fault will occur otherwise. 



<a id="a04a9d6e5ba1478bc00d4955bcaa1a2fd" name="a04a9d6e5ba1478bc00d4955bcaa1a2fd"></a>## [◆ ](#a04a9d6e5ba1478bc00d4955bcaa1a2fd)get\_normal\_unit\_vector()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_normal\_unit\_vector  ( )  const

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



<a id="a26aef3fac3655fe686283be4bd2fe7f0" name="a26aef3fac3655fe686283be4bd2fe7f0"></a>## [◆ ](#a26aef3fac3655fe686283be4bd2fe7f0)get\_overlap()

 ROCKY\_FUNCTIONS double IRockyContact::get\_overlap  ( )  const

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



<a id="af937221f53319cd4a30871829e3cc7e0" name="af937221f53319cd4a30871829e3cc7e0"></a>## [◆ ](#af937221f53319cd4a30871829e3cc7e0)get\_particle\_contact\_scalars()

 ROCKY\_FUNCTIONS [IRockyContactScalars](structIRockyContactScalars.xhtml) IRockyContact::get\_particle\_contact\_scalars  ( )  const

ReturnsAn `<a class="el" href="structIRockyContactScalars.xhtml">IRockyContactScalars</a>` object that gives access to all particle-to-particle contact scalars defined in the project. 



<a id="a4d10fc8ec36500e0a8f6673f3e7628fd" name="a4d10fc8ec36500e0a8f6673f3e7628fd"></a>## [◆ ](#a4d10fc8ec36500e0a8f6673f3e7628fd)get\_previous\_moment\_vector()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_previous\_moment\_vector  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#ab2927b1c13fc4325a5bd28ba97e15230">IRockyContactScalarsModel::enable_previous_moment_vector</a>` method and the module explicitly stored its value in the previous iteration, by using the `<a class="el" href="structIRockyContact.xhtml#a302215189897e9ad39f8d7a3ff571d6c">IRockyContact::set_previous_moment_vector</a>` method. 



<a id="afa684887b3dcfad056850ccfdf399ec3" name="afa684887b3dcfad056850ccfdf399ec3"></a>## [◆ ](#afa684887b3dcfad056850ccfdf399ec3)get\_previous\_normal\_vector()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_previous\_normal\_vector  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a36a468305e9a49ba36de61846260c1f1">IRockyContactScalarsModel::enable_storage_previous_normal_vector</a>` method. A segmentation fault will occur otherwise. 



<a id="ab6c8fca161c75cf870eb059f9ed3b11c" name="ab6c8fca161c75cf870eb059f9ed3b11c"></a>## [◆ ](#ab6c8fca161c75cf870eb059f9ed3b11c)get\_previous\_overlap()

 ROCKY\_FUNCTIONS double IRockyContact::get\_previous\_overlap  ( )  const

ReturnsThe value of the overlap corresponding to the previous timestep. 



<a id="acc8512372077732bfe12aa3483f2e35b" name="acc8512372077732bfe12aa3483f2e35b"></a>## [◆ ](#acc8512372077732bfe12aa3483f2e35b)get\_reduced\_young\_modulus()

 ROCKY\_FUNCTIONS double IRockyContact::get\_reduced\_young\_modulus  ( )  const

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



<a id="a6e335a5d032dded094c6b36ad5ea23c1" name="a6e335a5d032dded094c6b36ad5ea23c1"></a>## [◆ ](#a6e335a5d032dded094c6b36ad5ea23c1)get\_restitution\_coefficient()

 ROCKY\_FUNCTIONS double IRockyContact::get\_restitution\_coefficient  ( )  const

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



<a id="ad0940d0dcefd839aaba3770689a034bb" name="ad0940d0dcefd839aaba3770689a034bb"></a>## [◆ ](#ad0940d0dcefd839aaba3770689a034bb)get\_scale\_factor()

 ROCKY\_FUNCTIONS double IRockyContact::get\_scale\_factor  ( )  const

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



<a id="afe041153be8e43d3e5d7c7a500a49501" name="afe041153be8e43d3e5d7c7a500a49501"></a>## [◆ ](#afe041153be8e43d3e5d7c7a500a49501)get\_sliding\_distance()

 ROCKY\_FUNCTIONS double IRockyContact::get\_sliding\_distance  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a8e8fb75a47341a734ee04707a58f658f">IRockyContactScalarsModel::enable_storage_sliding_distance</a>` method. A segmentation fault will occur otherwise. 



<a id="a9b6c747c62166e351d363d693e18c46a" name="a9b6c747c62166e351d363d693e18c46a"></a>## [◆ ](#a9b6c747c62166e351d363d693e18c46a)get\_static\_friction\_coefficient()

 ROCKY\_FUNCTIONS double IRockyContact::get\_static\_friction\_coefficient  ( )  const

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



<a id="a20d7ffad55e1c1c28c848eb3b09c41f2" name="a20d7ffad55e1c1c28c848eb3b09c41f2"></a>## [◆ ](#a20d7ffad55e1c1c28c848eb3b09c41f2)get\_tangential\_adhesion\_force()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_tangential\_adhesion\_force  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#ab390c75dee689878d04d1db89be3fb95">IRockyContactScalarsModel::enable_storage_tangential_adhesion_force</a>` method. A segmentation fault will occur otherwise. 



<a id="aca5aae0a4d0c2033bbad4da067657704" name="aca5aae0a4d0c2033bbad4da067657704"></a>## [◆ ](#aca5aae0a4d0c2033bbad4da067657704)get\_tangential\_contact\_force()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_tangential\_contact\_force  ( )  const

ReturnsThe 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.   
 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#a5a65f842ce3bea36ee46b346a2741911">IRockyContactScalarsModel::enable_storage_tangential_contact_force</a>` method. 



<a id="a9fab3f0e6f78ea64e96209fbbd540b85" name="a9fab3f0e6f78ea64e96209fbbd540b85"></a>## [◆ ](#a9fab3f0e6f78ea64e96209fbbd540b85)get\_tangential\_relative\_velocity()

 ROCKY\_FUNCTIONS double3 IRockyContact::get\_tangential\_relative\_velocity  ( )  const

ReturnsThe 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#ad8ba6db25bce594fbb62b415b0634a95">IRockyContactScalarsModel::enable_storage_tangential_relative_velocity</a>` method. A segmentation fault will occur otherwise. 



<a id="a4cc9eb65e78d4eb4cbe34bb7c7baf85d" name="a4cc9eb65e78d4eb4cbe34bb7c7baf85d"></a>## [◆ ](#a4cc9eb65e78d4eb4cbe34bb7c7baf85d)get\_timestep()

 ROCKY\_FUNCTIONS double IRockyContact::get\_timestep  ( )  const

ReturnsThe magnitude of the simulation timestep. 



<a id="ab14e84d2a580a95b2fbcb3d1f5c92a25" name="ab14e84d2a580a95b2fbcb3d1f5c92a25"></a>## [◆ ](#ab14e84d2a580a95b2fbcb3d1f5c92a25)get\_triangle\_contact\_scalars()

 ROCKY\_FUNCTIONS [IRockyContactScalars](structIRockyContactScalars.xhtml) IRockyContact::get\_triangle\_contact\_scalars  ( )  const

ReturnsAn `<a class="el" href="structIRockyContactScalars.xhtml">IRockyContactScalars</a>` object that gives access to all particle-to-triangle contact scalars defined in the project. 



<a id="a46453e5b227065edb55c7b67177584f9" name="a46453e5b227065edb55c7b67177584f9"></a>## [◆ ](#a46453e5b227065edb55c7b67177584f9)is\_adhesive()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_adhesive  ( )  const

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



<a id="ae83dc410da7f54a0badbfb0c75fdaa4b" name="ae83dc410da7f54a0badbfb0c75fdaa4b"></a>## [◆ ](#ae83dc410da7f54a0badbfb0c75fdaa4b)is\_frictional()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_frictional  ( )  const

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



<a id="a395c9be7e50adea7317a808279faec0c" name="a395c9be7e50adea7317a808279faec0c"></a>## [◆ ](#a395c9be7e50adea7317a808279faec0c)is\_loading()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_loading  ( )  const

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



<a id="a0a27611118aab7a27fb6c1e53939cba1" name="a0a27611118aab7a27fb6c1e53939cba1"></a>## [◆ ](#a0a27611118aab7a27fb6c1e53939cba1)is\_particle\_particle\_contact()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_particle\_particle\_contact  ( )  const

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



<a id="a9de7fba112ea033f15e8ee1fb0305960" name="a9de7fba112ea033f15e8ee1fb0305960"></a>## [◆ ](#a9de7fba112ea033f15e8ee1fb0305960)is\_particle\_triangle\_contact()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_particle\_triangle\_contact  ( )  const

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



<a id="a79c5a7fb09b962d62eefe61f27cddcd7" name="a79c5a7fb09b962d62eefe61f27cddcd7"></a>## [◆ ](#a79c5a7fb09b962d62eefe61f27cddcd7)is\_positive\_oriented()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_positive\_oriented  ( )  const

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



<a id="abe5cd05335fe5264bc05d9808b23a9fe" name="abe5cd05335fe5264bc05d9808b23a9fe"></a>## [◆ ](#abe5cd05335fe5264bc05d9808b23a9fe)is\_unloading()

 ROCKY\_FUNCTIONS bool IRockyContact::is\_unloading  ( )  const

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



<a id="a52439d8dd07c36c9475eb248d7dcb38e" name="a52439d8dd07c36c9475eb248d7dcb38e"></a>## [◆ ](#a52439d8dd07c36c9475eb248d7dcb38e)just\_finished\_adhesive()

 ROCKY\_FUNCTIONS bool IRockyContact::just\_finished\_adhesive  ( )  const

ReturnsTrue 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.AttentionThis method will work properly only if called within the `ROCKY_PLUGIN_POST_FORCE_ON_FINISHED_CONTACTS` hook. 



<a id="afbda49c86a367e9a4f20492ff5007333" name="afbda49c86a367e9a4f20492ff5007333"></a>## [◆ ](#afbda49c86a367e9a4f20492ff5007333)just\_finished\_frictional()

 ROCKY\_FUNCTIONS bool IRockyContact::just\_finished\_frictional  ( )  const

ReturnsTrue if the contact is frictional and it has finished (the contacting entities stopped touching each other) at the current timestep.AttentionThis method will work properly only if called within the `ROCKY_PLUGIN_POST_FORCE_ON_FINISHED_CONTACTS` hook. 



<a id="a33e06ba2b8ca80ff15946ac27885dbd7" name="a33e06ba2b8ca80ff15946ac27885dbd7"></a>## [◆ ](#a33e06ba2b8ca80ff15946ac27885dbd7)just\_started\_adhesive()

 ROCKY\_FUNCTIONS bool IRockyContact::just\_started\_adhesive  ( )  const

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



<a id="ab280ec2c5bc3fe90ca4822939514d3b5" name="ab280ec2c5bc3fe90ca4822939514d3b5"></a>## [◆ ](#ab280ec2c5bc3fe90ca4822939514d3b5)just\_started\_frictional()

 ROCKY\_FUNCTIONS bool IRockyContact::just\_started\_frictional  ( )  const

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



<a id="aaa4594d0c921983edc1d1033661c6500" name="aaa4594d0c921983edc1d1033661c6500"></a>## [◆ ](#aaa4594d0c921983edc1d1033661c6500)set\_dynamic\_friction\_coefficient()

 ROCKY\_FUNCTIONS void IRockyContact::set\_dynamic\_friction\_coefficient  ( double  *value*) 

This method sets the value of the coefficient of dynamic friction at a frictionalcontact. 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 valueThe value of the coefficient of dynamic friction that must be used in the contact. 



<a id="a302215189897e9ad39f8d7a3ff571d6c" name="a302215189897e9ad39f8d7a3ff571d6c"></a>## [◆ ](#a302215189897e9ad39f8d7a3ff571d6c)set\_previous\_moment\_vector()

 ROCKY\_FUNCTIONS void IRockyContact::set\_previous\_moment\_vector  ( double3  *value*) 

This method allows a module implementing a custom rolling resistance modelto 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 `<a class="el" href="structIRockyContactScalarsModel.xhtml#ab2927b1c13fc4325a5bd28ba97e15230">IRockyContactScalarsModel::enable_previous_moment_vector</a>` 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 valueThe value of the rolling resistance moment just calculated. 



<a id="ad5f45118ba3d4bdedd2194640fc4c79d" name="ad5f45118ba3d4bdedd2194640fc4c79d"></a>## [◆ ](#ad5f45118ba3d4bdedd2194640fc4c79d)set\_restitution\_coefficient()

 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 valueThe value of the coefficient of restitution that must be used in the contact. 



<a id="a5a3233239461058a2f33a9f49494666c" name="a5a3233239461058a2f33a9f49494666c"></a>## [◆ ](#a5a3233239461058a2f33a9f49494666c)set\_static\_friction\_coefficient()

 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 valueThe value of the coefficient of static friction that must be used in the contact.