    

 ## On this page

  

 

 # IRockyContactScalars Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__contact__scalars_8hpp_source.xhtml">rocky_contact_scalars.hpp</a>>`

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

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

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

During the iterative process of a simulation, `<a class="el" href="structIRockyContactScalars.xhtml">IRockyContactScalars</a>` gives access to all contact scalars defined in the project. These contact scalars can be built-in scalars defined in the Rocky solver, as well as custom contact scalars defined by the current module or other active modules.



## Member Function Documentation

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

 ROCKY\_FUNCTIONS void IRockyContactScalars::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="ad4f28cca964b58258b7011f0dc59040d" name="ad4f28cca964b58258b7011f0dc59040d"></a>## [◆ ](#ad4f28cca964b58258b7011f0dc59040d)get\_scalar()

 ROCKY\_FUNCTIONS double IRockyContactScalars::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="a6413332aeb968cdc28e96a351deb3bcb" name="a6413332aeb968cdc28e96a351deb3bcb"></a>## [◆ ](#a6413332aeb968cdc28e96a351deb3bcb)max\_scalar()

 ROCKY\_FUNCTIONS void IRockyContactScalars::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="abdde96805bdced6ebf4f7c2a1b5d9a70" name="abdde96805bdced6ebf4f7c2a1b5d9a70"></a>## [◆ ](#abdde96805bdced6ebf4f7c2a1b5d9a70)set\_scalar()

 ROCKY\_FUNCTIONS void IRockyContactScalars::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.