BasicUnionOfWalls.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
9 
10 #ifndef BasicUnionOfWalls_H
11 #define BasicUnionOfWalls_H
12 
13 #include "BaseWall.h"
14 #include "Math/Vector.h"
15 #include "InfiniteWall.h"
16 
22 {
23 public:
24 
29 
34 
38  ~BasicUnionOfWalls() override;
39 
43  BasicUnionOfWalls* copy() const override;
44 
48  unsigned long getNumberOfObjects();
49 
53  void add(BaseWall& wall);
54 
58  bool getDistanceAndNormal(const BaseParticle& p, Mdouble& distance, Vec3D& normal_return) const override;
59 
63  void read(std::istream& is) override;
64 
68  void oldRead(std::istream& is);
69 
73  void write(std::ostream& os) const override;
74 
78  std::string getName() const override;
79 
85  void getVTK(std::vector<Vec3D>& points, std::vector<std::vector<double>>& triangleStrips);
86 
87  BaseWall* getObject(unsigned i);
88 
89 
90  void writeVTK(VTKContainer& vtk) const override;
91 
92 private:
96  std::vector<BaseWall*> walls_;
97 };
98 
99 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RowVector3d w
Definition: Matrix_resize_int.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
Restriction of a wall to the intersection with another wall.
Definition: BasicUnionOfWalls.h:22
void add(BaseWall &wall)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: BasicUnionOfWalls.cc:69
~BasicUnionOfWalls() override
Default destructor.
Definition: BasicUnionOfWalls.cc:34
void write(std::ostream &os) const override
Writes the BasicUnionOfWalls to an output stream, usually a restart file.
Definition: BasicUnionOfWalls.cc:128
void oldRead(std::istream &is)
Reads BasicUnionOfWalls from an old-style restart file.
bool getDistanceAndNormal(const BaseParticle &p, Mdouble &distance, Vec3D &normal_return) const override
Compute the distance from the wall for a given BaseParticle and return if there is a collision....
Definition: BasicUnionOfWalls.cc:82
unsigned long getNumberOfObjects()
Returns the number of objects.
Definition: BasicUnionOfWalls.cc:56
BasicUnionOfWalls()
Default constructor, the normal is infinitely long.
Definition: BasicUnionOfWalls.cc:14
void read(std::istream &is) override
Reads BasicUnionOfWalls from a restart file.
Definition: BasicUnionOfWalls.cc:107
std::vector< BaseWall * > walls_
Definition: BasicUnionOfWalls.h:96
void writeVTK(VTKContainer &vtk) const override
Definition: BasicUnionOfWalls.cc:207
void getVTK(std::vector< Vec3D > &points, std::vector< std::vector< double >> &triangleStrips)
Definition: BasicUnionOfWalls.cc:147
std::string getName() const override
Returns the name of the object, in this case the string "BasicUnionOfWalls".
Definition: BasicUnionOfWalls.cc:142
BasicUnionOfWalls * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: BasicUnionOfWalls.cc:46
BaseWall * getObject(unsigned i)
Definition: BasicUnionOfWalls.cc:201
Definition: Kernel/Math/Vector.h:30
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Definition: BaseWall.h:17