27 #ifndef SPECIESHANDLER_H
28 #define SPECIESHANDLER_H
66 unsigned int getMixedId(
const unsigned int id1,
const unsigned int id2)
const;
69 typename std::enable_if<!std::is_pointer<typename U::MixedSpeciesType>::value,
typename U::MixedSpeciesType*>::type
72 return dynamic_cast<typename U::MixedSpeciesType*
>(
getMixedObject(S->getIndex(),T->getIndex()));
82 virtual void write(std::ostream& os)
const;
Container to store all ParticleSpecies.
BaseSpecies is the class from which all other species are derived.
unsigned int getMixedId(const unsigned int id1, const unsigned int id2) const
Gets the Id of the behaviour between two given species.
const std::vector< BaseSpecies * > & getMixedObjects() const
Returns a pointer to the vector of all mixed objects.
SpeciesHandler()
Default constructor, it creates an empty SpeciesHandler.
SpeciesHandler operator=(const SpeciesHandler &rhs)
Assignment operator that copies all species and the pointer to the DPMBase from the given SpeciesHand...
virtual void write(std::ostream &os) const
Write all the species and mixed species to an output stream.
void removeObject(unsigned const int index)
Remove the ParticleSpecies with given id.
~SpeciesHandler()
Destructor, it destructs the SpeciesHandler and all ParticleSpecies it contains.
virtual void addObject(ParticleSpecies *const S)
Adds a new ParticleSpecies to the SpeciesHandler.
ParticleSpecies * readOldObject(std::istream &is)
Reads ParticleSpecies into the SpeciesHandler from old-style restart data.
void readObject(std::istream &is)
Reads Species data into the SpeciesHandler from restart file.
std::vector< BaseSpecies * > mixedObjects_
The list of pointers to the mixed species.
Container to store the pointers to all objects that one creates in a simulation.
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
std::string getName() const
Returns the name of the handler, namely the string "SpeciesHandler".
bool useAngularDOFs()
Check if angular DOF have to be used.