|
#include <ParticleSpecies.h>
Public Types | |
typedef BaseInteraction | InteractionType |
typedef BaseSpecies | MixedSpeciesType |
Public Member Functions | |
ParticleSpecies () | |
The default constructor. More... | |
ParticleSpecies (const ParticleSpecies &p) | |
The default copy constructor. More... | |
ParticleSpecies (BaseNormalForce *normalForce, BaseFrictionForce *frictionForce, BaseAdhesiveForce *adhesiveForce) | |
~ParticleSpecies () | |
The default destructor. More... | |
ParticleSpecies * | copy () const override=0 |
Creates a deep copy of the object from which it is called. More... | |
virtual BaseSpecies * | copyMixed () const =0 |
Creates a new MixedSpecies with the same force properties as the Species from which it is called. See Species::copyMixed for details. More... | |
void | read (std::istream &is) override |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const override |
Writes the species properties to an output stream. More... | |
std::string | getBaseName () const |
Used in Species::getName to obtain a unique name for each Species. More... | |
void | setDensity (Mdouble density) |
Mdouble | getMassFromRadius (Mdouble radius) const |
Mdouble | getMassFromRadius (const Mdouble radius, SpeciesHandler &speciesHandler) |
Mdouble | getVolumeFromRadius (Mdouble radius) const |
Mdouble | getDensity () const |
Allows density_ to be accessed. More... | |
void | computeMass (BaseParticle *p) const |
Compute Particle mass function, which required a reference to the Species vector. It computes the Particles mass, Inertia and the inverses. More... | |
void | setTemperatureDependentDensity (const std::function< double(double)> &temperatureDependentDensity) |
const std::function< double(double)> & | getTemperatureDependentDensity () const |
Mdouble | getSmallestParticleMass () const |
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls getLightestInverseParticleMassLocal, such that the computation is done on each node. More... | |
Mdouble | getMaxInteractionDistance () const |
returns the largest separation distance at which adhesive short-range forces can occur. More... | |
void | setMaxInteractionDistance (Mdouble interactionDistance=0) |
Sets maxInteractionDistance_. More... | |
const BaseSpecies * | getMixedSpecies (const ParticleSpecies *s) const |
virtual void | actionsAfterTimeStep (BaseParticle *particle) const |
Public Member Functions inherited from BaseSpecies | |
BaseSpecies () | |
The default constructor. More... | |
BaseSpecies (BaseNormalForce *normalForce, BaseFrictionForce *frictionForce_, BaseAdhesiveForce *adhesiveForce) | |
BaseSpecies (const BaseSpecies &p) | |
The copy constructor. More... | |
~BaseSpecies () | |
The default destructor. More... | |
virtual void | copyInto (BaseSpecies *s) const =0 |
void | setHandler (SpeciesHandler *handler) |
Sets the pointer to the handler to which this species belongs. More... | |
SpeciesHandler * | getHandler () const |
Returns the pointer to the handler to which this species belongs. More... | |
virtual void | mixAll (BaseSpecies *S, BaseSpecies *T)=0 |
creates default values for mixed species More... | |
virtual bool | getUseAngularDOFs () const =0 |
Returns true if torques (i.e. angular degrees of freedom) have to be calculated. More... | |
virtual BaseInteraction * | getNewInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp) const =0 |
returns new Interaction object. More... | |
virtual BaseInteraction * | getEmptyInteraction () const =0 |
virtual void | deleteEmptyInteraction (BaseInteraction *interaction) const =0 |
Mdouble | getInteractionDistance () const |
returns the largest separation distance at which adhesive short-range forces can occur. More... | |
BaseNormalForce * | getNormalForce () const |
BaseFrictionForce * | getFrictionForce () const |
BaseAdhesiveForce * | getAdhesiveForce () const |
void | setInteractionDistance (Mdouble interactionDistance) |
Public Member Functions inherited from BaseObject | |
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 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 Member Functions | |
Mdouble | getLargestInverseParticleMassLocal () const |
Computes inverse mass of the lightest particle (by mass) belonging to this species. If MPI is used, this computation is done locally on each node. More... | |
Private Attributes | |
Mdouble | density_ |
The mass density. More... | |
std::function< double(double temperature)> | temperatureDependentDensity_ |
Mdouble | maxInteractionDistance_ |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseSpecies | |
static Mdouble | average (Mdouble a, Mdouble b) |
Returns the harmonic mean of two variables. More... | |
static Mdouble | averageInf (Mdouble a, Mdouble b) |
Returns the harmonic mean of two variables, returning inf if either is inf. More... | |
Protected Attributes inherited from BaseSpecies | |
BaseNormalForce * | normalForce_ |
A pointer to the normal force parameters \detail This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
BaseFrictionForce * | frictionForce_ |
A pointer to the friction force parameters \detail This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
BaseAdhesiveForce * | adhesiveForce_ |
A pointer to the adhesive force parameters \detail This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
ParticleSpecies::ParticleSpecies | ( | ) |
The default constructor.
ParticleSpecies::ParticleSpecies | ( | const ParticleSpecies & | p | ) |
The default copy constructor.
[in] | p | the species that is copied |
References density_, and temperatureDependentDensity_.
ParticleSpecies::ParticleSpecies | ( | BaseNormalForce * | normalForce, |
BaseFrictionForce * | frictionForce, | ||
BaseAdhesiveForce * | adhesiveForce | ||
) |
ParticleSpecies::~ParticleSpecies | ( | ) |
|
inlinevirtual |
Reimplemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >.
void ParticleSpecies::computeMass | ( | BaseParticle * | p | ) | const |
Compute Particle mass function, which required a reference to the Species vector. It computes the Particles mass, Inertia and the inverses.
Compute BaseParticle mass function, which required a reference to the Species vector. It computes the Particles mass, Inertia and the inverses. this function is called, if BaseParticleHandler::addObject, SpeciesHandler::addObject, ParticleSpecies::setDensity, BaseParticle::setRadius or DPMBase::setParticleDimensions is called
References BaseParticle::computeMass().
Referenced by SuperQuadricParticle::setAxes(), SuperQuadricParticle::setExponents(), BaseParticle::setRadius(), WallParticleCollision::setupInitialConditions(), test1(), test2(), and BaseParticle::unfix().
|
overridepure virtual |
Creates a deep copy of the object from which it is called.
See BaseSpecies::copy for details
Implements BaseSpecies.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >.
Referenced by CurvyChute::createBottom().
|
pure virtual |
Creates a new MixedSpecies with the same force properties as the Species from which it is called. See Species::copyMixed for details.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >.
Referenced by SpeciesHandler::addObject().
std::string ParticleSpecies::getBaseName | ( | ) | const |
Mdouble ParticleSpecies::getDensity | ( | ) | const |
Allows density_ to be accessed.
References density_.
Referenced by Membrane::adjustVertexParticleSize(), Membrane::buildMesh(), BaseParticle::computeMass(), SuperQuadricParticle::computeMass(), HertzianSinterNormalSpecies::computeTimeStep(), FlowRule::getDensityVariation(), getMassFromRadius(), main(), ShearStage::printTime(), FileReader::read(), LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), SPHNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), FlowRule::setDensityVariation(), SuperQuadricParticle::setInertia(), NozzleDemo::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), and SinterForceUnitTest::setupInitialConditions().
|
private |
Computes inverse mass of the lightest particle (by mass) belonging to this species. If MPI is used, this computation is done locally on each node.
References BaseSpecies::getHandler(), and logger.
Referenced by getSmallestParticleMass().
Mdouble ParticleSpecies::getMassFromRadius | ( | const Mdouble | radius, |
SpeciesHandler & | speciesHandler | ||
) |
References getMassFromRadius(), and BaseSpecies::setHandler().
References getDensity(), and getVolumeFromRadius().
Referenced by NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), BaseCluster::calculateTimeStep(), DropletBoundary::checkBoundaryAfterParticlesMove(), ClosedCSCWalls::ClosedCSCWalls(), CSCWalls::CSCWalls(), getMassFromRadius(), MarbleRun::getParticleMass(), main(), ChuteBottom::makeRoughBottom(), ParticleCreation::ParticleCreation(), regimeForceUnitTest::regimeForceUnitTest(), BaseCluster::setupInitialConditions(), SinterPair::SinterPair(), and viscoElasticUnitTest::viscoElasticUnitTest().
|
inline |
returns the largest separation distance at which adhesive short-range forces can occur.
returns the largest separation distance (negative overlap) at which (adhesive) short-range forces can occur (needed for contact detection). Defined in each of the AdhesiveForceSpecies It is defined as a virtual function here to allow the function to be called from a BaseSpecies pointer (which is the kind of pointer used for MixedSpecies).
References maxInteractionDistance_.
Referenced by BaseParticle::getMaxInteractionRadius().
const BaseSpecies * ParticleSpecies::getMixedSpecies | ( | const ParticleSpecies * | s | ) | const |
References BaseSpecies::getHandler(), BaseObject::getIndex(), and SpeciesHandler::getMixedObject().
Referenced by BaseParticle::getInteractionDistance().
Mdouble ParticleSpecies::getSmallestParticleMass | ( | ) | const |
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls getLightestInverseParticleMassLocal, such that the computation is done on each node.
References getLargestInverseParticleMassLocal(), and MPIContainer::Instance().
References temperatureDependentDensity_.
References ERROR, BaseHandler< T >::getDPMBase(), BaseSpecies::getHandler(), DPMBase::getParticleDimensions(), logger, and constants::pi.
Referenced by getMassFromRadius().
|
overridevirtual |
Reads the species properties from an input stream.
[in] | is | input stream (typically the restart file) |
Reimplemented from BaseSpecies.
Reimplemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >.
References density_, BaseSpecies::read(), and BaseObject::read().
Referenced by Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read().
void ParticleSpecies::setDensity | ( | Mdouble | density | ) |
Allows density_ to be changed
[in] | density | the particle density |
References ParticleHandler::computeAllMasses(), density_, BaseHandler< T >::getDPMBase(), BaseSpecies::getHandler(), BaseObject::getIndex(), logger, and DPMBase::particleHandler.
Referenced by NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), AngledPeriodicBoundarySecondUnitTest::AngledPeriodicBoundarySecondUnitTest(), AngledPeriodicBoundaryUnitTest::AngledPeriodicBoundaryUnitTest(), AngleOfRepose::AngleOfRepose(), BouncingSuperQuadric::BouncingSuperQuadric(), BoundariesSelfTest::BoundariesSelfTest(), Membrane::buildMesh(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithWedge::ChuteWithWedge(), ClosedCSCWalls::ClosedCSCWalls(), Contact::Contact(), ParameterStudy1DDemo::createSpecies(), ParameterStudy2DDemo::createSpecies(), ParameterStudy3DDemo::createSpecies(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), MembraneDemo::initializeSpecies(), MembraneSelfTest::initializeSpecies(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), protectiveWall::protectiveWall(), FileReader::read(), SpeciesHandler::readOldObject(), regimeForceUnitTest::regimeForceUnitTest(), FlowRule::setDensityVariation(), MercuryOS::setMaterialProperties(), MarbleRun::setParticleDensity(), GranularJet::setSilbert(), ChutePeriodic::setup(), NozzleDemo::setupInitialConditions(), Drum::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), StressStrainControl::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FreeFall::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SinterPair::SinterPair(), StressStrainControl::StressStrainControl(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), test1(), test2(), viscoElasticUnitTest::viscoElasticUnitTest(), and Wall::Wall().
void ParticleSpecies::setMaxInteractionDistance | ( | Mdouble | interactionDistance = 0 | ) |
Sets maxInteractionDistance_.
interactionDistance | the interaction distance that has been changed |
Sets maxInteractionDistance_
interactionDistance | the interaction distance that has been changed |
References BaseSpecies::getHandler(), BaseObject::getIndex(), SpeciesHandler::getMixedObject(), BaseHandler< T >::getSize(), constants::i, and maxInteractionDistance_.
Referenced by SpeciesHandler::addObject(), and BaseSpecies::setInteractionDistance().
void ParticleSpecies::setTemperatureDependentDensity | ( | const std::function< double(double)> & | temperatureDependentDensity | ) |
References temperatureDependentDensity_.
|
overridevirtual |
Writes the species properties to an output stream.
[out] | os | output stream (typically the restart file) |
Reimplemented from BaseSpecies.
Reimplemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >.
References density_, BaseObject::write(), and BaseSpecies::write().
Referenced by Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write().
|
private |
The mass density.
Referenced by getDensity(), ParticleSpecies(), read(), setDensity(), and write().
|
private |
Returns the max distance between particles of this species and any other species below which adhesive forces can occur (needed for contact detection)
Referenced by getMaxInteractionDistance(), and setMaxInteractionDistance().
Change this function to let the particles expand due to temperature. The default value (empty) stands for constant density.
Referenced by getTemperatureDependentDensity(), ParticleSpecies(), and setTemperatureDependentDensity().