Skip to main content

Rocky Solver SDK 2024 R2

IRockyModel Struct Reference

Last update: 08.07.2024

#include <rocky_api.h>

Public Member Functions

double get_softening_factor () const
 
double get_timestep () const
 
void trigger_update_timestep () const
 
bool is_thermal_simulation () const
 
bool has_adhesion () const
 
void set_adhesive_distance (int home_index, int near_index, double adhesive_distance)
 
void set_minimum_restitution_coefficient (int home_index, int near_index, double minimum_restitution)
 
IRockyInteractionCalculationsData get_interactions_data () const
 
IRockyContactDataRecorder get_contact_data_recorder () const
 
int get_number_of_particle_groups () const
 
int get_number_of_particles () const
 
int get_number_of_geometries () const
 
int get_number_of_materials () const
 
int get_number_of_material_interactions () const
 
std::string get_geometry_name (int geometry_index) const
 
std::string get_particle_group_name (int particle_group_index) const
 
EBoundaryType get_geometry_type (int geometry_index) const
 
IRockyParticleScalarsModel get_particle_scalars () const
 
IRockyParticleTransferScalarsModel get_particle_transfer_scalars () const
 
IRockyParticleBreakageScalarsModel get_particle_breakage_scalars () const
 
IRockyJointScalarsModel get_joint_scalars () const
 
IRockyPairScalarsModel get_pair_scalars () const
 
IRockyGeometryScalarsModel get_geometry_scalars () const
 
IRockyTriangleScalarsModel get_triangle_scalars () const
 
IRockyContactScalarsModel get_particle_contact_scalars () const
 
IRockyContactScalarsModel get_triangle_contact_scalars () const
 
double get_current_time () const
 
double get_output_interval () const
 
int get_number_of_active_particles () const
 
int get_number_of_active_triangles ()
 
int get_number_of_processes () const
 
int get_number_of_devices () const
 
int get_device_id (int device_index) const
 
int find_point_cloud (const std::string &name)
 
int find_point_cloud_property (int point_cloud_index, const std::string &property_name)
 
void set_point_cloud_property_dimension (int point_cloud_index, int property_index, double dimension)
 
IRockyCurveCollectionData get_curve_collections () const
 
double get_length_factor () const
 
double get_mass_factor () const
 
double get_time_factor () const
 
double get_temperature_factor () const
 
double get_force_factor () const
 
double get_pressure_factor () const
 
double get_energy_factor () const
 

Detailed Description

IRockyModel includes auxiliary functions for setting up a custom module. Most of the preprocessing methods (such as ROCKY_PLUGIN_SETUP, ROCKY_PLUGIN_INITIALIZE, ROCKY_PLUGIN_NON_DIMENSIONALIZE, etc) provide an IRockyModel object as an argument.

Member Function Documentation

◆ find_point_cloud()

int IRockyModel::find_point_cloud ( const std::string &  name)
This method searches for a point cloud dataset in the project, by name.
Parameters
nameThe name given to the point cloud in the Rocky UI.
Returns
The index that uniquely identifies the wanted point cloud, if it was actually found. It returns -1 otherwise.

◆ find_point_cloud_property()

int IRockyModel::find_point_cloud_property ( int  point_cloud_index,
const std::string &  property_name 
)
This method searches for a specific property name in a point cloud dataset
imported into Rocky.
Parameters
point_cloud_indexThe index that uniquely identifies the point cloud.
property_nameThe name given to the property in the file defining the point cloud.
Returns
The index that uniquely identifies the wanted point cloud property, if it was actually found. It returns -1 otherwise.

◆ get_contact_data_recorder()

IRockyContactDataRecorder IRockyModel::get_contact_data_recorder ( ) const
Returns
An IRockyContactDataRecorder object which allows a module to configure which physical magnitudes the internal contact data recorder will record for use in statistics processing later on.

◆ get_current_time()

double IRockyModel::get_current_time ( ) const
Returns
The value of the current simulation time.

◆ get_curve_collections()

IRockyCurveCollectionData IRockyModel::get_curve_collections ( ) const
Returns
An IRockyCurveCollectionData object which allows to create and manage custom time curves and/or custom cross-plot curves that can be displayed in the Rocky UI.

◆ get_device_id()

int IRockyModel::get_device_id ( int  device_index) const
Returns
The index that identifies a given device when running a simulation in multi-GPU.

◆ get_energy_factor()

double IRockyModel::get_energy_factor ( ) const
Returns
The energy factor in Joule, used to nondimensionalize energy parameters.

◆ get_force_factor()

double IRockyModel::get_force_factor ( ) const
Returns
The force factor in Newton, used to nondimensionalize force parameters.

◆ get_geometry_name()

std::string IRockyModel::get_geometry_name ( int  geometry_index) const
Returns
The name given in the Rocky UI the geometry identified by geometry_index.

◆ get_geometry_scalars()

