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

# IRockyParticle Struct Reference

`#include <rocky_particle_api.hpp>`

## Public Member Functions

| Type | Name |
| - | - |
| ROCKY\_FUNCTIONS [IRockyMaterial](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyMaterial.md) | [get\_material](#a39ab5586c7a893cbe156d211a10c5efd) () const |
| ROCKY\_FUNCTIONS double3 | [get\_centroid\_position](#ab6a1844166c571196740d7cb3e8331a2) () const |
| ROCKY\_FUNCTIONS double | [get\_mass](#a9acf8ddfc5a9c3974e19e616193de571) () const |
| ROCKY\_FUNCTIONS double | [get\_original\_mass](#a0239b6fe520fb1bc69196cf4c7c298ac) () const |
| ROCKY\_FUNCTIONS double | [get\_size](#a702b4bce44c268065cf9961ea88375c3) () const |
| ROCKY\_FUNCTIONS double | [get\_release\_time](#af2ebac6fa5a5f9dbb5c37423ef96c471) () const |
| ROCKY\_FUNCTIONS double | [get\_cgm\_scale\_factor](#ad931e6e8afe554323408148c245a537e) () const |
| ROCKY\_FUNCTIONS double | [get\_volume](#a9a1df9319687462ce0c43b10e691299f) () const |
| ROCKY\_FUNCTIONS double | [get\_solid\_volume](#a0fac38fa13ec5aa6495119247b8aa5d6) () const |
| ROCKY\_FUNCTIONS double | [get\_surface\_area](#a2200149822388403dfd42afe5574f1f9) () const |
| ROCKY\_FUNCTIONS double | [get\_equivalent\_diameter](#a5951469e0997dab052087895e2ebd95c) () const |
| ROCKY\_FUNCTIONS double | [get\_sphericity](#ad60e62be9c1084b624f690d94ce0474b) () const |
| ROCKY\_FUNCTIONS double3 | [get\_translational\_velocity](#a38420bd69fec1d3a803cbc5d79ea0197) () const |
| ROCKY\_FUNCTIONS double3 | [get\_rotational\_velocity](#a1520d3fc8a40e54ad4c47ddb428fddff) () const |
| ROCKY\_FUNCTIONS double | [get\_impact\_energy](#a35881133856b678e30b00dfa1c604b96) () const |
| ROCKY\_FUNCTIONS double | [get\_strength](#a3479e29c70b861ee7724b3dec473f126) () const |
| ROCKY\_FUNCTIONS double3 | [get\_gravity](#a42a986a1659cf8a4374bf43ef6a53f63) () const |
| ROCKY\_FUNCTIONS int | [get\_particle\_group\_index](#a063a7d183c621dfffd7fdd644635e51a) () const |
| ROCKY\_FUNCTIONS int | [get\_material\_index](#a42f25fc898697efc23ee5576b936efa4) () const |
| ROCKY\_FUNCTIONS double | [get\_rolling\_resistance\_coefficient](#ad9ba593e2adb58a8273b23214b14b60b) () const |
| ROCKY\_FUNCTIONS thrust::tuple\< double3, double > | [get\_orientation\_axis\_angle](#adf12c219fb518212af2932b99c39ae52) () const |
| ROCKY\_FUNCTIONS double4 | [get\_orientation\_quaternion](#afd3262f90c7304197e8915b4d40a58f6) () const |
| ROCKY\_FUNCTIONS double3 | [get\_resultant\_force](#ac520e2ca9342f42a1260d42bb1f882a0) () const |
| ROCKY\_FUNCTIONS double3 | [get\_resultant\_moment](#a58a9a71f0e2cd25a475c5681682a8c7e) () const |
| ROCKY\_FUNCTIONS double | [get\_thermal\_conductivity](#a8c3db18d0afb4ebe6d4654d833d904cb) () const |
| ROCKY\_FUNCTIONS void | [set\_thermal\_conductivity](#a876773eeef5269e1335ae8a43cbb2d97) (double value) |
| ROCKY\_FUNCTIONS double | [get\_poisson\_ratio](#a6d11bc8367e406b7a56f98d92871f059) () const |
| ROCKY\_FUNCTIONS void | [set\_poisson\_ratio](#a7225418a496fdaae3dc3ba7bc3d7ebca) (double value) |
| ROCKY\_FUNCTIONS double | [get\_specific\_heat](#a5007ecaea7e26cfe50579a959ba91c07) () const |
| ROCKY\_FUNCTIONS int | [get\_tag](#a2949c9bf228226090d1e7cf95b63c38f) () const |
| ROCKY\_FUNCTIONS void | [set\_specific\_heat](#a6ea5a3cc6356d1b80b3e8cde1fe43211) (double value) |
| ROCKY\_FUNCTIONS [IRockyParticleScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleScalars.md) | [get\_scalars](#a305fe472ba945e793d450053dc3b092f) () |
| ROCKY\_FUNCTIONS const [IRockyParticleScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleScalars.md) | [get\_scalars](#a0899498770cbebb4b538cbc736e82231) () const |
| ROCKY\_FUNCTIONS [IRockyParticleTransferScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleTransferScalars.md) | [get\_transfer\_scalars](#af1bcfda3336619839953a01fbe7828ea) () |
| ROCKY\_FUNCTIONS [IRockyParticleBreakageScalars](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleBreakageScalars.md) | [get\_breakage\_scalars](#a9efea10efd70526b3ffe3f723253e44e) () |
| ROCKY\_FUNCTIONS void | [remove](#a2fdb4c9362bd6b650aba18ad2fb6c66d) () |
| ROCKY\_FUNCTIONS void | [add\_force](#aebc83f532d4bd643046c1c8a93e09f1d) (const double3 \&force) |
| ROCKY\_FUNCTIONS void | [add\_moment](#a8bb789078434998231949cc5c7c5f3b4) (const double3 \&moment) |
| ROCKY\_FUNCTIONS void | [set\_frozen](#ae6c885d84af14576949205c3b9fb5bd5) (bool frozen) |
| ROCKY\_FUNCTIONS void | [disable\_related\_particle\_contacts](#a98c502d7e6af16bbefdb1ff769810980) () |
| ROCKY\_FUNCTIONS void | [enable\_related\_particle\_contacts](#a964a3f27bd8217bbff4301539ecbc1fc) () |
| ROCKY\_FUNCTIONS void | [disable\_related\_triangle\_contacts](#a1c445981cc6ac5392560d863927b4211) () |
| ROCKY\_FUNCTIONS void | [enable\_related\_triangle\_contacts](#a6d87618d43d29b5d2dcd7f5946e1d0f4) () |
| ROCKY\_FUNCTIONS const double3 | [get\_moment\_of\_inertia](#a0ddf76406051617c1cf3ad5602230e74) () const |
| ROCKY\_FUNCTIONS bool | [is\_element](#a0ede768e89206dcba2b8929eefa961e7) () const |
| ROCKY\_FUNCTIONS bool | [is\_assembly](#a7324f759e40ff9147728dd7e666f9816) () const |
| ROCKY\_FUNCTIONS size\_t | [get\_number\_of\_assembly\_parts](#a7174efcf1264a05c6bd5cabe2e927148) () const |
| ROCKY\_FUNCTIONS [IRockyMaterial](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyMaterial.md) | [get\_assembly\_part\_material](#a1a737fd34952d960d93f4f8940fd804e) (size\_t part\_id) const |
| ROCKY\_FUNCTIONS void | [remove\_from\_contacts\_search](#af4d25f3ada35c955fd0fe7ba24a244c4) () |
| ROCKY\_FUNCTIONS void | [add\_to\_contacts\_search](#afe35f545701281de61b805237f4c5d8f) () |

## Detailed Description

[`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticle) is an interface for the internal particle object in Rocky. A particle object is the code representation of an individual particle in a Rocky simulation. It has several access methods to particle-related properties, as well as *particle scalars*, which are special variables that store values per particle that are preserved between time iterations. Values of *particle scalars* can be displayed in a 3D window as any other built-in particle property in Rocky. All property and variable values made available through [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticle) are dimensionless.

## Member Function Documentation

### add\_force()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::add_force(const double3 & force)
```

**This method sums a custom calculated force to the contact and body forces**

acting on the particle.

**Parameters**

| Name | Description |
| - | - |
| force | The custom force vector in Cartesian coordinates. |

### add\_moment()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::add_moment(const double3 & moment)
```

**This method sums a custom calculated moment to the moments**

acting on the particle.

**Parameters**

| Name | Description |
| - | - |
| moment | The custom moment vector in Cartesian coordinates. |

### add\_to\_contacts\_search()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::add_to_contacts_search()
```

**This method enables the detection of all contacts for the particle.**

### disable\_related\_particle\_contacts()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::disable_related_particle_contacts()
```

**This method activates the conditional disabling of particle-to-particle contacts detection.**

A given particle-to-particle contact will be ignored during the detection stage only if this method has been applied to both particles.

### disable\_related\_triangle\_contacts()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::disable_related_triangle_contacts()
```

**This method disables the detection of particle-to-triangle contacts for the particle.**

### enable\_related\_particle\_contacts()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::enable_related_particle_contacts()
```

**This method deactivates the conditional disabling of particle-to-particle contact detection,**

previously activated using the [`IRockyParticle::disable_related_particle_contacts`](#a98c502d7e6af16bbefdb1ff769810980)

### enable\_related\_triangle\_contacts()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::enable_related_triangle_contacts()
```

**This method enables the detection of particle-to-triangle contacts for the particle.**

### get\_assembly\_part\_material()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyMaterial IRockyParticle::get_assembly_part_material(size_t part_id) const
```

**Parameters**

| Name | Description |
| - | - |
| part\_id | The index of an assembly part. |

**Returns**

An [`IRockyMaterial`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyMaterial) object that gives access to the values of physical properties associated to the material from which the assembly part referent to `part_id` is made.

### get\_breakage\_scalars()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticleBreakageScalars IRockyParticle::get_breakage_scalars()
```

**Returns**

An [`IRockyParticleBreakageScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleBreakageScalars) object, that gives access to all particle breakage scalars variables defined in the project.

### get\_centroid\_position()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyParticle::get_centroid_position() const
```

**Returns**

The Cartesian coordinates of the current position of the particle's centroid.

### get\_cgm\_scale\_factor()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_cgm_scale_factor() const
```

**Returns**

The particle's Coarse-grain Modeling (CGM) scale factor.

### get\_equivalent\_diameter()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_equivalent_diameter() const
```

**Returns**

The equivalent diameter of the particle, which is defined as the diameter of a sphere of volume equal to the particle's volume.

### get\_gravity()

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

**Returns**

The gravitational acceleration vector in Cartesian coordinates.

### get\_impact\_energy()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_impact_energy() const
```

**Returns**

The sum of the impact energy registered in all active contacts on the surface of the particle until the current time.

> [!WARNING]
>
> This value will be available only if an instantaneous breakage model is enabled in the simulation.

### get\_mass()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_mass() const
```

**Returns**

The current value of the particle's mass. This value will be different from the original particle's mass only if the mass increment particle scalar is enabled in the simulation.

### get\_material()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyMaterial IRockyParticle::get_material() const
```

**Returns**

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

> [!WARNING]
>
> Invoking this method on assembly particles results on undefined behavior, as assembly particles may have multiple materials. Prefer to use [`IRockyParticle::get_assembly_part_material`](#a1a737fd34952d960d93f4f8940fd804e) instead.

### get\_material\_index()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyParticle::get_material_index() const
```

**Returns**

The material index associated to that particle

### get\_moment\_of\_inertia()

```cpp theme={null}
ROCKY_FUNCTIONS const double3 IRockyParticle::get_moment_of_inertia() const
```

**Returns**

A 3D vector whose components are the principal values of the particle's moment of inertia tensor.

### get\_number\_of\_assembly\_parts()

```cpp theme={null}
ROCKY_FUNCTIONS size_t IRockyParticle::get_number_of_assembly_parts() const
```

**Returns**

The number of parts that compose the assembly.

### get\_orientation\_axis\_angle()

```cpp theme={null}
ROCKY_FUNCTIONS thrust::tuple< double3, double > IRockyParticle::get_orientation_axis_angle(
) const
```

**Returns**

A tuple whose two components define the axis-angle particle orientation. The first one is a three dimensional vector representing the orientation axis, the second one is a single value representing the angle.

### get\_orientation\_quaternion()

```cpp theme={null}
ROCKY_FUNCTIONS double4 IRockyParticle::get_orientation_quaternion() const
```

**Returns**

The quaternion that represents the particle's orientation, expressed as a four-dimensional array $(q_r, q_i, q_j, q_k)$.

### get\_original\_mass()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_original_mass() const
```

**Returns**

The original value of the mass of a particle when it enters into the simulation.

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

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyParticle::get_particle_group_index() const
```

**Returns**

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

### get\_poisson\_ratio()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_poisson_ratio() const
```

**Returns**

The particle's Poisson's ratio value. If this property was defined as variable in the module's specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle's associated material.

### get\_release\_time()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_release_time() const
```

**Returns**

The time at which the particle was released.

### get\_resultant\_force()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyParticle::get_resultant_force() const
```

**Returns**

The resultant force vector acting on the particle, in Cartesian coordinates. This force is a combination of the forces calculated during the current time iteration that are applied on the particle, including contact forces, joint forces, fluid forces, and other forces coming from custom modules. If this method is called before the force calculation stage it will return a zero vector.

> [!WARNING]
>
> The force of gravity acting on the particle is not included in this resultant force.

### get\_resultant\_moment()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyParticle::get_resultant_moment() const
```

**Returns**

The resultant moment vector applied to the particle, in Cartesian coordinates. The resultant moment is the combination of all moments caused by the forces acting upon the particle, including contact forces, joint forces, fluid forces, and other forces coming from custom modules. If this method is called before the force calculation stage it will return a zero vector.

### get\_rolling\_resistance\_coefficient()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_rolling_resistance_coefficient() const
```

**Returns**

The particle's rolling resistance coefficient

### get\_rotational\_velocity()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyParticle::get_rotational_velocity() const
```

**Returns**

The current particle's rotational velocity vector expressed in Cartesian coordinates.

### get\_scalars() \[1/2]

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticleScalars IRockyParticle::get_scalars()
```

**Returns**

An [`IRockyParticleScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleScalars) object, that gives access to all particle scalars variables defined in the project.

### get\_scalars() \[2/2]

```cpp theme={null}
ROCKY_FUNCTIONS const IRockyParticleScalars IRockyParticle::get_scalars() const
```

**Returns**

A const [`IRockyParticleScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleScalars) object, that gives access to all particle scalars variables defined in the project.

### get\_size()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_size() const
```

**Returns**

The current value of the particle's size.

### get\_solid\_volume()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_solid_volume() const
```

**Returns**

The current value of the particle's solid volume. If the particle is porous (porosity > 0), the solid volume is the volume of the solid matrix. Otherwise, the volume returned by this function will coincide with the one returned by the `get_volume` function.

### get\_specific\_heat()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_specific_heat() const
```

**Returns**

The particle's specific heat value. If this property was defined as variable in the module's specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle's associated material.

### get\_sphericity()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_sphericity() const
```

**Returns**

The particle's sphericity value, which is defined as the ratio of $A_s$ to $A_p$, where $A_s$ is the surface area of a sphere with the same volume as the particle, whereas $A_p$ is the surface area of the particle itself. In general terms, the sphericity measures how closely the particle's actual shape resembles the shape of a perfect sphere.

### get\_strength()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_strength() const
```

**Returns**

A random value between 0 and 1 assigned to a particle at the time of generation. This value can be related to the breakage probability in a custom instantaneous breakage model.

### get\_surface\_area()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_surface_area() const
```

**Returns**

The current value of the particle's surface area.

### get\_tag()

```cpp theme={null}
ROCKY_FUNCTIONS int IRockyParticle::get_tag() const
```

**Returns**

The tag value inherited from the tags assigned to the segments of a custom fiber, if the [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticle) object represents an element of a custom fiber. The values of those tags must be specified in the column labeled "tag" in the csv file that defines the geometry of a custom fiber. All elements that arise from the subdivision of a given segment inherit the tag value assigned to that segment. If tags are not defined for a custom fiber or if this function is used with particles which are not elements of a custom fiber, this function will return -1.

### get\_thermal\_conductivity()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_thermal_conductivity() const
```

**Returns**

The particle's thermal conductivity. If this property was defined as variable in the module's specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle's associated material.

### get\_transfer\_scalars()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticleTransferScalars IRockyParticle::get_transfer_scalars()
```

**Returns**

An [`IRockyParticleTransferScalars`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r1/structIRockyParticleTransferScalars) object, that gives access to all particle transfer scalars variables defined in the project.

### get\_translational\_velocity()

```cpp theme={null}
ROCKY_FUNCTIONS double3 IRockyParticle::get_translational_velocity() const
```

**Returns**

The current particle's translational velocity vector expressed in Cartesian coordinates.

### get\_volume()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyParticle::get_volume() const
```

**Returns**

The current value of the particle's volume. If the particle is porous (porosity > 0), the volume returned is the particle's total or bulk volume, that is the volume obtained by summing the solid volume and the pore volume.

### is\_assembly()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyParticle::is_assembly() const
```

**Returns**

True if the given particle is an assembly, false otherwise.

### is\_element()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyParticle::is_element() const
```

**Returns**

True if the given particle is an element within a flexible particle, false otherwise.

### remove()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::remove()
```

**This method removes permanently the particle from the simulation.**

### remove\_from\_contacts\_search()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::remove_from_contacts_search()
```

**This method disables the detection of all contacts for the particle.**

### set\_frozen()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::set_frozen(bool frozen)
```

**This method sets the frozen state of a particle. When the frozen state of a particle**

is set to `true`, the solution of the motion equations for this particle are skipped afterwards.

**Parameters**

| Name | Description |
| - | - |
| frozen | True if the particle should be frozen, false otherwise. |

### set\_poisson\_ratio()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::set_poisson_ratio(double value)
```

**This method sets the Poisson's ratio value for the particle. This operation will**

be allowed only if Poisson's ratio was defined as a variable property for particles in the module's specification file. Otherwise, a segmentation fault will occur.

**Parameters**

| Name | Description |
| - | - |
| value | The Poisson's ratio to be set. |

### set\_specific\_heat()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::set_specific_heat(double value)
```

**This method sets the specific heat value for the particle. This operation will**

be allowed only if Poisson's ratio was defined as a variable property for particles in the module's specification file. Otherwise, a segmentation fault will occur.

**Parameters**

| Name | Description |
| - | - |
| value | The specific heat to be set. |

### set\_thermal\_conductivity()

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyParticle::set_thermal_conductivity(double value)
```

**This method sets the thermal conductivity value for the particle. This operation will**

be allowed only if thermal conductivity was defined as a variable property for particles in the module's specification file. Otherwise, a segmentation fault will occur.

**Parameters**

| Name | Description |
| - | - |
| value | The thermal conductivity to be set. |
