NuTo
Numerics Tool
SubBoxHandler.h
Go to the documentation of this file.
1 /*
2  * SubBoxBuilder.h
3  *
4  * Created on: 4 Mar 2014
5  * Author: ttitsche
6  */
7 
8 #pragma once
9 
10 
11 // member
14 
15 namespace NuTo
16 {
17 class CollidableWallBase;
18 class CollidableWallCylinder;
19 class ParticleHandler;
20 
21 
24 {
25 public:
29  SubBoxHandler(ParticleHandler& rSpheres, Specimen& rSpecimen, Eigen::Vector3i rDivisions);
30 
33  SubBoxHandler(ParticleHandler& rSpheres, Specimen& rSpecimen, int rParticlesPerSubBox);
34 
36  double GetVolume() const;
37 
39  void PrintBoxes();
40 
43  void VisualizeBorders(std::string rFile);
44 
46  std::vector<SubBox>& GetSubBoxes();
47 
50  void AddSubBox(SubBox& rSubBox);
51 
52 private:
53  ParticleHandler* mSpheres;
54  std::vector<SubBox> mSubBoxes;
55  Specimen mSpecimen;
56  Eigen::Vector3i mDivisions;
57 
58  void Build();
59 
61  void BuildBox();
62 
64  void BuildCylinder();
65 
66  void AddSpheresToBoxes();
67 
69  std::vector<CollidableWallBase*> GetXYWalls(unsigned int rIndex);
70 
72  void BuildSubBoxes();
73 
75  std::vector<Eigen::VectorXd> GetXYCorners(std::vector<CollidableWallBase*> rWalls);
76 
78  unsigned int GetBoxIndex(int rX, int rY, int rZ);
79 
81  Eigen::Vector3d GetSubBoxLength();
82 
84  std::vector<int> GetNInside(CollidableWallCylinder* rWallCylinder);
85 };
86 
87 } /* namespace NuTo */
void AddSubBox(SubBox &rSubBox)
adds a sub box to the sub box list sub box to add
Definition: SubBoxHandler.cpp:186
std::vector< SubBox > & GetSubBoxes()
getter for the sub box list
Definition: SubBoxHandler.cpp:181
class for Specimen
Definition: Specimen.h:16
void VisualizeBorders(std::string rFile)
visualizes the sub boxes
Definition: SubBoxHandler.cpp:335
SubBoxHandler(ParticleHandler &rSpheres, Specimen &rSpecimen, Eigen::Vector3i rDivisions)
constructor, initializes the handler with a given number of sub box divisions
Definition: SubBoxHandler.cpp:24
void PrintBoxes()
prints all sub boxes and the particles inside of them
Definition: SubBoxHandler.cpp:351
class for sub box handing -> improves the performance without changing the physics ...
Definition: SubBox.h:20
handles the particle list
Definition: ParticleHandler.h:25
builds and handles sub boxes
Definition: SubBoxHandler.h:23
double GetVolume() const
getter for specimen volume
Definition: SubBoxHandler.cpp:346
Definition: Exception.h:6
class for cylindric walls
Definition: CollidableWallCylinder.h:17