MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FixedClusterInsertionBoundary Class Reference

#include <FixedClusterInsertionBoundary.h>

+ Inheritance diagram for FixedClusterInsertionBoundary:

Public Member Functions

 FixedClusterInsertionBoundary ()
 Constructor: inherits from BaseClusterInsertionBoundary constructor. More...
 
 FixedClusterInsertionBoundary (const FixedClusterInsertionBoundary &other)
 Copy constructor with deep copy. More...
 
 ~FixedClusterInsertionBoundary () override
 Destructor: default destructor. More...
 
FixedClusterInsertionBoundarycopy () const override
 Creates a copy on the heap and returns a pointer. More...
 
void set (BaseParticle *particleToCopy, std::vector< Vec3D > positions, std::vector< Mdouble > radii, Vec3D velMin, Vec3D velMax, Mdouble rMicroParticle)
 Sets the properties of the ClusterInsertionBoundary. More...
 
void setPositionsAndRadii (std::vector< Vec3D > clusterPositions, std::vector< Mdouble > clusterRadii)
 this sets positions and radii of the desired clusters. More...
 
void checkBoundaryBeforeTimeStep (DPMBase *md) final
 inserts cluster: differently from RandomClusterInsertionBoundary, here no check for interaction is computed. More...
 
void placeParticle (BaseParticle *p, RNG &random) final
 Places particles according to vector clusterPositions_ and sets a random velocity, if required. More...
 
BaseParticlegenerateParticle (RNG &random) final
 Sets cluster radii according to vector clusterRadii_. More...
 
- Public Member Functions inherited from BaseClusterInsertionBoundary
 BaseClusterInsertionBoundary ()
 Constructor; sets everything to 0. More...
 
 BaseClusterInsertionBoundary (const BaseClusterInsertionBoundary &other)
 Copy constructor with deep copy. More...
 
 ~BaseClusterInsertionBoundary () override
 Destructor: default destructor. More...
 
void setRandomised (bool randomised)
 this turns off the randomise(): created for UnitTests. More...
 
bool getRandomised ()
 this returns a bool which indicates if the process is randomised (true) or not (false). More...
 
unsigned int getNumberOfClusterInserted ()
 this returns the number of cluster inserted. More...
 
void setRadiusMicroParticle (Mdouble rMP)
 this sets the radius of the micro particle composing the cluster. More...
 
void setRadiusRange (Mdouble radMin, Mdouble radMax)
 Sets the range of cluster radius that may be generated. More...
 
void setGeometry (Vec3D posMin, Vec3D posMax, Vec3D velMin, Vec3D velMax)
 Sets the geometry (position and velocity distribution) of the ClusterInsertionBoundary. More...
 
void setVelocityRange (Vec3D velMin, Vec3D velMax)
 Sets the velocity range of the ClusterInsertionBoundary. More...
 
void setAdditionalClusterProperties (Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance)
 sets additional cluster properties as: More...
 
void setOutputClusterProperties (bool doCdatOutput, bool doOverlOutput, bool doAmatOutput, bool doIntStrucOutput, bool doVtkOutput, bool doRestartOutput, bool doFStatOutput, bool doEneOutput)
 sets cluster whether or not cluster output files will be created, for example: More...
 
void read (std::istream &is) override
 reads boundary properties from istream More...
 
void write (std::ostream &os) const override
 writes boundary properties to ostream More...
 
- Public Member Functions inherited from InsertionBoundary
 InsertionBoundary ()
 Default constructor: set everything to 0/nullptr. More...
 
 InsertionBoundary (const InsertionBoundary &other)
 Copy constructor (with deep copy) More...
 
 ~InsertionBoundary () override
 Destructor: delete the particle that has to be copied at every insertion. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed)
 Sets the particle that will be inserted and the maximum number of times for which insertion may fail. More...
 
void checkBoundaryBeforeTimeStep (DPMBase *md) override
 Fills the boundary with particles. More...
 
void insertParticles (DPMBase *md)
 
