MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FluxBoundary.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 #ifndef FLUXBOUNDARY_H
27 #define FLUXBOUNDARY_H
28 
29 #include "BaseBoundary.h"
30 #include "Math/Vector.h"
31 
32 class ParticleHandler;
33 
34 class BaseParticle;
35 
41 class FluxBoundary : public BaseBoundary
42 {
43 public:
47  FluxBoundary();
48 
52  ~FluxBoundary() override;
53 
57  FluxBoundary* copy() const override;
58 
62  void set(const Vec3D& normal, Mdouble distance);
63 
67  void reset();
68 
72  void move(Mdouble position);
73 
77  Mdouble getDistance(const Vec3D& position) const;
78 
83 
88 
92  unsigned int getNumberOfParticlesCrossedForw() const;
93 
94  unsigned int getNumberOfParticlesCrossedBack() const;
95 
96  unsigned int getNumberOfParticlesCrossedNet() const;
97 
98  double getMassOfParticlesCrossedForw() const;
99 
100  double getMassOfParticlesCrossedBack() const;
101 
102  double getMassOfParticlesCrossedNet() const;
103 
104  double getVolumeOfParticlesCrossedForw() const;
105 
106  double getVolumeOfParticlesCrossedBack() const;
107 
108  double getVolumeOfParticlesCrossedNet() const;
109 
113  void read(std::istream& is) override;
114 
119  void oldRead(std::istream& is);
120 
124  void write(std::ostream& os) const override;
125 
129  std::string getName() const override;
130 
131 private:
149 
159 };
160 
161 
162 #endif
Mdouble distance_
The boundary's distance from the origin.
Definition: FluxBoundary.h:148
void reset()
Resets the counts to zero.
Definition: FluxBoundary.cc:95
unsigned int getNumberOfParticlesCrossedBack() const
unsigned int numberOfParticlesCrossedBack_
Definition: FluxBoundary.h:154
MERCURY_DEPRECATED void oldRead(std::istream &is)
Deprecated read method. use FluxBoundary::read() instead.
double Mdouble
Definition: GeneralDefine.h:34
Vec3D normal_
outward unit normal vector
Definition: FluxBoundary.h:135
void write(std::ostream &os) const override
Writes the boundary properties to an std::ostream.
double getMassOfParticlesCrossedNet() const
~FluxBoundary() override
destructor
Definition: FluxBoundary.cc:54
unsigned int getNumberOfParticlesCrossedNet() const
double massCrossedForw_
Definition: FluxBoundary.h:155
#define MERCURY_DEPRECATED
Definition: GeneralDefine.h:37
FluxBoundary()
default constructor
Definition: FluxBoundary.cc:35
std::string getName() const override
Returns the name of the object.
Used for measuring flow rates through a given plane; acts like a pair of scales Inherits from BaseBou...
Definition: FluxBoundary.h:41
Mdouble getDistance(const Vec3D &position) const
Returns the shortest distance between the boundary and given position.
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Runs at the end of each time step.
Mdouble scaleFactor_
This is the factor to rescale the given normal vector to a unit vectors.
Definition: FluxBoundary.h:144
double getVolumeOfParticlesCrossedNet() const
double volumeCrossedBack_
Definition: FluxBoundary.h:158
void set(const Vec3D &normal, Mdouble distance)
Sets boundary position based on a normal and distance.
Definition: FluxBoundary.cc:85
double getMassOfParticlesCrossedForw() const
Container to store all BaseParticle.
double getVolumeOfParticlesCrossedForw() const
double getMassOfParticlesCrossedBack() const
unsigned int getNumberOfParticlesCrossedForw() const
Gets the number of particles that have crossed the boundary.
double getVolumeOfParticlesCrossedBack() const
void read(std::istream &is) override
Reads some boundary properties from an std::istream.
Definition: Vector.h:49
void move(Mdouble position)
Sets the boundary's distance property to the given one.
double massCrossedBack_
Definition: FluxBoundary.h:156
double volumeCrossedForw_
Definition: FluxBoundary.h:157
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH)
Checks if particle has crossed the boundary and updates the scales if so.
unsigned int numberOfParticlesCrossedForw_
Number of particles that have been deleted by this boundary.
Definition: FluxBoundary.h:153
FluxBoundary * copy() const override
Copy method; creates copy on the heap and returns a pointer to it.
Definition: FluxBoundary.cc:66