walberla::pe::RigidBody Class Referenceabstract

#include <RigidBody.h>

Inheritance diagram for walberla::pe::RigidBody:

## Public Member Functions

Destructor
virtual ~RigidBody ()=0
Destructor for the RigidBody class. More...

Sleep mode functions
void wake ()
Waking the rigid body and ending the sleep mode. More...

void calcMotion ()
Calculating the current motion of a rigid body. More...

Get functions
bool hasManager () const
Returns whether the rigid body currently has a supervising rigid body manager. More...

ManagerID getManager ()
Returns the supervising rigid body manager of the rigid body. More...

ConstManagerID getManager () const

bool hasSuperBody () const
Returns whether the rigid body is contained in a superordinate body. More...

BodyID getSuperBody ()
Returns the superordinate body in which the rigid body is contained. More...

ConstBodyID getSuperBody () const

BodyID getTopSuperBody ()
Returns the top level superordinate body in which the rigid body is contained. More...

ConstBodyID getTopSuperBody () const

virtual bool hasSubBodies () const

bool isFinite () const
Returns whether the rigid body is finite or not. More...

bool isAwake () const
Returns whether the rigid body is awake or not. More...

bool isFixed () const
Returns whether the rigid body's position is fixed or not. More...

bool hasInfiniteMass () const
Checks if a body is "mobile" e.g. More...

bool isVisible () const
Returns whether the rigid body is visible or not. More...

bool isMarkedForDeletion () const

id_t getSystemID () const
Returns the unique system-specific ID of the rigid body. More...

id_t getID () const
Returns the user-specific ID of the rigid body. More...

const Vec3 getRelPosition () const
Returns the relative position of the rigid body within the superordinate body. More...

const Vec3 getPosition () const
Returns the global position of the center of mass of the rigid body. More...

const Vec3 getBodyLinearVel () const
Returns the relative linear velocity of the rigid body. More...

const Vec3 getLinearVel () const
Returns the global linear velocity of the rigid body. More...

const Vec3 getBodyAngularVel () const
Returns the relative angular velocity. More...

const Vec3getAngularVel () const
Returns the global angular velocity. More...

const Quat getRelQuaternion () const
Returns the relative orientation of the rigid body to its superbody. More...

const Quat getQuaternion () const
Returns the orientation of the rigid body. More...

const Mat3 getRotation () const
Returns the rotation of the rigid body. More...

real_t getMass () const
Returns the total mass of the rigid body. More...

real_t getInvMass () const
Returns the inverse total mass of the rigid body. More...

virtual real_t getVolume () const
Returns the volume of the rigid body. More...

const Mat3getBodyInertia () const
Returns the moment of inertia in reference to the body frame of the rigid body. More...

const Mat3 getInertia () const
Returns the moment of inertia in reference to the global world frame. More...

const Mat3getInvBodyInertia () const
Returns the inverse moment of inertia in reference to the body frame of the rigid body. More...

const Mat3 getInvInertia () const
Returns the inverse moment of inertia in reference to the global world frame. More...

const AABB & getAABB () const
Returns the axis-aligned bounding box of the rigid body. More...

real_t getAABBSize () const
Returns the length of the longest side of the AABB of the rigid body. More...

real_t getKineticEnergy () const
Returns the kinetic energy of the rigid body. More...

real_t getRotationalEnergy () const
Returns the rotational energy of the rigid body. More...

real_t getEnergy () const
Returns the energy of the rigid body. More...

const Vec3 vectorFromBFtoWF (real_t vx, real_t vy, real_t vz) const
Transformation from a relative to a global vector. More...

const Vec3 vectorFromBFtoWF (const Vec3 &v) const
Transformation from a relative to a global vector. More...

const Vec3 pointFromBFtoWF (real_t px, real_t py, real_t pz) const
Transformation from a relative to a global coordinate. More...

const Vec3 pointFromBFtoWF (const Vec3 &rpos) const
Transformation from a relative to a global coordinate. More...

virtual Vec3 velFromBF (real_t px, real_t py, real_t pz) const
Calculation of the global velocity of a relative point. More...

virtual Vec3 velFromBF (const Vec3 &rpos) const
Calculation of the global velocity of a relative point. More...

const Vec3 vectorFromWFtoBF (real_t vx, real_t vy, real_t vz) const
Transformation from a global to a relative vector. More...

const Vec3 vectorFromWFtoBF (const Vec3 &v) const
Transformation from a global to a relative vector. More...

const Vec3 pointFromWFtoBF (real_t px, real_t py, real_t pz) const
Transformation from a global to a relative coordinate. More...

const Vec3 pointFromWFtoBF (const Vec3 &gpos) const
Transformation from a global to a relative coordinate. More...

virtual Vec3 velFromWF (real_t px, real_t py, real_t pz) const
Calculation of the global velocity of a point in global coordinates. More...

virtual Vec3 velFromWF (const Vec3 &gpos) const
Calculation of the global velocity of a point in global coordinates. More...

const Vec3 accFromWF (real_t px, real_t py, real_t pz) const
Calculation of the global acceleration of a point in global coordinates. More...

const Vec3 accFromWF (const Vec3 &gpos) const
Calculation of the global acceleration of a point in global coordinates. More...

id_t getTypeID () const

Translation functions
void translate (real_t dx, real_t dy, real_t dz)
Translation of the center of mass of the rigid body by the displacement vector. More...

void translate (const Vec3 &dp)
Translation of the center of mass of the rigid body by the displacement vector dp. More...

Rotation functions
void rotate (real_t x, real_t y, real_t z, real_t angle)
Rotation of the rigid body around the global rotation axis (x,y,z) by the rotation angle angle. More...

void rotate (const Vec3 &axis, real_t angle)
Rotation of the rigid body around the specified global rotation axis by the rotation. More...

void rotate (real_t xangle, real_t yangle, real_t zangle)
Rotation of the rigid body by the Euler angles xangle, yangle and zangle. More...

void rotate (const Vec3 &euler)
Rotation of the rigid body by the Euler angles euler. More...

void rotate (const Quat &dq)
Rotation of the rigid body by the quaternion dq. More...

void rotateAroundOrigin (real_t x, real_t y, real_t z, real_t angle)
Rotation of the rigid body around the origin of the global world frame. More...

void rotateAroundOrigin (const Vec3 &axis, real_t angle)
Rotation of the rigid body around the origin of the global world frame. More...

void rotateAroundOrigin (real_t xangle, real_t yangle, real_t zangle)
Rotation of the rigid body around the origin of the global world frame. More...

void rotateAroundOrigin (const Vec3 &euler)
Rotation of the rigid body around the origin of the global world frame. More...

void rotateAroundOrigin (const Quat &dq)
Rotation of the rigid body around the origin of the global world frame. More...

void rotateAroundPoint (const Vec3 &point, const Vec3 &axis, real_t angle)
Rotation of the rigid body around a specific global coordinate. More...

void rotateAroundPoint (const Vec3 &point, const Vec3 &euler)
Rotation of the rigid body around a specific global coordinate. More...

Utility functions
bool containsRelPoint (real_t px, real_t py, real_t pz) const
Checks, whether a point in body relative coordinates lies inside the rigid body. More...

bool containsRelPoint (const Vec3 &rpos) const
Checks, whether a point in body relative coordinates lies inside the rigid body. More...

bool containsPoint (real_t px, real_t py, real_t pz) const
Checks, whether a point in global coordinates lies inside the rigid body. More...

bool containsPoint (const Vec3 &gpos) const
Checks, whether a point in global coordinates lies inside the rigid body. More...

bool isSurfaceRelPoint (real_t px, real_t py, real_t pz) const
Checks, whether a point in relative coordinates lies on the surface of the rigid body. More...

bool isSurfaceRelPoint (const Vec3 &rpos) const
Checks, whether a point in body relative coordinates lies on the surface of the rigid body. More...

bool isSurfacePoint (real_t px, real_t py, real_t pz) const
Checks, whether a point in global coordinates lies on the surface of the rigid body. More...

bool isSurfacePoint (const Vec3 &gpos) const
Checks, whether a point in global coordinates lies on the surface of the rigid body. More...

virtual Vec3 support (const Vec3 &d) const
Estimates the point which is farthest in direction d. More...

virtual Vec3 supportContactThreshold (const Vec3 &d) const
Estimates the point which is farthest in direction d. More...

virtual void calcBoundingBox ()=0

Force functions
bool hasForce () const
Returns whether the rigid body has non-zero acting forces or torques. More...

const Vec3getForce () const
Returns the current force acting on the body's center of mass. More...

const Vec3getTorque () const
Returns the current torque acting on the body's center of mass. More...

void setForce (const Vec3 &f)
Set the force acting at the body's center of mass. More...

void setTorque (const Vec3 &tau)
Set the torque acting at the body's center of mass. More...

void addRelForce (real_t fx, real_t fy, real_t fz)
Increases the total force acting in the body's center of mass. More...

void addRelForce (const Vec3 &f)
Increases the force acting in the body's center of mass. More...

