NuTo
Numerics Tool
Public Member Functions | Friends | List of all members
NuTo::CollidableParticleSphere Class Reference

class for spherical collidables More...

#include <CollidableParticleSphere.h>

Inheritance diagram for NuTo::CollidableParticleSphere:
NuTo::CollidableParticleBase NuTo::CollidableBase

Public Member Functions

 CollidableParticleSphere (Eigen::Vector3d rPosition, Eigen::Vector3d rVelocity, double rRadius, double rGrowthRate, int rIndex)
 constructor. More...
 
void MoveAndGrow (double rTime) override
 move spheres and apply growth, mTimeOfLastCollision update More...
 
double GetKineticEnergy () const override
 calculates and returns the kinetic energy of the sphere More...
 
double GetVolume () const override
 calculates and returns the volume of the sphere More...
 
void PerformCollision (CollidableBase &rCollidable) override
 collision between CollidableSphere and CollidableBase, resolve double dispatch, forward *this More...
 
void PerformCollision (CollidableParticleSphere &rSphere) override
 collision between CollidableSphere and CollidableSphere, physics here. More...
 
void PerformCollision (CollidableWallBase &rWall) override
 collision between CollidableSphere and CollidableWall, forward to CollidableWall. More...
 
double PredictCollision (CollidableBase &rCollidable, int &rType) override
 collision check between this and a CollidableBase, resolve double dispatch, forward *this More...
 
double PredictCollision (CollidableParticleSphere &rSphere, int &rType) override
 collision check between this and another CollidableSphere: Physics lead to quadratic equation. More...
 
double PredictCollision (CollidableWallBase &rWall, int &rType) override
 collision check between CollidableSphere and CollidableWall, forward to CollidableWall. More...
 
void GetLocalEventsToDelete (LocalEvents &rEventsToDelete) const override
 returns all old events, that need to be deleted More...
 
Eigen::MatrixXd ExportRow (bool rInitialRadius=false) const
 exports the sphere position and its radius to as a row in a Nx4-matrix More...
 
void VisualizationDynamic (Visualize::UnstructuredGrid &rVisualizer, bool rFinal) const
 visualize all moving collidables More...
 
void ResetVelocity ()
 resets the sphere velocity to 0.0 More...
 
void SetGrowthRate (double rGrowthRateFactor, double rTime)
 sets a new growth rate More...
 
const Eigen::Vector3d & GetPosition () const
 getter for sphere position More...
 
double GetRadius () const
 getter for sphere radius More...
 
double GetRadius0 () const
 getter for initial sphere radius More...
 
- Public Member Functions inherited from NuTo::CollidableParticleBase
 CollidableParticleBase (Eigen::Vector3d rPosition, Eigen::Vector3d rVelocity, int rIndex)
 constructor, every particle needs a position, a velocity and an identifier More...
 
- Public Member Functions inherited from NuTo::CollidableBase
 CollidableBase (int rIndex)
 constructor, initialized with an index More...
 
virtual ~CollidableBase ()
 destructor More...
 
int GetIndex () const
 getter for collidable index More...
 
void AddBox (SubBox &rBox)
 adds a SubBox to this collidable More...
 
void RemoveBox (SubBox &rBox)
 removes a SubBox from this collidable More...
 
void PrintLocalEvents () const
 prints the local event list More...
 
const std::vector< SubBox * > & GetSubBoxes () const
 returns all the SubBoxes of this collidable More...
 

Friends

class CollidableWallPhysical
 provides faster access for collision checks with walls More...
 
class CollidableWallVirtual
 
class CollidableWallCylinder
 
class CollidableWallBase
 

Additional Inherited Members

- Public Types inherited from NuTo::CollidableBase
typedef std::vector< CollidableParticleSphere * > ParticleContainer
 
- Protected Attributes inherited from NuTo::CollidableParticleBase
Eigen::Vector3d mPosition
 particle position More...
 
Eigen::Vector3d mVelocity
 particle velocity More...
 
- Protected Attributes inherited from NuTo::CollidableBase
int mIndex
 index, just a name for each collidable, multiple collidables with the same index possible More...
 
std::vector< SubBox * > mBoxes
 list of SubBoxes in which this collidable is inside if the collidable is passing a virutal sub box wall, multiple mBoxes are possible More...
 
LocalEvents mLocalEvents
 local event list adding single event: through EventBase::AddLocalEvents() remove single event: through EventBase::~EventBase() clear everything: on collision More...
 

Detailed Description

class for spherical collidables

Constructor & Destructor Documentation

