SphereInsertionBoundary Class Reference

Inserts particles in a sphere with a given radius, polar and azimuthal radius at a specific origin which is 0 by default. More...

#include <SphereInsertionBoundary.h>

+ Inheritance diagram for SphereInsertionBoundary:

Public Member Functions

 SphereInsertionBoundary ()
 Constructor; sets everything to 0. More...
 
 SphereInsertionBoundary (const SphereInsertionBoundary &other)
 Copy constructor with deep copy. More...
 
 ~SphereInsertionBoundary () override
 Destructor: default destructor. More...
 
SphereInsertionBoundarycopy () const override
 Creates a copy on the heap and returns a pointer. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin=0, Mdouble thetaMax=2.0 *constants::pi, Mdouble phiMin=0, Mdouble phiMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
 Sets the properties of the InsertionBoundary for mutliple different particle types. More...
 
void set (BaseParticle &particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin=0, Mdouble thetaMax=2.0 *constants::pi, Mdouble phiMin=0, Mdouble phiMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
 
void set (std::vector< BaseParticle * > particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin=0, Mdouble thetaMax=2.0 *constants::pi, Mdouble phiMin=0, Mdouble phiMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
 Sets the properties of the InsertionBoundary for a single particle type. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble radMin, Mdouble radMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax, Vec3D velMin, Vec3D velMax, Mdouble particleRMin, Mdouble particleRMax)
 old style set function which assumes a uniform psd. More...
 
void set (BaseParticle &particleToCopy, unsigned int maxFailed, Mdouble radMin, Mdouble radMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax, Vec3D velMin, Vec3D velMax, Mdouble particleRMin, Mdouble particleRMax)
 old style set function which assumes a uniform psd. More...
 
void setGeometry (Mdouble rMin, Mdouble rMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax)
 Sets the geometry (position and orientation) of the SphereInsertionBoundary. More...
 
Vec3D getOrigin () const
 Returns the origin of the spheres coordinate system. More...
 
void shiftBoundary (Vec3D shift) override
 shift the origin of the sphere in the cartesian coordinate system More...
 
void placeParticle (BaseParticle *p, RNG &random) override
 Generates a random position, velocity for the particle p. 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 ()
 
 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...
 
virtual BaseParticlegenerateParticle (RNG &random)
 Sets the properties of the InsertionBoundary for a single particle type ‍/ virtual void set(BaseParticle* particleToCopy, unsigned int maxFailed, Vec3D velMin, Vec3D velMax, double radMin, double radMax)=0;. More...
 
virtual void rotateBoundary (Vec3D angle)
 virtual function that rotates the boundary. More...
 
void checkBoundaryBeforeTimeStep (DPMBase *md) override
 Fills the boundary with particles. More...
 
void insertParticles (DPMBase *md)
 Fill a certain domain with particles. More...
 
unsigned int getNumberOfParticlesInserted () const
 Gets the number of particles inserted by the boundary. More...
 
Mdouble getMassOfParticlesInserted () const
 Gets the mass of particles inserted by the boundary. More...
 
Mdouble getVolumeOfParticlesInserted () const
 Gets the volume of particles inserted by the boundary. More...
 
void reset ()
 resets particle property counter variables. More...
 
void activate ()
 Turns on the InsertionBoundary. More...
 
void deactivate ()
 Turns off the InsertionBoundary. More...
 
bool isActivated ()
 Returns whether the InsertionBoundary is activated. More...
 
unsigned int getMaxFailed () const
 Gets the number of times that the boundary may fail to insert a particle. More...
 
void setParticleToCopy (std::vector< BaseParticle * > particleToCopy)
 Sets multiple different particles that will be inserted through the insertion boundary. More...
 
void setParticleToCopy (BaseParticle *particleToCopy)
 Sets the particle that will be inserted through the insertion boundary. More...
 
std::vector< BaseParticle * > getParticleToCopy ()
 Gets the particles that will be inserted through the insertion boundary. More...
 
Mdouble getVolumeFlowRate () const
 Gets the volume flow rate of the insertion routine. More...
 
void setVolumeFlowRate (Mdouble volumeFlowRate)
 Sets the volume flow rate of the insertion routine. More...
 
Mdouble getInitialVolume () const
 Gets the initialVolume() . More...
 
void setInitialVolume (Mdouble initialVolume)
 Gets the Volume which should be inserted by the insertion routine. More...
 
void setPSD (const PSD psd)
 Sets the range of particle radii that may be generated from a user defined PSD. More...
 
void setPSD (std::vector< PSD > psd, std::vector< Mdouble > probability)
 Sets the ranges of particle radii that may be generated from user defined PSDs. More...
 
std::vector< PSDgetPSD ()
 Gets the particle size distributions set by the user. More...
 
void setVariableVolumeFlowRate (const std::vector< Mdouble > &variableCumulativeVolumeFlowRate, Mdouble samplingInterval)
 Sets a variable volume flow rate. More...
 
bool insertParticle (Mdouble time)
 Checks the inserted total volume and returns if a particle is still allowed to be inserted. More...
 
bool getCheckParticleForInteraction () const
 Gets the variable that checks if a particle has an interaction. More...
 
void setCheckParticleForInteraction (bool checkParticleForInteraction)
 Sets the variable that checks if a particle has an interaction. More...
 
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
 

Protected Attributes

Mdouble thetaMin_
 Minimal and maximal azimuth angle in range [0,2*pi] defining the circle of the sphere in which insertion should happen. More...
 
Mdouble thetaMax_
 
Mdouble phiMin_
 Minimal and maximal polar angle in range [0,pi] defining the circle of the sphere in which insertion should happen. More...
 
Mdouble phiMax_
 
Mdouble radMin_
 Minimal and maximal radius defining the inner and outer circle of the sphere in which insertion should happen. More...
 
Mdouble radMax_
 
Vec3D origin_
 origin of the sphere. More...
 

Private Member Functions

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

Additional Inherited Members

- Public Attributes inherited from InsertionBoundary
std::vector< BaseParticle * > particleToCopy_
 read Distribution class from file. ‍/ friend std::istream& operator>>(std::istream& is, InsertionBoundary::Distribution& type); 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_
 Checks if a particle has an interaction with a wall or other particles. More...
 
std::vector< PSDparticleSizeDistributionVector_
 Defines a particle size distribution as an object of the PSD class; if particleSizeDistributionVector_ is empty, distribution_ is used instead. More...
 
Vec3D velMin_
 Minimum and maximum velocity of the particles to be inserted. More...
 
Vec3D velMax_
 
bool isManuallyInserting_
 A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE. More...
 
std::vector< Mdoubleprobability_
 vector of probabilities in range [0,1] which determine the mixing ratio of partice size distributions. More...
 
int chosenSpecies_
 stores the chosen species for each timestep. More...
 
BaseParticlep0 = nullptr
 pointer to the next particle that should be inserted (needs to be stored across time steps). More...
 

Detailed Description

Inserts particles in a sphere with a given radius, polar and azimuthal radius at a specific origin which is 0 by default.

Constructor & Destructor Documentation

◆ SphereInsertionBoundary() [1/2]

SphereInsertionBoundary::SphereInsertionBoundary ( )

Constructor; sets everything to 0.

Default constructor; sets every data member to 0.

14 {
15  radMin_ = 0.0;
16  radMax_ = 0.0;
17  phiMin_ = 0.0;
18  phiMax_ = 0.0;
19  thetaMin_ = 0.0;
20  thetaMax_ = 0.0;
21  origin_.setZero();
22 }
Mdouble radMax_
Definition: SphereInsertionBoundary.h:126
Mdouble thetaMax_
Definition: SphereInsertionBoundary.h:117
Vec3D origin_
origin of the sphere.
Definition: SphereInsertionBoundary.h:131
Mdouble phiMax_
Definition: SphereInsertionBoundary.h:122
Mdouble phiMin_
Minimal and maximal polar angle in range [0,pi] defining the circle of the sphere in which insertion ...
Definition: SphereInsertionBoundary.h:122
Mdouble radMin_
Minimal and maximal radius defining the inner and outer circle of the sphere in which insertion shoul...
Definition: SphereInsertionBoundary.h:126
Mdouble thetaMin_
Minimal and maximal azimuth angle in range [0,2*pi] defining the circle of the sphere in which insert...
Definition: SphereInsertionBoundary.h:117
void setZero()
Sets all elements to zero.
Definition: Vector.cc:23

References origin_, phiMax_, phiMin_, radMax_, radMin_, Vec3D::setZero(), thetaMax_, and thetaMin_.

Referenced by copy().

◆ SphereInsertionBoundary() [2/2]

SphereInsertionBoundary::SphereInsertionBoundary ( const SphereInsertionBoundary other)

Copy constructor with deep copy.

Copy constructor

28  : InsertionBoundary(other)
29 {
30  radMin_ = other.radMin_;
31  radMax_ = other.radMax_;
32  phiMin_ = other.phiMin_;
33  phiMax_ = other.phiMax_;
34  thetaMin_ = other.thetaMin_;
35  thetaMax_ = other.thetaMax_;
36  origin_ = other.origin_;
37 }
InsertionBoundary()
Definition: InsertionBoundary.cc:17

References origin_, phiMax_, phiMin_, radMax_, radMin_, thetaMax_, and thetaMin_.

◆ ~SphereInsertionBoundary()

SphereInsertionBoundary::~SphereInsertionBoundary ( )
overridedefault

Destructor: default destructor.

Destructor. Since there are no pointers in this class, there is no need for any actions here.

Member Function Documentation

◆ copy()

SphereInsertionBoundary * SphereInsertionBoundary::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

Implements BaseBoundary.

51 {
52 #ifdef DEBUG_CONSTRUCTOR
53  std::cout << "SphereInsertionBoundary::copy() const finished" << std::endl;
54 #endif
55  return new SphereInsertionBoundary(*this);
56 }
SphereInsertionBoundary()
Constructor; sets everything to 0.
Definition: SphereInsertionBoundary.cc:13

References SphereInsertionBoundary().

◆ getName()

std::string SphereInsertionBoundary::getName ( ) const
overrideprivatevirtual

Returns the name of the object.

Returns the name of the object class

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

Implements BaseObject.

261 {
262  return "SphereInsertionBoundary";
263 }

◆ getOrigin()

Vec3D SphereInsertionBoundary::getOrigin ( ) const

Returns the origin of the spheres coordinate system.

Returns the origin of the spheres coordinate system

Returns
origin_ the origin of the spheres coordinate system
215 {
216  return origin_;
217 }

References origin_.

Referenced by PSDSelfTest::setupInitialConditions().

◆ placeParticle()

void SphereInsertionBoundary::placeParticle ( BaseParticle p,
RNG random 
)
overridevirtual

Generates a random position, velocity for the particle p.

places a particle with random position (although within the boundary, of course), velocity and radius and returns its pointer.

Parameters
[in]randomRandom number generator

Implements InsertionBoundary.

172 {
173  // create vectors for cartesian position and velocity and cylindrical position
174  Vec3D pos, vel, posSpherical;
175 
176  // draw random numbers in cartesian coordinates and make sure they are inside the sphere sphere
177  do
178  {
179  pos.X = random.getRandomNumber(-radMax_,radMax_);
180  pos.Y = random.getRandomNumber(-radMax_,radMax_);
181  pos.Z = random.getRandomNumber(-radMax_,radMax_);
182  posSpherical = pos.getSphericalCoordinates();
183  }
184  // make sure particle stay inside the sphere of our sphere
185  while (posSpherical.X > radMax_ ||
186  posSpherical.X < radMin_ ||
187  posSpherical.Y < phiMin_ ||
188  posSpherical.Y >= phiMax_ ||
189  posSpherical.Z < thetaMin_||
190  posSpherical.Z >= thetaMax_);
191 
192  // set the velocity in cartesian coordinates
193  vel.X = random.getRandomNumber(velMin_.X, velMax_.X);
194  vel.Y = random.getRandomNumber(velMin_.Y, velMax_.Y);
195  vel.Z = random.getRandomNumber(velMin_.Z, velMax_.Z);
196 
197  p->setPosition(pos + origin_);
198  p->setVelocity(vel);
199 }
float * p
Definition: Tutorial_Map_using.cpp:9
Vec3D velMin_
Minimum and maximum velocity of the particles to be inserted.
Definition: InsertionBoundary.h:329
Vec3D velMax_
Definition: InsertionBoundary.h:329
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
Definition: Kernel/Math/Vector.h:30
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
Vec3D getSphericalCoordinates() const
Returns the representation of this Vec3D in spherical coordinates.
Definition: Vector.cc:231

References RNG::getRandomNumber(), Vec3D::getSphericalCoordinates(), origin_, p, phiMax_, phiMin_, radMax_, radMin_, thetaMax_, thetaMin_, InsertionBoundary::velMax_, InsertionBoundary::velMin_, Vec3D::X, Vec3D::Y, and Vec3D::Z.

◆ read()

void SphereInsertionBoundary::read ( std::istream &  is)
overridevirtual

reads boundary properties from istream

Reads the boundary properties from an istream

Parameters
[in,out]isthe istream

Reimplemented from InsertionBoundary.

224 {
226  std::string dummy;
227  is >> dummy >> radMin_
228  >> dummy >> radMax_;
229  is >> dummy >> phiMin_
230  >> dummy >> phiMax_;
231  is >> dummy >> thetaMin_
232  >> dummy >> thetaMax_;
233  is >> dummy >> velMin_
234  >> dummy >> velMax_;
235  is >> dummy >> origin_;
236 }
void read(std::istream &is) override
Reads the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:448
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References origin_, phiMax_, phiMin_, radMax_, radMin_, InsertionBoundary::read(), oomph::Global_string_for_annotation::string(), thetaMax_, thetaMin_, InsertionBoundary::velMax_, and InsertionBoundary::velMin_.

◆ set() [1/5]

void SphereInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Mdouble  radMin,
Mdouble  radMax,
Mdouble  thetaMin,
Mdouble  thetaMax,
Mdouble  phiMin,
Mdouble  phiMax,
Vec3D  velMin,
Vec3D  velMax,
Mdouble  particleRMin,
Mdouble  particleRMax 
)

