37 logger(
DEBUG,
"BasicUnionOfWalls::BasicUnionOfWalls ) finished");
50 walls_.push_back(w->copy());
52 logger(
DEBUG,
"BasicUnionOfWalls::BasicUnionOfWalls(const BasicUnionOfWalls &p) finished");
61 logger(
DEBUG,
"BasicUnionOfWalls::~BasicUnionOfWalls finished");
105 if (
walls_.empty())
return false;
116 if (w->getDistanceAndNormal(shifted, distance, normal) ==
true) {
134 for (
unsigned i = 0;
i < size;
i++)
152 os <<
" numWalls " <<
walls_.size();
165 return "BasicUnionOfWalls";
174 std::vector<std::vector<double>> myTriangleStrips;
175 unsigned long n = points.size();
178 w->getVTK(points, myTriangleStrips);
181 for (std::vector<Vec3D>::iterator p = points.begin() + n; p != points.end(); p++)
186 std::vector<bool> pointInWall;
187 pointInWall.reserve(points.size());
193 for (
auto p : points)
199 std::vector<double> strip;
200 for (
auto t : myTriangleStrips)
204 if (pointInWall[
i] ==
true)
210 if (strip.size() > 2)
211 triangleStrips.push_back(strip);
215 if (strip.size() > 2)
216 triangleStrips.push_back(strip);
~BasicUnionOfWalls() override
Default destructor.
std::vector< BaseWall * > walls_
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
A spherical particle is the most simple particle used in MercuryDPM.
void rotateBack(Vec3D &position) const
Applies the inverse rotation to a position.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
void read(std::istream &is) override
Reads BasicUnionOfWalls from a restart file.
std::string getName() const override
Returns the name of the object, in this case the string "BasicUnionOfWalls".
const std::complex< Mdouble > i
virtual void setHandler(WallHandler *handler)
A function which sets the WallHandler for this BaseWall.
void write(std::ostream &os) const override
Function that writes a BaseWall to an output stream, usually a restart file.
This is a class defining walls.
void setSpecies(const ParticleSpecies *species)
void rotate(Vec3D &position) const
Applies the rotation to a position.
BasicUnionOfWalls()
Default constructor, the normal is infinitely long.
WallHandler * getHandler() const
A function which returns the WallHandler that handles this BaseWall.
static BaseWall * createObject(const std::string &type)
Create a new wall, with the type given as a string (required for restarting).
BaseWall * getObject(unsigned i)
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...
BasicUnionOfWalls * copy() const override
Wall copy method. It calls the copy constructor of this Wall, useful for polymorphism.
void write(std::ostream &os) const override
Writes the BasicUnionOfWalls to an output stream, usually a restart file.
void getVTK(std::vector< Vec3D > &points, std::vector< std::vector< double >> &triangleStrips)
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...
Mdouble getRadius() const
Returns the particle's radius.
void read(std::istream &is) override
Function that reads a BaseWall from an input stream, usually a restart file.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
unsigned long getNumberOfObjects()
Returns the number of objects.
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
virtual BaseWall * copy() const =0
Pure virtual function that can be overwritten in inherited classes in order to copy a BaseWall...