    

 ## On this page

  

 

 # IRockyDeviceModel Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__model__api_8hpp_source.xhtml">rocky_model_api.hpp</a>>`

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

ROCKY\_FUNCTIONS double [get\_timestep](#ab03adbadfc1d2a7a8f3a1f849be73d1a) () const ROCKY\_FUNCTIONS double [get\_current\_time](#a089a84ac233a433ac17ac46fbbb229b3) () const ROCKY\_FUNCTIONS double3 [get\_gravity](#ac59cb9db0136afc98b82bfb07573101a) () const ROCKY\_FUNCTIONS void [set\_gravity](#a9980c5362764f3bf7a159ccd7865d947) (const double3 &amp;gravity) ROCKY\_FUNCTIONS [IRockyCloudPoint](structIRockyCloudPoint.xhtml) [get\_particle\_cloud\_point](#ac4d4eb7321ad6815176bda70de368c17) (int point\_cloud\_index, const [IRockyParticle](structIRockyParticle.xhtml) &amp;particle) ROCKY\_FUNCTIONS [IRockyPairScalars](structIRockyPairScalars.xhtml) [get\_pair\_scalars](#a380db6692ee5fe3c15b52d62cef723cd) (int pair\_index) ROCKY\_FUNCTIONS [IRockyGeometryScalars](structIRockyGeometryScalars.xhtml) [get\_geometry\_scalars](#a9bd2b236ca0c6f7859924b0ed588c584) (int geometry\_index) <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockyDeviceModel.xhtml">IRockyDeviceModel</a>` includes auxiliary functions that are available only during the execution of a simulation. Hooks such as `ROCKY_PLUGIN_PRE_FORCE...`, `ROCKY_PLUGIN_POST_FORCE...`, and `ROCKY_PLUGIN_PRE_MOVE...`, provide an `<a class="el" href="structIRockyDeviceModel.xhtml">IRockyDeviceModel</a>` object as a parameter.



## Member Function Documentation

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

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

ReturnsThe value of the current time in the simulation. 



<a id="a9bd2b236ca0c6f7859924b0ed588c584" name="a9bd2b236ca0c6f7859924b0ed588c584"></a>## [◆ ](#a9bd2b236ca0c6f7859924b0ed588c584)get\_geometry\_scalars()

 ROCKY\_FUNCTIONS [IRockyGeometryScalars](structIRockyGeometryScalars.xhtml) IRockyDeviceModel::get\_geometry\_scalars  ( int *geometry\_index*) 

ReturnsAn `<a class="el" href="structIRockyGeometryScalars.xhtml">IRockyGeometryScalars</a>` object, that gives access to all geometry scalars defined in a project.Parameters geometry\_indexThe index that identifies a specific geometry within a Rocky project. 



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

 ROCKY\_FUNCTIONS double3 IRockyDeviceModel::get\_gravity  ( )  const

This functions returns the current gravity accelerationin the simulation.ReturnsA `double3` value representing the current gravity acceleration vector in Cartesian Coordinates. 



<a id="a380db6692ee5fe3c15b52d62cef723cd" name="a380db6692ee5fe3c15b52d62cef723cd"></a>## [◆ ](#a380db6692ee5fe3c15b52d62cef723cd)get\_pair\_scalars()

 ROCKY\_FUNCTIONS [IRockyPairScalars](structIRockyPairScalars.xhtml) IRockyDeviceModel::get\_pair\_scalars  ( int *pair\_index*) 

ReturnsAn `<a class="el" href="structIRockyPairScalars.xhtml">IRockyPairScalars</a>` object, that gives access to all pair scalars defined in a project.Parameters pair\_indexThe index that identifies a specific pair of particle groups or a pair formed by a particle group and a geometry. 



<a id="ac4d4eb7321ad6815176bda70de368c17" name="ac4d4eb7321ad6815176bda70de368c17"></a>## [◆ ](#ac4d4eb7321ad6815176bda70de368c17)get\_particle\_cloud\_point()

 ROCKY\_FUNCTIONS [IRockyCloudPoint](structIRockyCloudPoint.xhtml) IRockyDeviceModel::get\_particle\_cloud\_point  ( int *point\_cloud\_index*,    const [IRockyParticle](structIRockyParticle.xhtml) &amp; *particle* )

This function gets an auxiliary object that gives accessto cloud point values of the nearest point to a given particle.Parameters point\_cloud\_indexThe index that uniquely identifies a point cloud dataset.particleA `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` whose position is used to determine the nearest cloud point.ReturnsAn `IRockyParticleCloudPoint` object, which can be used to get cloud point values of the nearest point to the particle passed as argument. For more information about point clouds, please refer to the Rocky User Manual. 



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

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

ReturnsThe value of the simulation timestep. 



<a id="a9980c5362764f3bf7a159ccd7865d947" name="a9980c5362764f3bf7a159ccd7865d947"></a>## [◆ ](#a9980c5362764f3bf7a159ccd7865d947)set\_gravity()

 ROCKY\_FUNCTIONS void IRockyDeviceModel::set\_gravity  ( const double3 &amp; *gravity*) 

This function sets the gravity acceleration to be usedglobally in the simulation from that time onward.Parameters gravityA `double3` value representing the gravity acceleration vector in Cartesian Coordinates.