    

 ## On this page

  

 

 # IRockyTriangleScalars Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__triangle__scalars_8hpp_source.xhtml">rocky_triangle_scalars.hpp</a>>`

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

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

ROCKY\_FUNCTIONS double [get\_thermal\_conductivity](#a05684b0ee2ad2ea56b3ed0d627d86cfe) () const ROCKY\_FUNCTIONS void [set\_thermal\_conductivity](#adfb451a883a51e0e52bbb4fb304bdbee) (const double value) ROCKY\_FUNCTIONS double [get\_poisson\_ratio](#ac72837182e4220fc58411bad8db38042) () const ROCKY\_FUNCTIONS void [set\_poisson\_ratio](#abc7a467e91fb2232868c27518c92c844) (const double value) ROCKY\_FUNCTIONS double [get\_exchanged\_heat](#afaf1ed93d75a4a75ad38c31f675decc2) () const ROCKY\_FUNCTIONS double [get\_scalar](#a27cf07c2dd9371c2b26106133266a327) (int scalar\_index) const ROCKY\_FUNCTIONS void [set\_scalar](#a2882608ab8fdf75777d411400604e135) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [add\_scalar](#ab9721444212bd5fe4e3af03fe3a70294) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [max\_scalar](#a6d802b0828e406fd357377d8500625f5) (int scalar\_index, double value) const <a id="details" name="details"></a>## Detailed Description

Triangle scalars are special variables within the Rocky solver that associate a value to each one of the geometry triangles that make up the geometries in the project. When running a simulation, an `<a class="el" href="structIRockyTriangleScalars.xhtml">IRockyTriangleScalars</a>` object gives access to all triangle scalars defined in the project. These triangle scalars can be built-in scalars defined in the solver, or custom triangle scalars defined by the current module or other active modules.



## Member Function Documentation

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

 ROCKY\_FUNCTIONS void IRockyTriangleScalars::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="afaf1ed93d75a4a75ad38c31f675decc2" name="afaf1ed93d75a4a75ad38c31f675decc2"></a>## [◆ ](#afaf1ed93d75a4a75ad38c31f675decc2)get\_exchanged\_heat()

 ROCKY\_FUNCTIONS double IRockyTriangleScalars::get\_exchanged\_heat  ( )  const

ReturnsThe value of the total heat transferred to the triangle by surrounding particles and/or SPH fluid elements, since the last reset. That value is calculated internally by the solver before moving particles and SPH elements. Therefore, in order to get access to the heat value including those of the last time iteration, a custom module must use this function after that point, for instance, at a `ROCKY_PLUGINS_POST_MOVE` hook. Moreover, the heat values are stored only if the `IRockyTriangleScalarsModel::enable_storage_sph_exchanged_heat()` function is called during initialization. If that operation is not done, any call to this function during simulation will cause a segmentation fault. 



<a id="ac72837182e4220fc58411bad8db38042" name="ac72837182e4220fc58411bad8db38042"></a>## [◆ ](#ac72837182e4220fc58411bad8db38042)get\_poisson\_ratio()

 ROCKY\_FUNCTIONS double IRockyTriangleScalars::get\_poisson\_ratio  ( )  const

ReturnsThe value of the Poisson's ratio assigned to the geometry triangle. The Rocky solver has a built-in triangle scalar that once enabled allow triangles to have associated a variable thermal conductivity, which overrides the constant value specified for the geometry's material. 



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

 ROCKY\_FUNCTIONS double IRockyTriangleScalars::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="a05684b0ee2ad2ea56b3ed0d627d86cfe" name="a05684b0ee2ad2ea56b3ed0d627d86cfe"></a>## [◆ ](#a05684b0ee2ad2ea56b3ed0d627d86cfe)get\_thermal\_conductivity()

 ROCKY\_FUNCTIONS double IRockyTriangleScalars::get\_thermal\_conductivity  ( )  const

ReturnsThe value of the thermal conductivity of the geometry triangle. The Rocky solver has a built-in triangle scalar that once enabled allow triangles to have associated a variable thermal conductivity, which overrides the constant value specified for the geometry's material. 



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

 ROCKY\_FUNCTIONS void IRockyTriangleScalars::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="abc7a467e91fb2232868c27518c92c844" name="abc7a467e91fb2232868c27518c92c844"></a>## [◆ ](#abc7a467e91fb2232868c27518c92c844)set\_poisson\_ratio()

 ROCKY\_FUNCTIONS void IRockyTriangleScalars::set\_poisson\_ratio  ( const double *value*) 

This method sets the value of the Poisson's ratio for the associated geometrytriangle, if the corresponding built-in triangle scalar was enabled. Otherwise, a segmentation fault will occur.Parameters valueThe value of the Poisson's ratio for the geometry triangle. 



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

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



<a id="adfb451a883a51e0e52bbb4fb304bdbee" name="adfb451a883a51e0e52bbb4fb304bdbee"></a>## [◆ ](#adfb451a883a51e0e52bbb4fb304bdbee)set\_thermal\_conductivity()

 ROCKY\_FUNCTIONS void IRockyTriangleScalars::set\_thermal\_conductivity  ( const double *value*) 

This method sets the value of the thermal conductivity for the associated geometrytriangle, if the corresponding built-in triangle scalar was enabled. Otherwise, a segmentation fault will occur.Parameters valueThe value of the triangle's thermal conductivity.