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

# Structure IRockyDeviceModel

![][C++]
![][public]

**#include \<rocky\_model\_api.hpp>**

`IRockyDeviceModel` 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 `IRockyDeviceModel` object as a parameter.

## Members

* [get\_current\_time](#structIRockyDeviceModel_1a089a84ac233a433ac17ac46fbbb229b3)
* [get\_geometry\_scalars](#structIRockyDeviceModel_1a9bd2b236ca0c6f7859924b0ed588c584)
* [get\_gravity](#structIRockyDeviceModel_1ac59cb9db0136afc98b82bfb07573101a)
* [get\_pair\_scalars](#structIRockyDeviceModel_1a380db6692ee5fe3c15b52d62cef723cd)
* [get\_particle\_cloud\_point](#structIRockyDeviceModel_1ac4d4eb7321ad6815176bda70de368c17)
* [get\_timestep](#structIRockyDeviceModel_1ab03adbadfc1d2a7a8f3a1f849be73d1a)
* [set\_gravity](#structIRockyDeviceModel_1a9980c5362764f3bf7a159ccd7865d947)

## Public functions

### Function get\_timestep

![][public]
![][const]

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

**Returns**:

The value of the simulation timestep.

**Return type**: ROCKY\_FUNCTIONS double

### Function get\_current\_time

![][public]
![][const]

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

**Returns**:

The value of the current time in the simulation.

**Return type**: ROCKY\_FUNCTIONS double

### Function get\_gravity

![][public]
![][const]

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyDeviceModel::get_gravity() const
```

**This functions returns the current gravity acceleration**:

in the simulation.

**Returns**:

A `double3` value representing the current gravity acceleration vector in Cartesian Coordinates.

**Return type**: ROCKY\_FUNCTIONS double3

### Function set\_gravity

![][public]

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyDeviceModel::set_gravity(const double3 &gravity)
```

**This function sets the gravity acceleration to be used**:

globally in the simulation from that time onward.

**Parameters**:

* **gravity**: A `double3` value representing the gravity acceleration vector in Cartesian Coordinates.

**Parameters**:

* const double3 & **gravity**

**Return type**: ROCKY\_FUNCTIONS void

### Function get\_particle\_cloud\_point

![][public]

```cpp theme={null}
ROCKY_FUNCTIONS IRockyCloudPoint IRockyDeviceModel::get_particle_cloud_point(int point_cloud_index, const IRockyParticle &particle)
```

**This function gets an auxiliary object that gives access**:

to cloud point values of the nearest point to a given particle.

**Parameters**:

* **point\_cloud\_index**: The index that uniquely identifies a point cloud dataset.
* **particle**: A `IRockyParticle` whose position is used to determine the nearest cloud point.

**Returns**:

An `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.

**Parameters**:

* int **point\_cloud\_index**
* const [IRockyParticle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/structIRockyParticle.md) & **particle**

**Return type**: ROCKY\_FUNCTIONS [IRockyCloudPoint](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/structIRockyCloudPoint.md)

### Function get\_pair\_scalars

![][public]

```cpp theme={null}
ROCKY_FUNCTIONS IRockyPairScalars IRockyDeviceModel::get_pair_scalars(int pair_index)
```

**Returns**:

An `IRockyPairScalars` object, that gives access to all pair scalars defined in a project.

**Parameters**:

* **pair\_index**: The index that identifies a specific pair of particle groups or a pair formed by a particle group and a geometry.

**Parameters**:

* int **pair\_index**

**Return type**: ROCKY\_FUNCTIONS [IRockyPairScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/structIRockyPairScalars.md)

### Function get\_geometry\_scalars

![][public]

```cpp theme={null}
ROCKY_FUNCTIONS IRockyGeometryScalars IRockyDeviceModel::get_geometry_scalars(int geometry_index)
```

**Returns**:

An `IRockyGeometryScalars` object, that gives access to all geometry scalars defined in a project.

**Parameters**:

* **geometry\_index**: The index that identifies a specific geometry within a Rocky project.

**Parameters**:

* int **geometry\_index**

**Return type**: ROCKY\_FUNCTIONS [IRockyGeometryScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/structIRockyGeometryScalars.md)

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

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[const]: https://img.shields.io/badge/-const-lightblue "const"