void addForce (real_t fx, real_t fy, real_t fz)
Increases the force acting in the body's center of mass. More...

void addForce (const Vec3 &f)
Increases the force acting in the body's center of mass. More...

void addRelForceAtRelPos (real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz)
Increases the force acting in the body's center of mass. More...

void addRelForceAtRelPos (const Vec3 &f, const Vec3 &rpos)
Increases the force acting in the body's center of mass. More...

void addRelForceAtPos (real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz)
Increases the force acting in the body's center of mass. More...

void addRelForceAtPos (const Vec3 &f, const Vec3 &gpos)
Increases the force acting in the body's center of mass. More...

void addForceAtRelPos (real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz)
Increases the force acting in the body's center of mass. More...

void addForceAtRelPos (const Vec3 &f, const Vec3 &rpos)
Increases the force acting in the body's center of mass. More...

void addForceAtPos (real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz)
Increases the force acting in the body's center of mass. More...

void addForceAtPos (const Vec3 &f, const Vec3 &gpos)
Increases the force acting in the body's center of mass. More...

void addTorque (real_t tx, real_t ty, real_t tz)
Increasing the torque acting in the body's center of mass. More...

void addTorque (const Vec3 &t)
Increasing the torque acting in the body's center of mass. More...

virtual void resetForceAndTorque ()
Resetting all acting forces and torques from the rigid body. More...

Impulse functions
void addImpulse (real_t jx, real_t jy, real_t jz)
Applying an impulse in the body's center of mass. More...

void addImpulse (const Vec3 &j)
Applying an impulse in the body's center of mass. More...

void addImpulseAtPos (real_t jx, real_t jy, real_t jz, real_t px, real_t py, real_t pz)
Applying an impulse at the given global coordinate. More...

void addImpulseAtPos (const Vec3 &j, const Vec3 &p)
Applying an impulse at the given global coordinate. More...

MPI functions
bool isRemote () const
Returns whether the rigid body is remote or not. More...

virtual void setRemote (bool remote)
Setting the remote flag of the rigid body. More...

bool isGlobal () const
Returns whether the rigid body is global or not. More...

void setGlobal (const bool global)
Setting the global flag of the rigid body. More...

bool isCommunicating () const
Returns whether the rigid body is local or not. More...

void setCommunicating (const bool communicating)
Setting the local flag of the rigid body. More...

Output functions
virtual void print (std::ostream &os, const char *tab) const =0

Debugging functions
virtual bool checkInvariants ()
Checks the validity of the state of the rigid body. More...

Public Member Functions inherited from walberla::pe::ccd::HashGridsBodyTrait
void * getGrid () const
Returns the grid the rigid body is currently assigned to. More...

size_t getHash () const
Returns the current hash value of the rigid body. More...

size_t getCellId () const
Returns the current body container index within the cell the body is currently assigned to. More...

void setGrid (void *grid)
Setting the grid the rigid body is associated with. More...

void setHash (size_t hash)
Setting the hash value of the rigid body. More...

void setCellId (size_t cell)
Setting the body container index within the cell the body is currently assigned to. More...

## Protected Member Functions

Fixation functions
virtual void fix ()
Setting the global position (the center of mass) of the rigid body fixed. More...

Functions for internal changes in compound geometries
void signalModification ()
Signals an internal modification of a contained subordinate body. More...

void signalTranslation ()
Signals a position change of a contained subordinate body. More...

void signalRotation ()
Signals an orientation change of a contained subordinate body. More...

void signalFixation ()
Signals a fixation change of a contained subordinate body. More...

virtual void handleModification ()
Handling an internal modification of a contained subordinate body. More...

virtual void handleTranslation ()
Handling a position change of a contained subordinate body. More...

virtual void handleRotation ()
Handling an orientation change of a contained subordinate body. More...

virtual void handleFixation ()
Handling a fixation change of a contained subordinate body. More...

Protected Member Functions inherited from walberla::pe::ccd::HashGridsBodyTrait
HashGridsBodyTrait ()
Constructor for the BodyTrait<HashGrids> specialization. More...

## Friends

template<typename... BodyTypes>
class Union

## Constructor

MPIRigidBodyTrait MPITrait

RigidBody (id_t const typeID, id_t sid, id_t uid)
Constructor for the RigidBody class. More...

## Set functions

virtual void setPositionImpl (real_t px, real_t py, real_t pz)

virtual void setOrientationImpl (real_t r, real_t i, real_t j, real_t k)
Setting the global orientation of the rigid body. More...

virtual void translateImpl (real_t dx, real_t dy, real_t dz)
Translation of the center of mass of the rigid body by the displacement vector. More...

virtual void rotateImpl (const Quat &dq)
Implements the rotation of a rigid body. More...

virtual void rotateAroundOriginImpl (const Quat &dq)
Implements the rotation of a rigid body. More...

virtual void rotateAroundPointImpl (const Vec3 &point, const Quat &dq)
Rotation of the rigid body around a specific global coordinate. More...

virtual bool containsRelPointImpl (real_t px, real_t py, real_t pz) const
Checks, whether a point in body relative coordinates lies inside the rigid body. More...

virtual bool isSurfaceRelPointImpl (real_t px, real_t py, real_t pz) const
Checks, whether a point in relative coordinates lies on the surface of the rigid body. More...

void setMassAndInertia (const real_t mass, const Mat3 &inertia)
Sets mass and inertia of a rigid body. More...

void setSB (BodyID body)
Sets the super body for the current body. More...

void resetSB ()
Resets the super body for the current body. More...

void setFinite (const bool finite)

void setVisible (bool visible)
Setting the rigid body visible/invisible. More...

void setPosition (real_t px, real_t py, real_t pz)
Setting the global position of the rigid body. More...

void setPosition (const Vec3 &gpos)
Setting the global position of the rigid body. More...

void setRelPosition (const Vec3 &gpos)
Setting the global position of the rigid body. More...

void setOrientation (real_t r, real_t i, real_t j, real_t k)
Setting the global orientation of the rigid body. More...

void setOrientation (const Quat &q)
Setting the global orientation of the rigid body. More...

void setRelOrientation (const Quat &q)
Setting the relative position of the rigid body. More...

void setMassAndInertiaToInfinity ()
Setting the mass to infinity. This will also make the inertia tensor infinite. More...

void setRelLinearVel (real_t vx, real_t vy, real_t vz)
Setting the relative linear velocity of the rigid body. More...

void setRelLinearVel (const Vec3 &lvel)

void setLinearVel (real_t vx, real_t vy, real_t vz)
Setting the global linear velocity of the rigid body. More...

void setLinearVel (const Vec3 &lvel)
/see setLinearVel( real_t vx, real_t vy, real_t vz ) More...

void setRelAngularVel (real_t ax, real_t ay, real_t az)
Setting the relative angular velocity of the rigid body. More...

void setRelAngularVel (const Vec3 &avel)
/see setRelAngularVel( real_t ax, real_t ay, real_t az ) More...

void setAngularVel (real_t ax, real_t ay, real_t az)
Setting the global angular velocity of the rigid body. More...

void setAngularVel (const Vec3 &avel)
/see setAngularVel( real_t ax, real_t ay, real_t az ) More...

void markForDeletion ()
Marks the rigid body for deletion during the next synchronization. More...

## Member variables

bool awake_
Sleep mode flag. More...

real_t mass_
The total mass of the rigid body. More...

real_t invMass_
The inverse total mass of the rigid body. More...

real_t motion_
The current motion of the rigid body. More...

Vec3 v_
The linear velocity of this rigid body. More...

Vec3 w_
Angular velocity of this rigid body. More...

Vec3 force_
Total force (external+contact) acting in the body's center of mass. More...

Vec3 torque_
Total torque (external+contact) acting in the body's center of mass. More...

Mat3 I_
The moment of inertia in reference to the body's own body frame. More...

Mat3 Iinv_
The inverse moment of inertia within the body frame. More...

ManagerID manager_
The rigid body manager responsible for the rigid body. More...

BodyID sb_
The superordinate rigid body. More...

bool finite_
Finiteness flag. More...

bool visible_
Visibility flag. More...

bool remote_
Remote flag. More...

bool communicating_
Communicating flag. More...

bool global_
Global flag. More...

bool toBeDeleted_
This flag marks the body for deletion during the next synchronization (only works on local bodies) More...

id_t sid_
The unique system-specific body ID. More...

id_t uid_
The user-specific body ID. More...

AABB aabb_
Axis-aligned bounding box for the rigid body. More...

Vec3 gpos_
The position of the center of mass of this rigid body. More...

Quat q_
The orientation of the body frame in the global world frame. More...

Mat3 R_
The rotation in reference to the global frame of reference. More...

id_t typeID_

## Additional Inherited Members

Public Attributes inherited from walberla::pe::cr::HCSITSBodyTrait
size_t index_

Protected Attributes inherited from walberla::pe::ccd::HashGridsBodyTrait
void * grid_
Pointer to the hash grid this rigid body is currently assigned to. More...

