BasicIntersectionOfWalls.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 BasicIntersectionOfWalls_H
11 #define BasicIntersectionOfWalls_H
12 
13 #include "BaseWall.h"
14 #include "Math/Vector.h"
15 #include "InfiniteWall.h"
16 
22 {
23 public:
24 
29 
34 
38  ~BasicIntersectionOfWalls() override;
39 
43  BasicIntersectionOfWalls* 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 private:
93  std::vector<BaseWall*> walls_;
94 };
95 
96 #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: BasicIntersectionOfWalls.h:22
void getVTK(std::vector< Vec3D > &points, std::vector< std::vector< double >> &triangleStrips)
Definition: BasicIntersectionOfWalls.cc:269
BaseWall * getObject(unsigned i)
Definition: BasicIntersectionOfWalls.cc:323
unsigned long getNumberOfObjects()
Returns the number of objects.
Definition: BasicIntersectionOfWalls.cc:56
~BasicIntersectionOfWalls() override
Default destructor.
Definition: BasicIntersectionOfWalls.cc:34
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: BasicIntersectionOfWalls.cc:69
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: BasicIntersectionOfWalls.cc:82
BasicIntersectionOfWalls()
Default constructor, the normal is infinitely long.
Definition: BasicIntersectionOfWalls.cc:14
void write(std::ostream &os) const override
Writes the BasicIntersectionOfWalls to an output stream, usually a restart file.
Definition: BasicIntersectionOfWalls.cc:250
std::string getName() const override
Returns the name of the object, in this case the string "BasicIntersectionOfWalls".
Definition: BasicIntersectionOfWalls.cc:264
BasicIntersectionOfWalls * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: BasicIntersectionOfWalls.cc:46
void read(std::istream &is) override
Reads BasicIntersectionOfWalls from a restart file.
Definition: BasicIntersectionOfWalls.cc:227
std::vector< BaseWall * > walls_
Definition: BasicIntersectionOfWalls.h:93
void oldRead(std::istream &is)
Reads BasicIntersectionOfWalls from an old-style restart file.
Definition: Kernel/Math/Vector.h:30
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286