MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseBoundary.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 #ifndef BaseBoundary_H
27 #define BaseBoundary_H
28 
29 #include "BaseObject.h"
30 #include "Math/ExtendedMath.h"
31 
32 class BoundaryHandler;
33 class ParticleHandler;
34 class BaseParticle;
35 class DPMBase;
36 
42 class BaseBoundary : public BaseObject
43 {
44 public:
48  BaseBoundary();
49 
53  BaseBoundary(const BaseBoundary &b);
54 
58  virtual ~BaseBoundary();
59 
64  virtual BaseBoundary* copy() const = 0;
65 
70  void read(std::istream& is) = 0;
71 
76  void write(std::ostream& os) const = 0;
77 
81  virtual void createPeriodicParticles(BaseParticle *P UNUSED, ParticleHandler &pH UNUSED);
82 
86  virtual bool checkBoundaryAfterParticleMoved(BaseParticle *P UNUSED, ParticleHandler &pH UNUSED);
87 
91  virtual void checkBoundaryBeforeTimeStep(DPMBase* md UNUSED);
92 
96  void setHandler(BoundaryHandler* handler);
97 
101  BoundaryHandler* getHandler() const;
102 
103 private:
104 
109 };
110 #endif
Container to store pointers to all BaseBoundary objects.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:65
void write(std::ostream &os) const =0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject...
Definition: BaseBoundary.cc:76
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:49
virtual void checkBoundaryBeforeTimeStep(DPMBase *md UNUSED)
Fills a (3D) boundary with particles.
virtual void createPeriodicParticles(BaseParticle *P UNUSED, ParticleHandler &pH UNUSED)
Creates periodic copies of given particle in case of periodic boundaries.
Definition: BaseBoundary.cc:88
virtual BaseBoundary * copy() const =0
Used to create a copy of the object NB: purely virtual function.
void setHandler(BoundaryHandler *handler)
Sets the boundary's BoundaryHandler.
#define UNUSED
Definition: GeneralDefine.h:39
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
Container to store all BaseParticle.
virtual bool checkBoundaryAfterParticleMoved(BaseParticle *P UNUSED, ParticleHandler &pH UNUSED)
Checks if given particle passed the boundary.
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:108
virtual ~BaseBoundary()
destructor
Definition: BaseBoundary.cc:56
BaseBoundary()
default constructor.
Definition: BaseBoundary.cc:32
void read(std::istream &is)=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
Definition: BaseBoundary.cc:67