old style set function which assumes a uniform psd.

140 {
141  PSD uniformPSD;
142  uniformPSD.setDistributionUniform(particleRMin, particleRMax, 2);
143  setPSD(uniformPSD);
144  set(particleToCopy, maxFailed, radMin, radMax, thetaMin, thetaMax, phiMin, phiMax, velMin, velMax);
145 }
void setPSD(const PSD psd)
Sets the range of particle radii that may be generated from a user defined PSD.
Definition: InsertionBoundary.cc:652
Contains a vector with radii and probabilities of a user defined particle size distribution (PSD)
Definition: PSD.h:47
void setDistributionUniform(Mdouble radMin, Mdouble radMax, int numberOfBins)
create a PSD vector for a uniform distribution.
Definition: PSD.cc:294
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin=0, Mdouble thetaMax=2.0 *constants::pi, Mdouble phiMin=0, Mdouble phiMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: SphereInsertionBoundary.cc:105

References set(), PSD::setDistributionUniform(), and InsertionBoundary::setPSD().

◆ set() [2/5]

void SphereInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Mdouble  rMin,
Mdouble  rMax,
Mdouble  thetaMin = 0,
Mdouble  thetaMax = 2.0*constants::pi,
Mdouble  phiMin = 0,
Mdouble  phiMax = constants::pi,
Vec3D  velMin = {0, 0, 0},
Vec3D  velMax = {0, 0, 0} 
)
119 {
120  set(&particleToCopy, maxFailed, radMin, radMax, thetaMin, thetaMax, phiMin, phiMax, velMin, velMax);
121 }

