5 #ifndef SUBCRITICALMASERBOUNDARY_H
6 #define SUBCRITICALMASERBOUNDARY_H
100 void read(std::istream& is)
override;
105 void write(std::ostream& os)
const override;
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseBoundary.h:28
Definition: BaseParticle.h:33
Container to store pointers to all particles.
Definition: ParticleHandler.h:28
Definition: ParticleSpecies.h:16
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:20
Variation on the PeriodicBoundary which also has an outflow part.
Definition: SubcriticalMaserBoundary.h:56
std::map< const ParticleSpecies *, const ParticleSpecies * > speciesConversionMaserToNormal_
List of 'maser' particles' species, and their normal counterparts.
Definition: SubcriticalMaserBoundary.h:239
Mdouble getDistance(BaseParticle *p) const
Returns the distance of the wall to the particle.
Definition: SubcriticalMaserBoundary.h:201
void setShift(Vec3D shift)
Sets the shift of the Maser. Usually don't use this directly, use set() or setPlanewiseShift() instea...
Definition: SubcriticalMaserBoundary.cc:85
Mdouble getDistanceLeft() const
Definition: SubcriticalMaserBoundary.cc:428
bool isNormalParticle(BaseParticle *p) const
Returns true if the particle is a Normal particle, and false otherwise.
Definition: SubcriticalMaserBoundary.cc:363
void actionsBeforeTimeLoop() override
Does everything that needs to be done for this boundary between setupInitialConditions and the time l...
Definition: SubcriticalMaserBoundary.cc:372
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH) const
Shifts the particle to its 'periodic' position if it is a maser particle and has crossed either of th...
Definition: SubcriticalMaserBoundary.cc:249
bool isClosestToRightBoundary(const BaseParticle *const p) const
Returns whether the given particle is closer to the right boundary of the periodic part.
Definition: SubcriticalMaserBoundary.h:189
Vec3D normal_
Normal unit vector of both maser walls. Points in the flowing direction.
Definition: SubcriticalMaserBoundary.h:210
Vec3D shift_
Direction in which particles are to be shifted when they cross the boundary.
Definition: SubcriticalMaserBoundary.h:229
bool isMaserParticle(BaseParticle *p) const
Returns true if the particle is a Maser particle, and false otherwise.
Definition: SubcriticalMaserBoundary.cc:351
void deactivateMaser()
Stops copying particles (and act merely as a chute)
Definition: SubcriticalMaserBoundary.cc:408
void createPeriodicParticle(BaseParticle *p, ParticleHandler &pH) override
Creates periodic particles when the particle is a maser particle and is sufficiently close to one of ...
Definition: SubcriticalMaserBoundary.cc:176
Mdouble getDistanceRight() const
Definition: SubcriticalMaserBoundary.cc:433
void removeParticleFromMaser(BaseParticle *p)
Convert a maser particle into a 'normal' particle.
Definition: SubcriticalMaserBoundary.cc:341
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: SubcriticalMaserBoundary.cc:122
void set(Vec3D normal, Vec3D planewiseShift, Mdouble distanceLeft, Mdouble distanceRight)
Sets all boundary properties at once and adds particles of the handler to the maser....
Definition: SubcriticalMaserBoundary.cc:51
void setPlanewiseShift(Vec3D planewiseShift)
Sets a planewise direction to the shift. Doesn't change the normal or the positions.
Definition: SubcriticalMaserBoundary.cc:79
Mdouble distanceRight_
position of right boundary wall, s.t. normal*x=position_right
Definition: SubcriticalMaserBoundary.h:220
void createPeriodicParticles(ParticleHandler &pH) override
Definition: SubcriticalMaserBoundary.cc:209
SubcriticalMaserBoundary * copy() const override
Creates a copy of this maser on the heap.
Definition: SubcriticalMaserBoundary.cc:46
SubcriticalMaserBoundary()
MaserBoundary constructor.
Definition: SubcriticalMaserBoundary.cc:11
Mdouble distanceLeft_
position of left boundary wall, s.t. normal*x=position_left
Definition: SubcriticalMaserBoundary.h:215
void read(std::istream &is) override
reads boundary properties from istream
Definition: SubcriticalMaserBoundary.cc:94
void addParticleToMaser(BaseParticle *p)
Converts a 'normal' particle into a maser particle.
Definition: SubcriticalMaserBoundary.cc:293
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Evaluates what the particles have to do after they have changed position.
Definition: SubcriticalMaserBoundary.cc:275
std::string getName() const override
Returns the name of the object.
Definition: SubcriticalMaserBoundary.cc:141
std::map< const ParticleSpecies *, const ParticleSpecies * > speciesConversionNormalToMaser_
List of 'normal' particles' species, and their maser counterparts.
Definition: SubcriticalMaserBoundary.h:234
void activateMaser()
Opens the gap, and transforms particles to maser particles. Also calls turnOnCopying().
Definition: SubcriticalMaserBoundary.cc:384
BaseParticle * createGhostCopy(BaseParticle *p) const
Creates a copy of the input particle, that gets removed again in DPMBase::removeDuplicatePeriodicPart...
Definition: SubcriticalMaserBoundary.cc:224
void shiftPosition(BaseParticle *p) const
Shifts the particle to its 'periodic' position.
Definition: SubcriticalMaserBoundary.cc:150
bool maserIsActivated_
Flag whether or not the gap is created and particles transformed already.
Definition: SubcriticalMaserBoundary.h:244
Definition: Kernel/Math/Vector.h:30
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:56
#define min(a, b)
Definition: datatypes.h:22
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286