walberla::pe::Plane Class Reference

Detailed Description

Plane geometry.

The Plane class represents the geometric primitive plane, which is one of the basic geometric primitives of the pe module. The class is derived from the GeomPrimitive base class, which makes the plane both a geometric primitive and a rigid body.
The plane geometry is an infinite rigid body dividing the global space in two half spaces. One of these half spaces is considered to be inside the plane. Bodies entering this half space are therefore colliding with the plane. The other half space is considered to be outside the plane. The plane is represented by the following equation:

                           \f[ ax + by + cz = d , \f]

where a, b and c are the x, y and z component of the normal vector. The normal n of the plane is a normalized vector that points towards the half space outside the plane. d is the distance/displacement from the origin of the global world frame to the plane. A positive value of d indicates that the origin of the global world frame is inside the plane, whereas a negative value of d indicates that the origin is outside the plane. A value of 0 therefore indicates that the origin is on the surface of the plane. The global position \( (x,y,z) \) of the plane can be considered the anchor point of the plane. Rotations that are performed via the setOrientation() or the rotate() functions rotate the plane around this anchor point.

#include <Plane.h>

+ Inheritance diagram for walberla::pe::Plane:

Public Member Functions

Constructor
 Plane (id_t sid, id_t uid, const Vec3 &gpos, const Vec3 &normal, real_t d, MaterialID material)
 Constructor for the Plane class. More...
 
Destructor
 ~Plane () override
 Destructor for the PlaneBase class. More...
 
Get functions
real_t getVolume () const override
 Returns the volume of the plane. More...
 
const Vec3getNormal () const
 Returns the normal of the plane in reference to the global world frame. More...
 
real_t getDisplacement () const
 Returns the displacement/distance from the origin of the global world frame. More...
 
Output functions
void print (std::ostream &os, const char *tab) const override
 Output of the current state of a plane. More...
 
- Public Member Functions inherited from walberla::pe::GeomPrimitive
MaterialID getMaterial () const
 Returns the material of the geometric primitive. More...
 
- Public Member Functions inherited from walberla::pe::RigidBody
virtual ~RigidBody ()=0
 Destructor for the RigidBody class. More...
 
void wake ()
 Waking the rigid body and ending the sleep mode. More...
 
void calcMotion ()
 Calculating the current motion of a rigid body. More...
 
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...
 
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
 
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...
 
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...
 
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...
 
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...
 
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...
 
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...
 
virtual bool checkInvariants ()
 Checks the validity of the state of the 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...
 
- 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...
 

Utility functions

real_t getRelDepth (real_t px, real_t py, real_t pz) const
 Calculates the depth of a point relative to the plane's frame of reference. More...
 
real_t getRelDepth (const Vec3 &rpos) const
 Calculates the depth of a point relative to the plane's frame of reference. More...
 
real_t getDepth (real_t px, real_t py, real_t pz) const
 Calculates the depth of a point in global coordinates. More...
 
real_t getDepth (const Vec3 &gpos) const
 Calculates the depth of a point in global coordinates. More...
 
real_t getRelDistance (real_t px, real_t py, real_t pz) const
 Calculates the distance of a point relative to the plane's frame of reference. More...
 
real_t getRelDistance (const Vec3 &rpos) const
 Calculates the distance of a point relative to the plane's frame of reference. More...
 
real_t getDistance (real_t px, real_t py, real_t pz) const
 Calculates the distance of a point in global coordinates. More...
 
real_t getDistance (const Vec3 &gpos) const
 Calculates the distance of a point in global coordinates. More...
 
static id_t getStaticTypeID ()
 Returns unique type id of this type. More...
 
void setPositionImpl (real_t px, real_t py, real_t pz) override
 Setting the global position of the plane. More...
 
void setOrientationImpl (real_t r, real_t i, real_t j, real_t k) override
 Setting the global orientation of the plane. More...
 
void translateImpl (real_t dx, real_t dy, real_t dz) override
 Translation of the global position of the plane by the displacement vector. More...
 
void rotateImpl (const Quat &dq) override
 Rotation of the plane by the quaternion dq. More...
 
void rotateAroundOriginImpl (const Quat &dq) override
 Rotation of the plane around the origin of the global world frame. More...
 
void rotateAroundPointImpl (const Vec3 &point, const Quat &dq) override
 Rotation of the plane around a specific global coordinate. More...
 
bool containsRelPointImpl (real_t px, real_t py, real_t pz) const override
 Checks, whether a point in body relative coordinates lies inside the plane. More...
 
