34 #ifdef DEBUG_CONSTRUCTOR
35 std::cout <<
"CircularPeriodicBoundary::CircularPeriodicBoundary() finished" << std::endl;
37 #ifdef MERCURY_USE_MPI
41 logger(
WARN,
"CircularPeriodicBoundaries are currently not implemented in parallel MercuryDPM");
50 #ifdef DEBUG_CONSTRUCTOR
51 std::cout <<
"CircularPeriodicBoundary::CircularPeriodicBoundary(double innerRadius) finished" << std::endl;
57 #ifdef DEBUG_DESTRUCTOR
58 std::cerr <<
"CircularPeriodicBoundary::~CircularPeriodicBoundary() finished" << std::endl;
64 #ifdef DEBUG_CONSTRUCTOR
65 std::cerr <<
"CircularPeriodicBoundary::copy() const finished" << std::endl;
95 if (i > 0 && (R - maxDistance <
115 if (i > 1 && R * R * (1 - pow(
cos(alpha - pieSize), 2)) < maxDistance)
135 unsigned numberOfParticles = pH.
getSize();
136 for (
unsigned i = 0;
i < numberOfParticles;
i++)
154 if (i > 0 && i > oldI)
157 if (alpha < 0 || alpha > pieSize)
159 if (alpha > 2.0 * pieSize)
175 else if (i >= 0 && i < oldI)
187 else if (alpha < 0.5 * pieSize)
191 else if (alpha < pieSize)
202 else if (i > 0 && alpha < 0)
207 else if (i > 0 && alpha > pieSize)
217 for (
auto p = pH.
begin(); p != pH.
end(); ++p)
247 return "CircularPeriodicBoundary";
This class contains all information and functions required for communication between processors...
void read(std::istream &is) override
reads the CircularPeriodicBoundary
void oldRead(std::istream &is)
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
unsigned int getIndex() const
Returns the index of the object in the handler.
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
static MPIContainer & Instance()
fetch the instance to be used for communication
Mdouble X
the vector components
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
void addObject(BaseParticle *P) override
Adds a BaseParticle to the ParticleHandler.
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
CircularPeriodicBoundary()
default constructor
void setDisplacement(const Vec3D &disp)
Sets the particle's displacement (= difference between current position and that of the previous time...
std::string getName() const override
Returns the name of the object.
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles)
const std::complex< Mdouble > i
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
std::size_t getNumberOfProcessors() const
Get the total number of processors participating in this simulation.
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of (used in periodic bounda...
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
void read(std::istream &is) override=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
Mdouble log(Mdouble Power)
used to create a circular periodic boundary
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
void rotateParticle(BaseParticle *P, double angle)
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
~CircularPeriodicBoundary() override
destructor
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
void write(std::ostream &os) const override=0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject...
Container to store all BaseParticle.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void createPeriodicParticle(BaseParticle *p, ParticleHandler &pH) override
CircularPeriodicBoundary * copy() const override
Used to create a copy of the object NB: purely virtual function.
const Vec3D & getDisplacement() const
Returns the particle's displacement relative to the previous time step.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
void createPeriodicParticles(ParticleHandler &pH) override
void write(std::ostream &os) const override
outputs the CircularPeriodicBoundary
bool checkBoundaryAfterParticleMoved(BaseParticle *P, ParticleHandler &pH)