References set().

◆ set() [3/5]

void SphereInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Mdouble  radMin,
Mdouble  radMax,
Mdouble  thetaMin,
Mdouble  thetaMax,
Mdouble  phiMin,
Mdouble  phiMax,
Vec3D  velMin,
Vec3D  velMax,
Mdouble  particleRMin,
Mdouble  particleRMax 
)

old style set function which assumes a uniform psd.

old style set function which also assumes a uniform psd. Note if you want a specific PSD do not use but this is quicker for a uniform in size PSD

130 {
131  PSD uniformPSD;
132  uniformPSD.setDistributionUniform(particleRMin, particleRMax, 2);
133  setPSD(uniformPSD);
134  set(particleToCopy, maxFailed, radMin, radMax, thetaMin, thetaMax, phiMin, phiMax, velMin, velMax);
135 }

References set(), PSD::setDistributionUniform(), and InsertionBoundary::setPSD().

◆ set() [4/5]

void SphereInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Mdouble  radMin,
Mdouble  radMax,
Mdouble  thetaMin = 0,
Mdouble  thetaMax = 2.0*constants::pi,
Mdouble  phiMin = 0,
Mdouble  phiMax = constants::pi,
Vec3D  velMin = {0, 0, 0},
Vec3D  velMax = {0, 0, 0} 
)