unsigned int getNumberOfParticlesInserted () const
 Gets the number of particles inserted by the boundary. More...
 
double getMassOfParticlesInserted () const
 
double getVolumeOfParticlesInserted () const
 
void reset ()
 
void activate ()
 Turns on the InsertionBoundary. More...
 
void deactivate ()
 Turns off the InsertionBoundary. More...
 
bool isActivated ()
 Returns whether the InsertionBoundary is activated. More...
 
void setMaxFailed (unsigned int maxFailed)
 Sets the number of times that the wall may fail to insert a particle. More...
 
unsigned int getMaxFailed () const
 Gets the number of times that the boundary may fail to insert a particle. More...
 
void setParticleToCopy (BaseParticle *particleToCopy)
 Sets the particle that will be inserted through the insertion boundary. More...
 
BaseParticlegetParticleToCopy () const
 Gets the particle that will be inserted through the insertion boundary. More...
 
void read (std::istream &is) override
 Reads the boundary's id_ and maxFailed_. More...
 
void write (std::ostream &os) const override
 Writes the boundary's id_ and maxFailed_. More...
 
Mdouble getVolumeFlowRate () const
 
void setVolumeFlowRate (Mdouble volumeFlowRate_)
 
Mdouble getInitialVolume () const
 
void setInitialVolume (Mdouble initialVolume)
 
void setPSD (PSD psd)
 Sets the range of particle radii that may be generated from a user defined PSD. More...
 
PSD getPSD ()
 
void setDistribution (Distribution distribution)
 Sets the range of particle radii that may be generated to custom distributions. More...
 
Distribution getDistribution ()
 Gets the range of particle radii that may be generated. More...
 
void setVariableVolumeFlowRate (const std::vector< Mdouble > &variableCumulativeVolumeFlowRate, Mdouble samplingInterval)
 
bool insertParticle (Mdouble time)
 
bool getCheckParticleForInteraction () const
 
void setCheckParticleForInteraction (bool checkParticleForInteraction)
 
void setManualInsertion (bool manualInsertion)
 Set the flag for a manual PSD insertion routine. More...
 
- Public Member Functions inherited from BaseBoundary
 BaseBoundary ()
 default constructor. More...
 
 BaseBoundary (const BaseBoundary &b)
 copy constructor More...
 
 ~BaseBoundary () override
 destructor More...
 
virtual void createPeriodicParticle (BaseParticle *p UNUSED, ParticleHandler &pH UNUSED)
 Creates a periodic particle in case of periodic boundaries in serial build. More...
 
virtual void createPeriodicParticles (ParticleHandler &pH UNUSED)
 Creates periodic copies of given particle in case of periodic boundaries. More...
 
virtual void checkBoundaryAfterParticlesMove (ParticleHandler &pH)
 Virtual function that does things to particles, each time step after particles have moved. More...
 
virtual void actionsBeforeTimeLoop ()
 Virtual function that does something after DPMBase::setupInitialConditions but before the first time step. More...
 
virtual void modifyGhostAfterCreation (BaseParticle *particle, int i)
 
virtual void writeVTK (std::fstream &file)
 
void setHandler (BoundaryHandler *handler)
 Sets the boundary's BoundaryHandler. More...
 
BoundaryHandlergetHandler () const
 Returns the boundary's BoundaryHandler. More...
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Private Member Functions

std::string getName () const override
 Returns the name of the object. More...
 

Additional Inherited Members

- Public Types inherited from InsertionBoundary
enum  Distribution { Distribution::Uniform, Distribution::Normal_1_5 }
 Defines a custom particle size distribution; distribution_ will always be used, unless particleSizeDistribution_ is non-empty. More...
 
- Protected Attributes inherited from BaseClusterInsertionBoundary
unsigned int nClusterInserted_
 
Mdouble radiusParticle_
 
int nParticles_
 
LinearPlasticViscoelasticFrictionSpeciesclusterSpecies_
 
bool isCdatOutputOn_
 
bool isOverlOutputOn_
 
