AxisymmetricIntersectionOfWalls.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 
5 #ifndef AXISYMMETRICINTERSECTIONOFWALLS_H
6 #define AXISYMMETRICINTERSECTIONOFWALLS_H
7 
8 #include "IntersectionOfWalls.h"
9 #include "InteractionHandler.h"
10 #include "Math/Vector.h"
11 
105 {
106 public:
111 
116 
120  AxisymmetricIntersectionOfWalls(Vec3D position, Vec3D normal, std::vector<normalAndPosition> walls,
121  const ParticleSpecies* species);
122 
127 
132 
136  AxisymmetricIntersectionOfWalls* copy() const final;
137 
143  bool getDistanceAndNormal(const BaseParticle& P, Mdouble& distance, Vec3D& normal_return) const final;
144 
148  void read(std::istream& is) final;
149 
153  void write(std::ostream& os) const final;
154 
158  std::string getName() const final;
159 
160  void setAxis(Vec3D a);
161 
163  void convertLimits(Vec3D& min, Vec3D& max) const;
164 
165  void writeVTK(VTKContainer& vtk) const override;
166 
167  /*
168  * \brief actually writes the wall to the VTK file. Display min and max are used to limit the VTK plotting area.
169  */
170  void writeVTK(VTKContainer& vtk, Vec3D min, Vec3D max) const;
171 
172 
173 
178  const std::vector<Mdouble>& getDisplayedSegments() const { return displayedSegments_; }
179 
189  void setDisplayedSegments(const std::vector<Mdouble>& displayedSegments)
190  {
191  logger.assert_always(displayedSegments.size() % 2 == 0, "AxisymmetricIntersectionOfWalls::setDisplayedSegments: The vector displayedSegments must have a length divisible by 2.");
192  displayedSegments_ = displayedSegments;
193  }
194 
195  private:
196 
203  std::vector<Mdouble> displayedSegments_;
204 };
205 
206 
207 #endif
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
float * p
Definition: Tutorial_Map_using.cpp:9
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:105
AxisymmetricIntersectionOfWalls & operator=(const AxisymmetricIntersectionOfWalls &other)
Copy assignment operator.
Definition: AxisymmetricIntersectionOfWalls.cc:43
void write(std::ostream &os) const final
outputs wall
Definition: AxisymmetricIntersectionOfWalls.cc:127
void setAxis(Vec3D a)
Definition: AxisymmetricIntersectionOfWalls.cc:149
AxisymmetricIntersectionOfWalls * copy() const final
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
Definition: AxisymmetricIntersectionOfWalls.cc:58
void writeVTK(VTKContainer &vtk) const override
Definition: AxisymmetricIntersectionOfWalls.cc:168
std::string getName() const final
Returns the name of the object.
Definition: AxisymmetricIntersectionOfWalls.cc:144
std::vector< Mdouble > displayedSegments_
The starting end ending points of segments that are displayed in VTK.
Definition: AxisymmetricIntersectionOfWalls.h:203
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const final
Computes the distance from the wall for a given BaseParticle and returns true if there is a collision...
Definition: AxisymmetricIntersectionOfWalls.cc:73
void convertLimits(Vec3D &min, Vec3D &max) const
Definition: AxisymmetricIntersectionOfWalls.cc:154
const std::vector< Mdouble > & getDisplayedSegments() const
Gets the displayed segments.
Definition: AxisymmetricIntersectionOfWalls.h:178
~AxisymmetricIntersectionOfWalls() override
Destructor.
Definition: AxisymmetricIntersectionOfWalls.cc:34
void read(std::istream &is) final
reads wall
Definition: AxisymmetricIntersectionOfWalls.cc:110
AxisymmetricIntersectionOfWalls()
Default constructor.
Definition: AxisymmetricIntersectionOfWalls.cc:10
void setDisplayedSegments(const std::vector< Mdouble > &displayedSegments)
Sets the displayed segments.
Definition: AxisymmetricIntersectionOfWalls.h:189
Definition: BaseParticle.h:33
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Definition: IntersectionOfWalls.h:38
Definition: ParticleSpecies.h:16
Definition: Kernel/Math/Vector.h:30
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
const Scalar * a
Definition: level2_cplx_impl.h:32
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Definition: BaseWall.h:17