IRockyGeometryScalarsModel IRockyModel::get_geometry_scalars ( ) const
Returns
An IRockyGeometryScalarsModel object, which allows users to add new boundary scalars during a setup of a module. Boundary scalars are special variables that associate values to all geometries within a project.

◆ get_geometry_type()

EBoundaryType IRockyModel::get_geometry_type ( int  geometry_index) const
Returns
An enum key indicating the type of a geometry contained in a project. The possible values are:
btReceivingConveyor = 1
btFeedConveyor = 2
btCustom = 3
btInlet = 4
Parameters
geometry_indexThe index that identifies a geometry within the Rocky solver.

◆ get_interactions_data()

IRockyInteractionCalculationsData IRockyModel::get_interactions_data ( ) const
Returns
An IRockyInteractionCalculationsData object, which can be used to access data and methods related to materials, materials interactions and particle groups.

◆ get_joint_scalars()

IRockyJointScalarsModel IRockyModel::get_joint_scalars ( ) const
Returns
An IRockyJointScalarsModel object, which allows users to add new joint scalars during a setup of a module. Joint scalars are special variables attached to joints in flexible particles that are able to store values that are preserved between time iterations.

◆ get_length_factor()

double IRockyModel::get_length_factor ( ) const
Returns
The length factor in meters, used to nondimensionalize length parameters.

◆ get_mass_factor()

double IRockyModel::get_mass_factor ( ) const
Returns
The length factor in kilograms, used to nondimensionalize mass parameters.

◆ get_number_of_active_particles()

int IRockyModel::get_number_of_active_particles ( ) const
Returns
The current number of active particles in the simulation. This number can vary throughout a simulation because new particles are injected and/or some particles leave the solution domain.

◆ get_number_of_active_triangles()

int IRockyModel::get_number_of_active_triangles ( )
Returns
The current number of active triangles in the simulation. This number can vary throughout a simulation because the active particle region changes due to particles moving, which will active or de-active triangles that are inside or outside the active region.

◆ get_number_of_devices()

int IRockyModel::get_number_of_devices ( ) const
Returns
The number of devices set to run the simulation when using multi-GPU.

◆ get_number_of_geometries()

int IRockyModel::get_number_of_geometries ( ) const
Returns
The total number of boundaries defined in the Rocky project.

◆ get_number_of_material_interactions()

int IRockyModel::get_number_of_material_interactions ( ) const
Returns
The total number of material interactions that it is possible to define with the current materials defined in the Rocky project.

◆ get_number_of_materials()

int IRockyModel::get_number_of_materials ( ) const
Returns
The total number of materials defined in the Rocky project.

◆ get_number_of_particle_groups()

int IRockyModel::get_number_of_particle_groups ( ) const
Returns
The total number of particle groups defined in the Rocky project. A particle group is a category of particles of the same shape and material.

◆ get_number_of_particles()

int IRockyModel::get_number_of_particles ( ) const
Returns
The total number of individual particles in a whole simulation.

◆ get_number_of_processes()

int IRockyModel::get_number_of_processes ( ) const
Returns
The number of allowed parallel processes when the simulation runs in CPU.

◆ get_output_interval()

double IRockyModel::get_output_interval ( ) const
Returns
The value of the simulation output interval.

◆ get_pair_scalars()

IRockyPairScalarsModel IRockyModel::get_pair_scalars ( ) const
Returns
An IRockyPairScalarsModel object, which allows users to add new pair scalars during a setup of a module. Pair scalars are special variables that associate values to all combinations of particle groups and combinations of particle groups and geometries within a project.

◆ get_particle_breakage_scalars()

IRockyParticleBreakageScalarsModel IRockyModel::get_particle_breakage_scalars ( ) const
Returns
An IRockyParticleBreakageScalarsModel object, which allows users to add new particle breakage scalars or activate particle breakage scalars known to Rocky during the setup of a module. Particle breakage scalars are special particle scalars used in conjunction with instantaneous breakage models, in order to transfer values calculated at a breakage event to the point at which the fragments size distribution is determined.

◆ get_particle_contact_scalars()

IRockyContactScalarsModel IRockyModel::get_particle_contact_scalars ( ) const
Returns
An IRockyContactScalarsModel object, which allows users to add new (particle-to-particle) contact scalars during the setup phase of a module. Contact scalars are special variables attached to contacts that are able to store values that are preserved between time iterations.
For handling scalars related to particle-to-triangle contacts, please consult the
IRockyModel::get_triangle_contact_scalars method.

◆ get_particle_group_name()

std::string IRockyModel::get_particle_group_name ( int  particle_group_index) const
Returns
The name given in the Rocky UI the particle group identified by particle_group_index.

◆ get_particle_scalars()

IRockyParticleScalarsModel IRockyModel::get_particle_scalars ( ) const
Returns
An IRockyParticleScalarsModel object, which allows users to add new particle scalars or activate particle scalars known to Rocky during the setup of a module. Particle scalars are special variables attached to particles that are able to store values per particle that are preserved between time iterations.

◆ get_particle_transfer_scalars()

