SPH
Public Member Functions | List of all members
CenterOfMass Class Reference

Computes the center of mass of particles. More...

#include <Integrals.h>

Inheritance diagram for CenterOfMass:
IIntegral< Vector > Polymorphic

Public Member Functions

 CenterOfMass (const Optional< Size > bodyId=NOTHING)
 
virtual Vector evaluate (const Storage &storage) const override
 Computes the integral quantity using particles in the storage. More...
 
virtual std::string getName () const override
 Returns the name of the integral. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Computes the center of mass of particles.

By default, the center of mass is computed from all particles, optionally only particles belonging to body of given ID are considered. The center is evaluated with a respect to reference frame.

Definition at line 150 of file Integrals.h.

Constructor & Destructor Documentation

◆ CenterOfMass()

CenterOfMass::CenterOfMass ( const Optional< Size bodyId = NOTHING)
explicit

Definition at line 124 of file Integrals.cpp.

Member Function Documentation

◆ evaluate()

Vector CenterOfMass::evaluate ( const Storage storage) const
overridevirtual

Computes the integral quantity using particles in the storage.

Storage must contain quantites relevant to the integral implementation. Generally positions, masses and density must be present.

Implements IIntegral< Vector >.

Definition at line 127 of file Integrals.cpp.

◆ getName()

virtual std::string CenterOfMass::getName ( ) const
inlineoverridevirtual

Returns the name of the integral.

Needed to label the integral in logs, GUI etc.

Implements IIntegral< Vector >.

Definition at line 159 of file Integrals.h.


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