Skip to main content

Rocky Solver SDK 2024 R2

IRockyPairScalarsModel Struct Reference

Last update: 08.07.2024

#include <rocky_pair_scalars.hpp>

Inherits ScalarsModel< rocky20::PairScalarsController >.

Public Member Functions

IRockyStatisticsAdderget_statistics_adder_array (int scalar_index)
 
IRockyStatisticsAccumulatorget_statistics_accumulator_array (int scalar_index)
 
int find (const char *name)
 
int add (const char *name, const char *unit, bool output=true)
 
void reset (int scalar_index)
 
void set_dimension (int scalar_index, double dimension_factor)
 

Detailed Description

An IRockyPairScalarsModel object allows users to create and configure custom pair scalars. Pair scalars are special variables with a value attached to every combination of two particle groups and each combination of a particle group and a geometry. Their typical use is the accumulation of collision data for inter-group collision statistics, but they can be used in any other application in which it is necessary to associate values to such combination pairs.

Member Function Documentation

◆ add()

int IRockyPairScalarsModel::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.
Returns
The index that will uniquely identify the scalar variable during the execution of the simulation.

◆ find()

int IRockyPairScalarsModel::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.
Returns
The index that uniquely identifies the wanted scalar if it was actually found. It returns -1 otherwise.

◆ get_statistics_accumulator_array()

IRockyStatisticsAccumulator * IRockyPairScalarsModel::get_statistics_accumulator_array ( int  scalar_index)
Returns
The array of all IRockyStatisticsAccumulator objects currently stored in a given scalar. The size of this array will be the number of combinations between particle groups plus the number of combinations between particle groups and geometries in a project.
Parameters
scalar_indexThe index that identifies the scalar, attributed when it was created.

◆ get_statistics_adder_array()

IRockyStatisticsAdder * IRockyPairScalarsModel::get_statistics_adder_array ( int  scalar_index)
Returns
The array of all IRockyStatisticsAdder objects currently stored in a given scalar. The size of this array will be the number of combinations between particle groups plus the number of combinations between particle groups and geometries in a project.
Parameters
scalar_indexThe index that identifies the scalar, attributed when it was created.

◆ reset()

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

◆ set_dimension()

void IRockyPairScalarsModel::set_dimension ( int  scalar_index,
double  dimension_factor 
)

The purpose of this method is to associate a dimensional factor
to 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 IRockyModel 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.