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

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

**#include \<rocky\_boundary\_scalars.hpp>**

When running a simulation, an `IRockyGeometryScalars` gives access to all geometry scalars defined in the project. Geometry scalars are special variables with a different value associated to every geometry in a project.

**Inherits from**:

* EntityScalars\< rocky20::BoundaryScalars >

## Members

* [add\_scalar](#structIRockyGeometryScalars_1a870beada21c47f75239b2f523e1dfca1)
* [get\_scalar](#structIRockyGeometryScalars_1aa943cd14cadc5673b99e273f135e82e1)
* [max\_scalar](#structIRockyGeometryScalars_1aa5bd66e1850855de607d9499a7dfc0b4)
* [set\_scalar](#structIRockyGeometryScalars_1a566039747df70cbffa7bba5225906a5e)

## Public functions

### Function get\_scalar

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

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyGeometryScalars::get_scalar(int scalar_index) const
```

**If a custom scalar variable was defined during the setup of the module,**:

the value currently stored can be accessed with this method.

**Parameters**:

* **scalar\_index**: The integer index that was associated to the scalar variable during the setup of the module.

**Returns**:

The value currently stored in the scalar variable.

**Parameters**:

* int **scalar\_index**

**Return type**: ROCKY\_FUNCTIONS double

### Function set\_scalar

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

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyGeometryScalars::set_scalar(int scalar_index, double value) const
```

**If a custom scalar variable was defined during the setup of the module,**:

this method can be used to store a value on it.

**Parameters**:

* **scalar\_index**: The integer index that was associated to the scalar variable during the setup of the module.
* **value**: The value that must be stored.

**Parameters**:

* int **scalar\_index**
* double **value**

**Return type**: ROCKY\_FUNCTIONS void

### Function add\_scalar

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

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyGeometryScalars::add_scalar(int scalar_index, double value) const
```

**If a custom scalar variable was defined during the setup of the module,**:

this method can be used to sum a value to the current one stored in it.

**Parameters**:

* **scalar\_index**: The integer index that was associated to the scalar variable during the setup of the module.
* **value**: The value that must be summed to the current stored value.\


**Parameters**:

* int **scalar\_index**
* double **value**

**Return type**: ROCKY\_FUNCTIONS void

### Function max\_scalar

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

```cpp theme={null}
ROCKY_FUNCTIONS void IRockyGeometryScalars::max_scalar(int scalar_index, double value) const
```

**If a custom scalar variable was defined during the setup of the module,**:

this method can be used to make the scalar store the maximum of a set of values. A common use of this method is, for instance, to find the maximum among a set of values associated to the contacts of a particle.

**Parameters**:

* **scalar\_index**: The integer index that was associated to the scalar variable during the setup of the module.
* **value**: A value that must be checked if it is greater than the current stored value.

**Parameters**:

* int **scalar\_index**
* double **value**

**Return type**: ROCKY\_FUNCTIONS void

[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"