bool isAmatOutputOn_
 
bool isIntStrucOutputOn_
 
bool isVtkOutputOn_
 
bool isRestartOutputOn_
 
bool isFStatOutputOn_
 
bool isEneOutputOn_
 
Mdouble sizeDispersityParticle_
 
Mdouble velocityDampingModulus_
 
int nInternalStructurePoints_
 
Mdouble energyRatioTolerance_
 
Mdouble collisionTimeOverTimeStep_
 
Vec3D posMin_
 
Vec3D posMax_
 
Vec3D velMin_
 
Vec3D velMax_
 
bool setRadiusParticleAndNotNumberOfParticles_
 
std::vector< Vec3DclusterPositions_
 
std::vector< MdoubleclusterRadii_
 
bool randomised_
 
- Protected Attributes inherited from InsertionBoundary
BaseParticleparticleToCopy_
 Particle that will be inserted through the insertion boundary. More...
 
unsigned int maxFailed_
 Number of times that the wall may fail to insert a particle. More...
 
unsigned int numberOfParticlesInserted_
 Number of particles that are already inserted. More...
 
Mdouble massInserted_
 Total mass of particles inserted. More...
 
Mdouble volumeInserted_
 Total volume of particles inserted. More...
 
bool isActivated_
 The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate). More...
 
Mdouble volumeFlowRate_
 
Mdouble initialVolume_
 
std::vector< MdoublevariableCumulativeVolumeFlowRate_
 
Mdouble samplingInterval_
 
bool checkParticleForInteraction_
 
PSD particleSizeDistribution_
 Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is empty, distribution_ is used instead. More...
 
Mdouble radMin_
 Minimum and maximum radii of the generated particles. More...
 
Mdouble radMax_
 
Distribution distribution_ = Distribution::Uniform
 defines a custom particle size distribution, which by default is uniform More...
 
bool isManuallyInserting_
 A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE. More...
 

Detailed Description

RandomClusterInsertionBoundary This class works exactly like CubeInsertionBoundary class but inserts clusters instead of particles, and the insertion process is not random, but determined by radii and positions specified by the user. MPI: It does not work with MPI. One of the reasons is the need to adapt function DPMBase::importParticlesAs(). In particular particles and interaction should be imported as MPIParticle and MPIInteraction. In addition to this, the same should be done inside BaseCluster::actionsAfterSolve() when particles are centred around the desired position.

Definition at line 39 of file FixedClusterInsertionBoundary.h.

Constructor & Destructor Documentation

FixedClusterInsertionBoundary::FixedClusterInsertionBoundary ( )

Constructor: inherits from BaseClusterInsertionBoundary constructor.

Default constructor: inherits from BaseClusterInsertionBoundary constructor.

Definition at line 31 of file FixedClusterInsertionBoundary.cc.

References DEBUG, and logger.

Referenced by copy().

