27 #ifndef SPECIESHANDLER_H
28 #define SPECIESHANDLER_H
70 unsigned int getMixedId(
unsigned int id1,
unsigned int id2)
const;
73 typename std::enable_if<!std::is_pointer<typename U::MixedSpeciesType>::value,
typename U::MixedSpeciesType*>::type
76 return static_cast<typename U::MixedSpeciesType*
>(
getMixedObject(S->getIndex(), T->getIndex()));
89 virtual void write(std::ostream& os)
const;
92 std::string
getName()
const override;
Container to store the pointers to all objects that one creates in a simulation.
Definition: BaseHandler.h:51
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
BaseSpecies is the class from which all other species are derived.
Definition: BaseSpecies.h:50
Definition: ParticleSpecies.h:37
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
void updateMixedObjects()
Updates the mixed species.
Definition: SpeciesHandler.cc:868
bool useAngularDOFs()
Check if angular DOF have to be used.
Definition: SpeciesHandler.cc:955
std::string getName() const override
Returns the name of the handler, namely the string "SpeciesHandler".
Definition: SpeciesHandler.cc:947
void removeObject(unsigned int index) override
Remove the ParticleSpecies with given id.
Definition: SpeciesHandler.cc:915
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:54
SpeciesHandler & operator=(const SpeciesHandler &rhs)
Assignment operator that copies all species and the pointer to the DPMBase from the given SpeciesHand...
Definition: SpeciesHandler.cc:115
std::vector< BaseSpecies * > mixedObjects_
The list of pointers to the mixed species.
Definition: SpeciesHandler.h:99
unsigned int getMixedId(unsigned int id1, unsigned int id2) const
Gets the Id of the behaviour between two given species.
Definition: SpeciesHandler.cc:814
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:890
void readAndAddObject(std::istream &is) override
Reads Species data into the SpeciesHandler from restart file.
Definition: SpeciesHandler.cc:161
const std::vector< BaseSpecies * > & getMixedObjects() const
Returns a pointer to the vector of all mixed objects.
Definition: SpeciesHandler.cc:823
ParticleSpecies * readOldObject(std::istream &is)
Reads ParticleSpecies into the SpeciesHandler from old-style restart data.
Definition: SpeciesHandler.cc:736
~SpeciesHandler() override
Destructor, it destructs the SpeciesHandler and all ParticleSpecies it contains.
Definition: SpeciesHandler.cc:141
SpeciesHandler()
Default constructor, it creates an empty SpeciesHandler.
Definition: SpeciesHandler.cc:84
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
virtual void write(std::ostream &os) const
Write all the species and mixed species to an output stream.
Definition: SpeciesHandler.cc:929