33 logger(
DEBUG,
"AxisymmetricIntersectionOfWalls() finished");
42 logger(
DEBUG,
"AxisymmetricIntersectionOfWalls(const AxisymmetricIntersectionOfWalls &p) finished");
54 logger(
DEBUG,
"~AxisymmetricIntersectionOfWalls() finished.");
68 return *(other.
copy());
100 tangentialUnitVector /= tangential;
103 Vec3D transformedPosition =
Vec3D(tangential, 0.0, normal);
104 Vec3D transformedNormal;
115 normalReturn = transformedNormal.
Z *
getOrientation() + transformedNormal.
X * tangentialUnitVector;
143 return "AxisymmetricIntersectionOfWalls";
148 double x[2] = {min.
X, max.
X};
149 double y[2] = {min.
Y, max.
Y};
150 double z[2] = {min.
Z, max.
Z};
158 for (
unsigned i=0; i<2; i++)
159 for (
unsigned j=0; j<2; j++)
160 for (
unsigned k=0; k<2; k++) {
164 if (XSquared>maxXSquared) maxXSquared=XSquared;
165 if (Z<min.
Z) min.
Z=
Z;
166 if (Z>max.
Z) max.
Z=
Z;
168 max.
X = sqrt(maxXSquared);
176 std::vector<Vec3D> myPoints;
184 wall->createVTK (myPoints,min,max);
191 intersectVTK(myPoints, -other->getNormal(), other->getPosition());
196 std::vector<Vec3D> rzVec;
197 for (
auto& p: myPoints)
213 std::vector<XY> xyVec;
214 for (
unsigned ir=0; ir<nr; ir++) {
216 xyVec.push_back({
cos(angle),
sin(angle)});
221 unsigned nPoints = vtk.
points.size();
223 for (
auto rz : rzVec)
225 for (
auto xy : xyVec)
236 unsigned nz = rzVec.size();
239 for (
unsigned iz=0; iz<nz-1; iz++) {
240 std::vector<double> cell;
241 cell.reserve(2*nr+2);
242 for (
unsigned ir=0; ir<nr; ir++) {
243 cell.push_back(nPoints+ir+iz*nr);
244 cell.push_back(nPoints+ir+(iz+1)*nr);
246 cell.push_back(nPoints+iz*nr);
247 cell.push_back(nPoints+(iz+1)*nr);
unsigned int getIndex() const
Returns the index of the object in the handler.
Mdouble X
the vector components
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void convertLimits(Vec3D &min, Vec3D &max) const
void setOrientation(const Vec3D &orientation)
Sets the orientation of this BaseInteractable.
void read(std::istream &is) override
Reads an IntersectionOfWalls from an input stream, for example a restart file.
Vec3D getMin() const
Return the "bottom left" corner of the domain, a vector with xMin_, yMin_ and zMin_.
void write(std::ostream &os) const final
outputs wall
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...
std::string getName() const final
Returns the name of the object.
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...
void intersectVTK(std::vector< Vec3D > &points, const Vec3D normal, const Vec3D position) const
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
const Vec3D & getOrientation() const
Returns the orientation of this BaseInteractable.
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Mdouble getWallInteractionRadius() const
Returns the interaction radius for interaction with walls. See also BaseParticle::getInteractionRadiu...
std::vector< InfiniteWall > wallObjects_
The wall "segments"/directions that together make up the finite wall.
WallHandler * getHandler() const
A function which returns the WallHandler that handles this BaseWall.
void writeVTK(VTKContainer &vtk) const override
AxisymmetricIntersectionOfWalls * copy() const final
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
std::vector< std::vector< double > > triangleStrips
AxisymmetricIntersectionOfWalls & operator=(const AxisymmetricIntersectionOfWalls &other)
Copy assignment operator.
void read(std::istream &is) final
reads wall
~AxisymmetricIntersectionOfWalls()
Destructor.
AxisymmetricIntersectionOfWalls()
Default constructor.
Vec3D getMax() const
Return the "upper right" corner of the domain, a vector with xMin_, yMin_ and zMin_.
A AxisymmetricIntersectionOfWalls is an axisymmetric wall, defined by rotating a twodimensional Inter...
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
std::vector< Vec3D > points
Implementation of a 3D vector (by Vitaliy).
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
void write(std::ostream &os) const override
Writes an IntersectionOfWalls to an output stream, for example a restart file.