SPH
Public Types | Public Member Functions | List of all members
BodyView Class Reference

Non-owning view of particles belonging to the same body. More...

#include <Initial.h>

Public Types

enum class  RotationOrigin { FRAME_ORIGIN , CENTER_OF_MASS }
 Predefined types of center point. More...
 

Public Member Functions

 BodyView (Storage &storage, const Size bodyIndex)
 
BodyViewdisplace (const Vector &dr)
 Moves the particles of the body in given direction. More...
 
BodyViewaddVelocity (const Vector &v)
 Adds a velocity vector to all particles of the body. More...
 
BodyViewaddRotation (const Vector &omega, const RotationOrigin origin)
 Adds an angular velocity to all particles of the body. More...
 
BodyViewaddRotation (const Vector &omega, const Vector &origin)
 Adds an angular velocity to all particles of the body. More...
 

Detailed Description

Non-owning view of particles belonging to the same body.

Object allows to access, modify and setup additional properties of the particles created by InitialConditions.

Definition at line 20 of file Initial.h.

Member Enumeration Documentation

◆ RotationOrigin

Predefined types of center point.

Enumerator
FRAME_ORIGIN 

Add angular velocity with respect to origin of coordinates.

CENTER_OF_MASS 

Rotate the body around its center of mass.

Definition at line 47 of file Initial.h.

Constructor & Destructor Documentation

◆ BodyView()

NAMESPACE_SPH_BEGIN BodyView::BodyView ( Storage storage,
const Size  bodyIndex 
)

Definition at line 19 of file Initial.cpp.

Member Function Documentation

◆ addRotation() [1/2]

BodyView & BodyView::addRotation ( const Vector omega,
const RotationOrigin  origin 
)

Adds an angular velocity to all particles of the body.

The new velocities are added to velocities previously assigned to the particles.

Parameters
omegaAngular velocity (in radians/s), the direction of the vector is the axis of rotation.
originCenter point of the rotation, see RotationOrigin enum.
Returns
Reference to itself.

Definition at line 72 of file Initial.cpp.

◆ addRotation() [2/2]

BodyView & BodyView::addRotation ( const Vector omega,
const Vector origin 
)

Adds an angular velocity to all particles of the body.

The new velocities are added to velocities previously assigned to the particles.

Parameters
omegaAngular velocity (in radians/s), the direction of the vector is the axis of rotation.
originVector defining the center point of the rotation.
Returns
Reference to itself.

Definition at line 49 of file Initial.cpp.

◆ addVelocity()

BodyView & BodyView::addVelocity ( const Vector v)

Adds a velocity vector to all particles of the body.

If the particles previously had nonzero velocities, the velocities are added; the previous velocities are not erased.

Parameters
vVelocity vector added to all particles.
Returns
Reference to itself.

Definition at line 38 of file Initial.cpp.

◆ displace()

BodyView & BodyView::displace ( const Vector dr)

Moves the particles of the body in given direction.

The particles are moved relative to the current position.

Parameters
drDisplacement vector.
Returns
Reference to itself.

Definition at line 23 of file Initial.cpp.


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