size_t hash_
Current hash value of this rigid body. More...

size_t cellId_
The body's index in the body container of the grid cell this rigid body is currently assigned to. More...

Private Member Functions inherited from walberla::NonCopyable
NonCopyable ()=default

~NonCopyable ()=default

## ◆ RigidBody()

 walberla::pe::RigidBody::RigidBody ( id_t const typeID, id_t sid, id_t uid )
explicitprotected

Constructor for the RigidBody class.

Parameters
 typeID The geometry type of the rigid body. sid The unique system-specific ID of the rigid body. uid The user-specific ID of the rigid body.

## ◆ ~RigidBody()

 walberla::pe::RigidBody::~RigidBody ( )
pure virtualdefault

Destructor for the RigidBody class.

## ◆ accFromWF() [1/2]

 const Vec3 walberla::pe::RigidBody::accFromWF ( const Vec3 & gpos ) const
inline

Calculation of the global acceleration of a point in global coordinates.

Parameters
 gpos The global coordinate.
Returns
The global acceleration.

The function calculates the global acceleration of a point in global coordinates.

## ◆ accFromWF() [2/2]

 const Vec3 walberla::pe::RigidBody::accFromWF ( real_t px, real_t py, real_t pz ) const
inline

Calculation of the global acceleration of a point in global coordinates.

Parameters
 px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
The global acceleration.

The function calculates the global acceleration of a point in global coordinates.

## ◆ addForce() [1/2]

 void walberla::pe::RigidBody::addForce ( const Vec3 & f )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting force.
Returns
void

The function applies a global force to the rigid body. The given force is acting directly in the body's center of mass and increases the total acting force on the body. If the rigid body is part of a superordinate body, the force is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the force can also cause a torque in the superordinate body.

## ◆ addForce() [2/2]

 void walberla::pe::RigidBody::addForce ( real_t fx, real_t fy, real_t fz )
inline

Increases the force acting in the body's center of mass.

Parameters
 fx The x-component of the force. fy The y-component of the force. fz The z-component of the force.
Returns
void

The function applies a global force to the rigid body. The given force is acting directly in the body's center of mass and increases the total acting force on the body. If the rigid body is part of a superordinate body, the force is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the force can also cause a torque in the superordinate body.

## ◆ addForceAtPos() [1/2]

 void walberla::pe::RigidBody::addForceAtPos ( const Vec3 & f, const Vec3 & gpos )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting global force. gpos The global coordinate.
Returns
void

The given force is acting at the specified coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addForceAtPos() [2/2]

 void walberla::pe::RigidBody::addForceAtPos ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
inline

Increases the force acting in the body's center of mass.

Parameters
 fx The x-component of the global force. fy The y-component of the global force. fz The z-component of the global force. px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
void

The given force is acting at the specified coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addForceAtRelPos() [1/2]

 void walberla::pe::RigidBody::addForceAtRelPos ( const Vec3 & f, const Vec3 & rpos )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting global force. rpos The relative coordinate.
Returns
void

The function applies a global force to the rigid body. The given force is acting at the specified body relative coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addForceAtRelPos() [2/2]

 void walberla::pe::RigidBody::addForceAtRelPos ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
inline

Increases the force acting in the body's center of mass.

Parameters
 fx The x-component of the global force. fy The y-component of the global force. fz The z-component of the global force. px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
void

The function applies a global force to the rigid body. The given force is acting at the specified body relative coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addImpulse() [1/2]

 void walberla::pe::RigidBody::addImpulse ( const Vec3 & j )
inline

Applying an impulse in the body's center of mass.

Parameters
 j The acting impulse.
Returns
void

The impulse is acting directly in the body's center of mass and instantaneously changes the linear velocity of the rigid body. If the body is part of a superordinate body, the impulse is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the impulse can also change the angular velocity of the rigid body (and the superordinate body).

## ◆ addImpulse() [2/2]

 void walberla::pe::RigidBody::addImpulse ( real_t jx, real_t jy, real_t jz )
inline

Applying an impulse in the body's center of mass.

Parameters
 jx The x-component of the impulse. jy The y-component of the impulse. jz The z-component of the impulse.
Returns
void

The impulse is acting directly in the body's center of mass and instantaneously changes the linear velocity of the rigid body. If the body is part of a superordinate body, the impulse is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the impulse can also change the angular velocity of the rigid body (and the superordinate body).

## ◆ addImpulseAtPos() [1/2]

 void walberla::pe::RigidBody::addImpulseAtPos ( const Vec3 & j, const Vec3 & p )
inline

Applying an impulse at the given global coordinate.

Parameters
 j The acting impulse. p The global coordinate.
Returns
void

The given impulse is acting at the specified coordinate and instantaneously changes the linear velocity of the rigid body. Depending on the position of the body's center of mass, the impulse can also change the angular velocity. If the rigid body is part of a superordinate body, the impulse is also acting on the superordinate body.

## ◆ addImpulseAtPos() [2/2]

 void walberla::pe::RigidBody::addImpulseAtPos ( real_t jx, real_t jy, real_t jz, real_t px, real_t py, real_t pz )
inline

Applying an impulse at the given global coordinate.

Parameters
 jx The x-component of the impulse. jy The y-component of the impulse. jz The z-component of the impulse. px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
void

The given impulse is acting at the specified coordinate and instantaneously changes the linear velocity of the rigid body. Depending on the position of the body's center of mass, the impulse can also change the angular velocity. If the rigid body is part of a superordinate body, the impulse is also acting on the superordinate body.

## ◆ addRelForce() [1/2]

 void walberla::pe::RigidBody::addRelForce ( const Vec3 & f )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting relative force.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting directly in the body's center of mass and increases the total force acting on the body. If the body is part of a superordinate body, the force is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the force can also cause a torque in the superordinate body.

## ◆ addRelForce() [2/2]

 void walberla::pe::RigidBody::addRelForce ( real_t fx, real_t fy, real_t fz )
inline

Increases the total force acting in the body's center of mass.

Parameters
 fx The x-component of the relative force. fy The y-component of the relative force. fz The z-component of the relative force.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting directly in the body's center of mass and increases the total force acting on the body. If the body is part of a superordinate body, the force is also acting on the superordinate body. Depending on the position of the superordinate body's center of mass, the force can also cause a torque in the superordinate body.

## ◆ addRelForceAtPos() [1/2]

 void walberla::pe::RigidBody::addRelForceAtPos ( const Vec3 & f, const Vec3 & gpos )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting relative force. gpos The global coordinate.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting at the specified global coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addRelForceAtPos() [2/2]

 void walberla::pe::RigidBody::addRelForceAtPos ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
inline

Increases the force acting in the body's center of mass.

Parameters
 fx The x-component of the relative force. fy The y-component of the relative force. fz The z-component of the relative force. px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting at the specified global coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addRelForceAtRelPos() [1/2]

 void walberla::pe::RigidBody::addRelForceAtRelPos ( const Vec3 & f, const Vec3 & rpos )
inline

Increases the force acting in the body's center of mass.

Parameters
 f The acting relative force. rpos The relative coordinate.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting at the specified body relative coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addRelForceAtRelPos() [2/2]

 void walberla::pe::RigidBody::addRelForceAtRelPos ( real_t fx, real_t fy, real_t fz, real_t px, real_t py, real_t pz )
inline

Increases the force acting in the body's center of mass.

Parameters
 fx The x-component of the relative force. fy The y-component of the relative force. fz The z-component of the relative force. px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
void

The function applies a body relative force to the rigid body. The given force is acting at the specified body relative coordinate and increases the total acting force on the rigid body. Depending on the position, the force can cause a torque in the body's center of mass. If the body is part of a superordinate body, the force is also acting on the superordinate body.

## ◆ addTorque() [1/2]

 void walberla::pe::RigidBody::addTorque ( const Vec3 & t )
inline

Increasing the torque acting in the body's center of mass.

Parameters
 t The acting torque.
Returns
void

The torque is acting directly in the body's center of mass and increases the total acting torque on the body. If the rigid body is part of a superordinate body, the torque is applied to the superordinate body instead. It is not possible to apply a torque on subordinate rigid bodies!

## ◆ addTorque() [2/2]

 void walberla::pe::RigidBody::addTorque ( real_t tx, real_t ty, real_t tz )
inline

Increasing the torque acting in the body's center of mass.

Parameters
 tx The x-component of the torque. ty The y-component of the torque. tz The z-component of the torque.
Returns
void

The torque is acting directly in the body's center of mass and increases the total acting torque on the body. If the rigid body is part of a superordinate body, the torque is applied to the superordinate body instead. It is not possible to apply a torque on subordinate rigid bodies!

## ◆ calcBoundingBox()

 virtual void walberla::pe::RigidBody::calcBoundingBox ( )
pure virtual

## ◆ calcMotion()

 void walberla::pe::RigidBody::calcMotion ( )
inline

Calculating the current motion of a rigid body.

Returns
void

This function calculates the current motion of a rigid body. The motion is a scalar value, consisting of the current linear and angular velocity and is calculated by the following equation:

