MercuryDPM
Trunk
|
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 | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual void | read (std::istream &is)=0 |
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 (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long 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... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
Private Attributes | |
unsigned int | index_ = 0 |
location in BaseHandler::objects_ More... | |
unsigned int | id_ = 0 |
unique identifier within handler (remains constant even if particle is moved) More... | |
unsigned int | groupId_ = 0 |
Identifier of a group within handler. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BaseObject &o) |
A purely virtual method with an implementation which reads the index from the stream and assigns it to id_. More... | |
std::istream & | operator>> (std::istream &is, BaseObject &o) |
Operator overloading for reading the data from an input stream into the BAseObject "o". 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 50 of file BaseObject.h.
|
default |
Default constructor.
|
default |
Copy constructor, copies all the objects BaseObject contains.
|
virtualdefault |
virtual destructor
|
inline |
Definition at line 137 of file BaseObject.h.
References groupId_.
Referenced by MeshTriangle::getInteractionWith(), and BaseWall::getInteractionWith().
|
inline |
Returns the unique identifier of any particular object.
Definition at line 125 of file BaseObject.h.
References id_.
Referenced by ParticleHandler::addExistingObject(), ParticleHandler::addGhostObject(), WallHandler::addObject(), ParticleHandler::addObject(), SubcriticalMaserBoundary::addParticleToMaser(), ConstantMassFlowMaserBoundary::addParticleToMaser(), DeletionBoundary::checkBoundaryAfterParticleMoved(), DPMBase::computeInternalForce(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), copyPositionFrom(), PeriodicBoundaryHandler::findNewParticle(), Screw::getDistanceAndNormalLabCoordinates(), MeshTriangle::getDistanceNormalOverlapType(), BaseInteraction::getEffectiveMass(), BaseInteraction::getEffectiveRadius(), BaseInteraction::getI(), BaseParticle::getInfo(), MeshTriangle::getInteractionWith(), BaseInteraction::getP(), BaseInteraction::importI(), BaseInteraction::importP(), HGrid::insertParticleToHgrid(), PeriodicBoundaryHandler::processLocalGhostParticles(), Domain::processReceivedBoundaryParticleData(), Domain::processReceivedInteractionData(), WallHandler::readAndAddObject(), CurvyChute::recreateBottom(), BaseInteraction::setI(), BaseWall::setIndSpecies(), BaseParticle::setIndSpecies(), BaseSpecies::setInteractionDistance(), BaseInteraction::setP(), Membrane::updateFaceNeighbors(), PeriodicBoundaryHandler::updateMaserParticle(), PeriodicBoundaryHandler::updateParticles(), Domain::updateParticles(), PeriodicBoundaryHandler::updateParticleStatus(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), BaseInteraction::write(), Membrane::write(), BaseInteraction::writeInteraction(), BaseInteractable::~BaseInteractable(), BaseParticle::~BaseParticle(), and SuperQuadricParticle::~SuperQuadricParticle().
|
inline |
Returns the index of the object in the handler.
Definition at line 118 of file BaseObject.h.
References index_.
Referenced by PossibleContactList::add_PossibleContact(), SpeciesHandler::addObject(), BaseWall::addParticlesAtWall(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), DeletionBoundary::checkBoundaryAfterParticleMoved(), ConstantMassFlowMaserBoundary::checkBoundaryAfterParticleMoved(), LiquidMigrationWilletInteraction::form(), BaseInteraction::gatherContactStatistics(), HorizontalBaseScrew::getDistanceAndNormal(), AxisymmetricIntersectionOfWalls::getDistanceAndNormal(), ScrewsymmetricIntersectionOfWalls::getDistanceAndNormal(), RestrictedWall::getInteractionWith(), SuperQuadricParticle::getInteractionWithSuperQuad(), ParticleSpecies::getMixedSpecies(), PossibleContact::getNext(), PossibleContact::getOtherParticle(), PossibleContact::getPrevious(), HGrid::insertParticleToHgrid(), PossibleContactList::remove_ParticlePosibleContacts(), BaseInteraction::removeFromHandler(), InteractionHandler::removeObjectKeepingPeriodics(), ParticleSpecies::setDensity(), ParticleSpecies::setMaxInteractionDistance(), 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 Membrane, TimeDependentPeriodicBoundary, BaseParticle, IntersectionOfWalls, PeriodicBoundary, ScrewsymmetricIntersectionOfWalls, AxisymmetricIntersectionOfWalls, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, BaseClusterInsertionBoundary, ConstantMassFlowMaserBoundary, DeletionBoundary, InfiniteWall, CubeInsertionBoundary, TriangulatedWall, SubcriticalMaserBoundary, FluxBoundary, CG< Coordinates, BaseFunction, Fields >, CG< CGCoordinates::XYZ, BaseFunction, Fields >, InfiniteWallWithHole, PolydisperseInsertionBoundary, SphericalWall, Domain, BaseInteraction, AngledPeriodicBoundary, Screw, Coil, HeaterBoundary, CircularPeriodicBoundary, HeatFluidCoupledParticle, MeshTriangle, HorizontalScrew, RestrictedWall, HopperInsertionBoundary, BasicIntersectionOfWalls, BasicUnionOfWalls, SuperQuadricParticle, ArcWall, TimeSmoothedCG< Coordinates, BaseFunction, Fields >, LiquidFilmParticle, SimpleDrumSuperquadrics, BidisperseCubeInsertionBoundary, RandomClusterInsertionBoundary, ThermalParticle, LevelSetWall, TimeAveragedCG< Coordinates, BaseFunction, Fields >, TimeAveragedCG< CGCoordinates::XYZ, BaseFunction, Fields >, FixedClusterInsertionBoundary, HorizontalBaseScrew, LeesEdwardsBoundary, CylindricalWall, NurbsWall, ChuteInsertionBoundary, TriangleWall, CubeDeletionBoundary, MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, SineWall, Combtooth, StressStrainControlBoundary, SphericalParticle, ParabolaChute, SubcriticalMaserBoundaryTEST, ShearBoxBoundary, DropletBoundary, and VChute.
Referenced by MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::mixAll(), BaseCG::write(), write(), and BaseWall::writeVTK().
|
virtual |
Except that it is virtual, it does the same thing as setIndex() does.
[in] | index |
Definition at line 56 of file BaseObject.cc.
References index_.
|
pure virtual |
[in] | param[in] is stream object from which data is read |
Implemented in Membrane, TimeDependentPeriodicBoundary, BaseParticle, IntersectionOfWalls, InsertionBoundary, PeriodicBoundary, ScrewsymmetricIntersectionOfWalls, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, AxisymmetricIntersectionOfWalls, BaseSpecies, ConstantMassFlowMaserBoundary, BaseClusterInsertionBoundary, DeletionBoundary, InfiniteWall, CubeInsertionBoundary, TriangulatedWall, SubcriticalMaserBoundary, FluxBoundary, HeatFluidCoupledParticle, MeshTriangle, PolydisperseInsertionBoundary, SphericalWall, Domain, LiquidFilmParticle, InfiniteWallWithHole, ThermalParticle, HeaterBoundary, BaseInteraction, ArcWall, AngledPeriodicBoundary, SuperQuadricParticle, Screw, HorizontalScrew, TriangleWall, HopperInsertionBoundary, LevelSetWall, CircularPeriodicBoundary, Coil, SimpleDrumSuperquadrics, RestrictedWall, BidisperseCubeInsertionBoundary, BasicIntersectionOfWalls, BasicUnionOfWalls, LiquidMigrationWilletInteraction, EmptyFrictionInteraction, HorizontalBaseScrew, EmptyAdhesiveInteraction, HertzianViscoelasticInteraction, BaseCG, FrictionInteraction, MindlinInteraction, MindlinRollingTorsionInteraction, LeesEdwardsBoundary, SlidingFrictionInteraction, LinearPlasticViscoelasticInteraction, SinterLinInteraction, NurbsWall, BaseInteractable, BaseBoundary, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, RegimeSinterInteraction, ReversibleAdhesiveInteraction, HertzianSinterInteraction, LinearViscoelasticInteraction, SinterInteraction, ChuteInsertionBoundary, BondedInteraction, IrreversibleAdhesiveInteraction, BaseWall, CylindricalWall, DropletBoundary, MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, SineWall, CubeDeletionBoundary, Combtooth, ParticleSpecies, StressStrainControlBoundary, ParabolaChute, BasePeriodicBoundary, SubcriticalMaserBoundaryTEST, VChute, and ShearBoxBoundary.
Definition at line 81 of file BaseObject.cc.
References groupId_, id_, and helpers::readOptionalVariable().
Referenced by operator>>(), ParticleSpecies::read(), BaseBoundary::read(), and BaseInteractable::read().
|
inline |
Definition at line 131 of file BaseObject.h.
References groupId_.
Referenced by BaseCluster::particleInsertionSuccessful(), and WallHandler::readTriangleWall().
void BaseObject::setId | ( | unsigned long | 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 | id number of the current object |
Definition at line 72 of file BaseObject.cc.
References id_.
Referenced by SubcriticalMaserBoundary::addParticleToMaser(), ConstantMassFlowMaserBoundary::addParticleToMaser(), MPISphericalParticle::copyDataFromMPIParticleToParticle(), BaseParticle::oldRead(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read(), WallHandler::readAndAddObject(), and PeriodicBoundaryHandler::updateMaserParticle().
void BaseObject::setIndex | ( | unsigned int | index | ) |
Allows one to assign an index to an object in the handler/container.
[in] | index | index number of the current object |
Definition at line 64 of file BaseObject.cc.
References index_.
Referenced by SubcriticalMaserBoundary::addParticleToMaser(), ConstantMassFlowMaserBoundary::addParticleToMaser(), RestrictedWall::getInteractionWith(), BaseParticle::oldRead(), and 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 | stream object to which data is written |
Implemented in Membrane, TimeDependentPeriodicBoundary, BaseParticle, IntersectionOfWalls, InsertionBoundary, PeriodicBoundary, ScrewsymmetricIntersectionOfWalls, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, AxisymmetricIntersectionOfWalls, BaseSpecies, ConstantMassFlowMaserBoundary, DeletionBoundary, BaseClusterInsertionBoundary, CubeInsertionBoundary, TriangulatedWall, SubcriticalMaserBoundary, FluxBoundary, CG< Coordinates, BaseFunction, Fields >, CG< CGCoordinates::XYZ, BaseFunction, Fields >, MeshTriangle, InfiniteWallWithHole, PolydisperseInsertionBoundary, SphericalWall, Domain, AngledPeriodicBoundary, HeaterBoundary, Screw, BaseInteraction, Coil, CircularPeriodicBoundary, ArcWall, HorizontalScrew, RestrictedWall, TriangleWall, HopperInsertionBoundary, BasicIntersectionOfWalls, BasicUnionOfWalls, HeatFluidCoupledParticle, SimpleDrumSuperquadrics, BidisperseCubeInsertionBoundary, TimeSmoothedCG< Coordinates, BaseFunction, Fields >, ThermalParticle, TimeAveragedCG< Coordinates, BaseFunction, Fields >, LiquidMigrationWilletInteraction, SuperQuadricParticle, TimeAveragedCG< CGCoordinates::XYZ, BaseFunction, Fields >, EmptyFrictionInteraction, LiquidFilmParticle, HorizontalBaseScrew, EmptyAdhesiveInteraction, HertzianViscoelasticInteraction, BaseCG, FrictionInteraction, MindlinInteraction, MindlinRollingTorsionInteraction, LeesEdwardsBoundary, CylindricalWall, BaseInteractable, BaseBoundary, SlidingFrictionInteraction, LinearPlasticViscoelasticInteraction, SinterLinInteraction, NurbsWall, ChargedBondedInteraction, LiquidBridgeWilletInteraction, ParhamiMcMeekingSinterInteraction, RegimeSinterInteraction, ReversibleAdhesiveInteraction, HertzianSinterInteraction, LinearViscoelasticInteraction, SinterInteraction, ChuteInsertionBoundary, BondedInteraction, IrreversibleAdhesiveInteraction, BaseWall, DropletBoundary, CubeDeletionBoundary, MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, SineWall, Combtooth, ParticleSpecies, StressStrainControlBoundary, BasePeriodicBoundary, ParabolaChute, SubcriticalMaserBoundaryTEST, ShearBoxBoundary, and VChute.
Definition at line 91 of file BaseObject.cc.
References getName(), groupId_, and id_.
Referenced by operator<<(), ParticleSpecies::write(), BaseBoundary::write(), and BaseInteractable::write().
|
friend |
A purely virtual method with an implementation which reads the index from the stream and assigns it to id_.
[in] | is | |
[in,out] | os | |
[in] | o |
Definition at line 36 of file BaseObject.cc.
|
friend |
Operator overloading for reading the data from an input stream into the BAseObject "o".
[in] | o | |
[in,out] | is |
Definition at line 47 of file BaseObject.cc.
|
private |
Identifier of a group within handler.
Useful to define properties to particle or wall clusters, etc. E.g. one can apply an action to a specific group, visualise a specific group, coarse-grain a specific group, etc.
Definition at line 157 of file BaseObject.h.
Referenced by getGroupId(), read(), setGroupId(), and write().
|
private |
|
private |
location in BaseHandler::objects_
Definition at line 144 of file BaseObject.h.
Referenced by getIndex(), moveInHandler(), and setIndex().