MercuryDPM  Alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseBoundary.cc
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 #include "BaseBoundary.h"
27 #include "BoundaryHandler.h"
28 
33 {
34  handler_ = nullptr;
35 #ifdef DEBUG_CONSTRUCTOR
36  std::cout<<"BaseBoundary::BaseBoundary() finished"<<std::endl;
37 #endif
38 }
39 
45  : BaseObject(b)
46 {
47  handler_ = b.handler_;
48 #ifdef DEBUG_CONSTRUCTOR
49  std::cout<<"BaseBoundary::BaseBoundary(const BaseBoundary &b) finished"<<std::endl;
50 #endif
51 }
52 
57 {
58 #ifdef DEBUG_DESTRUCTOR
59  std::cout << "BaseBoundary::~BaseBoundary() finished"<<std::endl;
60 #endif
61 }
62 
67 void BaseBoundary::read(std::istream& is)
68 {
69  BaseObject::read(is);
70 }
71 
76 void BaseBoundary::write(std::ostream& os) const
77 {
79 }
80 
89 {
90 }
91 
101 {
102  return false;
103 }
104 
111 {
112 }
113 
119 {
120  handler_ = handler;
121 }
122 
128 {
129  return handler_;
130 }
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
void setHandler(BoundaryHandler *handler)
Sets the boundary's BoundaryHandler.
#define UNUSED
Definition: GeneralDefine.h:39
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
virtual void read(std::istream &is)=0
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
Definition: BaseObject.cc:124
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
virtual void write(std::ostream &os) const =0
A purely virtual function which has an implementation which writes the name and the object id_ to the...
Definition: BaseObject.cc:133
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