$\Phi = \mbox{bias} \cdot \Phi + (1-\mbox{bias}) \cdot ( \vec{v}^2 + \vec{w}^2 ),$

where $\Phi$ is the motion, $\vec{v}$ is the linear velocity, $\vec{w}$ is the angular velocity and bias is the weighting factor for the recency-weighted average between the new motion value and the motion value from the last time frame (see pe::sleepBias). If the motion drops below pe::sleepThreshold, the rigid body is put to sleep.

## ◆ checkInvariants()

 bool walberla::pe::RigidBody::checkInvariants ( )
virtual

Checks the validity of the state of the rigid body.

Returns
true if no error is detected, false if any error if found.

## ◆ containsPoint() [1/2]

 bool walberla::pe::RigidBody::containsPoint ( const Vec3 & gpos ) const
inline

Checks, whether a point in global coordinates lies inside the rigid body.

Parameters
 gpos The global coordinate.
Returns
true if the point lies inside the rigid body, false if not.

## ◆ containsPoint() [2/2]

 bool walberla::pe::RigidBody::containsPoint ( real_t px, real_t py, real_t pz ) const
inline

Checks, whether a point in global coordinates lies inside the rigid body.

Parameters
 px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
true if the point lies inside the rigid body, false if not.

## ◆ containsRelPoint() [1/2]

 bool walberla::pe::RigidBody::containsRelPoint ( const Vec3 & rpos ) const
inline

Checks, whether a point in body relative coordinates lies inside the rigid body.

Parameters
 rpos The relative coordinate.
Returns
true if the point lies inside the rigid body, false if not.

## ◆ containsRelPoint() [2/2]

 bool walberla::pe::RigidBody::containsRelPoint ( real_t px, real_t py, real_t pz ) const
inline

Checks, whether a point in body relative coordinates lies inside the rigid body.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
true if the point lies inside the rigid body, false if not.

## ◆ containsRelPointImpl()

 bool walberla::pe::RigidBody::containsRelPointImpl ( real_t px, real_t py, real_t pz ) const
inlineprotectedvirtual

Checks, whether a point in body relative coordinates lies inside the rigid body.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
true if the point lies inside the rigid body, false if not.

## ◆ fix()

 void walberla::pe::RigidBody::fix ( )
inlineprotectedvirtual

Setting the global position (the center of mass) of the rigid body fixed.

Returns
void

This function fixes the global position (the center of mass) of a finite rigid body. If the body is contained in a superordinate body, fixing the contained body will also fix the global position of the superordinate body. In case the body is infinite or contained in an infinite superordinate body (as for instance a plane or an union containing a plane) the function has no effect.

In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ getAABB()

 const AABB & walberla::pe::RigidBody::getAABB ( ) const
inline

Returns the axis-aligned bounding box of the rigid body.

Returns
The axis-aligned bounding box of the rigid body.

## ◆ getAABBSize()

 real_t walberla::pe::RigidBody::getAABBSize ( ) const
inline

Returns the length of the longest side of the AABB of the rigid body.

Returns
The length of the longest side of the AABB of the rigid body.

## ◆ getAngularVel()

 const Vec3 & walberla::pe::RigidBody::getAngularVel ( ) const
inline

Returns the global angular velocity.

Returns
The global angular velocity.

This function returns the angular velocity of the center of mass in reference to the global world frame.

## ◆ getBodyAngularVel()

 const Vec3 walberla::pe::RigidBody::getBodyAngularVel ( ) const
inline

Returns the relative angular velocity.

Returns
The relative angular velocity.

This function returns the angular velocity of the center of mass in reference to the body's own frame of reference.

## ◆ getBodyInertia()

 const Mat3 & walberla::pe::RigidBody::getBodyInertia ( ) const
inline

Returns the moment of inertia in reference to the body frame of the rigid body.

Returns
The body relative moment of inertia.

## ◆ getBodyLinearVel()

 const Vec3 walberla::pe::RigidBody::getBodyLinearVel ( ) const
inline

Returns the relative linear velocity of the rigid body.

Returns
The relative linear velocity.

This function returns the linear velocity of the center of mass of the rigid body in reference to the body's own frame of reference.

## ◆ getEnergy()

 real_t walberla::pe::RigidBody::getEnergy ( ) const
inline

Returns the energy of the rigid body.

Returns
energy. Takes into account rotational energy, kinetic energy and potential energy.

## ◆ getForce()

 const Vec3 & walberla::pe::RigidBody::getForce ( ) const
inline

Returns the current force acting on the body's center of mass.

Returns
The acting force.

This function returns the current force acting on the rigid body. If the body is contained in a union, then this force is part of the total force acting on the union.

## ◆ getID()

 id_t walberla::pe::RigidBody::getID ( ) const
inline

Returns the user-specific ID of the rigid body.

Returns
The user-specific ID.

## ◆ getInertia()

 const Mat3 walberla::pe::RigidBody::getInertia ( ) const
inline

Returns the moment of inertia in reference to the global world frame.

Returns
The global moment of inertia.

## ◆ getInvBodyInertia()

 const Mat3 & walberla::pe::RigidBody::getInvBodyInertia ( ) const
inline

Returns the inverse moment of inertia in reference to the body frame of the rigid body.

Returns
The inverse body relative moment of inertia.

## ◆ getInvInertia()

 const Mat3 walberla::pe::RigidBody::getInvInertia ( ) const
inline

Returns the inverse moment of inertia in reference to the global world frame.

Returns
The inverse global moment of inertia.

## ◆ getInvMass()

 real_t walberla::pe::RigidBody::getInvMass ( ) const
inline

Returns the inverse total mass of the rigid body.

Returns
The inverse total mass of the rigid body.

## ◆ getKineticEnergy()

 real_t walberla::pe::RigidBody::getKineticEnergy ( ) const
inline

Returns the kinetic energy of the rigid body.

Returns
kinetic energy

## ◆ getLinearVel()

 const Vec3 walberla::pe::RigidBody::getLinearVel ( ) const
inline

Returns the global linear velocity of the rigid body.

Returns
The global linear velocity.

This function returns the linear velocity of the center of mass of the rigid body in reference to the global world frame.

## ◆ getManager() [1/2]

 ConstManagerID walberla::pe::RigidBody::getManager ( )
inline

Returns the supervising rigid body manager of the rigid body.

Returns
The supervising rigid body manager.

If the body is currently not supervised by an rigid body manager, the returned ManagerID is 0.

## ◆ getManager() [2/2]

 ConstManagerID walberla::pe::RigidBody::getManager ( ) const
inline

## ◆ getMass()

 real_t walberla::pe::RigidBody::getMass ( ) const
inline

Returns the total mass of the rigid body.

Returns
The total mass of the rigid body.

## ◆ getPosition()

 const Vec3 walberla::pe::RigidBody::getPosition ( ) const
inline

Returns the global position of the center of mass of the rigid body.

Returns
The global position of the center of mass.

## ◆ getQuaternion()

 const Quat walberla::pe::RigidBody::getQuaternion ( ) const
inline

Returns the orientation of the rigid body.

Returns
The orientation of the rigid body.

This function returns the quaternion of the rigid body, which represents the orientation of the body in reference to the global world frame.

## ◆ getRelPosition()

 const Vec3 walberla::pe::RigidBody::getRelPosition ( ) const
inline

Returns the relative position of the rigid body within the superordinate body.

Returns
The relative position of the rigid body.

If this body is not contained in a superbody the zero-vector is returned.

## ◆ getRelQuaternion()

 const Quat walberla::pe::RigidBody::getRelQuaternion ( ) const
inline

Returns the relative orientation of the rigid body to its superbody.

Returns
The relative orientation of the rigid body.

This function returns the quaternion, which represents the orientation of the body in reference to coordinate system of the superbody. If this body has no superbody the union-quaternion is returned.

## ◆ getRotation()

 const Mat3 walberla::pe::RigidBody::getRotation ( ) const
inline

Returns the rotation of the rigid body.

Returns
The rotation of the rigid body.

This function returns the rotation matrix of the rigid body, which represents the rotation of the body in reference to the global world frame.

## ◆ getRotationalEnergy()

 real_t walberla::pe::RigidBody::getRotationalEnergy ( ) const
inline

Returns the rotational energy of the rigid body.

Returns
rotational energy

## ◆ getSuperBody() [1/2]

 ConstBodyID walberla::pe::RigidBody::getSuperBody ( )
inline

Returns the superordinate body in which the rigid body is contained.

Returns
The superordinate body.

This function returns the direct superordinate body in which the rigid body is contained. If the rigid body is not contained in another body, the returned BodyID is the body itself.

## ◆ getSuperBody() [2/2]

 ConstBodyID walberla::pe::RigidBody::getSuperBody ( ) const
inline

## ◆ getSystemID()

 id_t walberla::pe::RigidBody::getSystemID ( ) const
inline

Returns the unique system-specific ID of the rigid body.

Returns
The system-specific ID.

