    

 ## On this page

  

 

 # IRockyGeometryScalarsModel Struct Reference

 Last update: 17.07.2025 

`#include <<a class="el" href="rocky__boundary__scalars_8hpp_source.xhtml">rocky_boundary_scalars.hpp</a>>`

Inherits ScalarsModel&lt; rocky20::BoundaryScalarsController &gt;.

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

[IRockyStatisticsAdder](structIRockyStatisticsAdder.xhtml) \* [get\_statistics\_adder\_array](structIRockyGeometryScalarsModel.xhtml#a1cc2456dbf51f7f97c9cfd4c08fd890b) (int scalar\_index) [IRockyStatisticsAccumulator](structIRockyStatisticsAccumulator.xhtml) \* [get\_statistics\_accumulator\_array](structIRockyGeometryScalarsModel.xhtml#af5e62356931688660f277719ca88ff2c) (int scalar\_index) int [find](structIRockyGeometryScalarsModel.xhtml#a8605e8eb24231ebdcbd9087602aa64fa) (const char \*name) int [add](structIRockyGeometryScalarsModel.xhtml#ac5361e4dec1e3d63aa923b3576d8cb69) (const char \*name, const char \*unit, bool output=true) void [reset](structIRockyGeometryScalarsModel.xhtml#a0c029b4e23f71891ed12a704f0f0cde4) (int scalar\_index) void [set\_dimension](structIRockyGeometryScalarsModel.xhtml#aa7148cfa90081ff19a8fda5e7e1cb379) (int scalar\_index, double dimension\_factor) <a id="details" name="details"></a>## Detailed Description

An `<a class="el" href="structIRockyGeometryScalarsModel.xhtml">IRockyGeometryScalarsModel</a>` object allows users to create and configure custom geometry scalars. Geometry scalars are special variables that can have a value associated to every geometry defined in the project.



## Member Function Documentation

<a id="ac5361e4dec1e3d63aa923b3576d8cb69" name="ac5361e4dec1e3d63aa923b3576d8cb69"></a>## [◆ ](#ac5361e4dec1e3d63aa923b3576d8cb69)add()

 int IRockyGeometryScalarsModel::add  ( const char \*  *name*,    const char \*  *unit*,    bool  *output* = `true`   ) 

This method creates a new scalar variable of type `double`for storing custom values during a simulation, preserving them between time iterations.Parameters nameThe name given to the scalar variable. The purpose of this name is twofold. First, it enables to find this scalar variable from other module, in order to share their values. Second, if the scalar variable can be displayed in a 3D window as a property, this name will identify it in the Rocky UI.unitA string specifying the unit in S.I. associated to the scalar variable.outputEnables/disables the storage in disk at output times, for the visualization and post-processing of the scalar values.ReturnsThe index that will uniquely identify the scalar variable during the execution of the simulation. 



<a id="a8605e8eb24231ebdcbd9087602aa64fa" name="a8605e8eb24231ebdcbd9087602aa64fa"></a>## [◆ ](#a8605e8eb24231ebdcbd9087602aa64fa)find()

 int IRockyGeometryScalarsModel::find  ( const char \*  *name*) 

This method searches for a scalar variable already created by other modules,in order to allow access to its values, or store new values on it, during the execution of the simulation.Parameters nameThe name given to the scalar at the moment of its creation.ReturnsThe index that uniquely identifies the wanted scalar if it was actually found. It returns -1 otherwise. 



<a id="af5e62356931688660f277719ca88ff2c" name="af5e62356931688660f277719ca88ff2c"></a>## [◆ ](#af5e62356931688660f277719ca88ff2c)get\_statistics\_accumulator\_array()

 [IRockyStatisticsAccumulator](structIRockyStatisticsAccumulator.xhtml) \* IRockyGeometryScalarsModel::get\_statistics\_accumulator\_array  ( int  *scalar\_index*) 

ReturnsThe array of all `<a class="el" href="structIRockyStatisticsAccumulator.xhtml">IRockyStatisticsAccumulator</a>` objects currently stored in a given scalar. The size of this array will be equal to the number of geometries in the project, and the contained objects will be ordered according to the geometry indexes.Parameters scalar\_indexThe index that identifies the scalar, attributed when it was created. 



<a id="a1cc2456dbf51f7f97c9cfd4c08fd890b" name="a1cc2456dbf51f7f97c9cfd4c08fd890b"></a>## [◆ ](#a1cc2456dbf51f7f97c9cfd4c08fd890b)get\_statistics\_adder\_array()

 [IRockyStatisticsAdder](structIRockyStatisticsAdder.xhtml) \* IRockyGeometryScalarsModel::get\_statistics\_adder\_array  ( int  *scalar\_index*) 

ReturnsThe array of all `<a class="el" href="structIRockyStatisticsAdder.xhtml">IRockyStatisticsAdder</a>` objects currently stored in a given scalar. The size of this array will be equal to the number of geometries in the project, and the contained objects will be ordered according to the geometry indexes.Parameters scalar\_indexThe index that identifies the scalar, attributed when it was created. 



<a id="a0c029b4e23f71891ed12a704f0f0cde4" name="a0c029b4e23f71891ed12a704f0f0cde4"></a>## [◆ ](#a0c029b4e23f71891ed12a704f0f0cde4)reset()

 void IRockyGeometryScalarsModel::reset  ( int  *scalar\_index*) 

This method resets to zero all values stored in a scalar variable.Parameters scalar\_indexThe index attributed to the scalar variable at the moment of its creation. 



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

 void IRockyGeometryScalarsModel::set\_dimension  ( int  *scalar\_index*,    double  *dimension\_factor*   ) 

The purpose of this method is to associate a dimensional factorto a scalar variable. This factor will be used to nondimensionalize their values. For instance, if the scalar represents a force, a force dimensional factor must be associated through this method. Dimensional factors for the fundamental magnitudes are provided by functions of a `<a class="el" href="structIRockyModel.xhtml">IRockyModel</a>` object.Parameters scalar\_indexThe index attributed to the scalar variable at the moment of its creation.dimension\_factorThe appropriate dimensional factor for the scalar variable.