bool isSurfaceRelPointImpl (real_t px, real_t py, real_t pz) const override
 Checks, whether a point in body relative coordinates lies on the plane. More...
 
void calcBoundingBox () override
 Calculation of the bounding box of the plane. More...
 

Member variables

Vec3 normal_
 Normal of the plane in reference to the global world frame. More...
 
real_t d_
 Plane displacement from the origin. More...
 
static id_t staticTypeID_ = std::numeric_limits<id_t>::max()
 
template<class T , int N>
struct SetBodyTypeIDs
 needed to be able to set static type ids with setStaticTypeID More...
 
static void setStaticTypeID (id_t typeID)
 

Additional Inherited Members

- Public Attributes inherited from walberla::pe::RigidBody
MPIRigidBodyTrait MPITrait
 
- Public Attributes inherited from walberla::pe::cr::HCSITSBodyTrait
size_t index_
 
- Protected Member Functions inherited from walberla::pe::GeomPrimitive
 GeomPrimitive (id_t const typeID, id_t sid, id_t uid, MaterialID material)
 Constructor for the GeomPrimitive class. More...
 
 ~GeomPrimitive () override=0
 Destructor for the Primitive class. More...
 
- Protected Member Functions inherited from walberla::pe::RigidBody
virtual void fix ()
 Setting the global position (the center of mass) of the rigid body fixed. More...
 
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...
 
 RigidBody (id_t const typeID, id_t sid, id_t uid)
 Constructor for the RigidBody class. More...
 
void setMassAndInertia (const real_t mass, const Mat3 &inertia)
 Sets mass and inertia of a rigid body. More...
 
- Protected Member Functions inherited from walberla::pe::ccd::HashGridsBodyTrait
 HashGridsBodyTrait ()
 Constructor for the BodyTrait<HashGrids> specialization. More...
 
- Protected Attributes inherited from walberla::pe::GeomPrimitive
MaterialID material_
 The material of the geometric primitive. More...
 
- Protected Attributes inherited from walberla::pe::RigidBody
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...
 
- 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...
 

Constructor & Destructor Documentation

◆ Plane()

walberla::pe::Plane::Plane ( id_t  sid,
id_t  uid,
const Vec3 gpos,
const Vec3 normal,
real_t  d,
MaterialID  material 
)
explicit

Constructor for the Plane class.

Parameters
sidUnique system-specific ID for the plane.
uidUser-specific ID for the plane.
gposThe global position (anchor point) of the plane.
normalThe plane's normal in reference to the global world frame, \( |n| = 1 \).
dThe displacement of the plane.
materialThe material of the plane.

The plane equation is: \( ax + by + cz = d \).
a, b and c are the x, y and z coordinate of the normal vector and d is the distance from the origin to the plane.

◆ ~Plane()

walberla::pe::Plane::~Plane ( )
override

Destructor for the PlaneBase class.

Member Function Documentation

◆ calcBoundingBox()

void walberla::pe::Plane::calcBoundingBox ( )
overrideprotectedvirtual

Calculation of the bounding box of the plane.

Returns
void

This function updates the axis-aligned bounding box of the plane primitive according to the current position and orientation of the plane. Note that the bounding box is increased in all dimensions by pe::contactThreshold to guarantee that rigid bodies in close proximity of the plane are also considered during the collision detection process.

Implements walberla::pe::RigidBody.

◆ containsRelPointImpl()

bool walberla::pe::Plane::containsRelPointImpl ( real_t  px,
real_t  py,
real_t  pz 
) const
overrideprotectedvirtual

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

Parameters
pxThe x-component of the relative coordinate.
pyThe y-component of the relative coordinate.
pzThe z-component of the relative coordinate.
Returns
true if the point lies inside the plane, false if not.

Reimplemented from walberla::pe::RigidBody.

◆ getDepth() [1/2]

real_t walberla::pe::Plane::getDepth ( const Vec3 gpos) const
inline

Calculates the depth of a point in global coordinates.

Parameters
gposThe global coordinate.
Returns
Depth of the global point.

Returns a positive value, if the point lies inside the plane and a negative value, if the point lies outside the plane.

◆ getDepth() [2/2]

real_t walberla::pe::Plane::getDepth ( real_t  px,
real_t  py,
real_t  pz 
) const
inline

Calculates the depth of a point in global coordinates.

Parameters
pxThe x-component of the global coordinate.
pyThe y-component of the global coordinate.
pzThe z-component of the global coordinate.
Returns
Depth of the global point.