IRockyParticleTransferScalarsModel IRockyModel::get_particle_transfer_scalars ( ) const
Returns
An IRockyParticleTransferScalarsModel object, which allows users to add new particle transfer scalars or activate particle transfer scalars known to Rocky during the setup 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. Their typical use is the accumulation of values from all contacts or joints associated to a particle or an element at a given time iteration.

◆ get_pressure_factor()

double IRockyModel::get_pressure_factor ( ) const
Returns
The pressure factor in Pascal, used to nondimensionalize pressure parameters.

◆ get_softening_factor()

double IRockyModel::get_softening_factor ( ) const
Returns
The value of the numerical softening factor, which is a global reduction factor that multiplies all stiffness values computed throughout a simulation. This factor is commonly used to increase the timestep and, therefore, speed up the execution of simulations.

◆ get_temperature_factor()

double IRockyModel::get_temperature_factor ( ) const
Returns
The temperature factor in Kelvin, used to nondimensionalize temperature parameters.

◆ get_time_factor()

double IRockyModel::get_time_factor ( ) const
Returns
The time factor in seconds, used to nondimensionalize time parameters.

◆ get_timestep()

double IRockyModel::get_timestep ( ) const
Returns
The current value of the simulation timestep.

◆ get_triangle_contact_scalars()

IRockyContactScalarsModel IRockyModel::get_triangle_contact_scalars ( ) const
Returns
An IRockyContactScalarsModel object, which allows users to add new (particle-to-triangle) contact scalars during the setup phase of a module. Contact scalars are special variables attached to contacts that are able to store values that are preserved between time iterations.
For handling scalars for particle-to-particle contacts, please consult the
IRockyModel::get_particle_contact_scalars method.

◆ get_triangle_scalars()

IRockyTriangleScalarsModel IRockyModel::get_triangle_scalars ( ) const
Returns
An IRockyTriangleScalarsModel object, which allows users to add new triangle scalars during a setup of a module. Triangle scalars are special variables attached to geometry triangles that are able to store values that are preserved between time iterations.

◆ has_adhesion()

bool IRockyModel::has_adhesion ( ) const
Returns
True if the current Rocky project has enabled some adhesion model. Adhesive contacts will exist in a simulation only if that condition is met.

◆ is_thermal_simulation()

bool IRockyModel::is_thermal_simulation ( ) const
Returns
True if the thermal option is enabled in the current Rocky project, false otherwise.

◆ set_adhesive_distance()

void IRockyModel::set_adhesive_distance ( int  home_index,
int  near_index,
double  adhesive_distance 
)
This method sets a value of the adhesive distance per material interaction,
for a custom adhesive force model. Whenever a new value set for an adhesive distance is greater than the previous maximum adhesive distance among all material interactions, a new neighbors search operation will be triggered. For this reason, if adhesive distances are increased too frequently, the simulation performance can be compromised.
Parameters
home_indexThe index of the first material in the material interaction.
near_indexThe index of the second material in the material interaction.
adhesive_distanceThe value of the adhesive distance for contacts involving entities with the specified combination of materials.

◆ set_minimum_restitution_coefficient()

void IRockyModel::set_minimum_restitution_coefficient ( int  home_index,
int  near_index,
double  minimum_restitution 
)
This method is intended to be used by a module implementing a variable restitution
coefficient model. It allows the module to set the minimum expected value of the restitution coefficient associated to a given material interaction. The Rocky solver will use these values to calculate the stable timestep for the simulation. Every time the value of the minimum restitution coefficient of any material interaction is changed, a timestep calculation will be triggered. For this reason, if the restitution coefficient changes too frequently, the simulation performance can be compromised. The timestep will be changed only if the new calculated timestep is smaller than the previous one.
Parameters
home_indexThe index of the first material in the material interaction.
near_indexThe index of the second material in the material interaction.
minimum_restitutionThe minimum expected value for the restitution coefficient in a collision involving entities with the specified combination of materials.

◆ set_point_cloud_property_dimension()

void IRockyModel::set_point_cloud_property_dimension ( int  point_cloud_index,
int  property_index,
double  dimension 
)
The purpose of this method is to associate a dimensional factor
to a point cloud property. This factor will be used to nondimensionalize all the associated values. For instance, if the property represents a force, a force dimensional factor must be associated through this method. Dimensional factors for the fundamental magnitudes are provided by functions of an IRockyModel object.
Parameters
point_cloud_indexThe index that uniquely identifies the point cloud.
property_indexThe index that uniquely identifies the point cloud property.
dimensionThe appropriate dimensional factor for the point cloud property.

◆ trigger_update_timestep()

void IRockyModel::trigger_update_timestep ( ) const

When called, enable the timestep update calculation at the beginning of the next iteration. If the module implements the ROCKY_PLUGIN_COMPUTE_TIMESTEP method it will be called during the update process, changing the solver timestep if the new computed timestep is smaller than the current one.

Attention
If timestep is set using the advanced parameters, the update timestep calculation will be ignored.