Skip to main content

Rocky Solver SDK 2024 R2

IRockyGeometryMotionData Struct Reference

Last update: 08.07.2024

#include <rocky_boundary_api.hpp>

Public Member Functions

int get_id () const
 
std::string get_name () const
 
double3 get_force () const
 
double3 get_moment () const
 
double3 get_position () const
 
double3 get_translational_velocity () const
 
double4 get_orientation_quaternion () const
 
double3 get_orientation_euler_angles () const
 
double3 get_rotational_velocity () const
 
void set_position (double3 position)
 
void set_translational_velocity (double3 v)
 
void set_orientation (double4 quat)
 
void set_orientation_angles (double3 angles)
 
void set_rotational_velocity (double3 w)
 
bool has_linked_motion_frame () const
 

Detailed Description

IRockyGeometryMotionData is an interface for a geometry motion in Rocky. A geometry motion represents the information from the motion applied to the geometry in Rocky's last simulation timestep. This information includes for Rocky's current simulation timestep, the forces and moments from the particles that are being applied to the geometry, and also the position, translational velocity, rotational velocity and orientation of the geometry from the previous timestep's motion. The information represented in a geometry motion are the forces and moments from the particles simulation, the position, translational velocity, rotational velocity and orientation of the geometry from the previous motion. To move the geometry within Rocky's current simulation timestep, the same motion information, i.e. (the new position, translational velocity, rotational velocity and orientation of the geometry) must be defined as within the previous timestep. If no motion is applied to the geometry, nothing is required to be set. If the geometry has no motion applied to it, the geometry's translational and rotational velocities are zero and its position and orientation are equal to the ones set at the end of the previous timestep. All property and variable values made available through IRockyGeometryMotionData are dimensionless.

Attention
The geometry's gravity center is the reference position Rocky uses for the geometry's motions. Thus, the geometry's gravity center will have a new position after each motion applied.

Member Function Documentation

◆ get_force()

double3 IRockyGeometryMotionData::get_force ( ) const
Returns
The Cartesian components of the force applied by Rocky to the geometry.

◆ get_id()

int IRockyGeometryMotionData::get_id ( ) const
Returns
The ID of the geometry.

◆ get_moment()

double3 IRockyGeometryMotionData::get_moment ( ) const
Returns
The Cartesian components of the moment applied by Rocky to the geometry.

◆ get_name()

std::string IRockyGeometryMotionData::get_name ( ) const
Returns
The name of the geometry.

◆ get_orientation_euler_angles()

double3 IRockyGeometryMotionData::get_orientation_euler_angles ( ) const
Returns
A vector whose components are the Euler angles that define the orientation of the geometry. In this vector, the x-component is the roll angle, the y-component is the pitch angle and the z-component is the yaw angle.

◆ get_orientation_quaternion()

double4 IRockyGeometryMotionData::get_orientation_quaternion ( ) const
Returns
The orientation of the geometry expressed as a quaternion (w, x, y and z).

◆ get_position()

double3 IRockyGeometryMotionData::get_position ( ) const
Returns
The Cartesian coordinates of the reference position for the motion, which coincides with the geometry's gravity center.

◆ get_rotational_velocity()

double3 IRockyGeometryMotionData::get_rotational_velocity ( ) const
Returns
The Cartesian components of the geometry's rotational velocity.

◆ get_translational_velocity()

double3 IRockyGeometryMotionData::get_translational_velocity ( ) const
Returns
The Cartesian components of the geometry's translational velocity.

◆ has_linked_motion_frame()

bool IRockyGeometryMotionData::has_linked_motion_frame ( ) const
Returns
True if the geometry has motion from the Rocky's internal motion kernel implementation. False otherwise.

◆ set_orientation()

void IRockyGeometryMotionData::set_orientation ( double4  quat)
Sets the geometry's new orientation (quaternion) according to the motion that was applied.
Parameters
quatThe geometry's new orientation expressed as a quaternion (w, x, y and z).
Attention
Calling set_orientation in a geometry that is already linked to a motion frame is not allowed.

◆ set_orientation_angles()

void IRockyGeometryMotionData::set_orientation_angles ( double3  angles)
Sets the geometry's new orientation in Euler angles according to the motion that was applied.
Parameters
anglesA vector whose components are the Euler angles that define the new orientation of the geometry. In this vector, the x-component is the roll angle, the y-component is the pitch angle and the z-component is the yaw angle.
Attention
Calling set_orientation_angles in a geometry that is already linked to a motion frame is not allowed.

◆ set_position()

void IRockyGeometryMotionData::set_position ( double3  position)
Sets the new position for the geometry according to the motion that was applied.
Rocky uses the geometry's gravity center as the reference position for the geometry's motions. Thus, the geometry's gravity center will have a new position after each motion applied.
Parameters
positionThe Cartesian components of the geometry's new position, which is equal to the new location of its gravity center.
Attention
Calling set_position in a geometry that is already linked to a motion frame is not allowed.

◆ set_rotational_velocity()

void IRockyGeometryMotionData::set_rotational_velocity ( double3  w)
Sets the geometry's new rotational velocity according to the motion that was applied.
Parameters
wThe Cartesian components of the geometry's new rotational velocity.
Attention
Calling set_rotational_velocity in a geometry that is already linked to a motion frame is not allowed.

◆ set_translational_velocity()

void IRockyGeometryMotionData::set_translational_velocity ( double3  v)
Sets the geometry's new translational velocity according to the motion that was applied.
Parameters
vThe Cartesian components of the geometry's new translational velocity.
Attention
Calling set_translational_velocity in a geometry that is already linked to a motion frame is not allowed.