## ◆ getTopSuperBody() [1/2]

 ConstBodyID walberla::pe::RigidBody::getTopSuperBody ( )
inline

Returns the top level superordinate body in which the rigid body is contained.

Returns
The top level superordinate body.

This function returns the top level superordinate body in which the rigid body is contained. If the rigid body is not contained in another body, the returned BodyID is the body itself.

Returns
The superordinate body.

This function returns the top level superordinate body in which the rigid body is contained. If the rigid body is not contained in another body, the returned BodyID is the body itself.

## ◆ getTopSuperBody() [2/2]

 ConstBodyID walberla::pe::RigidBody::getTopSuperBody ( ) const
inline

## ◆ getTorque()

 const Vec3 & walberla::pe::RigidBody::getTorque ( ) const
inline

Returns the current torque acting on the body's center of mass.

Returns
The acting torque.

This function returns the current torque acting in the center of mass of the rigid body. If the body is contained in a union, then this torque represents the part of the total torque acting on the union that results from the forces on this body.

## ◆ getTypeID()

 id_t walberla::pe::RigidBody::getTypeID ( ) const
inline

## ◆ getVolume()

 real_t walberla::pe::RigidBody::getVolume ( ) const
inlinevirtual

Returns the volume of the rigid body.

Returns
The volume of the rigid body.

## ◆ handleFixation()

 void walberla::pe::RigidBody::handleFixation ( )
inlineprotectedvirtual

Handling a fixation change of a contained subordinate body.

Returns
void

This function handles a fixation change of one of the contained subordinate bodies. Derived compound geometries that contain other primitive bodies are required to override this function in order to react to the fixation change. All primitive geometries can use the empty default implementation.

## ◆ handleModification()

 void walberla::pe::RigidBody::handleModification ( )
inlineprotectedvirtual

Handling an internal modification of a contained subordinate body.

Returns
void

This function handles an internal modification of one of the contained subordinate bodies. Derived compound geometries that contain other primitive or compound bodies are required to override this function in order to react to the modification. All primitive geometries can use the empty default implementation.

## ◆ handleRotation()

 void walberla::pe::RigidBody::handleRotation ( )
inlineprotectedvirtual

Handling an orientation change of a contained subordinate body.

Returns
void

This function handles a rotation or orientation change of one of the contained subordinate bodies. Derived compound geometries that contain other primitive bodies are required to override this function in order to react to the rotation. All primitive geometries can use the empty default implementation.

## ◆ handleTranslation()

 void walberla::pe::RigidBody::handleTranslation ( )
inlineprotectedvirtual

Handling a position change of a contained subordinate body.

Returns
void

This function handles a translation or position change of one of the contained subordinate bodies. Derived compound geometries that contain other primitive bodies are required to override this function in order to react to the translation. All primitive geometries can use the empty default implementation.

## ◆ hasForce()

 bool walberla::pe::RigidBody::hasForce ( ) const
inline

Returns whether the rigid body has non-zero acting forces or torques.

Returns
true if the currently acting force and/or torque is non-zero, false if not.

## ◆ hasInfiniteMass()

 bool walberla::pe::RigidBody::hasInfiniteMass ( ) const
inline

Checks if a body is "mobile" e.g.

will be integrated by the simulation

## ◆ hasManager()

 bool walberla::pe::RigidBody::hasManager ( ) const
inline

Returns whether the rigid body currently has a supervising rigid body manager.

Returns
true if the rigid body has a supervising manager, false if not.

## ◆ hasSubBodies()

 virtual bool walberla::pe::RigidBody::hasSubBodies ( ) const
inlinevirtual

## ◆ hasSuperBody()

 bool walberla::pe::RigidBody::hasSuperBody ( ) const
inline

Returns whether the rigid body is contained in a superordinate body.

Returns
true if the rigid body is contained in a superordinate body, false if not.

## ◆ isAwake()

 bool walberla::pe::RigidBody::isAwake ( ) const
inline

Returns whether the rigid body is awake or not.

Returns
true in case the rigid body is awake, false if is not.

## ◆ isCommunicating()

 bool walberla::pe::RigidBody::isCommunicating ( ) const
inline

Returns whether the rigid body is local or not.

Returns
true in case of a local rigid body, false otherwise.

## ◆ isFinite()

 bool walberla::pe::RigidBody::isFinite ( ) const
inline

Returns whether the rigid body is finite or not.

Returns
true in case of a finite rigid body, false in case of a infinite rigid body.

## ◆ isFixed()

 bool walberla::pe::RigidBody::isFixed ( ) const
inline

Returns whether the rigid body's position is fixed or not.

Returns
true in case of a fixed/stationary rigid body, false in case of a free body.

## ◆ isGlobal()

 bool walberla::pe::RigidBody::isGlobal ( ) const
inline

Returns whether the rigid body is global or not.

Returns
true in case of a global rigid body, false otherwise.

## ◆ isMarkedForDeletion()

 bool walberla::pe::RigidBody::isMarkedForDeletion ( ) const
inline

## ◆ isRemote()

 bool walberla::pe::RigidBody::isRemote ( ) const
inline

Returns whether the rigid body is remote or not.

Returns
true in case of a remote rigid body, false in case of a local body.

## ◆ isSurfacePoint() [1/2]

 bool walberla::pe::RigidBody::isSurfacePoint ( const Vec3 & gpos ) const
inline

Checks, whether a point in global coordinates lies on the surface of the rigid body.

Parameters
 gpos The global coordinate.
Returns
true if the point lies on the surface of the rigid body, false if not.

The tolerance level of the check is surfaceThreshold.

## ◆ isSurfacePoint() [2/2]

 bool walberla::pe::RigidBody::isSurfacePoint ( real_t px, real_t py, real_t pz ) const
inline

Checks, whether a point in global coordinates lies on the surface of the rigid body.

Parameters
 px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
true if the point lies on the surface of the rigid body, false if not.

The tolerance level of the check is surfaceThreshold.

## ◆ isSurfaceRelPoint() [1/2]

 bool walberla::pe::RigidBody::isSurfaceRelPoint ( const Vec3 & rpos ) const
inline

Checks, whether a point in body relative coordinates lies on the surface of the rigid body.

Parameters
 rpos The relative coordinate.
Returns
true if the point lies on the surface of the rigid body, false if not.

The tolerance level of the check is pe::surfaceThreshold.

## ◆ isSurfaceRelPoint() [2/2]

 bool walberla::pe::RigidBody::isSurfaceRelPoint ( real_t px, real_t py, real_t pz ) const
inline

Checks, whether a point in relative coordinates lies on the surface of the rigid body.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
true if the point lies on the surface of the rigid body, false if not.

The tolerance level of the check is surfaceThreshold.

## ◆ isSurfaceRelPointImpl()

 bool walberla::pe::RigidBody::isSurfaceRelPointImpl ( real_t px, real_t py, real_t pz ) const
inlineprotectedvirtual

Checks, whether a point in relative coordinates lies on the surface of the rigid body.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
true if the point lies on the surface of the rigid body, false if not.

The tolerance level of the check is surfaceThreshold.

## ◆ isVisible()

 bool walberla::pe::RigidBody::isVisible ( ) const
inline

Returns whether the rigid body is visible or not.

Returns
true in case of a visible rigid body, false in case of an invisible body.

## ◆ markForDeletion()

 void walberla::pe::RigidBody::markForDeletion ( )
inline

Marks the rigid body for deletion during the next synchronization.

Attention
Only works on local bodies!!!
Has no effect on global or shadow bodies.
Bodies which are non communicating have to be explicitly communicated during synchronization!

## ◆ pointFromBFtoWF() [1/2]

 const Vec3 walberla::pe::RigidBody::pointFromBFtoWF ( const Vec3 & rpos ) const
inline

Transformation from a relative to a global coordinate.

Parameters
 rpos the relative coordinate.
Returns
The transformed global coordinate.

The function calculates the transformation of a point relative to the body's center of mass to a point in global coordinates.

## ◆ pointFromBFtoWF() [2/2]

 const Vec3 walberla::pe::RigidBody::pointFromBFtoWF ( real_t px, real_t py, real_t pz ) const
inline

Transformation from a relative to a global coordinate.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
The transformed global coordinate.

The function calculates the transformation of a point relative to the body's center of mass to a point in global coordinates.

## ◆ pointFromWFtoBF() [1/2]

 const Vec3 walberla::pe::RigidBody::pointFromWFtoBF ( const Vec3 & gpos ) const
inline

Transformation from a global to a relative coordinate.

Parameters
 gpos The global coordinate.
Returns
The transformed relative coordinate.

The function calculates the transformation of a point in global coordinates to a point relative to the body's center of mass.

## ◆ pointFromWFtoBF() [2/2]

 const Vec3 walberla::pe::RigidBody::pointFromWFtoBF ( real_t px, real_t py, real_t pz ) const
inline

Transformation from a global to a relative coordinate.

Parameters
 px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
The transformed relative coordinate.

The function calculates the transformation of a point in global coordinates to a point relative to the body's center of mass.

