NuTo
Numerics Tool
SubBox.h
Go to the documentation of this file.
1 /*
2  * CellGridBox.h
3  *
4  * Created on: 5 Feb 2014
5  * Author: ttitsche
6  */
7 
8 #pragma once
9 
10 #include <vector>
11 
12 namespace NuTo
13 {
14 class EventListHandler;
15 class CollidableParticleSphere;
16 class CollidableBase;
17 class CollidableWallBase;
18 
20 class SubBox
21 {
22 public:
25  SubBox(int rIndex);
26 
28  ~SubBox();
29 
33  void CreateEvents(EventListHandler& rEvents, CollidableBase& rCollidable);
34 
36  void AddSphere(CollidableParticleSphere& rSphere);
37 
40 
43 
45  void SetWalls(const std::vector<CollidableWallBase*>& rCollidables);
46 
48  void AddWall(CollidableWallBase& rWall);
49 
51  void RemoveWall(CollidableWallBase& rWall);
52 
54  void Print();
55 
57  const std::vector<CollidableBase*>& GetCollidables() const;
58 
60  const std::vector<CollidableWallBase*>& GetWalls() const;
61 
63  int GetIndex() const;
64 
65 private:
66  int mIndex;
67  std::vector<CollidableWallBase*> mWalls;
68  std::vector<CollidableBase*> mCollidables;
69 };
70 
71 } /* namespace NuTo */
void AddSphere(CollidableParticleSphere &rSphere)
the sphere is now handled by this sub box
Definition: SubBox.cpp:28
class for spherical collidables
Definition: CollidableParticleSphere.h:28
void CreateEvents(EventListHandler &rEvents, CollidableBase &rCollidable)
creates events between mCollidables and rCollidable
Definition: SubBox.cpp:74
class for sub box handing -> improves the performance without changing the physics ...
Definition: SubBox.h:20
int GetIndex() const
getter for mIndex
Definition: SubBox.cpp:97
void Print()
print mCollidables without the walls
Definition: SubBox.cpp:61
const std::vector< CollidableBase * > & GetCollidables() const
getter for mCollidables
Definition: SubBox.cpp:85
Base class for all collidables.
Definition: CollidableBase.h:22
class for event list operations
Definition: EventListHandler.h:23
bool AddIfInside(CollidableParticleSphere &rSphere)
adds a sphere only, if its inside of this box
Definition: SubBox.cpp:102
void AddWall(CollidableWallBase &rWall)
add a single wall
Definition: SubBox.cpp:50
const std::vector< CollidableWallBase * > & GetWalls() const
getter for mWalls
Definition: SubBox.cpp:56
SubBox(int rIndex)
constructor
Definition: SubBox.cpp:17
void RemoveSphere(CollidableParticleSphere &rSphere)
the sphere leaves this sub box
Definition: SubBox.cpp:34
void SetWalls(const std::vector< CollidableWallBase * > &rCollidables)
sets the virtual and physical walls as sub box boundaries
Definition: SubBox.cpp:41
Definition: Exception.h:6
base class for walls
Definition: CollidableWallBase.h:23
void RemoveWall(CollidableWallBase &rWall)
remove a single wall
Definition: SubBox.cpp:90
~SubBox()
destructor, Deletes mWalls on destruction
Definition: SubBox.cpp:22