NuTo::CollidableParticleSphere::CollidableParticleSphere ( Eigen::Vector3d  rPosition,
Eigen::Vector3d  rVelocity,
double  rRadius,
double  rGrowthRate,
int  rIndex 
)

constructor.

Create CollidableSphere

Parameters
rPositionsphere position
rVelocitysphere velocity
rRadiussphere radius > 0
rGrowthRatesphere growth rate > 0
rIndexname

Member Function Documentation

Eigen::MatrixXd NuTo::CollidableParticleSphere::ExportRow ( bool  rInitialRadius = false) const

exports the sphere position and its radius to as a row in a Nx4-matrix

Parameters
rInitialRadiusswitch to export mRadius or mRadius0
Returns
1x4-matrix, [posX, posY, posZ, radius/radius0]
double NuTo::CollidableParticleSphere::GetKineticEnergy ( ) const
overridevirtual

calculates and returns the kinetic energy of the sphere

Implements NuTo::CollidableParticleBase.

void NuTo::CollidableParticleSphere::GetLocalEventsToDelete ( Event::LocalEvents rEventsToDelete) const
overridevirtual

returns all old events, that need to be deleted

Parameters
rEventsToDeletereturn argument

Implements NuTo::CollidableBase.

const Eigen::Vector3d & NuTo::CollidableParticleSphere::GetPosition ( ) const

getter for sphere position

double NuTo::CollidableParticleSphere::GetRadius ( ) const

getter for sphere radius

double NuTo::CollidableParticleSphere::GetRadius0 ( ) const

getter for initial sphere radius

double NuTo::CollidableParticleSphere::GetVolume ( ) const
overridevirtual

calculates and returns the volume of the sphere

Implements NuTo::CollidableParticleBase.

void NuTo::CollidableParticleSphere::MoveAndGrow ( double  rTime)
overridevirtual

move spheres and apply growth, mTimeOfLastCollision update

Parameters
rTimenew global time.

Implements NuTo::CollidableBase.

void NuTo::CollidableParticleSphere::PerformCollision ( CollidableBase rCollidable)
overridevirtual

collision between CollidableSphere and CollidableBase, resolve double dispatch, forward *this

Parameters
rCollidablecollision partner

Implements NuTo::CollidableBase.

void NuTo::CollidableParticleSphere::PerformCollision ( CollidableParticleSphere rSphere)
overridevirtual

collision between CollidableSphere and CollidableSphere, physics here.

Parameters
rSpherecollision partner

Implements NuTo::CollidableBase.

void NuTo::CollidableParticleSphere::PerformCollision ( CollidableWallBase rWall)
overridevirtual

collision between CollidableSphere and CollidableWall, forward to CollidableWall.

Parameters
rWallcollision partner

Implements NuTo::CollidableBase.

double NuTo::CollidableParticleSphere::PredictCollision ( CollidableBase rCollidable,
int &  rType 
)
overridevirtual

collision check between this and a CollidableBase, resolve double dispatch, forward *this

Parameters
rCollidablepossible collision partner
rTypereturn argument, element of enum CollidableBase::EventType
Returns
predicted collision time

Implements NuTo::CollidableBase.

double NuTo::CollidableParticleSphere::PredictCollision ( CollidableParticleSphere rSphere,
int &  rType 
)
overridevirtual

collision check between this and another CollidableSphere: Physics lead to quadratic equation.

Parameters
rSpherepossible collision partner
rTypereturn argument, element of enum CollidableBase::EventType
Returns
predicted collision time

Implements NuTo::CollidableBase.

double NuTo::CollidableParticleSphere::PredictCollision ( CollidableWallBase rWall,
int &  rType 
)
overridevirtual

collision check between CollidableSphere and CollidableWall, forward to CollidableWall.

Parameters
rWallpossible collision partner
rTypereturn argument, element of enum CollidableBase::EventType
Returns
predicted collision time

Implements NuTo::CollidableBase.

void NuTo::CollidableParticleSphere::ResetVelocity ( )

resets the sphere velocity to 0.0

void NuTo::CollidableParticleSphere::SetGrowthRate ( double  rGrowthRateFactor,
double  rTime 
)

sets a new growth rate

Parameters
rGrowthRateFactorgrowthrate *= rGRFactor
rTimeglobal time
void NuTo::CollidableParticleSphere::VisualizationDynamic ( Visualize::UnstructuredGrid rVisualizer,
bool  rFinal 
) const

visualize all moving collidables

Parameters
rVisualizerNuTo object for ascii-export

Friends And Related Function Documentation

friend class CollidableWallBase
friend
friend class CollidableWallCylinder
friend
friend class CollidableWallPhysical
friend

provides faster access for collision checks with walls

friend class CollidableWallVirtual
friend

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