NuTo
Numerics Tool
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NuTo::CollidableWallBase Class Referenceabstract

base class for walls More...

#include <CollidableWallBase.h>

Inheritance diagram for NuTo::CollidableWallBase:
NuTo::CollidableBase NuTo::CollidableWallCylinder NuTo::CollidableWallPhysical NuTo::CollidableWallVirtual

Public Member Functions

 CollidableWallBase (Eigen::VectorXd rPosition, Eigen::VectorXd rDirection, int rIndex)
 constructor, create CollidableWallBase using the point-and-normal-vector plane definition More...
 
virtual ~CollidableWallBase ()
 destructor, do nothing More...
 
void SetBoxes (SubBox &rInsideBox, SubBox &rOutsideBox)
 every wall should know its box and the neighbour box More...
 
void PerformCollision (CollidableBase &rCollidable) override
 collision between CollidableWall and CollidableBase, resolve double dispatch, forward *this More...
 
virtual void PerformCollision (CollidableParticleSphere &rSphere) override=0
 collision between CollidableWall and CollidableSphere, pass to child classes More...
 
void PerformCollision (CollidableWallBase &rWall) override
 collision between CollidableWall and CollidableWall, does nothing More...
 
double PredictCollision (CollidableBase &rCollidable, int &rType) override
 collision check between CollidableWall and CollidableBase, resolve double dispatch, forward *this More...
 
virtual double PredictCollision (CollidableParticleSphere &rSphere, int &rType) override=0
 collision check between CollidableWall and CollidableSphere, pass to child classes More...
 
double PredictCollision (CollidableWallBase &rWall, int &rType) override
 collision check between CollidableWall and CollidableWall, does nothing More...
 
void MoveAndGrow (double) override
 walls to neither grow nor move, do nothing More...
 
virtual bool IsPhysical () const =0
 ture for physical walls More...
 
virtual void VisualizationStatic (Visualize::UnstructuredGrid &rVisualizer) const
 visualize all non-moving collidables More...
 
void GetLocalEventsToDelete (LocalEvents &) const override
 does nothing as all other wall events are still legal More...
 
virtual bool IsInside (const CollidableParticleSphere &rSphere) const
 returns whether a sphere is on the positive side of this wall More...
 
const Eigen::Vector3d & GetDirection () const
 getter for the wall direction More...
 
const Eigen::Vector3d & GetPosition () const
 getter fot the wall position 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...
 

Protected Member Functions

virtual void Print (std::ostream &rReturnStream) const override
 prints CollidableWall More...
 

Protected Attributes

Eigen::Vector3d mPosition
 point of the point-and-normal-vector plane definition More...
 
Eigen::Vector3d mDirection
 normal vector of the point-and-normal-vector plane definition More...
 
SubBoxmInsideBox
 box on the inner side of the wall More...
 
SubBoxmOutsideBox
 box on the outer side of the wall More...
 
int mNonNullAxis
 index of the direction component that is != 0 More...
 
bool mIsAxisAligned
 true –> calculations without vector calculations 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...
 

Additional Inherited Members

- Public Types inherited from NuTo::CollidableBase
typedef std::vector< CollidableParticleSphere * > ParticleContainer
 

Detailed Description

base class for walls

Constructor & Destructor Documentation

NuTo::CollidableWallBase::CollidableWallBase ( Eigen::VectorXd  rPosition,
Eigen::VectorXd  rDirection,
int  rIndex 
)

constructor, create CollidableWallBase using the point-and-normal-vector plane definition

Parameters
rPositionpoint on the plane
rDirectionnormal vector pointing inside the domain, gets normalized.
rIndexname
NuTo::CollidableWallBase::~CollidableWallBase ( )
virtual

destructor, do nothing

Member Function Documentation

const Eigen::Vector3d & NuTo::CollidableWallBase::GetDirection ( ) const

getter for the wall direction

void NuTo::CollidableWallBase::GetLocalEventsToDelete ( LocalEvents ) const
inlineoverridevirtual

does nothing as all other wall events are still legal

Implements NuTo::CollidableBase.

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

getter fot the wall position

bool NuTo::CollidableWallBase::IsInside ( const CollidableParticleSphere rSphere) const
virtual

returns whether a sphere is on the positive side of this wall

Parameters
rSpheresphere to test

Reimplemented in NuTo::CollidableWallCylinder.

virtual bool NuTo::CollidableWallBase::IsPhysical ( ) const
pure virtual
void NuTo::CollidableWallBase::MoveAndGrow ( double  )
inlineoverridevirtual

walls to neither grow nor move, do nothing

Implements NuTo::CollidableBase.

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

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

Parameters
rCollidablecollision partner

Implements NuTo::CollidableBase.

virtual void NuTo::CollidableWallBase::PerformCollision ( CollidableParticleSphere rSphere)
overridepure virtual

collision between CollidableWall and CollidableSphere, pass to child classes

Parameters
rSpherecollision partner

Implements NuTo::CollidableBase.

Implemented in NuTo::CollidableWallVirtual, NuTo::CollidableWallCylinder, and NuTo::CollidableWallPhysical.

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

collision between CollidableWall and CollidableWall, does nothing

Parameters
rWallcollision partner

Implements NuTo::CollidableBase.

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

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

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

Implements NuTo::CollidableBase.

virtual double NuTo::CollidableWallBase::PredictCollision ( CollidableParticleSphere rSphere,
int &  rType 
)
overridepure virtual

collision check between CollidableWall and CollidableSphere, pass to child classes

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

Implements NuTo::CollidableBase.

Implemented in NuTo::CollidableWallVirtual, NuTo::CollidableWallCylinder, and NuTo::CollidableWallPhysical.

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

collision check between CollidableWall and CollidableWall, does nothing

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

Implements NuTo::CollidableBase.

void NuTo::CollidableWallBase::Print ( std::ostream &  rReturnStream) const
overrideprotectedvirtual

prints CollidableWall

Parameters
rReturnStreamoutput stream, that gets modified

Implements NuTo::CollidableBase.

Reimplemented in NuTo::CollidableWallCylinder.

void NuTo::CollidableWallBase::SetBoxes ( SubBox rInsideBox,
SubBox rOutsideBox 
)

every wall should know its box and the neighbour box

Parameters
rInsideBoxbox on the inner side of the wall
rOutsideBoxbox on the outer side of the wall
void NuTo::CollidableWallBase::VisualizationStatic ( Visualize::UnstructuredGrid rVisualizer) const
virtual

visualize all non-moving collidables

Parameters
rVisualizerNuTo object for ascii-export

Reimplemented in NuTo::CollidableWallCylinder.

Member Data Documentation

Eigen::Vector3d NuTo::CollidableWallBase::mDirection
protected

normal vector of the point-and-normal-vector plane definition

SubBox* NuTo::CollidableWallBase::mInsideBox
protected

box on the inner side of the wall

bool NuTo::CollidableWallBase::mIsAxisAligned
protected

true –> calculations without vector calculations

int NuTo::CollidableWallBase::mNonNullAxis
protected

index of the direction component that is != 0

SubBox* NuTo::CollidableWallBase::mOutsideBox
protected

box on the outer side of the wall

Eigen::Vector3d NuTo::CollidableWallBase::mPosition
protected

point of the point-and-normal-vector plane definition


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