MercuryDPM
Alpha
|
It is an abstract base class due to the purely virtual functions declared below. Even if the function is purely virtual, it does not imply that it cannot have a definition. Abstract classes are useful to define a interface. More...
#include <BaseObject.h>
Public Member Functions | |
BaseObject () | |
Default constructor. More... | |
BaseObject (const BaseObject &p) | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject () |
virtual destructor More... | |
virtual void | read (std::istream &is)=0 |
A purely virtual method with an implementation which reads the index from the stream and assigns it to id_. More... | |
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 output stream. More... | |
virtual std::string | getName () const =0 |
A purely virtual function. More... | |
virtual void | moveInHandler (const unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (const unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (const unsigned int id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
Private Attributes | |
unsigned int | index_ |
location in BaseHandler::objects_ More... | |
unsigned int | id_ |
unique identifier within handler (remains constant even if particle is moved) More... | |
It is an abstract base class due to the purely virtual functions declared below. Even if the function is purely virtual, it does not imply that it cannot have a definition. Abstract classes are useful to define a interface.
Definition at line 49 of file BaseObject.h.
BaseObject::BaseObject | ( | ) |
Default constructor.
Initialises the member variables to zero.
Definition at line 55 of file BaseObject.cc.
References DEBUG, id_, index_, and logger.
BaseObject::BaseObject | ( | const BaseObject & | p | ) |
Copy constructor, copies all the objects BaseObject contains.
[in] | p |
Definition at line 65 of file BaseObject.cc.
References DEBUG, id_, index_, and logger.
|
virtual |
virtual destructor
Definition at line 75 of file BaseObject.cc.
unsigned int BaseObject::getId | ( | ) | const |
Returns the unique identifier of any particular object.
Definition at line 116 of file BaseObject.cc.
References id_.
Referenced by ParticleHandler::addObject(), WallHandler::addObject(), MaserBoundary::addParticleToMaser(), DPMBase::computeInternalForces(), DPMBase::getInfo(), HGrid::insertParticleToHgrid(), ParticleHandler::readObject(), BaseInteractable::removeInteraction(), BaseWall::setIndSpecies(), BaseParticle::setIndSpecies(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), BaseInteraction::write(), BaseInteractable::~BaseInteractable(), and BaseParticle::~BaseParticle().
unsigned int BaseObject::getIndex | ( | ) | const |
Returns the index of the object in the handler.
Definition at line 108 of file BaseObject.cc.
References index_.
Referenced by PossibleContactList::add_PossibleContact(), SpeciesHandler::addObject(), DeletionBoundary::checkBoundaryAfterParticleMoved(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), LiquidMigrationWilletInteraction::form(), BaseInteraction::gatherContactStatistics(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), PossibleContact::getNext(), PossibleContact::getOtherParticle(), PossibleContact::getPrevious(), HGrid::insertParticleToHgrid(), PossibleContactList::remove_ParticlePosibleContacts(), BaseInteraction::removeFromHandler(), InteractionHandler::removeObjectKeepingPeriodics(), ParticleSpecies::setDensity(), PossibleContact::setNextPosition(), PossibleContact::setPreviousPosition(), BaseInteractable::setSpecies(), AngledPeriodicBoundary::shiftPosition(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), BaseInteraction::writeToFStat(), BaseWall::writeVTK(), and BaseInteractable::~BaseInteractable().
|
pure virtual |
A purely virtual function.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, IntersectionOfWalls, PeriodicBoundary, InfiniteWall, TriangulatedWall, InfiniteWallWithHole, BaseParticle, AxisymmetricIntersectionOfWalls, SphericalWall, AngledPeriodicBoundary, Coil, BaseInteraction, RestrictedWall, CircularPeriodicBoundary, HopperInsertionBoundary, DeletionBoundary, Screw, CubeInsertionBoundary, CylindricalWall, ChuteInsertionBoundary, MaserBoundary, LeesEdwardsBoundary, ShearBoxBoundary, LiquidFilmParticle, and ThermalParticle.
Referenced by write(), and BaseWall::writeVTK().
|
virtual |
Except that it is virtual, it does the same thing as setIndex() does.
[in] | index |
Definition at line 83 of file BaseObject.cc.
References index_.
|
pure virtual |
A purely virtual method with an implementation which reads the index from the stream and assigns it to id_.
[in] | is |
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, IntersectionOfWalls, PeriodicBoundary, TriangulatedWall, InfiniteWall, InsertionBoundary, InfiniteWallWithHole, AxisymmetricIntersectionOfWalls, SphericalWall, BaseParticle, AngledPeriodicBoundary, BaseInteraction, Coil, RestrictedWall, CircularPeriodicBoundary, HopperInsertionBoundary, Screw, DeletionBoundary, CubeInsertionBoundary, CylindricalWall, BaseInteractable, MindlinRollingTorsionInteraction, BaseWall, BaseBoundary, LiquidMigrationWilletInteraction, MindlinInteraction, HertzianViscoelasticInteraction, LinearPlasticViscoelasticInteraction, ChuteInsertionBoundary, FrictionInteraction, BondedInteraction, IrreversibleAdhesiveInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, HertzianSinterInteraction, SinterInteraction, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, ReversibleAdhesiveInteraction, ParticleSpecies, LiquidFilmParticle, ThermalParticle, MaserBoundary, SinterNormalSpecies, LeesEdwardsBoundary, ShearBoxBoundary, BondedSpecies, EmptyFrictionSpecies, FrictionSpecies, MindlinRollingTorsionSpecies, ChargedBondedSpecies, LiquidBridgeWilletSpecies, LiquidMigrationWilletSpecies, ParhamiMcMeekingSinterSpecies, ReversibleAdhesiveSpecies, MindlinSpecies, SlidingFrictionSpecies, HertzianSinterNormalSpecies, HertzianViscoelasticNormalSpecies, LinearPlasticViscoelasticNormalSpecies, LinearViscoelasticNormalSpecies, and EmptyAdhesiveSpecies.
Definition at line 124 of file BaseObject.cc.
References id_.
Referenced by operator>>(), ParticleSpecies::read(), BaseBoundary::read(), and BaseInteractable::read().
void BaseObject::setId | ( | const unsigned int | id | ) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler.
[in] | id |
Definition at line 99 of file BaseObject.cc.
References id_.
Referenced by MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read().
void BaseObject::setIndex | ( | const unsigned int | index | ) |
Allows one to assign an index to an object in the handler/container.
[in] | index |
Definition at line 91 of file BaseObject.cc.
References index_.
Referenced by MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read().
|
pure virtual |
A purely virtual function which has an implementation which writes the name and the object id_ to the output stream.
[in] | os |
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, IntersectionOfWalls, PeriodicBoundary, InfiniteWall, TriangulatedWall, InfiniteWallWithHole, InsertionBoundary, BaseParticle, AxisymmetricIntersectionOfWalls, SphericalWall, AngledPeriodicBoundary, Coil, RestrictedWall, HopperInsertionBoundary, CircularPeriodicBoundary, BaseInteraction, DeletionBoundary, Screw, CubeInsertionBoundary, CylindricalWall, BaseInteractable, ChuteInsertionBoundary, BaseBoundary, MindlinRollingTorsionInteraction, BaseWall, LiquidMigrationWilletInteraction, MindlinInteraction, HertzianViscoelasticInteraction, LinearPlasticViscoelasticInteraction, BondedInteraction, IrreversibleAdhesiveInteraction, FrictionInteraction, EmptyFrictionInteraction, LinearViscoelasticInteraction, EmptyAdhesiveInteraction, SlidingFrictionInteraction, HertzianSinterInteraction, SinterInteraction, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, ReversibleAdhesiveInteraction, ParticleSpecies, MaserBoundary, SinterNormalSpecies, LeesEdwardsBoundary, ShearBoxBoundary, LiquidFilmParticle, ThermalParticle, BondedSpecies, EmptyFrictionSpecies, FrictionSpecies, MindlinRollingTorsionSpecies, ChargedBondedSpecies, LiquidBridgeWilletSpecies, LiquidMigrationWilletSpecies, ParhamiMcMeekingSinterSpecies, ReversibleAdhesiveSpecies, MindlinSpecies, SlidingFrictionSpecies, HertzianSinterNormalSpecies, HertzianViscoelasticNormalSpecies, LinearPlasticViscoelasticNormalSpecies, LinearViscoelasticNormalSpecies, and EmptyAdhesiveSpecies.
Definition at line 133 of file BaseObject.cc.
References getName(), and id_.
Referenced by operator<<(), ParticleSpecies::write(), BaseBoundary::write(), and BaseInteractable::write().
|
private |
unique identifier within handler (remains constant even if particle is moved)
Definition at line 120 of file BaseObject.h.
Referenced by BaseObject(), getId(), read(), setId(), and write().
|
private |
location in BaseHandler::objects_
Definition at line 115 of file BaseObject.h.
Referenced by BaseObject(), getIndex(), moveInHandler(), and setIndex().