Sets the properties of the InsertionBoundary for mutliple different particle types.

Sets all the properties of the cylindrical insertion boundary.

Parameters
[in]particleToCopyPointer to the BaseParticle which is used as a basis for the particles to be inserted
[in]maxFailedThe maximum number of times the insertion of a particle may be tried and failed before the insertion of particles is considered done NB: this property is used in the parent's InsertionBoundary::checkBoundaryBeforeTimeStep().
[in]radMinminimal radius defining of the sphere boundary
[in]radMaxmaximal radius of the sphere boundary
[in]phiMinMinimal polar angle of the sphere boundary
[in]phiMaxmaximal polar angle of the sphere boundary
[in]thetaMinminimal azimuth angle of the sphere boundary
[in]thetaMaxmaximal azimuth angle of the sphere boundary
[in]velMinMinimum velocity of inserted particles
[in]velMaxMaximum velocity of inserted particles
108 {
109  velMin_ = velMin;
110  velMax_ = velMax;
111  maxFailed_ = maxFailed;
112  setParticleToCopy(particleToCopy);
113  setGeometry(radMin, radMax, thetaMin, thetaMax, phiMin, phiMax);
114 }
void setParticleToCopy(std::vector< BaseParticle * > particleToCopy)
Sets multiple different particles that will be inserted through the insertion boundary.
Definition: InsertionBoundary.cc:378
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Definition: InsertionBoundary.h:265
void setGeometry(Mdouble rMin, Mdouble rMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax)
Sets the geometry (position and orientation) of the SphereInsertionBoundary.
Definition: SphereInsertionBoundary.cc:156

References InsertionBoundary::maxFailed_, setGeometry(), InsertionBoundary::setParticleToCopy(), InsertionBoundary::velMax_, and InsertionBoundary::velMin_.

Referenced by set(), InsertionBoundarySelfTest::setupInitialConditions(), and PSDSelfTest::setupInitialConditions().

◆ set() [5/5]

void SphereInsertionBoundary::set ( std::vector< BaseParticle * >  particleToCopy,
unsigned int  maxFailed,
Mdouble  radMin,
Mdouble  radMax,
Mdouble  thetaMin = 0,
Mdouble  thetaMax = 2.0*constants::pi,
Mdouble  phiMin = 0,
Mdouble  phiMax = constants::pi,
Vec3D  velMin = {0, 0, 0},
Vec3D  velMax = {0,0,0} 
)

Sets the properties of the InsertionBoundary for a single particle type.

Sets all the properties of the cylindrical insertion boundary.

Parameters
[in]particleToCopyvector of pointers to the BaseParticles which are used as a basis for the particle types (species) to be inserted
[in]maxFailedThe maximum number of times the insertion of a particle may be tried and failed before the insertion of particles is considered done NB: this property is used in the parent's InsertionBoundary::checkBoundaryBeforeTimeStep().
[in]radMinminimal radius defining of the sphere boundary
[in]radMaxmaximal radius of the sphere boundary
[in]phiMinMinimal polar angle of the sphere boundary
[in]phiMaxmaximal polar angle of the sphere boundary
[in]thetaMinminimal azimuth angle of the sphere boundary
[in]thetaMaxmaximal azimuth angle of the sphere boundary
[in]velMinMinimum velocity of inserted particles
[in]velMaxMaximum velocity of inserted particles
79 {
80  velMin_ = velMin;
81  velMax_ = velMax;
82  maxFailed_ = maxFailed;
83  setParticleToCopy(particleToCopy);
84  setGeometry(radMin, radMax, thetaMin, thetaMax, phiMin, phiMax);
85 }

