SubcriticalMaserBoundaryTEST.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, 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
Definition: BaseParticle.h:54
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
Definition: ParticleSpecies.h:37
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:41
Definition: SubcriticalMaserBoundaryTEST.h:36
void deactivateMaser()
Stops copying particles, and act merely as a periodic domain.
Definition: SubcriticalMaserBoundaryTEST.cc:261
Mdouble getDistance(const Vec3D &position) const override
gets the distance to the closest wall if maser is inactive, otherwise distance to right wall
Definition: SubcriticalMaserBoundaryTEST.cc:306
void actionsBeforeTimeLoop() override
Definition: SubcriticalMaserBoundaryTEST.cc:101
void setActivationTime(Mdouble time)
sets the activate time of the maser
Definition: SubcriticalMaserBoundaryTEST.cc:293
Mdouble getDistanceFromRight(const Vec3D &position) const
returns the distance to the right wall
Definition: SubcriticalMaserBoundaryTEST.cc:323
void modifyPeriodicComplexity(std::vector< int > &complexity, int &totalPeriodicComplexity, BaseParticle *particle, int i) const override
modifies the periodic complexity to support a maser boundary
Definition: SubcriticalMaserBoundaryTEST.cc:340
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Evaluates what the particles have to do after they have changed position.
Definition: SubcriticalMaserBoundaryTEST.cc:199
void setCopyFlowParticles(bool copyFlowParticles)
Definition: SubcriticalMaserBoundaryTEST.cc:93
std::string getName() const override
Returns the name of the object.
Definition: SubcriticalMaserBoundaryTEST.cc:88
void extendBottom() const
Definition: SubcriticalMaserBoundaryTEST.cc:410
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: SubcriticalMaserBoundaryTEST.cc:77
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: SubcriticalMaserBoundaryTEST.cc:161
Mdouble activationTime_
Time at which the maser opens.
Definition: SubcriticalMaserBoundaryTEST.h:147
void copyExtraParticles() const
Definition: SubcriticalMaserBoundaryTEST.cc:502
~SubcriticalMaserBoundaryTEST() override
destructor
Definition: SubcriticalMaserBoundaryTEST.cc:45
SubcriticalMaserBoundaryTEST()
MaserBoundary constructor.
Definition: SubcriticalMaserBoundaryTEST.cc:33
void activateMaser()
Activates the maser functionaly of this periodic boundary.
Definition: SubcriticalMaserBoundaryTEST.cc:231
void performActionsBeforeAddingParticles() override
Checks before adding particles if the maser needs to be activated.
Definition: SubcriticalMaserBoundaryTEST.cc:393
void read(std::istream &is) override
reads boundary properties from istream
Definition: SubcriticalMaserBoundaryTEST.cc:64
bool maserIsActivated_
Flag whether or not the gap is created and particles transformed already.
Definition: SubcriticalMaserBoundaryTEST.h:142
bool isActivated() const
Returns whether the maser is activated or not.
Definition: SubcriticalMaserBoundaryTEST.cc:283
SubcriticalMaserBoundaryTEST * copy() const override
Creates a copy of this maser on the heap.
Definition: SubcriticalMaserBoundaryTEST.cc:55
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: SubcriticalMaserBoundaryTEST.cc:127
bool copyFlowParticles_
Flag for whether or not we copy a few blocks of flow particles in the front when activating the maser...
Definition: SubcriticalMaserBoundaryTEST.h:152
void modifyGhostAfterCreation(BaseParticle *particle, int i) override
Definition: SubcriticalMaserBoundaryTEST.cc:374
Definition: Vector.h:51
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51