MercuryDPM  Beta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaserBoundary.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 
27 #ifndef MASERBOUNDARY_H
28 #define MASERBOUNDARY_H
29 
30 #include <map>
31 
32 #include "BaseBoundary.h"
33 #include "Math/Vector.h"
34 
35 class ParticleSpecies;
36 
45 {
46 public:
50  MaserBoundary* copy() const;
51 
55  void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight);
56 
60  void read(std::istream& is);
61 
65  void write(std::ostream& os) const;
66 
70  virtual std::string getName() const;
71 
76 
80  Mdouble getDistance(const Vec3D &position);
81 
85  void shiftPosition(BaseParticle* p);
86 
92 
99 
104 
105 private:
129 
133  std::map<const ParticleSpecies*,const ParticleSpecies*> speciesConversionNormalToMaser_;
134 
138  std::map<const ParticleSpecies*,const ParticleSpecies*> speciesConversionMaserToNormal_;
139 };
140 #endif
Mdouble distanceLeft_
position of left boundary wall, s.t. normal*x=position_left
Vec3D normal_
Normal unit vector of both maser walls. Points in the flowing direction.
void addParticleToMaser(BaseParticle *P)
Converts a 'normal' particle into a maser particle.
Mdouble getDistance(BaseParticle &p)
Returns the distance of the wall to the particle.
double Mdouble
void write(std::ostream &os) const
writes boundary properties to ostream
Mdouble distanceRight_
position of right boundary wall, s.t. normal*x=position_right
void shiftPosition(BaseParticle *p)
shifts the particle to its 'periodic' position
std::map< const ParticleSpecies *, const ParticleSpecies * > speciesConversionNormalToMaser_
List of 'normal' particles' species, and their maser counterparts.
std::map< const ParticleSpecies *, const ParticleSpecies * > speciesConversionMaserToNormal_
List of 'maser' particles' species, and their normal counterparts.
void read(std::istream &is)
reads boundary properties from istream
#define UNUSED
Definition: GeneralDefine.h:37
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH UNUSED)
Shifts the particle to its 'periodic' position if it is a maser particle and has crossed either of th...
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Sets all boundary properties at once.
Container to store all BaseParticle.
virtual std::string getName() const
Returns the name of the object.
Variation on the PeriodicBoundary with maser-like properties.
Definition: MaserBoundary.h:44
bool closestToLeftBoundary_
Dummy variable used when checking the proximity of particles to the boundary walls. TRUE if closest wall is the left boundary wall.
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:45
void createPeriodicParticles(BaseParticle *p, ParticleHandler &pH)
Creates periodic particle when the particle is a maser particle and is sufficiently close to one of t...
MaserBoundary * copy() const
Creates a copy on the heap.
Vec3D shift_
Direction in which particles are to be shifted when they cross the boundary.