References InsertionBoundary::maxFailed_, setGeometry(), InsertionBoundary::setParticleToCopy(), InsertionBoundary::velMax_, and InsertionBoundary::velMin_.

◆ setGeometry()

void SphereInsertionBoundary::setGeometry ( Mdouble  rMin,
Mdouble  rMax,
Mdouble  thetaMin,
Mdouble  thetaMax,
Mdouble  phiMin,
Mdouble  phiMax 
)

Sets the geometry (position and orientation) of the SphereInsertionBoundary.

set the geometry of the Cylindrical insertion boundary by setting the position and orientation.

Parameters
[in]radMinminimal radius defining of the sphere boundary
[in]radMaxmaximal radius of the sphere boundary
[in]phiMinminimal polar angle of the sphere boundary
[in]phiMaxmaximal polar angle of the sphere boundary
[in]thetaMinminimal azimuth angle of the sphere boundary
[in]thetaMaxmaximal azimuth angle of the sphere boundary
157 {
158  radMin_ = rMin;
159  radMax_ = rMax;
160  phiMin_ = phiMin;
161  phiMax_ = phiMax;
162  thetaMin_ = thetaMin;
163  thetaMax_ = thetaMax;
164 }

References phiMax_, phiMin_, radMax_, radMin_, thetaMax_, and thetaMin_.

Referenced by set().

◆ shiftBoundary()

void SphereInsertionBoundary::shiftBoundary ( Vec3D  shift)
overridevirtual

shift the origin of the sphere in the cartesian coordinate system

shifts the sphere by a translation vector in the cartesian coordinate system

Parameters
[in]shifttranslation vector which shifts the sphere by certain X,Y,Z coordinates

Reimplemented from InsertionBoundary.

206 {
207  origin_ += shift;
208 }

References origin_.

Referenced by PSDSelfTest::setupInitialConditions().

◆ write()

void SphereInsertionBoundary::write ( std::ostream &  os) const
overridevirtual

writes boundary properties to ostream

Writes boundary's properties to an ostream

Parameters
[in]osthe ostream

Reimplemented from InsertionBoundary.

243 {
245  os << " radMin " << radMin_
246  << " radMax " << radMax_
247  << " phiMin " << phiMin_
248  << " phiMax " << phiMax_
249  << " thetaMin " << thetaMin_
250  << " thetaMax " << thetaMax_
251  << " velMin " << velMin_
252  << " velMax " << velMax_
253  << " origin " << origin_;
254 }
void write(std::ostream &os) const override
Writes the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:536

References origin_, phiMax_, phiMin_, radMax_, radMin_, thetaMax_, thetaMin_, InsertionBoundary::velMax_, InsertionBoundary::velMin_, and InsertionBoundary::write().

Member Data Documentation

◆ origin_

Vec3D SphereInsertionBoundary::origin_
protected

origin of the sphere.

Referenced by getOrigin(), placeParticle(), read(), shiftBoundary(), SphereInsertionBoundary(), and write().

◆ phiMax_

Mdouble SphereInsertionBoundary::phiMax_
protected

◆ phiMin_

Mdouble SphereInsertionBoundary::phiMin_
protected

Minimal and maximal polar angle in range [0,pi] defining the circle of the sphere in which insertion should happen.

Referenced by placeParticle(), read(), setGeometry(), SphereInsertionBoundary(), and write().

◆ radMax_

Mdouble SphereInsertionBoundary::radMax_
protected

◆ radMin_

Mdouble SphereInsertionBoundary::radMin_
protected

Minimal and maximal radius defining the inner and outer circle of the sphere in which insertion should happen.

Referenced by placeParticle(), read(), setGeometry(), SphereInsertionBoundary(), and write().

◆ thetaMax_

Mdouble SphereInsertionBoundary::thetaMax_
protected

◆ thetaMin_

Mdouble SphereInsertionBoundary::thetaMin_
protected

Minimal and maximal azimuth angle in range [0,2*pi] defining the circle of the sphere in which insertion should happen.

Referenced by placeParticle(), read(), setGeometry(), SphereInsertionBoundary(), and write().


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