32 {
33  logger(DEBUG, "RandomClusterInsertionBoundary::RandomClusterInsertionBoundary() finished");
34 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseClusterInsertionBoundary()
Constructor; sets everything to 0.
FixedClusterInsertionBoundary::FixedClusterInsertionBoundary ( const FixedClusterInsertionBoundary other)

Copy constructor with deep copy.

Copy constructor

Definition at line 39 of file FixedClusterInsertionBoundary.cc.

References DEBUG, and logger.

41 
42  logger(DEBUG, "RandomClusterInsertionBoundary::RandomClusterInsertionBoundary() finished");
43 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseClusterInsertionBoundary()
Constructor; sets everything to 0.
FixedClusterInsertionBoundary::~FixedClusterInsertionBoundary ( )
overridedefault

Destructor: default destructor.

Default Destructor.

Member Function Documentation

void FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep ( DPMBase md)
finalvirtual

inserts cluster: differently from RandomClusterInsertionBoundary, here no check for interaction is computed.

Here the insertion process takes place. Differently from RandomClusterInsertionBoundary, this is basically just a for loop.

Reimplemented from BaseClusterInsertionBoundary.

Definition at line 107 of file FixedClusterInsertionBoundary.cc.

References BaseClusterInsertionBoundary::clusterRadii_, BaseClusterInsertionBoundary::collisionTimeOverTimeStep_, BaseCluster::doAmatOutput(), BaseCluster::doCdatOutput(), BaseCluster::doEneOutput(), BaseCluster::doFStatOutput(), BaseCluster::doIntStrucOutput(), BaseCluster::doOverlOutput(), BaseCluster::doRestartOutput(), BaseCluster::doVtkOutput(), BaseClusterInsertionBoundary::energyRatioTolerance_, generateParticle(), ParticleHandler::getMass(), BaseHandler< T >::getNextGroupId(), BaseHandler< T >::getObject(), BaseClusterInsertionBoundary::getRandomised(), BaseHandler< T >::getSize(), ParticleHandler::getVolume(), constants::i, DPMBase::importParticlesAs(), DPMBase::interactionHandler, InsertionBoundary::isActivated_, BaseClusterInsertionBoundary::isAmatOutputOn_, BaseClusterInsertionBoundary::isCdatOutputOn_, BaseClusterInsertionBoundary::isEneOutputOn_, BaseClusterInsertionBoundary::isFStatOutputOn_, BaseClusterInsertionBoundary::isIntStrucOutputOn_, BaseClusterInsertionBoundary::isOverlOutputOn_, BaseClusterInsertionBoundary::isRestartOutputOn_, BaseClusterInsertionBoundary::isVtkOutputOn_, logger, InsertionBoundary::massInserted_, BaseClusterInsertionBoundary::nClusterInserted_, BaseClusterInsertionBoundary::nInternalStructurePoints_, InsertionBoundary::numberOfParticlesInserted_, DPMBase::particleHandler, placeParticle(), BaseClusterInsertionBoundary::radiusParticle_, DPMBase::random, RNG::randomise(), BaseCluster::setClusterId(), BaseCluster::setCollisionTimeOverTimeStep(), BaseCluster::setEnergyRatioTolerance(), BaseCluster::setNumberOfInternalStructurePoints(), BaseCluster::setParticleSpecies(), BaseCluster::setPosition(), BaseCluster::setRadiusCluster(), BaseCluster::setRadiusParticle(), BaseClusterInsertionBoundary::setRadiusParticleAndNotNumberOfParticles_, BaseCluster::setSizeDispersityParticle(), BaseCluster::setVelocity(), BaseCluster::setVelocityDampingModulus(), BaseClusterInsertionBoundary::sizeDispersityParticle_, DPMBase::solve(), DPMBase::speciesHandler, BaseClusterInsertionBoundary::velocityDampingModulus_, VERBOSE, and InsertionBoundary::volumeInserted_.

108 {
109  logger(VERBOSE, "In FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep\n");
110 
111  if (!isActivated_)
112  return;
113 
114  /* Each time step, the InsertionBoundary attempts to fill up a region with
115  * clusters.
116  *
117  * It first calls generateParticle() to get a randomised particle, subject
118  * to a specified distribution over sizes and species. (The basic class
119  * supports size dispersity only but PolydisperseInsertionBoundary will
120  * support species dispersity.)
121  * Then it repeatedly calls placeParticle(), which gives the cluster a
122  * random location (and possibly velocity) in a specified,
123  * geometry-dependent bound. Each time, it checks whether the new cluster
124  * would have an interaction with another cluster or a wall.
125  *
126  * If it manages to do that within maxFailed_ tries, then:
127  * * the new cluster is created and inserted,
128  * * the failure counter is reset, and
129  * the processes is repeated with a new generateParticle().
130  *
131  * Otherwise, the processes terminates for this time step.
132  * */
133 
134  for (std::vector<Mdouble>::const_iterator i = clusterRadii_.begin(); i != clusterRadii_.end(); ++i) {
135 
136 
137  auto p0 = generateParticle(md->random);
138 
139  placeParticle(p0, md->random);
140 
141 
142  BaseCluster cluster;
143  if(getRandomised())
144  cluster.random.randomise();
150  cluster.doCdatOutput(isCdatOutputOn_);
152  cluster.doAmatOutput(isAmatOutputOn_);
154  cluster.doVtkOutput(isVtkOutputOn_);
157  cluster.doEneOutput(isEneOutputOn_);
159  //Here, differently from RandomClusterInsertionBoundary the only possibility is to set radiusCluster and
160  // radiusParticle.
163  cluster.setRadiusCluster(p0->getRadius());
164  cluster.setPosition(p0->getPosition());
165  cluster.setVelocity(p0->getVelocity());
166  cluster.setParticleSpecies(
167  dynamic_cast<LinearPlasticViscoelasticFrictionSpecies*>(
168  md->speciesHandler.getObject(p0->getIndSpecies())));
169  cluster.solve();
170 
171  md->importParticlesAs( cluster.particleHandler, cluster.interactionHandler, p0->getSpecies() );
172 
173  // Number of cluster inserted
175  // Total number of particles inserted
177  // This is the total mass composed by every single particle (not cluster!) inserted
179  // This is the total volume composed by every single particle (not cluster!) inserted
181  logger(VERBOSE, "Successfully inserted cluster %/%.", nClusterInserted_, clusterRadii_.size());
182 
183  delete p0;
184  }
185 
186 }
Mdouble getVolume() const
void setCollisionTimeOverTimeStep(Mdouble cTOTS)
This sets the collisionTimeOverTimeStep number (which is the ratio between collision time and time st...
Definition: BaseCluster.cc:76
void solve()
The work horse of the code.
Definition: DPMBase.cc:3968
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
void setNumberOfInternalStructurePoints(int gL)
This sets the value of the number of particles used to compute the internal structure.
Definition: BaseCluster.cc:217
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void doOverlOutput(bool iOOO)
This sets the bool variable that defines whether the cluster overlap output will be written or not...
Definition: BaseCluster.cc:292
void placeParticle(BaseParticle *p, RNG &random) final
Places particles according to vector clusterPositions_ and sets a random velocity, if required.
void doIntStrucOutput(bool iISOO)
This sets the bool variable that defines whether the cluster internal structure output will be writte...
Definition: BaseCluster.cc:320
void doAmatOutput(bool iAOO)
This sets the bool variable that defines whether the cluster adjacency matrix output will be written ...
Definition: BaseCluster.cc:306
void doEneOutput(bool isEneOutputOn)
This sets the bool variable that defines whether the cluster ene output will be written or not...
Definition: BaseCluster.cc:376
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
void setSizeDispersityParticle(Mdouble sDP)
This sets the value of particles' dispersity in size.
Definition: BaseCluster.cc:117
bool getRandomised()
this returns a bool which indicates if the process is randomised (true) or not (false).
Mdouble getMass() const
void doCdatOutput(bool iCOO)
This sets the bool variable that defines whether the cluster data output will be written or not...
Definition: BaseCluster.cc:278
void randomise()
sets the random variables such that they differ for each run
Definition: RNG.cc:98
void setVelocity(Vec3D v)
This sets the value of velocity after creation.
Definition: BaseCluster.cc:264
unsigned getNextGroupId()
Should be called each time you assign a groupId. Returns the value of nextGroupId_ and increases next...
Definition: BaseHandler.h:293
Mdouble volumeInserted_
Total volume of particles inserted.
void setVelocityDampingModulus(Mdouble vDM)
This sets the value of the velocity damping modulus.
Definition: BaseCluster.cc:200
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void doVtkOutput(bool iVOO)
This sets the bool variable that defines whether the cluster vtk output will be written or not...
Definition: BaseCluster.cc:334
void doFStatOutput(bool isfStatOutputOn)
This sets the bool variable that defines whether the cluster fStat output will be written or not...
Definition: BaseCluster.cc:362
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:1324
BaseParticle * generateParticle(RNG &random) final
Sets cluster radii according to vector clusterRadii_.
void setParticleSpecies(LinearPlasticViscoelasticFrictionSpecies *particleSpecies)
This sets the species of the particle.
Definition: BaseCluster.cc:250
void importParticlesAs(ParticleHandler &particleHandler, InteractionHandler &interactionHandler, const ParticleSpecies *species)
Copies particles, interactions assigning species from a local simulation to a global one...
Definition: DPMBase.cc:4737
void setEnergyRatioTolerance(Mdouble eRT)
This sets the value of the value of the energy ratio threshold under which the process can be conside...
Definition: BaseCluster.cc:234
void doRestartOutput(bool isRestartOutputOn)
This sets the bool variable that defines whether the cluster restart output will be written or not...
Definition: BaseCluster.cc:348
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
void setRadiusParticle(Mdouble rP)
This sets the value of particles' radius if there's no dispersity in size.
Definition: BaseCluster.cc:97
Mdouble massInserted_
Total mass of particles inserted.
void setPosition(Vec3D p)
This sets the value of position_, which is the position in which the cluster will be inserted...
Definition: BaseCluster.cc:60
void setClusterId(unsigned int iC)
This sets the value of the cluster ID.
Definition: BaseCluster.cc:183
void setRadiusCluster(Mdouble rCR)
This sets the desired value of the cluster radius (there is no getter of this value, but there is a getter of the actual mean cluster radius obtained, getMeanClusterRadius)
Definition: BaseCluster.cc:149
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
FixedClusterInsertionBoundary * FixedClusterInsertionBoundary::copy ( ) const
overridevirtual

Creates a copy on the heap and returns a pointer.

Copy method; creates a copy on the heap and returns its pointer.

Returns
pointer to the copy on the heap

Reimplemented from BaseClusterInsertionBoundary.

Definition at line 55 of file FixedClusterInsertionBoundary.cc.

References FixedClusterInsertionBoundary().

56 {
57 #ifdef DEBUG_CONSTRUCTOR
58  std::cout << "BaseClusterInsertionBoundary::copy() const finished" << std::endl;
59 #endif
60  return new FixedClusterInsertionBoundary(*this);
61 }
FixedClusterInsertionBoundary()
Constructor: inherits from BaseClusterInsertionBoundary constructor.
BaseParticle * FixedClusterInsertionBoundary::generateParticle ( RNG random)
finalvirtual

Sets cluster radii according to vector clusterRadii_.

Reimplemented from InsertionBoundary.

Definition at line 203 of file FixedClusterInsertionBoundary.cc.

References BaseClusterInsertionBoundary::clusterRadii_, BaseParticle::copy(), InsertionBoundary::getParticleToCopy(), BaseClusterInsertionBoundary::nClusterInserted_, and BaseParticle::setRadius().

Referenced by checkBoundaryBeforeTimeStep().

204 {
207  return P;
208 }
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
BaseParticle * getParticleToCopy() const
Gets the particle that will be inserted through the insertion boundary.
std::string FixedClusterInsertionBoundary::getName ( ) const
overrideprivatevirtual

Returns the name of the object.

Returns the name of the object class

Returns
the object's class' name, i.e. 'ClusterInsertionBoundary'

Reimplemented from BaseClusterInsertionBoundary.

Definition at line 214 of file FixedClusterInsertionBoundary.cc.

215 {
216  return "FixedClusterInsertionBoundary";
217 }
void FixedClusterInsertionBoundary::placeParticle ( BaseParticle p,
RNG random 
)
finalvirtual

Places particles according to vector clusterPositions_ and sets a random velocity, if required.

Reimplemented from BaseClusterInsertionBoundary.

Definition at line 189 of file FixedClusterInsertionBoundary.cc.

References BaseClusterInsertionBoundary::clusterPositions_, BaseClusterInsertionBoundary::getRandomised(), RNG::getRandomNumber(), BaseClusterInsertionBoundary::nClusterInserted_, RNG::randomise(), BaseInteractable::setPosition(), BaseInteractable::setVelocity(), BaseClusterInsertionBoundary::velMax_, BaseClusterInsertionBoundary::velMin_, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by checkBoundaryBeforeTimeStep().

190 {
191  if(getRandomised())
192  random.randomise();
193  Vec3D pos, vel;
195  vel.X = random.getRandomNumber(velMin_.X, velMax_.X);
196  vel.Y = random.getRandomNumber(velMin_.Y, velMax_.Y);
197  vel.Z = random.getRandomNumber(velMin_.Z, velMax_.Z);
198  p->setPosition(pos);
199  p->setVelocity(vel);
200 }
Mdouble X
the vector components
Definition: Vector.h:65
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
bool getRandomised()
this returns a bool which indicates if the process is randomised (true) or not (false).
void randomise()
sets the random variables such that they differ for each run
Definition: RNG.cc:98
Mdouble Y
Definition: Vector.h:65
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: Vector.h:49
Mdouble Z
Definition: Vector.h:65
void FixedClusterInsertionBoundary::set ( BaseParticle particleToCopy,
std::vector< Vec3D positions,
std::vector< Mdouble radii,
Vec3D  velMin,
Vec3D  velMax,
Mdouble  rMicroParticle 
)

Sets the properties of the ClusterInsertionBoundary.

Sets all the properties of the cuboidal insertion boundary.

Parameters
[in]particleToCopyPointer to the BaseParticle which is used as a basis for clusters to be inserted
[in]positionsVector containing all clusters positions
[in]radiiVector containing all clusters radii
[in]velMinMinimum velocity of inserted particles
[in]velMaxMaximum velocity of inserted particles
[in]rMicroParticleRadius of the single particle composing the cluster.

Definition at line 73 of file FixedClusterInsertionBoundary.cc.

References InsertionBoundary::setParticleToCopy(), setPositionsAndRadii(), BaseClusterInsertionBoundary::setRadiusMicroParticle(), and BaseClusterInsertionBoundary::setVelocityRange().

76 {
77  setParticleToCopy(particleToCopy);
78 
79  setPositionsAndRadii(positions, radii);
80  setVelocityRange(velMin, velMax);
81 
82  setRadiusMicroParticle(rMicroParticle);
83 }
void setPositionsAndRadii(std::vector< Vec3D > clusterPositions, std::vector< Mdouble > clusterRadii)
this sets positions and radii of the desired clusters.
void setParticleToCopy(BaseParticle *particleToCopy)
Sets the particle that will be inserted through the insertion boundary.
void setRadiusMicroParticle(Mdouble rMP)
this sets the radius of the micro particle composing the cluster.
void setVelocityRange(Vec3D velMin, Vec3D velMax)
Sets the velocity range of the ClusterInsertionBoundary.
void FixedClusterInsertionBoundary::setPositionsAndRadii ( std::vector< Vec3D clusterPositions,
std::vector< Mdouble clusterRadii 
)

this sets positions and radii of the desired clusters.

After a few checks, this sets positions and radii of the desired clusters.

Definition at line 86 of file FixedClusterInsertionBoundary.cc.

References BaseClusterInsertionBoundary::clusterPositions_, BaseClusterInsertionBoundary::clusterRadii_, ERROR, and logger.

Referenced by set().

87 {
88  if (clusterPositions.size() != clusterRadii.size())
89  logger(ERROR, "clusterPositions and clusterRadii have different size."
90  " clusterPositions.size() = %, clusterRadii.size() = %.",
91  clusterPositions.size(), clusterRadii.size());
92  else if (clusterPositions.empty())
93  logger(ERROR, "clusterPositions is empty."
94  " clusterPositions.size() = %.", clusterPositions.size() );
95  else if (clusterRadii.empty())
96  logger(ERROR, "clusterRadii is empty."
97  " clusterRadii.size() = %.", clusterRadii.size());
98  else
99  {
100  clusterPositions_ = clusterPositions;
101  clusterRadii_ = clusterRadii;
102  }
103 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")

The documentation for this class was generated from the following files: