    

 ## On this page

  

 

 # IRockyParticleTransferScalarsModel Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__particle__scalars_8hpp_source.xhtml">rocky_particle_scalars.hpp</a>>`

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

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

int [find](#a6d1850250b4509904702af664aed3e26) (const char \*name) int [add](#acbfca5e53543c5617fe3197d57bcb011) (const char \*name, const char \*unit, bool output=true) void [reset](#a631c82eba37e60df503645f60d8ddd24) (int scalar\_index) void [set\_dimension](#a6d5cd79b547774f98c5c692afe75a87f) (int scalar\_index, double dimension\_factor) <a id="details" name="details"></a>## Detailed Description

An `<a class="el" href="structIRockyParticleTransferScalarsModel.xhtml">IRockyParticleTransferScalarsModel</a>` allows users to add new particle transfer scalars, find particle transfer scalars created in other modules or activate particle transfer scalars known to Rocky, during the setup stage of a module. Particle transfer scalars are special particle scalars whose values are reset automatically to zero at the beginning of a new time iteration.



## Member Function Documentation

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

 int IRockyParticleTransferScalarsModel::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="a6d1850250b4509904702af664aed3e26" name="a6d1850250b4509904702af664aed3e26"></a>## [◆ ](#a6d1850250b4509904702af664aed3e26)find()

 int IRockyParticleTransferScalarsModel::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="a631c82eba37e60df503645f60d8ddd24" name="a631c82eba37e60df503645f60d8ddd24"></a>## [◆ ](#a631c82eba37e60df503645f60d8ddd24)reset()

 void IRockyParticleTransferScalarsModel::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="a6d5cd79b547774f98c5c692afe75a87f" name="a6d5cd79b547774f98c5c692afe75a87f"></a>## [◆ ](#a6d5cd79b547774f98c5c692afe75a87f)set\_dimension()

 void IRockyParticleTransferScalarsModel::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.