## ◆ print()

 virtual void walberla::pe::RigidBody::print ( std::ostream & os, const char * tab ) const
pure virtual

## ◆ resetForceAndTorque()

 void walberla::pe::RigidBody::resetForceAndTorque ( )
inlinevirtual

Resetting all acting forces and torques from the rigid body.

Returns
void

## ◆ resetSB()

 void walberla::pe::RigidBody::resetSB ( )
inline

Resets the super body for the current body.

Attention
Behaviour changed compared to setSuperBody of old PE!!!

## ◆ rotate() [1/5]

 void walberla::pe::RigidBody::rotate ( const Quat & dq )
inline

Rotation of the rigid body by the quaternion dq.

Parameters
 dq The quaternion for the rotation.
Returns
void

Changing the orientation/rotation of the rigid body. The rigid body is rotated around its center of mass by the quaternion dq.
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) box on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotate() [2/5]

 void walberla::pe::RigidBody::rotate ( const Vec3 & axis, real_t angle )
inline

Rotation of the rigid body around the specified global rotation axis by the rotation.

angle angle.

Parameters
 axis The global rotation axis. angle The rotation angle (radian measure).
Returns
void

Changing the orientation/rotation of the rigid body. The rigid body is rotated around its center of mass around the given axis axis by angle degrees (radian measure).
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) box on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotate() [3/5]

 void walberla::pe::RigidBody::rotate ( const Vec3 & euler )
inline

Rotation of the rigid body by the Euler angles euler.

Parameters
 euler 3-dimensional vector of the three rotation angles (radian measure).
Returns
void

Changing the orientation/rotation of the rigid body. The rigid body is rotated around its center of mass by the Euler angles euler (all components in radian measure). The rotations are applied in the order x, y, and z.
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) box on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotate() [4/5]

 void walberla::pe::RigidBody::rotate ( real_t x, real_t y, real_t z, real_t angle )
inline

Rotation of the rigid body around the global rotation axis (x,y,z) by the rotation angle angle.

Parameters
 x The x-component of the global rotation axis. y The y-component of the global rotation axis. z The z-component of the global rotation axis. angle The rotation angle (radian measure).
Returns
void

Changing the orientation/rotation of the rigid body. The rigid body is rotated around its center of mass around the given axis (x,y,z) by angle degrees (radian measure).
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) box on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotate() [5/5]

 void walberla::pe::RigidBody::rotate ( real_t xangle, real_t yangle, real_t zangle )
inline

Rotation of the rigid body by the Euler angles xangle, yangle and zangle.

Parameters
 xangle Rotation around the x-axis (radian measure). yangle Rotation around the y-axis (radian measure). zangle Rotation around the z-axis (radian measure).
Returns
void

Changing the orientation/rotation of the rigid body. The rigid body is rotated around its center of mass by the Euler angles xangle, yangle and zangle (all in radian measure). The rotations are applied in the order x, y, and z.
Note:

• Rotating a box contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) box on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotateAroundOrigin() [1/5]

 void walberla::pe::RigidBody::rotateAroundOrigin ( const Quat & dq )
inline

Rotation of the rigid body around the origin of the global world frame.

Parameters
 dq The quaternion for the rotation.
Returns
void

This function rotates the rigid body around the origin of the global world frame and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated by the Euler angles euler (all components in radian measure). The rotations are applied in the order x, y, and z.
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotateAroundOrigin() [2/5]

 void walberla::pe::RigidBody::rotateAroundOrigin ( const Vec3 & axis, real_t angle )
inline

Rotation of the rigid body around the origin of the global world frame.

Parameters
 axis The global rotation axis. angle The rotation angle (radian measure).
Returns
void

This function rotates the rigid body around the origin of the global world frame and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated around the given axis axis by angle degrees (radian measure).

rotateAroundOrigin( const Quat& dq )

## ◆ rotateAroundOrigin() [3/5]

 void walberla::pe::RigidBody::rotateAroundOrigin ( const Vec3 & euler )
inline

Rotation of the rigid body around the origin of the global world frame.

Parameters
 euler 3-dimensional vector of the three rotation angles (radian measure).
Returns
void

This function rotates the box around the origin of the global world frame and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated by the Euler angles euler (all components in radian measure). The rotations are applied in the order x, y, and z.

rotateAroundOrigin( const Quat& dq )

## ◆ rotateAroundOrigin() [4/5]

 void walberla::pe::RigidBody::rotateAroundOrigin ( real_t x, real_t y, real_t z, real_t angle )
inline

Rotation of the rigid body around the origin of the global world frame.

Parameters
 x The x-component of the global rotation axis. y The y-component of the global rotation axis. z The z-component of the global rotation axis. angle The rotation angle (radian measure).
Returns
void

This function rotates the rigid body around the origin of the global world frame and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated around the given axis (x,y,z) by angle degrees (radian measure).

rotateAroundOrigin( const Quat& dq )

## ◆ rotateAroundOrigin() [5/5]

 void walberla::pe::RigidBody::rotateAroundOrigin ( real_t xangle, real_t yangle, real_t zangle )
inline

Rotation of the rigid body around the origin of the global world frame.

Parameters
 xangle Rotation around the x-axis (radian measure). yangle Rotation around the y-axis (radian measure). zangle Rotation around the z-axis (radian measure).
Returns
void

This function rotates the rigid body around the origin of the global world frame and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated by the Euler angles xangle, yangle and zangle (all components in radian measure). The rotations are applied in the order x, y, and z.

rotateAroundOrigin( const Quat& dq )

## ◆ rotateAroundOriginImpl()

 void walberla::pe::RigidBody::rotateAroundOriginImpl ( const Quat & dq )
inlineprotectedvirtual

Implements the rotation of a rigid body.

May be overwritten in derived classes for performance reasons.

Parameters
 dq The quaternion for the rotation.
Returns
void

Reimplemented in walberla::pe::Plane.

## ◆ rotateAroundPoint() [1/2]

 void walberla::pe::RigidBody::rotateAroundPoint ( const Vec3 & point, const Vec3 & axis, real_t angle )
inline

Rotation of the rigid body around a specific global coordinate.

Parameters
 point The global center of the rotation. axis The global rotation axis. angle The rotation angle (radian measure).
Returns
void

This function rotates the rigid body around the given global coordinate point and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated around the given axis axis by angle degrees (radian measure).
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotateAroundPoint() [2/2]

 void walberla::pe::RigidBody::rotateAroundPoint ( const Vec3 & point, const Vec3 & euler )
inline

Rotation of the rigid body around a specific global coordinate.

Parameters
 point The global center of the rotation. euler 3-dimensional vector of the three rotation angles (radian measure).
Returns
void

This function rotates the rigid body around the given global coordinate point and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated by the Euler angles euler (all components in radian measure). The rotations are applied in the order x, y, and z.
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ rotateAroundPointImpl()

 void walberla::pe::RigidBody::rotateAroundPointImpl ( const Vec3 & point, const Quat & dq )
inlineprotectedvirtual

Rotation of the rigid body around a specific global coordinate.

Parameters
 point The global center of the rotation. dq The quaternion for the rotation.
Returns
void

This function rotates the rigid body around the given global coordinate point and changes both the global position and the orientation/rotation of the rigid body. The rigid body is rotated by the quaternion dq.
Note:

• Rotating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

Reimplemented in walberla::pe::Plane.

## ◆ rotateImpl()

 void walberla::pe::RigidBody::rotateImpl ( const Quat & dq )
inlineprotectedvirtual

Implements the rotation of a rigid body.

May be overwritten in derived classes for performance reasons.

Parameters
 dq The quaternion for the rotation.
Returns
void

Reimplemented in walberla::pe::Plane.

## ◆ setAngularVel() [1/2]

 void walberla::pe::RigidBody::setAngularVel ( const Vec3 & avel )
inline

## ◆ setAngularVel() [2/2]

 void walberla::pe::RigidBody::setAngularVel ( real_t ax, real_t ay, real_t az )
inline

Setting the global angular velocity of the rigid body.

Parameters
 ax The x-component of the global angular velocity. ay The y-component of the global angular velocity. az The z-component of the global angular velocity.
Returns
void

This function sets the angular velocity of the rigid body. If the body is contained in a superordinate body the function has no effect.

In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setCommunicating()

 void walberla::pe::RigidBody::setCommunicating ( const bool communicating )
inline

Setting the local flag of the rigid body.

Returns
void

This function declares the rigid body as a local body. Note that this function should not be used explicitly, but is automatically called during the setup of local rigid bodies. Using this function explicitly may lead to simulation errors during a parallel simulation!

## ◆ setFinite()

 void walberla::pe::RigidBody::setFinite ( const bool finite )
inline

## ◆ setForce()

 void walberla::pe::RigidBody::setForce ( const Vec3 & f )
inline

Set the force acting at the body's center of mass.

Parameters
 f The acting force.
Returns
void

## ◆ setGlobal()

 void walberla::pe::RigidBody::setGlobal ( const bool global )