Returns a positive value, if the point lies inside the plane and a negative value, if the point lies outside the plane.

◆ getDisplacement()

real_t walberla::pe::Plane::getDisplacement ( ) const
inline

Returns the displacement/distance from the origin of the global world frame.

Returns
The displacement of the plane.

A positive displacement value indicates that the origin of the global world frame is contained in the plane, whereas a negative value indicates that the origin is not contained in the plane.

◆ getDistance() [1/2]

real_t walberla::pe::Plane::getDistance ( const Vec3 gpos) const
inline

Calculates the distance of a point in global coordinates.

Parameters
gposThe global coordinate.
Returns
Distance of the global point.

Returns a positive value, if the point lies outside the plane and a negative value, if the point lies inside the plane.

◆ getDistance() [2/2]

real_t walberla::pe::Plane::getDistance ( real_t  px,
real_t  py,
real_t  pz 
) const
inline

Calculates the distance of a point in global coordinates.

Parameters
pxThe x-component of the global coordinate.
pyThe y-component of the global coordinate.
pzThe z-component of the global coordinate.
Returns
Distance of the global point.

Returns a positive value, if the point lies outside the plane and a negative value, if the point lies inside the plane.

◆ getNormal()

const Vec3 & walberla::pe::Plane::getNormal ( ) const
inline

Returns the normal of the plane in reference to the global world frame.

Returns
The normal of the plane.

◆ getRelDepth() [1/2]

real_t walberla::pe::Plane::getRelDepth ( const Vec3 rpos) const
inline

Calculates the depth of a point relative to the plane's frame of reference.

Parameters
rposThe relative coordinate.
Returns
Depth of the relative point.

Returns a positive value, if the point lies inside the plane and a negative value, if the point lies outside the plane.

◆ getRelDepth() [2/2]

real_t walberla::pe::Plane::getRelDepth ( real_t  px,
real_t  py,
real_t  pz 
) const
inline

Calculates the depth of a point relative to the plane's frame of reference.

Parameters
pxThe x-component of the relative coordinate.
pyThe y-component of the relative coordinate.
pzThe z-component of the relative coordinate.
Returns
Depth of the relative point.

Returns a positive value, if the point lies inside the plane and a negative value, if the point lies outside the plane.

◆ getRelDistance() [1/2]

real_t walberla::pe::Plane::getRelDistance ( const Vec3 rpos) const
inline

Calculates the distance of a point relative to the plane's frame of reference.

Parameters
rposThe relative coordinate.
Returns
Distance of the relative point.

Returns a positive value, if the point lies outside the plane and a negative value, if the point lies inside the plane.

◆ getRelDistance() [2/2]

real_t walberla::pe::Plane::getRelDistance ( real_t  px,
real_t  py,
real_t  pz 
) const
inline

Calculates the distance of a point relative to the plane's frame of reference.

Parameters
pxThe x-component of the relative coordinate.
pyThe y-component of the relative coordinate.
pzThe z-component of the relative coordinate.
Returns
Distance of the relative point.

Returns a positive value, if the point lies outside the plane and a negative value, if the point lies inside the plane.

◆ getStaticTypeID()

id_t walberla::pe::Plane::getStaticTypeID ( )
inlinestatic

Returns unique type id of this type.

Returns
geometry specific type id

◆ getVolume()

real_t walberla::pe::Plane::getVolume ( ) const
inlineoverridevirtual

Returns the volume of the plane.

Returns
The volume is always infinity.

Reimplemented from walberla::pe::RigidBody.

◆ isSurfaceRelPointImpl()

bool walberla::pe::Plane::isSurfaceRelPointImpl ( real_t  px,
real_t  py,
real_t  pz 
) const
overrideprotectedvirtual

Checks, whether a point in body relative coordinates lies on the plane.

Parameters
pxThe x-component of the relative coordinate.
pyThe y-component of the relative coordinate.
pzThe z-component of the relative coordinate.
Returns
true if the point lies on the plane, false if not.

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

Reimplemented from walberla::pe::RigidBody.

◆ print()

void walberla::pe::Plane::print ( std::ostream &  os,
const char *  tab 
) const
overridevirtual

Output of the current state of a plane.

Parameters
osReference to the output stream.
tabIndentation in front of every line of the plane output.
Returns
void

Implements walberla::pe::RigidBody.

◆ rotateAroundOriginImpl()

void walberla::pe::Plane::rotateAroundOriginImpl ( const Quat dq)
overrideprotectedvirtual

