Base class of all shape types.
This class contains the basic properties which are inherent for all shapes. It also stores the shapeType identifier which allows to cast to the actual shape.
#include <BaseShape.h>
Public Types | |
using | ShapeTypeT = int |
Public Member Functions | |
BaseShape ()=default | |
BaseShape (const int shapeType) | |
virtual | ~BaseShape ()=default |
virtual void | updateMassAndInertia (const real_t density) |
Updates mass and inertia according to the actual shape. More... | |
virtual real_t | getVolume () const |
const real_t & | getMass () const |
const real_t & | getInvMass () const |
const Mat3 & | getInertiaBF () const |
const Mat3 & | getInvInertiaBF () const |
const ShapeTypeT & | getShapeType () const |
virtual Vec3 | support (const Vec3 &) const |
virtual void | pack (walberla::mpi::SendBuffer &buf) |
virtual void | unpack (walberla::mpi::RecvBuffer &buf) |
Static Public Attributes | |
static const int | INVALID_SHAPE = -1 |
Unique invalid shape type identifier. More... | |
Protected Attributes | |
real_t | mass_ = real_t(0) |
mass More... | |
real_t | invMass_ = real_t(0) |
inverse mass More... | |
Mat3 | inertiaBF_ = Mat3(real_t(0)) |
inertia matrix in the body frame More... | |
Mat3 | invInertiaBF_ = Mat3(real_t(0)) |
inverse inertia matrix in the body frame More... | |
ShapeTypeT | shapeType_ = INVALID_SHAPE |
using walberla::mesa_pd::data::BaseShape::ShapeTypeT = int |
|
default |
|
inlineexplicit |
|
virtualdefault |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Updates mass and inertia according to the actual shape.
Reimplemented in walberla::mesa_pd::data::ConvexPolyhedron, walberla::mesa_pd::data::CylindricalBoundary, walberla::mesa_pd::data::Box, walberla::mesa_pd::data::Ellipsoid, walberla::mesa_pd::data::HalfSpace, and walberla::mesa_pd::data::Sphere.
inertia matrix in the body frame
inverse inertia matrix in the body frame