Skip to main content

Rocky Solver SDK 2024 R2

IRockyTriangleScalars Struct Reference

Last update: 17.07.2025

#include <rocky_triangle_scalars.hpp>

Inherits EntityScalars< rocky20::TriangleScalars >.

Public Member Functions

ROCKY_FUNCTIONS double get_thermal_conductivity () const
 
ROCKY_FUNCTIONS void set_thermal_conductivity (const double value)
 
ROCKY_FUNCTIONS double get_poisson_ratio () const
 
ROCKY_FUNCTIONS void set_poisson_ratio (const double value)
 
ROCKY_FUNCTIONS double get_exchanged_heat () const
 
ROCKY_FUNCTIONS double get_scalar (int scalar_index) const
 
ROCKY_FUNCTIONS void set_scalar (int scalar_index, double value) const
 
ROCKY_FUNCTIONS void add_scalar (int scalar_index, double value) const
 
ROCKY_FUNCTIONS void max_scalar (int scalar_index, double value) const
 

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 IRockyTriangleScalars 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

◆ 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.

◆ get_exchanged_heat()

ROCKY_FUNCTIONS double IRockyTriangleScalars::get_exchanged_heat ( ) const
Returns
The 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.

◆ get_poisson_ratio()

ROCKY_FUNCTIONS double IRockyTriangleScalars::get_poisson_ratio ( ) const
Returns
The 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.

◆ 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.
Returns
The value currently stored in the scalar variable.

◆ get_thermal_conductivity()

ROCKY_FUNCTIONS double IRockyTriangleScalars::get_thermal_conductivity ( ) const
Returns
The 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.

◆ 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.

◆ 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 geometry
triangle, 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.

◆ 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.

◆ 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 geometry
triangle, if the corresponding built-in triangle scalar was enabled. Otherwise, a segmentation fault will occur.
Parameters
valueThe value of the triangle's thermal conductivity.

Connect with Ansys