inline

Setting the global flag of the rigid body.

Returns
void

This function declares the rigid body as a global body. Note that this function should not be used explicitly, but is automatically called during the setup of local rigid bodies. Using this function explicitly may lead to simulation errors during a parallel simulation!

## ◆ setLinearVel() [1/2]

 void walberla::pe::RigidBody::setLinearVel ( const Vec3 & lvel )
inline

## ◆ setLinearVel() [2/2]

 void walberla::pe::RigidBody::setLinearVel ( real_t vx, real_t vy, real_t vz )
inline

Setting the global linear velocity of the rigid body.

Parameters
 vx The x-component of the global linear velocity. vy The y-component of the global linear velocity. vz The z-component of the global linear velocity.
Returns
void

This function sets the linear velocity of the rigid body. If the body is contained in a superordinate body the function has no effect.

In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setMassAndInertia()

 void walberla::pe::RigidBody::setMassAndInertia ( const real_t mass, const Mat3 & inertia )
inlineprotected

Sets mass and inertia of a rigid body.

Also calculates inverse values.

Parameters
 mass mass to be set (may be infinity) inertia inertia to be set (if mass is infinity this one will be ignored)

## ◆ setMassAndInertiaToInfinity()

 void walberla::pe::RigidBody::setMassAndInertiaToInfinity ( )
inline

Setting the mass to infinity. This will also make the inertia tensor infinite.

Attention
This cannot be undone!

## ◆ setOrientation() [1/2]

 void walberla::pe::RigidBody::setOrientation ( const Quat & q )
inline

Setting the global orientation of the rigid body.

Parameters
 q The global orientation.
Returns
void

This function sets the global orientation of the rigid body to the given quaternion q.

Note:

• Setting the orientation of a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setOrientation() [2/2]

 void walberla::pe::RigidBody::setOrientation ( real_t r, real_t i, real_t j, real_t k )
inline

Setting the global orientation of the rigid body.

Parameters
 r The value for the real_t part. i The value for the first imaginary part. j The value for the second imaginary part. k The value for the third imaginary part.
Returns
void

This function sets the global orientation of the rigid body to the given quaternion (r,i,j,k).

Note:

• Setting the orientation of a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setOrientationImpl()

 void walberla::pe::RigidBody::setOrientationImpl ( real_t r, real_t i, real_t j, real_t k )
inlineprotectedvirtual

Setting the global orientation of the rigid body.

Parameters
 r The value for the real_t part. i The value for the first imaginary part. j The value for the second imaginary part. k The value for the third imaginary part.
Returns
void

This function sets the global orientation of the rigid body to the given quaternion (r,i,j,k).

Note:

• Setting the orientation of a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this changes the union and may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the box on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

Reimplemented in walberla::pe::Plane.

## ◆ setPosition() [1/2]

 void walberla::pe::RigidBody::setPosition ( const Vec3 & gpos )
inline

Setting the global position of the rigid body.

Parameters
 gpos The global position.
Returns
void

This function sets the global position of the rigid body to the given coordinate gpos.

Note:

• Setting the position of a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setPosition() [2/2]

 void walberla::pe::RigidBody::setPosition ( real_t px, real_t py, real_t pz )
inline

Setting the global position of the rigid body.

Parameters
 px The x-component of the global position. py The y-component of the global position. pz The z-component of the global position.
Returns
void

This function sets the global position of the rigid body to the given coordinate (px,py,pz).

Note:

• Setting the position of a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setPositionImpl()

 void walberla::pe::RigidBody::setPositionImpl ( real_t px, real_t py, real_t pz )
inlineprotectedvirtual

Reimplemented in walberla::pe::Plane.

## ◆ setRelAngularVel() [1/2]

 void walberla::pe::RigidBody::setRelAngularVel ( const Vec3 & avel )
inline

## ◆ setRelAngularVel() [2/2]

 void walberla::pe::RigidBody::setRelAngularVel ( real_t ax, real_t ay, real_t az )
inline

Setting the relative angular velocity of the rigid body.

Parameters
 ax The x-component of the relative angular velocity. ay The y-component of the relative angular velocity. az The z-component of the relative angular velocity.
Returns
void

This function sets the angular velocity of the rigid body in reference to the body's own frame of reference. The given relative velocity is translated into the global world frame depending on the orientation of the rigid body. If the body is contained in a superordinate body the function has no effect.

In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setRelLinearVel() [1/2]

 void walberla::pe::RigidBody::setRelLinearVel ( const Vec3 & lvel )
inline

## ◆ setRelLinearVel() [2/2]

 void walberla::pe::RigidBody::setRelLinearVel ( real_t vx, real_t vy, real_t vz )
inline

Setting the relative linear velocity of the rigid body.

Parameters
 vx The x-component of the relative linear velocity. vy The y-component of the relative linear velocity. vz The z-component of the relative linear velocity.
Returns
void

This function sets the linear velocity of the rigid body in reference to the body's own frame of reference. The given relative velocity is translated into the global world frame depending on the orientation of the rigid body. If the body is contained in a superordinate body the function has no effect.

In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setRelOrientation()

 void walberla::pe::RigidBody::setRelOrientation ( const Quat & q )
inline

Setting the relative position of the rigid body.

Parameters
 q The relative orientation.
Returns
void

This function sets the relative orientation of the rigid body w. r. t. the superbodies position.

Note:

• Setting the relative orientation of a rigid body without superbody will have no effect.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setRelPosition()

 void walberla::pe::RigidBody::setRelPosition ( const Vec3 & gpos )
inline

Setting the global position of the rigid body.

Parameters
 gpos The relative position.
Returns
void

This function sets the relative position of the rigid body w. r. t. the superbodies position.

Note:

• Setting the position of a rigid body without superbody will have no effect.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ setRemote()

 void walberla::pe::RigidBody::setRemote ( bool remote )
inlinevirtual

Setting the remote flag of the rigid body.

Parameters
 remote true to declare the rigid body remote, false declare it local.
Returns
void

This function sets the remote flag of the rigid body. Note that this function should not be used explicitly, but is automatically called during the MPI communication to set the remote status of a rigid body within the simulation world. Using this function explicitly may lead to simulation errors during a parallel simulation!

## ◆ setSB()

 void walberla::pe::RigidBody::setSB ( BodyID body )
inline

Sets the super body for the current body.

Attention
Behaviour changed compared to setSuperBody of old PE!!!

## ◆ setTorque()

 void walberla::pe::RigidBody::setTorque ( const Vec3 & tau )
inline

Set the torque acting at the body's center of mass.

Parameters
 tau The acting torque.
Returns
void

## ◆ setVisible()

 void walberla::pe::RigidBody::setVisible ( bool visible )
inline

Setting the rigid body visible/invisible.

Parameters
 visible true to make the rigid body visible, false to make it invisible.
Returns
void

## ◆ signalFixation()

 void walberla::pe::RigidBody::signalFixation ( )
inlineprotected

Signals a fixation change of a contained subordinate body.

Returns
void

This function can be used by derived primitive geometries to signal a change of the fixation flag to its superordinate body.

## ◆ signalModification()

 void walberla::pe::RigidBody::signalModification ( )
inlineprotected

Signals an internal modification of a contained subordinate body.

Returns
void

This function can be used by derived primitive geometries to signal an internal modification to its superordinate body.

## ◆ signalRotation()

 void walberla::pe::RigidBody::signalRotation ( )
inlineprotected

Signals an orientation change of a contained subordinate body.

Returns
void

This function can be used by derived primitive geometries to signal a rotation or orientation change to its superordinate body.

## ◆ signalTranslation()

 void walberla::pe::RigidBody::signalTranslation ( )
inlineprotected

Signals a position change of a contained subordinate body.

Returns
void

This function can be used by derived primitive geometries to signal a translation or a position change to its superordinate body.

## ◆ support()

 Vec3 walberla::pe::RigidBody::support ( const Vec3 & d ) const
inlinevirtual

Estimates the point which is farthest in direction d.

Parameters
 d The normalized search direction in world-frame coordinates.
Returns
The support point in world-frame coordinates in direction d.

## ◆ supportContactThreshold()

 Vec3 walberla::pe::RigidBody::supportContactThreshold ( const Vec3 & d ) const
inlinevirtual

Estimates the point which is farthest in direction d.

Parameters
 d The normalized search direction in world-frame coordinates
Returns
The support point in world-frame coordinates in direction d extended by a vector in direction d of length pe::contactThreshold.

Reimplemented in walberla::pe::Box, and walberla::mesh::pe::ConvexPolyhedron.

## ◆ translate() [1/2]

 void walberla::pe::RigidBody::translate ( const Vec3 & dp )
inline

Translation of the center of mass of the rigid body by the displacement vector dp.

Parameters
 dp The displacement vector.
Returns
void

Note:

• Translating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ translate() [2/2]

 void walberla::pe::RigidBody::translate ( real_t dx, real_t dy, real_t dz )
inline

Translation of the center of mass of the rigid body by the displacement vector.

(dx,dy,dz).

