 |
revision: v0.14
|
Go to the documentation of this file.
31 #ifndef MPICONTAINER_H_
32 #define MPICONTAINER_H_
39 #ifdef MERCURY_USE_MPI
43 #ifdef MERCURY_FORCE_ASSERTS
44 #define MERCURY_ASSERTS true
46 #ifdef MERCURY_NO_ASSERTS
47 #define MERCURY_ASSERTS false
50 #define MERCURY_ASSERTS false
52 #define MERCURY_ASSERTS true
92 #ifdef MERCURY_USE_MPI
95 typename std::enable_if<std::is_integral<T>::value, MPI_Datatype>::type
99 MPI_Type_match_size(MPI_TYPECLASS_INTEGER,
sizeof(T), &type);
105 typename std::enable_if<std::is_floating_point<T>::value, MPI_Datatype>::type
109 MPI_Type_match_size(MPI_TYPECLASS_REAL,
sizeof(T),&type);
154 #ifdef MERCURY_USE_MPI
155 MPI_Waitall(pending_.size(),pending_.data(),MPI_STATUSES_IGNORE);
157 MPI_Barrier(communicator_);
170 typename std::enable_if<std::is_scalar<T>::value,
void>::type
176 logger(
FATAL,
"[MPI FATAL]: Sending data to self!");
179 #ifdef MERCURY_USE_MPI
181 MPI_Isend(&t, 1, Detail::toMPIType(t), to, tag, communicator_, &request);
182 pending_.push_back(request);
189 typename std::enable_if<std::is_scalar<T>::value,
void>::type
190 send(T* t,
int count,
int to,
int tag)
195 logger(
FATAL,
"[MPI FATAL]: Sending data to self!");
200 logger(
WARN,
"[MPI ERROR]: Sending zero data");
203 #ifdef MERCURY_USE_MPI
205 MPI_Isend(t, count, Detail::toMPIType(*t), to, tag, communicator_, &request);
206 pending_.push_back(request);
220 typename std::enable_if<std::is_scalar<T>::value,
void>::type
226 logger(
FATAL,
"[MPI FATAL]: Receiving data from self!");
229 #ifdef MERCURY_USE_MPI
231 MPI_Irecv(&t, 1, Detail::toMPIType(t), from, tag, communicator_, &request);
232 pending_.push_back(request);
239 typename std::enable_if<std::is_scalar<T>::value,
void>::type
245 logger(
FATAL,
"[MPI FATAL]: Receiving data fromself!");
250 logger(
WARN,
"[MPI ERROR]: Receiving zero data");
253 #ifdef MERCURY_USE_MPI
255 MPI_Irecv(&t, count, Detail::toMPIType(*t), from, tag, communicator_, &request);
256 pending_.push_back(request);
277 logger(
FATAL,
"[MPI FATAL]: Sending data to self!");
282 logger(
WARN,
"[MPI ERROR]: Sending zero data");
285 #ifdef MERCURY_USE_MPI
287 MPI_Isend(t, count, dataTypes_[type], to, tag, communicator_, &request);
288 pending_.push_back(request);
309 logger(
FATAL,
"[MPI FATAL]: Receiving data to self!");
314 logger(
WARN,
"[MPI ERROR]: Receiving zero data");
317 #ifdef MERCURY_USE_MPI
319 MPI_Irecv(t, count, dataTypes_[type], from, tag, communicator_, &request);
320 pending_.push_back(request);
334 typename std::enable_if<std::is_scalar<T>::value,
void>::type
340 logger(
FATAL,
"[MPI FATAL]: Sending data to self!");
345 logger(
WARN,
"[MPI ERROR]: Sending zero data");
348 #ifdef MERCURY_USE_MPI
349 MPI_Ssend(&t, count, Detail::toMPIType(t), to, tag, communicator_);
360 logger(
FATAL,
"[MPI FATAL]: Sending data to self!");
365 logger(
WARN,
"[MPI ERROR]: Sending zero data");
368 #ifdef MERCURY_USE_MPI
369 MPI_Ssend(t,count,dataTypes_[type], to, tag, communicator_);
382 typename std::enable_if<std::is_scalar<T>::value,
void>::type
388 logger(
FATAL,
"[MPI FATAL]: Receiving data from self!");
393 logger(
WARN,
"[MPI ERROR]: Receiving zero data");
396 #ifdef MERCURY_USE_MPI
397 MPI_Recv(&t, count, Detail::toMPIType(t), from, tag,communicator_, MPI_STATUS_IGNORE);
407 logger(
FATAL,
"[MPI FATAL]: Receiving data to self!");
412 logger(
WARN,
"[MPI ERROR]: Receiving zero data");
415 #ifdef MERCURY_USE_MPI
416 MPI_Recv(t, count, dataTypes_[type], from, tag, communicator_, MPI_STATUS_IGNORE);
430 #ifdef MERCURY_USE_MPI
431 MPI_Gather(&send_t, 1, Detail::toMPIType(send_t), receive_t, 1, Detail::toMPIType(send_t), 0, communicator_);
440 typename std::enable_if<std::is_scalar<T>::value,
void>::type
443 #ifdef MERCURY_USE_MPI
444 MPI_Bcast(&t,1,Detail::toMPIType(t),fromProcessor,communicator_);
453 typename std::enable_if<std::is_scalar<T>::value,
void>::type
456 #ifdef MERCURY_USE_MPI
457 MPI_Bcast((
void *)t,size,Detail::toMPIType(t[0]),fromProcessor,communicator_);
469 #ifdef MERCURY_USE_MPI
470 MPI_Bcast((
void *)t,1,dataTypes_[type],fromProcessor,communicator_);
484 #ifdef MERCURY_USE_MPI
486 typename std::enable_if<std::is_scalar<T>::value,
void>::type
487 reduce(T& t, MPI_Op operation,
int id = 0)
492 MPI_Reduce(MPI_IN_PLACE, &t, 1, Detail::toMPIType(t), operation,
id, communicator_);
496 MPI_Reduce(&t,
nullptr, 1, Detail::toMPIType(t), operation,
id, communicator_);
509 #ifdef MERCURY_USE_MPI
511 typename std::enable_if<std::is_scalar<T>::value,
void>::type
512 allReduce(T& send_t, T& receive_t, MPI_Op operation)
514 MPI_Allreduce(&send_t, &receive_t, 1, Detail::toMPIType(send_t), operation,communicator_);
527 #ifdef MERCURY_USE_MPI
529 typename std::enable_if<std::is_scalar<T>::value,
void>::type
530 allGather(T& send_t,
int send_count, std::vector<T>& receive_t,
int receive_count)
532 MPI_Allgather(&send_t, send_count, Detail::toMPIType(send_t),
533 receive_t.data(), receive_count, Detail::toMPIType(receive_t[0]),communicator_);
550 #ifdef MERCURY_USE_MPI
566 #ifdef MERCURY_USE_MPI
567 MPI_Datatype MPIType;
568 MPI_Type_contiguous(
sizeof(T), MPI_BYTE, &MPIType);
569 MPI_Type_commit(&MPIType);
570 dataTypes_.push_back(MPIType);
580 #ifdef MERCURY_USE_MPI
581 for(MPI_Datatype type : dataTypes_)
583 MPI_Type_free(&type);
611 #ifdef MERCURY_USE_MPI
615 std::vector<MPI_Request> pending_;
620 MPI_Comm communicator_;
624 std::vector<MPI_Datatype> dataTypes_;
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:145
In the reference case the particle just moves two times as fast.
Definition: MovingWallUnitTest.cpp:159
double particleWallFriction
Definition: MonodispersedDrum.cpp:303
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallsUnitTest.cpp:44
double sizeRatio
Definition: MonodispersedDrum.cpp:298
int main(int argc, char *argv[])
Definition: MonodispersedDrum.cpp:326
Use AxisymmetricIntersectionOfWalls to Screw Screw::read Screw::read Screw::read define axisymmetric ...
Definition: AxisymmetricIntersectionOfWalls.h:126
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:341
void setRollingFriction(double drum, double f1)
Definition: MonodispersedDrum.cpp:270
void send(T *t, MercuryMPIType type, int count, int to, int tag)
asynchronously send a list of MercuryMPITypes objects to some other processor.
Definition: MpiContainer.h:271
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
void setTorsionFriction(double drum, double f1)
Definition: MonodispersedDrum.cpp:276
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingIntersectionOfWallsUnitTest.cpp:113
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
MovingIntersectionOfWallsUnitTest_Basic()
Definition: MovingIntersectionOfWallsUnitTest.cpp:43
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
unsigned int numberOfParticlesToBeInserted
Definition: MonodisperseSmoothInclinedChute.cpp:123
InfiniteWall * wall
Definition: MovingWallUnitTest.cpp:79
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
@ PARTICLE_DATA
Definition: MpiContainer.h:79
double insertTimeInterval
Definition: MonodisperseSmoothInclinedChute.cpp:122
const Mdouble pi
Definition: ExtendedMath.h:45
std::enable_if< std::is_scalar< T >::value, void >::type directReceive(T &t, int count, int from, int tag)
synchronously receive a list of scalars from another processor. if the send command has not been issu...
Definition: MpiContainer.h:383
void accelerate(const Vec3D &vel)
Increases the particle's velocity_ by the given vector.
Definition: BaseParticle.cc:622
int main()
Definition: MovingWallsUnitTest.cpp:119
std::enable_if< std::is_scalar< T >::value, void >::type send(T *t, int count, int to, int tag)
Definition: MpiContainer.h:190
void setChuteAngleAndMagnitudeOfGravity(Mdouble chuteAngle, Mdouble gravity)
Sets gravity vector according to chute angle (in degrees)
Definition: Chute.cc:716
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:934
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:54
void broadcast(T *t, MercuryMPIType type, int fromProcessor=0)
Broadcasts an MercuryMPIType to all other processors.
Definition: MpiContainer.h:467
void initialiseMPI()
Inialises the MPI library.
Definition: MpiContainer.cc:137
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
Vec3D velocity
Definition: MovingIntersectionOfWallsUnitTest.cpp:123
void setTorque(const Vec3D &torque)
Sets the torque on this BaseInteractable.
Definition: BaseInteractable.h:161
A IntersectionOfWalls is convex polygon defined as an intersection of InfiniteWall's.
Definition: IntersectionOfWalls.h:59
void setFrictionCoeff(double pwf, double ppf)
Definition: MonodispersedDrum.cpp:251
LinearViscoelasticSpecies * species
Definition: MovingIntersectionOfWallsUnitTest.cpp:106
BaseParticle * p2f
Definition: MovingIntersectionOfWallsUnitTest.cpp:98
void createMercuryMPIType(T t, MercuryMPIType type)
Get the communicator used for MPI commands.
Definition: MpiContainer.h:564
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:607
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T *t, int size, int fromProcessor)
Broadcasts a scalar from the root to all other processors.
Definition: MpiContainer.h:454
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:129
void addObject(Vec3D normal, Vec3D point)
Adds a wall to the set of infinite walls, given a normal vector pointing into the wall (i....
Definition: IntersectionOfWalls.cc:137
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:105
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MonodispersedDrum.cpp:41
void setNormal(Vec3D normal)
Changes the normal of the InfiniteWall.
Definition: InfiniteWall.cc:127
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
double CORDrum
Definition: MonodispersedDrum.cpp:296
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1315
Mdouble X
the vector components
Definition: Vector.h:65
double particleParticleFriction
Definition: MonodispersedDrum.cpp:303
void setSpecies(const ParticleSpecies *species)
sets species of subwalls as well
Definition: IntersectionOfWalls.cc:72
double drumRadius
Definition: MonodispersedDrum.cpp:308
LinearViscoelasticSlidingFrictionSpecies * species
Definition: MovingWallUnitTest.cpp:78
void setFractionalPolydispersity(double fpd)
Definition: MonodispersedDrum.cpp:241
double massS1
Definition: MonodispersedDrum.cpp:294
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:594
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
double rollingFriction1
Definition: MonodispersedDrum.cpp:316
void initialiseMPI()
Inialises the MPI library.
Definition: MpiContainer.cc:137
Definition: MovingIntersectionOfWallsUnitTest.cpp:40
int processorID_
The ID of the processor this class is running on.
Definition: MpiContainer.h:604
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
std::enable_if< std::is_scalar< T >::value, void >::type receive(T &t, int from, int tag)
asynchronously receive a scalar from some other processor.
Definition: MpiContainer.h:221
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
double radiusS1
Definition: MonodispersedDrum.cpp:292
BaseParticle * p3e
Definition: MovingIntersectionOfWallsUnitTest.cpp:102
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
Definition: BaseInteractable.h:230
@ R
Definition: StatisticsVector.h:42
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1451
@ PERIODIC_COMPLEXITY
Definition: MpiContainer.h:85
@ PARTICLE
Definition: MpiContainer.h:67
std::size_t getProcessorID()
Reduces a scalar on all processors to one scalar on a target processor.
Definition: MpiContainer.cc:113
Definition: MovingWallUnitTest.cpp:178
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
void setWallsWriteVTK(FileType writeWallsVTK)
Sets whether walls are written into a VTK file.
Definition: DPMBase.cc:908
@ INTERACTION_COUNT
Definition: MpiContainer.h:83
int numS1ToBeInserted
Definition: MonodispersedDrum.cpp:306
double revolutionsPerSecond
Definition: MonodispersedDrum.cpp:309
int main(int argc, char *argv[])
Definition: MonodisperseSmoothInclinedChute.cpp:126
virtual void createMPIType()
Definition: BaseInteraction.cc:851
double insertTime
the amount of time that new particles should be inserted.
Definition: MonodisperseSmoothInclinedChute.cpp:121
void setPrescribedVelocity(const std::function< Vec3D(double)> &prescribedVelocity)
Allows the velocity of an infinite mass interactable to be prescribed.
Definition: BaseInteractable.cc:444
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
void setRevolutionSpeed(double rpm)
Definition: MonodispersedDrum.cpp:236
MPIContainer()
Constructor.
Definition: MpiContainer.cc:43
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: Helpers.cc:374
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1441
Definition: MovingWallUnitTest.cpp:104
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:613
Data class to send a particle force over MPI.
Definition: MpiDataClass.h:114
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:50
std::enable_if< std::is_scalar< T >::value, void >::type directSend(T &t, int count, int to, int tag)
synchronously send a list of scalars to another processor. the data should be received directly or th...
Definition: MpiContainer.h:335
BaseParticle * p1e
Definition: MovingIntersectionOfWallsUnitTest.cpp:100
void setForce(const Vec3D &force)
Sets the force on this BaseInteractable.
Definition: BaseInteractable.h:149
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: MonodisperseSmoothInclinedChutePatternInflow.cpp:132
double rollingFrictionDrum
Definition: MonodispersedDrum.cpp:315
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
double rhoS1
Definition: MonodispersedDrum.cpp:293
double slidingFrictionDrum
Definition: MonodispersedDrum.cpp:312
double checkTime
Definition: MonodispersedDrum.cpp:322
@ VELOCITY_DATA
Definition: MpiContainer.h:82
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:190
In the reference case the particle just moves two times as fast.
Definition: MovingWallUnitTest.cpp:85
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
void setSlidingFriction(double drum, double f1)
Definition: MonodispersedDrum.cpp:264
void compareParticles(BaseParticle *Ptest, BaseParticle *Pref, double absError, Vec3D positionDifference, Vec3D velocityDifference, Quaternion orientationDifference, Vec3D AngularVelocityDifference)
Definition: MovingWallUnitTest.cpp:216
void directReceive(T *t, MercuryMPIType type, int count, int from, int tag)
Definition: MpiContainer.h:402
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
void setOrientationViaNormal(Vec3D normal)
Sets the orientation of this BaseInteractable by defining the vector that results from the rotation o...
Definition: BaseInteractable.cc:199
void directSend(T *t, MercuryMPIType type, int count, int to, int tag)
Definition: MpiContainer.h:355
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: MonodisperseSmoothInclinedChute.cpp:40
int step
Definition: MonodispersedDrum.cpp:321
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
double densityRatio
Definition: MonodispersedDrum.cpp:299
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:160
void gather(T &send_t, T *receive_t)
Gathers a scaler from all processors to a vector of scalars on the root.
Definition: MpiContainer.h:428
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
void actionsBeforeTimeStep() override
A virtual function which allows to define operations to be executed before the new time step.
Definition: MonodispersedDrum.cpp:173
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:179
void deleteMercuryMPITypes()
Deletes the MercuryMPITypes.
Definition: MpiContainer.h:578
int numberOfProcessors_
The total number of processors in the communicator.
Definition: MpiContainer.h:609
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
double CORS1
Definition: MonodispersedDrum.cpp:296
@ PARTICLE_COUNT
Definition: MpiContainer.h:78
Contains material and contact force properties.
Definition: Species.h:35
Definition: MovingWallUnitTest.cpp:40
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:833
@ VELOCITY
Definition: MpiContainer.h:67
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
Definition: MovingWallUnitTest.cpp:128
virtual BaseInteraction * getEmptyInteraction() const =0
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
void hGridRebuild()
This sets up the parameters required for the contact model.
Definition: MercuryBase.cc:204
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
BaseParticle * p2e
Definition: MovingIntersectionOfWallsUnitTest.cpp:101
void actionsOnRestart() override
A virtual function where the users can add extra code which is executed only when the code is restart...
Definition: MonodispersedDrum.cpp:214
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:86
@ INTERACTION_DATA
Definition: MpiContainer.h:84
std::size_t getNumberOfProcessors() const
Get the total number of processors participating in this simulation.
Definition: MpiContainer.cc:104
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:96
Definition: MovingWallUnitTest.cpp:202
Definition: MovingWallUnitTest.cpp:169
@ POSITION
Definition: MpiContainer.h:67
@ INTERACTION
Definition: MpiContainer.h:67
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
void initialiseMercuryMPITypes(const SpeciesHandler &speciesHandler)
Creates the MPI types required for communication of Mercury data through the MPI interface.
Definition: MpiContainer.cc:74
Definition: MovingIntersectionOfWallsUnitTest.cpp:111
void sync()
Process all pending asynchronous communication requests before continuing.
Definition: MpiContainer.h:152
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:203
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130
Definition: MovingWallsUnitTest.cpp:35
double volumeFraction
Definition: MonodispersedDrum.cpp:301
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Mdouble Y
Definition: Vector.h:65
double torsionFrictionDrum
Definition: MonodispersedDrum.cpp:318
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: MovingWallUnitTest.cpp:236
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
@ PARTICLE_INDEX
Definition: MpiContainer.h:86
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
double torsionFriction1
Definition: MonodispersedDrum.cpp:319
IntersectionOfWalls * triangle
Definition: MovingIntersectionOfWallsUnitTest.cpp:103
BaseParticle * p3f
Definition: MovingIntersectionOfWallsUnitTest.cpp:99
std::enable_if< std::is_scalar< T >::value, void >::type send(T &t, int to, int tag)
Asynchronously send a scalar to some other processor.
Definition: MpiContainer.h:171
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:171
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:625
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
void setPrescribedPosition(const std::function< Vec3D(double)> &prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
Definition: BaseInteractable.cc:413
void compareParticles(BaseParticle *Ptest, BaseParticle *Pref, double absError, Vec3D positionDifference, Vec3D velocityDifference, Quaternion orientationDifference, Vec3D AngularVelocityDifference)
Definition: MovingIntersectionOfWallsUnitTest.cpp:125
double slidingFriction1
Definition: MonodispersedDrum.cpp:313
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
@ SUPERQUADRIC
Definition: MpiContainer.h:67
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:54
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingIntersectionOfWallsUnitTest.cpp:49
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1446
Definition: MovingWallUnitTest.cpp:115
void receive(T *t, MercuryMPIType type, int count, int from, int tag)
asynchronously receive a list of MercuryMPIType objects from some other processor.
Definition: MpiContainer.h:303
Definition: MovingWallUnitTest.cpp:95
Definition: BaseParticle.h:54
#define UNUSED
Definition: GeneralDefine.h:39
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
SphericalParticle * particle
Definition: MovingWallUnitTest.cpp:80
int numS1
Definition: MonodispersedDrum.cpp:305
Definition: MonodisperseSmoothInclinedChute.cpp:37
BaseParticle * p1f
Definition: MovingIntersectionOfWallsUnitTest.cpp:97
void setCOR(double drumCOR, double COR1)
Definition: MonodispersedDrum.cpp:257
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
@ SUPERQUADRIC_DATA
Definition: MpiContainer.h:87
Data class to send a particle velocity over MPI.
Definition: MpiDataClass.h:103
@ PERIODIC_POSITION_DATA
Definition: MpiContainer.h:81
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:619
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:631
Definition: MpiContainer.h:91
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1001
Definition: MovingWallUnitTest.cpp:143
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T &t, int fromProcessor=0)
Broadcasts a scalar from the root to all other processors.
Definition: MpiContainer.h:441
Data class to send a particle position over MPI.
Definition: MpiDataClass.h:90
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
MercuryMPIType
An enum that indicates what type of data is being send over MPI.
Definition: MpiContainer.h:66
Mdouble Z
Definition: Vector.h:65
double fractionalPolydispersity
Definition: MonodispersedDrum.cpp:310
MovingWall()
Definition: MovingWallUnitTest.cpp:43
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
void cleanChute()
Deletes all outflow particles once every 100 time steps.
Definition: Chute.cc:464
MercuryMPITag
An enum that facilitates the creation of unique communication tags in the parallel code.
Definition: MpiContainer.h:77
void setDrumFillFraction(double dff)
Definition: MonodispersedDrum.cpp:246
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:116
double drumFillFraction
Definition: MonodispersedDrum.cpp:300
@ FORCE
Definition: MpiContainer.h:67
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MovingWallUnitTest.cpp:170
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: MonodisperseSmoothInclinedChute.cpp:75
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
Definition: MonodispersedDrum.cpp:38
Creates chutes with different bottoms. Inherits from Mercury3D (-> MercuryBase -> DPMBase).
Definition: Chute.h:65
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
std::enable_if< std::is_scalar< T >::value, void >::type receive(T *t, int count, int from, int tag)
Definition: MpiContainer.h:240
double getDrumRadius()
Definition: MonodispersedDrum.cpp:282
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:251
int main(int argc UNUSED, char *argv[] UNUSED)
Definition: MovingIntersectionOfWallsUnitTest.cpp:144
std::string name
Definition: MercuryProb.h:48
void setDrumRadius(double radius)
Definition: MonodispersedDrum.cpp:231
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
@ POSITION_DATA
Definition: MpiContainer.h:80
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:600
MovingWalls(std::string name)
Definition: MovingWallsUnitTest.cpp:37
void createOpenPrism(std::vector< Vec3D > points, Vec3D prismAxis)
Creates an open prism which is a polygon between the points, except the first and last point,...
Definition: IntersectionOfWalls.cc:466
void setWriteVTK(FileType f)
Definition: InteractionHandler.cc:553
MPIContainer(const MPIContainer &orig)=delete
Copy constructor is disabled, to enforce a singleton pattern.
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1425
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:885
Definition: MovingWallUnitTest.cpp:189
virtual void deleteEmptyInteraction(BaseInteraction *interaction) const =0
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76
double tc
Definition: MonodispersedDrum.cpp:296
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4225
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408