MercuryDPM  Trunk
 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-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 #include "BaseBoundary.h"
27 #include "BoundaryHandler.h"
28 
33 {
34  handler_ = nullptr;
35  logger(DEBUG, "BaseBoundary::BaseBoundary() finished");
36 }
37 
43  : BaseObject(b)
44 {
45  handler_ = b.handler_;
46  logger(DEBUG, "BaseBoundary::BaseBoundary(const BaseBoundary &b) finished");
47 }
48 
53 {
54  logger(DEBUG, "BaseBoundary::~BaseBoundary() finished");
55 }
56 
61 void BaseBoundary::read(std::istream& is)
62 {
63  BaseObject::read(is);
64 }
65 
70 void BaseBoundary::write(std::ostream& os) const
71 {
73 }
74 
82 {
83 }
84 
92 {
93 }
94 
102 {
103 }
104 
114 {
115 }
116 
118 {
119 }
120 
121 
126 {
127  logger(VERBOSE, "In BaseBoundary::checkBoundaryBeforeTimeLoop\n");
128 }
129 
135 {
136  handler_ = handler;
137 }
138 
144 {
145  return handler_;
146 }
147 
148 #ifdef MERCURY_USE_MPI
149 
152 std::set<BaseParticle*>& BaseBoundary::getParticlesToBeDeleted()
153 {
154  return particlesToBeDeleted_;
155 }
156 #endif
157 
virtual void createPeriodicParticle(BaseParticle *p UNUSED, ParticleHandler &pH UNUSED)
Creates a periodic particle in case of periodic boundaries in serial build.
Definition: BaseBoundary.cc:81
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:72
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
virtual void createPeriodicParticles(ParticleHandler &pH UNUSED)
Creates periodic copies of given particle in case of periodic boundaries.
Definition: BaseBoundary.cc:91
virtual void checkBoundaryBeforeTimeStep(DPMBase *md)
Virtual function that does things before each time step.
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:50
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
void read(std::istream &is) override=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
Definition: BaseBoundary.cc:61
void setHandler(BoundaryHandler *handler)
Sets the boundary's BoundaryHandler.
virtual void checkBoundaryAfterParticlesMove(ParticleHandler &pH)
Virtual function that does things to particles, each time step after particles have moved...
#define UNUSED
Definition: GeneralDefine.h:39
void write(std::ostream &os) const override=0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject...
Definition: BaseBoundary.cc:70
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
virtual void read(std::istream &is)=0
Definition: BaseObject.cc:81
Container to store all BaseParticle.
~BaseBoundary() override
destructor
Definition: BaseBoundary.cc:52
virtual void actionsBeforeTimeLoop()
Virtual function that does something after DPMBase::setupInitialConditions but before the first time ...
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:152
virtual void modifyGhostAfterCreation(BaseParticle *particle, int i)
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:91
BaseBoundary()
default constructor.
Definition: BaseBoundary.cc:32