Parameters
 dx The x-component of the translation/displacement. dy The y-component of the translation/displacement. dz The z-component of the translation/displacement.
Returns
void

Note:

• Translating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

## ◆ translateImpl()

 void walberla::pe::RigidBody::translateImpl ( real_t dx, real_t dy, real_t dz )
inlineprotectedvirtual

Translation of the center of mass of the rigid body by the displacement vector.

(dx,dy,dz).

Parameters
 dx The x-component of the translation/displacement. dy The y-component of the translation/displacement. dz The z-component of the translation/displacement.
Returns
void

Note:

• Translating a rigid body contained in a union changes the mass distribution and geometry of the union. Therefore this may cause an invalidation of links contained in the union.
• In case of a MPI parallel simulation, changing the settings of a (local) rigid body on one process may invalidate the settings of the rigid body on another process. In order to synchronize all rigid bodies after local changes, the simulation has to be synchronized by the user. Note that any changes on remote rigid bodies are neglected and overwritten by the settings of the rigid body on its local process!

Reimplemented in walberla::pe::Plane.

## ◆ vectorFromBFtoWF() [1/2]

 const Vec3 walberla::pe::RigidBody::vectorFromBFtoWF ( const Vec3 & v ) const
inline

Transformation from a relative to a global vector.

Parameters
 v the relative vector.
Returns
The transformed global vector.

The function calculates the transformation of a vector in body frame to a vector in global world frame.

## ◆ vectorFromBFtoWF() [2/2]

 const Vec3 walberla::pe::RigidBody::vectorFromBFtoWF ( real_t vx, real_t vy, real_t vz ) const
inline

Transformation from a relative to a global vector.

Parameters
 vx The x-component of the relative vector. vy The y-component of the relative vector. vz The z-component of the relative vector.
Returns
The transformed global vector.

The function calculates the transformation of a vector in body frame to a vector in global world frame.

## ◆ vectorFromWFtoBF() [1/2]

 const Vec3 walberla::pe::RigidBody::vectorFromWFtoBF ( const Vec3 & v ) const
inline

Transformation from a global to a relative vector.

Parameters
 v The global vector.
Returns
The transformed relative vector.

The function calculates the transformation of a vector in global world frame to a vector in body frame.

## ◆ vectorFromWFtoBF() [2/2]

 const Vec3 walberla::pe::RigidBody::vectorFromWFtoBF ( real_t vx, real_t vy, real_t vz ) const
inline

Transformation from a global to a relative vector.

Parameters
 vx The x-component of the global vector. vy The y-component of the global vector. vz The z-component of the global vector.
Returns
The transformed relative vector.

The function calculates the transformation of a vector in global world frame to a vector in body frame.

## ◆ velFromBF() [1/2]

 Vec3 walberla::pe::RigidBody::velFromBF ( const Vec3 & rpos ) const
virtual

Calculation of the global velocity of a relative point.

Parameters
 rpos The relative coordinate.
Returns
The global velocity.

The function calculates the global velocity of a point relative to the body's center of mass.

Reimplemented in walberla::pe::Squirmer.

## ◆ velFromBF() [2/2]

 Vec3 walberla::pe::RigidBody::velFromBF ( real_t px, real_t py, real_t pz ) const
virtual

Calculation of the global velocity of a relative point.

Parameters
 px The x-component of the relative coordinate. py The y-component of the relative coordinate. pz The z-component of the relative coordinate.
Returns
The global velocity.

The function calculates the global velocity of a point relative to the body's center of mass.

Reimplemented in walberla::pe::Squirmer.

## ◆ velFromWF() [1/2]

 Vec3 walberla::pe::RigidBody::velFromWF ( const Vec3 & gpos ) const
virtual

Calculation of the global velocity of a point in global coordinates.

Parameters
 gpos The global coordinate.
Returns
The global velocity.

The function calculates the global velocity of a point in global coordinates.

Reimplemented in walberla::pe::Squirmer.

## ◆ velFromWF() [2/2]

 Vec3 walberla::pe::RigidBody::velFromWF ( real_t px, real_t py, real_t pz ) const
virtual

Calculation of the global velocity of a point in global coordinates.

Parameters
 px The x-component of the global coordinate. py The y-component of the global coordinate. pz The z-component of the global coordinate.
Returns
The global velocity.

The function calculates the global velocity of a point in global coordinates.

Reimplemented in walberla::pe::Squirmer.

## ◆ wake()

 void walberla::pe::RigidBody::wake ( )
inline

Waking the rigid body and ending the sleep mode.

Returns
void

This function wakes a rigid body from sleep mode. Note that this function has no effect if it is called on a subordinate rigid body, i.e. a body contained in another rigid body.

## ◆ Union

template<typename... BodyTypes>
 friend class Union
friend

## ◆ aabb_

 AABB walberla::pe::RigidBody::aabb_
protected

Axis-aligned bounding box for the rigid body.

## ◆ awake_

 bool walberla::pe::RigidBody::awake_
protected

Sleep mode flag.

The flag value indicates if the rigid body is currently awake (true) or in sleep mode (false).

## ◆ communicating_

 bool walberla::pe::RigidBody::communicating_
protected

Communicating flag.

The local flag indicates whether the rigid body is local in an MPI parallel simulation. Local bodies are not participating in any communication process.

## ◆ finite_

 bool walberla::pe::RigidBody::finite_
protected

Finiteness flag.

The flag value indicates if the rigid body is finite (true) or infinite (false).

## ◆ force_

 Vec3 walberla::pe::RigidBody::force_
protected

Total force (external+contact) acting in the body's center of mass.

## ◆ global_

 bool walberla::pe::RigidBody::global_
protected

Global flag.

The global flag indicates whether the rigid body is global in an MPI parallel simulation.

## ◆ gpos_

 Vec3 walberla::pe::RigidBody::gpos_
private

The position of the center of mass of this rigid body.

If the body is contained in union this and the other properties are relative to its center / orientation. Use the respective function getPosition() / getRotation() to access the actual global Position in the world frame

## ◆ I_

 Mat3 walberla::pe::RigidBody::I_
protected

The moment of inertia in reference to the body's own body frame.

The moment of inertia quantifies the rotational inertia of a rigid body, i.e. its inertia with respect to rotational motion, in a manner somewhat analogous to how mass quantifies the inertia of a body with respect to translational motion. The naming convention of the tensor elements is

$\left(\begin{array}{*{3}{c}} I_{xx} & I_{xy} & I_{xz} \\ I_{yx} & I_{yy} & I_{yz} \\ I_{zx} & I_{zy} & I_{zz} \\ \end{array}\right)$

## ◆ Iinv_

 Mat3 walberla::pe::RigidBody::Iinv_
protected

The inverse moment of inertia within the body frame.

## ◆ invMass_

 real_t walberla::pe::RigidBody::invMass_
protected

The inverse total mass of the rigid body.

## ◆ manager_

 ManagerID walberla::pe::RigidBody::manager_
protected

The rigid body manager responsible for the rigid body.

## ◆ mass_

 real_t walberla::pe::RigidBody::mass_
protected

The total mass of the rigid body.

## ◆ motion_

 real_t walberla::pe::RigidBody::motion_
protected

The current motion of the rigid body.

If this value drops under the specified sleep threshold, the rigid body will be put to sleep.

## ◆ MPITrait

 MPIRigidBodyTrait walberla::pe::RigidBody::MPITrait

## ◆ q_

 Quat walberla::pe::RigidBody::q_
private

The orientation of the body frame in the global world frame.

## ◆ R_

 Mat3 walberla::pe::RigidBody::R_
private

The rotation in reference to the global frame of reference.

## ◆ remote_

 bool walberla::pe::RigidBody::remote_
protected

Remote flag.

This flag indicates whether the rigid body belongs to a remote process (true) or to the local process (false).

## ◆ sb_

 BodyID walberla::pe::RigidBody::sb_
protected

The superordinate rigid body.

This data member is the connection to the superordinate body, which is either the enclosing Union or the rigid body itself.

## ◆ sid_

 id_t walberla::pe::RigidBody::sid_
protected

The unique system-specific body ID.

## ◆ toBeDeleted_

 bool walberla::pe::RigidBody::toBeDeleted_
protected

This flag marks the body for deletion during the next synchronization (only works on local bodies)

## ◆ torque_

 Vec3 walberla::pe::RigidBody::torque_
protected

Total torque (external+contact) acting in the body's center of mass.

## ◆ typeID_

 id_t walberla::pe::RigidBody::typeID_
private

## ◆ uid_

 id_t walberla::pe::RigidBody::uid_
protected

The user-specific body ID.

## ◆ v_

 Vec3 walberla::pe::RigidBody::v_
mutableprotected

The linear velocity of this rigid body.

## ◆ visible_

 bool walberla::pe::RigidBody::visible_
protected

Visibility flag.

## ◆ w_

 Vec3 walberla::pe::RigidBody::w_
mutableprotected

Angular velocity of this rigid body.

The documentation for this class was generated from the following files: