Skip to main content
#include <rocky_particle_api.hpp>

Public Member Functions

Detailed Description

IRockyParticle is an interface for the internal particle object in Rocky. A particle object is the code representation of an individual particle in a Rocky simulation. It has several access methods to particle-related properties, as well as particle scalars, which are special variables that store values per particle that are preserved between time iterations. Values of particle scalars can be displayed in a 3D window as any other built-in particle property in Rocky. All property and variable values made available through IRockyParticle are dimensionless.

Member Function Documentation

add_force()

This method sums a custom calculated force to the contact and body forces acting on the particle. Parameters

add_moment()

This method sums a custom calculated moment to the moments acting on the particle. Parameters

add_to_contacts_search()

This method enables the detection of all contacts for the particle.

disable_related_particle_contacts()

This method activates the conditional disabling of particle-to-particle contacts detection. A given particle-to-particle contact will be ignored during the detection stage only if this method has been applied to both particles.

disable_related_triangle_contacts()

This method disables the detection of particle-to-triangle contacts for the particle.

enable_related_particle_contacts()

This method deactivates the conditional disabling of particle-to-particle contact detection, previously activated using the IRockyParticle::disable_related_particle_contacts

enable_related_triangle_contacts()

This method enables the detection of particle-to-triangle contacts for the particle.

get_assembly_part_material()

Parameters Returns An IRockyMaterial object that gives access to the values of physical properties associated to the material from which the assembly part referent to part_id is made.

get_breakage_scalars()

Returns An IRockyParticleBreakageScalars object, that gives access to all particle breakage scalars variables defined in the project.

get_centroid_position()

Returns The Cartesian coordinates of the current position of the particle’s centroid.

get_cgm_scale_factor()

Returns The particle’s Coarse-grain Modeling (CGM) scale factor.

get_equivalent_diameter()

Returns The equivalent diameter of the particle, which is defined as the diameter of a sphere of volume equal to the particle’s volume.

get_gravity()

Returns The gravitational acceleration vector in Cartesian coordinates.

get_impact_energy()

Returns The sum of the impact energy registered in all active contacts on the surface of the particle until the current time.
This value will be available only if an instantaneous breakage model is enabled in the simulation.

get_mass()

Returns The current value of the particle’s mass. This value will be different from the original particle’s mass only if the mass increment particle scalar is enabled in the simulation.

get_material()

Returns An IRockyMaterial object that gives access to the values of physical properties associated to the material from which the particle is made.
Invoking this method on assembly particles results on undefined behavior, as assembly particles may have multiple materials. Prefer to use IRockyParticle::get_assembly_part_material instead.

get_material_index()

Returns The material index associated to that particle

get_moment_of_inertia()

Returns A 3D vector whose components are the principal values of the particle’s moment of inertia tensor.

get_number_of_assembly_parts()

Returns The number of parts that compose the assembly.

get_orientation_axis_angle()

Returns A tuple whose two components define the axis-angle particle orientation. The first one is a three dimensional vector representing the orientation axis, the second one is a single value representing the angle.

get_orientation_quaternion()

Returns The quaternion that represents the particle’s orientation, expressed as a four-dimensional array (qr,qi,qj,qk)(q_r, q_i, q_j, q_k).

get_original_mass()

Returns The original value of the mass of a particle when it enters into the simulation.

get_particle_group_index()

Returns The index that uniquely identifies the particle group to which the particle belongs.

get_poisson_ratio()

Returns The particle’s Poisson’s ratio value. If this property was defined as variable in the module’s specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle’s associated material.

get_release_time()

Returns The time at which the particle was released.

get_resultant_force()

Returns The resultant force vector acting on the particle, in Cartesian coordinates. This force is a combination of the forces calculated during the current time iteration that are applied on the particle, including contact forces, joint forces, fluid forces, and other forces coming from custom modules. If this method is called before the force calculation stage it will return a zero vector.
The force of gravity acting on the particle is not included in this resultant force.

get_resultant_moment()

Returns The resultant moment vector applied to the particle, in Cartesian coordinates. The resultant moment is the combination of all moments caused by the forces acting upon the particle, including contact forces, joint forces, fluid forces, and other forces coming from custom modules. If this method is called before the force calculation stage it will return a zero vector.

get_rolling_resistance_coefficient()

Returns The particle’s rolling resistance coefficient

get_rotational_velocity()

Returns The current particle’s rotational velocity vector expressed in Cartesian coordinates.

get_scalars() [1/2]

Returns An IRockyParticleScalars object, that gives access to all particle scalars variables defined in the project.

get_scalars() [2/2]

Returns A const IRockyParticleScalars object, that gives access to all particle scalars variables defined in the project.

get_size()

Returns The current value of the particle’s size.

get_solid_volume()

Returns The current value of the particle’s solid volume. If the particle is porous (porosity > 0), the solid volume is the volume of the solid matrix. Otherwise, the volume returned by this function will coincide with the one returned by the get_volume function.

get_specific_heat()

Returns The particle’s specific heat value. If this property was defined as variable in the module’s specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle’s associated material.

get_sphericity()

Returns The particle’s sphericity value, which is defined as the ratio of AsA_s to ApA_p, where AsA_s is the surface area of a sphere with the same volume as the particle, whereas ApA_p is the surface area of the particle itself. In general terms, the sphericity measures how closely the particle’s actual shape resembles the shape of a perfect sphere.

get_strength()

Returns A random value between 0 and 1 assigned to a particle at the time of generation. This value can be related to the breakage probability in a custom instantaneous breakage model.

get_surface_area()

Returns The current value of the particle’s surface area.

get_tag()

Returns The tag value inherited from the tags assigned to the segments of a custom fiber, if the IRockyParticle object represents an element of a custom fiber. The values of those tags must be specified in the column labeled “tag” in the csv file that defines the geometry of a custom fiber. All elements that arise from the subdivision of a given segment inherit the tag value assigned to that segment. If tags are not defined for a custom fiber or if this function is used with particles which are not elements of a custom fiber, this function will return -1.

get_thermal_conductivity()

Returns The particle’s thermal conductivity. If this property was defined as variable in the module’s specification file, the method will return the value specifically assigned to the particle. Otherwise, it will return the value specified in the Rocky UI for the particle’s associated material.

get_transfer_scalars()

Returns An IRockyParticleTransferScalars object, that gives access to all particle transfer scalars variables defined in the project.

get_translational_velocity()

Returns The current particle’s translational velocity vector expressed in Cartesian coordinates.

get_volume()

Returns The current value of the particle’s volume. If the particle is porous (porosity > 0), the volume returned is the particle’s total or bulk volume, that is the volume obtained by summing the solid volume and the pore volume.

is_assembly()

Returns True if the given particle is an assembly, false otherwise.

is_element()

Returns True if the given particle is an element within a flexible particle, false otherwise.

remove()

This method removes permanently the particle from the simulation.

remove_from_contacts_search()

This method disables the detection of all contacts for the particle.

set_frozen()

This method sets the frozen state of a particle. When the frozen state of a particle is set to true, the solution of the motion equations for this particle are skipped afterwards. Parameters

set_poisson_ratio()

This method sets the Poisson’s ratio value for the particle. This operation will be allowed only if Poisson’s ratio was defined as a variable property for particles in the module’s specification file. Otherwise, a segmentation fault will occur. Parameters

set_specific_heat()

This method sets the specific heat value for the particle. This operation will be allowed only if Poisson’s ratio was defined as a variable property for particles in the module’s specification file. Otherwise, a segmentation fault will occur. Parameters

set_thermal_conductivity()

This method sets the thermal conductivity value for the particle. This operation will be allowed only if thermal conductivity was defined as a variable property for particles in the module’s specification file. Otherwise, a segmentation fault will occur. Parameters