Rotation of the plane around the origin of the global world frame.

Parameters
dqThe quaternion for the rotation.
Returns
void
Exceptions
std::logic_errorInvalid rotation of a plane inside an exclusive section.

Changing the orientation/rotation of the plane. The plane is rotated around the origin of the global frame around by the quaternion dq. Therefore the anchor point (global position) and the normal of the plane are changed, not its distance (displacement) to the origin.
Note:

  • Rotating a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

◆ rotateAroundPointImpl()

void walberla::pe::Plane::rotateAroundPointImpl ( const Vec3 point,
const Quat dq 
)
overrideprotectedvirtual

Rotation of the plane around a specific global coordinate.

Parameters
pointThe global center of the rotation.
dqThe global rotation.
Returns
void
Exceptions
std::logic_errorInvalid rotation of a plane inside an exclusive section.

This function rotates the plane around the given global coordinate point and changes the global position, the displacement from the origin, and the orientation/rotation of the plane. The plane is rotated around the given axis axis by angle degrees (radian measure).
Note:

  • Rotating a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

◆ rotateImpl()

void walberla::pe::Plane::rotateImpl ( const Quat dq)
overrideprotectedvirtual

Rotation of the plane by the quaternion dq.

Parameters
dqThe quaternion for the rotation.
Returns
void
Exceptions
std::logic_errorInvalid rotation of a plane inside an exclusive section.

Changing the orientation/rotation of the plane. The plane is rotated around its anchor point (its current global position) by the quaternion dq. This rotation changes the normal of the plane and its distance (displacement) to the origin of the global world frame.
Note:

  • Rotating a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

◆ setOrientationImpl()

void walberla::pe::Plane::setOrientationImpl ( real_t  r,
real_t  i,
real_t  j,
real_t  k 
)
overrideprotectedvirtual

Setting the global orientation of the plane.

Parameters
rThe quaternion scalar part.
i,j,kThe quaternion vector part.
Returns
void
Exceptions
std::logic_errorInvalid rotation of a plane inside an exclusive section.

This function sets the normal of the plane corresponding to the given global orientation, where the initial orientation of the plane's normal is (0,0,1). This change of orientation corresponds to a rotation around the anchor point of the plane, which is consequently not changed. However, this rotation changes the distance (displacement) to the origin of the global world frame.

Note:

  • Setting the orientation of a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

◆ setPositionImpl()

void walberla::pe::Plane::setPositionImpl ( real_t  px,
real_t  py,
real_t  pz 
)
overrideprotectedvirtual

Setting the global position of the plane.

Parameters
pxThe x-component of the global position.
pyThe y-component of the global position.
pzThe z-component of the global position.
Returns
void
Exceptions
std::logic_errorInvalid translation of a plane inside an exclusive section.

This function sets the global position (anchor point) of the plane.

Note:

  • Setting the position of a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

◆ setStaticTypeID()

static void walberla::pe::Plane::setStaticTypeID ( id_t  typeID)
inlinestaticprivate

◆ translateImpl()

void walberla::pe::Plane::translateImpl ( real_t  dx,
real_t  dy,
real_t  dz 
)
overrideprotectedvirtual

Translation of the global position of the plane by the displacement vector.

(dx,dy,dz).

Parameters
dxThe x-component of the translation/displacement.
dyThe y-component of the translation/displacement.
dzThe z-component of the translation/displacement.
Returns
void
Exceptions
std::logic_errorInvalid translation of a plane inside an exclusive section.

Note:

  • Translating a plane contained in a union changes the geometry of the union. Therefore this may cause an invalidation of links contained in the union.

Reimplemented from walberla::pe::RigidBody.

Friends And Related Function Documentation

◆ SetBodyTypeIDs

template<class T , int N>
friend struct SetBodyTypeIDs
friend

needed to be able to set static type ids with setStaticTypeID

Member Data Documentation

◆ d_

real_t walberla::pe::Plane::d_
protected

Plane displacement from the origin.

The displacement can be categorized in the following way:

  • > 0: The global origin is inside the plane
  • < 0: The global origin is outside the plane
  • = 0: The global origin is on the surface of the plane

◆ normal_

Vec3 walberla::pe::Plane::normal_
protected

Normal of the plane in reference to the global world frame.

The normal of the plane is always pointing towards the halfspace outside the plane.

◆ staticTypeID_

id_t walberla::pe::Plane::staticTypeID_ = std::numeric_limits<id_t>::max()
staticprivate

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