momentOfInertia Class Reference

Calculates the inertia tensor and principal axes and moments of a polyhedra/cells/triSurfaces. Inertia can either be of the solid body or of a thin shell. More...

Static Public Member Functions

static void massPropertiesSolid (const pointField &pts, const triFaceList &triFaces, scalar density, scalar &mass, vector &cM, tensor &J)
 
static void massPropertiesShell (const pointField &pts, const triFaceList &triFaces, scalar density, scalar &mass, vector &cM, tensor &J, bool doReduce=false)
 
static void massPropertiesSolid (const triSurface &surf, scalar density, scalar &mass, vector &cM, tensor &J)
 
static void massPropertiesShell (const triSurface &surf, scalar density, scalar &mass, vector &cM, tensor &J, bool doReduce=false)
 
static void massPropertiesPatch (const polyPatch &pp, scalar density, scalar &mass, vector &cM, tensor &J, bool doReduce=false)
 
static tensor applyParallelAxisTheorem (scalar mass, const vector &cM, const tensor &J, const vector &refPt)
 
static tmp< tensorFieldmeshInertia (const polyMesh &mesh)
 
static tensor meshInertia (const polyMesh &mesh, label celli)
 

Detailed Description

Calculates the inertia tensor and principal axes and moments of a polyhedra/cells/triSurfaces. Inertia can either be of the solid body or of a thin shell.

References:

    "Fast and Accurate Computation of Polyhedral Mass Properties",
    Brian Mirtich,
    Journal of Graphics Tools, Volume 1, Number 2, 1996.

https://people.eecs.berkeley.edu/~jfc/mirtich/massProps.html https://people.eecs.berkeley.edu/~jfc/mirtich/papers/volInt.ps.gz https://people.eecs.berkeley.edu/~jfc/mirtich/code/volumeIntegration.tar

Source files

Definition at line 65 of file momentOfInertia.H.

Member Function Documentation

◆ massPropertiesSolid() [1/2]

void massPropertiesSolid ( const pointField pts,
const triFaceList triFaces,
scalar  density,
scalar &  mass,
vector cM,
tensor J 
)
static

Definition at line 34 of file momentOfInertia.C.

References forAll, Foam::I, n, Vector< Cmpt >::x(), Tensor< Cmpt >::xx(), Tensor< Cmpt >::xy(), Tensor< Cmpt >::xz(), Vector< Cmpt >::y(), Tensor< Cmpt >::yx(), Tensor< Cmpt >::yy(), Tensor< Cmpt >::yz(), Vector< Cmpt >::z(), Foam::Zero, Tensor< Cmpt >::zx(), Tensor< Cmpt >::zy(), and Tensor< Cmpt >::zz().

Here is the call graph for this function:

◆ massPropertiesShell() [1/2]

void massPropertiesShell ( const pointField pts,
const triFaceList triFaces,
scalar  density,
scalar &  mass,
vector cM,
tensor J,
bool  doReduce = false 
)
static

Definition at line 191 of file momentOfInertia.C.

References triangle< Point, PointRef >::centre(), forAll, triangle< Point, PointRef >::mag(), Foam::reduce(), and Foam::Zero.

Here is the call graph for this function:

◆ massPropertiesSolid() [2/2]

void massPropertiesSolid ( const triSurface surf,
scalar  density,
scalar &  mass,
vector cM,
tensor J 
)
static

Definition at line 259 of file momentOfInertia.C.

References forAll, PrimitivePatch< FaceList, PointField >::points(), and UList< T >::size().

Here is the call graph for this function:

◆ massPropertiesShell() [2/2]

void massPropertiesShell ( const triSurface surf,
scalar  density,
scalar &  mass,
vector cM,
tensor J,
bool  doReduce = false 
)
static

Definition at line 279 of file momentOfInertia.C.

References forAll, PrimitivePatch< FaceList, PointField >::points(), and UList< T >::size().

Here is the call graph for this function:

◆ massPropertiesPatch()

void massPropertiesPatch ( const polyPatch pp,
scalar  density,
scalar &  mass,
vector cM,
tensor J,
bool  doReduce = false 
)
static

Definition at line 300 of file momentOfInertia.C.

References DynamicList< T, SizeMin >::append(), f(), forAll, PrimitivePatch< FaceList, PointField >::points(), UList< T >::size(), and List< T >::transfer().

Here is the call graph for this function:

◆ applyParallelAxisTheorem()

Foam::tensor applyParallelAxisTheorem ( scalar  mass,
const vector cM,
const tensor J,
const vector refPt 
)
static

Definition at line 334 of file momentOfInertia.C.

References Foam::I.

◆ meshInertia() [1/2]

Foam::tmp< Foam::tensorField > meshInertia ( const polyMesh mesh)
static

Definition at line 352 of file momentOfInertia.C.

References forAll, mesh, primitiveMesh::nCells(), and tmp< T >::ref().

Here is the call graph for this function:

◆ meshInertia() [2/2]

Foam::tensor meshInertia ( const polyMesh mesh,
label  celli 
)
static

Definition at line 370 of file momentOfInertia.C.

References polyMeshTetDecomposition::cellTetIndices(), forAll, mesh, polyMesh::points(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

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