Skip to main content

Rocky Solver SDK 2026 R1

Structure IRockyDeviceModel

Last update: 09.03.2026

#include

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

Public functions

Function get_timestep

![][const]

ROCKY_FUNCTIONS double IRockyDeviceModel::get_timestep() const

Returns:

The value of the simulation timestep.

Return type: ROCKY_FUNCTIONS double

Function get_current_time

![][const]

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

![][const]

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

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

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:

Return type: ROCKY_FUNCTIONS IRockyCloudPoint

Function get_pair_scalars

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

Function get_geometry_scalars

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

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

Connect with Ansys