    

 ## On this page

  

 

 # IRockyPairScalars Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__pair__scalars_8hpp_source.xhtml">rocky_pair_scalars.hpp</a>>`

Inherits EntityScalars&lt; rocky20::PairScalars &gt;.

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

ROCKY\_FUNCTIONS double [get\_scalar](#a2115866634ce54e7425ab949bb87d006) (int scalar\_index) const ROCKY\_FUNCTIONS void [set\_scalar](#a5b7525f5f3d361571c0a2de51c61f189) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [add\_scalar](#ac4629dbc764141b132b43a4ed53c1412) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [max\_scalar](#ac5e39d90b8b54baf30023e7665d55555) (int scalar\_index, double value) const <a id="details" name="details"></a>## Detailed Description

When running a simulation, an `<a class="el" href="structIRockyPairScalars.xhtml">IRockyPairScalars</a>` gives access to all pair scalars defined in the project. Pair scalars are special variables with a value attached to every combination of two particle groups and with each combination of a particle group and a geometry.



## Member Function Documentation

<a id="ac4629dbc764141b132b43a4ed53c1412" name="ac4629dbc764141b132b43a4ed53c1412"></a>## [◆ ](#ac4629dbc764141b132b43a4ed53c1412)add\_scalar()

 ROCKY\_FUNCTIONS void IRockyPairScalars::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\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueThe value that must be summed to the current stored value.  




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

 ROCKY\_FUNCTIONS double IRockyPairScalars::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\_indexThe integer index that was associated to the scalar variable during the setup of the module.ReturnsThe value currently stored in the scalar variable. 



<a id="ac5e39d90b8b54baf30023e7665d55555" name="ac5e39d90b8b54baf30023e7665d55555"></a>## [◆ ](#ac5e39d90b8b54baf30023e7665d55555)max\_scalar()

 ROCKY\_FUNCTIONS void IRockyPairScalars::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\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueA value that must be checked if it is greater than the current stored value. 



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

 ROCKY\_FUNCTIONS void IRockyPairScalars::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\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueThe value that must be stored.