MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SubcriticalMaserBoundaryTEST.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 SUBCRITICALMASERBOUNDARYTEST_H
28 #define SUBCRITICALMASERBOUNDARYTEST_H
29 
30 #include "Particles/BaseParticle.h"
32 
33 class ParticleSpecies;
34 
36 {
37 public:
42 
47 
51  SubcriticalMaserBoundaryTEST* copy() const override;
52 
56  void read(std::istream& is) override;
57 
61  void write(std::ostream& os) const override;
62 
66  std::string getName() const override;
67 
68  void actionsBeforeTimeLoop() override;
69 
75 
82 
87 
91  void activateMaser();
92 
96  void deactivateMaser();
97 
101  bool isActivated() const;
102 
106  void setActivationTime(Mdouble time);
107 
111  Mdouble getDistance(const Vec3D& position) const override;
112 
116  Mdouble getDistanceFromRight(const Vec3D& position) const;
117 
121  void modifyPeriodicComplexity(std::vector<int>& complexity, int& totalPeriodicComplexity,
122  BaseParticle* particle, int i) const override;
123 
124  void modifyGhostAfterCreation(BaseParticle* particle, int i) override;
125 
126 
130  void performActionsBeforeAddingParticles() override;
131 
132  void extendBottom() const;
133 
134  void copyExtraParticles() const;
135 
136  void setCopyFlowParticles(bool copyFlowParticles);
137 
138 private:
143 
148 
153 
154 };
155 
156 #endif
SubcriticalMaserBoundaryTEST * copy() const override
Creates a copy of this maser on the heap.
bool isActivated() const
Returns whether the maser is activated or not.
double Mdouble
Definition: GeneralDefine.h:34
void write(std::ostream &os) const override
writes boundary properties to ostream
Mdouble getDistanceFromRight(const Vec3D &position) const
returns the distance to the right wall
void activateMaser()
Activates the maser functionaly of this periodic boundary.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
~SubcriticalMaserBoundaryTEST() override
destructor
bool maserIsActivated_
Flag whether or not the gap is created and particles transformed already.
void modifyPeriodicComplexity(std::vector< int > &complexity, int &totalPeriodicComplexity, BaseParticle *particle, int i) const override
modifies the periodic complexity to support a maser boundary
Defines a pair of periodic walls. Inherits from BaseBoundary.
void deactivateMaser()
Stops copying particles, and act merely as a periodic domain.
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Evaluates what the particles have to do after they have changed position.
void modifyGhostAfterCreation(BaseParticle *particle, int i) override
std::string getName() const override
Returns the name of the object.
void read(std::istream &is) override
reads boundary properties from istream
void performActionsBeforeAddingParticles() override
Checks before adding particles if the maser needs to be activated.
void setActivationTime(Mdouble time)
sets the activate time of the maser
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...
SubcriticalMaserBoundaryTEST()
MaserBoundary constructor.
Container to store all BaseParticle.
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: Vector.h:49
Mdouble activationTime_
Time at which the maser opens.
Mdouble getDistance(const Vec3D &position) const override
gets the distance to the closest wall if maser is inactive, otherwise distance to right wall ...
bool copyFlowParticles_
Flag for whether or not we copy a few blocks of flow particles in the front when activating the maser...
void setCopyFlowParticles(bool copyFlowParticles)