OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
This class implements a linked list whose entries are Pairs (see below). More...
#include <dictionary.h>
Public Member Functions | |
Dictionary () | |
Constructor, creates empty dictionary. More... | |
~Dictionary () | |
Destructor. More... | |
void | clear () |
Clears the receiver. More... | |
Pair * | add (int aKey, double value) |
Adds a new Pair with given keyword and value into receiver. More... | |
double & | at (int aKey) |
Returns the value of the pair which key is aKey. More... | |
bool | includes (int aKey) |
Checks if dictionary includes given key. More... | |
void | printYourself () |
Prints the receiver on screen. More... | |
void | formatAsString (std::string &str) |
Formats itself as string. More... | |
int | giveSize () |
Returns number of pairs of receiver. More... | |
contextIOResultType | saveContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Saves the receiver contends (state) to given stream. More... | |
contextIOResultType | restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
Restores the receiver contents (state) from given stream. More... | |
Protected Attributes | |
Pair * | first |
First pair. More... | |
Pair * | last |
Last pair. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Dictionary &r) |
This class implements a linked list whose entries are Pairs (see below).
Dictionaries are typically used by degrees of freedom for storing their unknowns. A dictionary stores its pairs in a linked list form. It knows the first pair (attribute 'first') of the list. It also knows the last one (attribute 'last') in order to append an additional pair fast.
Definition at line 58 of file dictionary.h.
|
inline |
Constructor, creates empty dictionary.
Definition at line 68 of file dictionary.h.
References oofem::operator<<().
oofem::Dictionary::~Dictionary | ( | ) |
Pair * oofem::Dictionary::add | ( | int | aKey, |
double | value | ||
) |
Adds a new Pair with given keyword and value into receiver.
aKey | key of new pair |
value | value of new pair |
Definition at line 81 of file dictionary.C.
References oofem::Pair::append(), first, includes(), last, and OOFEM_ERROR.
Referenced by at(), oofem::OOFEMTXTInputRecord::giveField(), oofem::Steel1::initializeFrom(), oofem::SimpleTransportCrossSection::initializeFrom(), oofem::StructuralInterfaceCrossSection::initializeFrom(), oofem::IsotropicLinearElasticMaterial::initializeFrom(), oofem::OrthotropicLinearElasticMaterial::initializeFrom(), oofem::StructuralMaterial::initializeFrom(), oofem::SimpleCrossSection::initializeFrom(), oofem::CompoDamageMat::initializeFrom(), oofem::Material::initializeFrom(), oofem::LatticeDamage2d::initializeFrom(), oofem::ConcreteDPM::initializeFrom(), and oofem::ConcreteDPM2::initializeFrom().
double & oofem::Dictionary::at | ( | int | aKey | ) |
Returns the value of the pair which key is aKey.
If requested key doesn't exist, it is created with assigned value 0.
aKey | Key for pair. |
Definition at line 106 of file dictionary.C.
References add(), first, oofem::Pair::giveKey(), oofem::Pair::giveNext(), and oofem::Pair::giveValue().
Referenced by oofem::RandomMaterialStatusExtensionInterface::_giveProperty(), oofem::RandomMaterialStatusExtensionInterface::_setProperty(), oofem::NewtonianFluidMaterial::checkConsistency(), oofem::NonlinearFluidMaterial::checkConsistency(), oofem::BinghamFluidMaterial2::checkConsistency(), oofem::InitialCondition::give(), oofem::VariableCrossSection::give(), oofem::Material::give(), oofem::CrossSection::give(), oofem::PerfectlyPlasticMaterial::give(), oofem::RCM2Material::give(), oofem::Concrete2::give(), oofem::IsotropicLinearElasticMaterial::giveInputRecord(), oofem::OrthotropicLinearElasticMaterial::giveInputRecord(), oofem::SimpleCrossSection::giveInputRecord(), oofem::Material::giveInputRecord(), oofem::Material::giveIPValue(), oofem::BoundaryLoad::giveProperty(), oofem::MasterDof::giveUnknownsDictionaryValue(), oofem::Material::modifyProperty(), restoreContext(), oofem::InitialCondition::scale(), and oofem::MasterDof::updateUnknownsDictionary().
void oofem::Dictionary::clear | ( | ) |
Clears the receiver.
Definition at line 52 of file dictionary.C.
References first, oofem::Pair::giveNext(), and last.
Referenced by oofem::OOFEMTXTInputRecord::giveField(), oofem::SimpleTransportCrossSection::initializeFrom(), restoreContext(), and ~Dictionary().
void oofem::Dictionary::formatAsString | ( | std::string & | str | ) |
Formats itself as string.
Definition at line 161 of file dictionary.C.
References first, oofem::Pair::giveKey(), oofem::Pair::giveNext(), and oofem::Pair::giveValue().
int oofem::Dictionary::giveSize | ( | ) |
Returns number of pairs of receiver.
Definition at line 67 of file dictionary.C.
References first, and oofem::Pair::giveNext().
bool oofem::Dictionary::includes | ( | int | aKey | ) |
Checks if dictionary includes given key.
aKey | Dictionary key. |
Definition at line 126 of file dictionary.C.
References first, oofem::Pair::giveKey(), and oofem::Pair::giveNext().
Referenced by oofem::RandomMaterialStatusExtensionInterface::_giveProperty(), add(), oofem::VariableCrossSection::give(), oofem::Material::give(), oofem::CrossSection::give(), oofem::PerfectlyPlasticMaterial::give(), oofem::RCM2Material::give(), oofem::Concrete2::give(), oofem::SimpleCrossSection::giveInputRecord(), oofem::BoundaryLoad::giveProperty(), oofem::InitialCondition::hasConditionOn(), oofem::CrossSection::hasProperty(), oofem::Material::hasProperty(), oofem::StructuralMaterial::initializeFrom(), and oofem::Material::modifyProperty().
void oofem::Dictionary::printYourself | ( | ) |
Prints the receiver on screen.
Definition at line 145 of file dictionary.C.
References first, oofem::Pair::giveNext(), and oofem::Pair::printYourself().
Referenced by oofem::InitialCondition::printYourself(), oofem::CrossSection::printYourself(), oofem::FiberedCrossSection::printYourself(), oofem::Material::printYourself(), and oofem::LayeredCrossSection::printYourself().
contextIOResultType oofem::Dictionary::restoreContext | ( | DataStream & | stream, |
ContextMode | mode, | ||
void * | obj = NULL |
||
) |
Restores the receiver contents (state) from given stream.
throws | an ContextIOERR exception if error encountered |
Definition at line 218 of file dictionary.C.
References at(), oofem::CIO_IOERR, oofem::CIO_OK, clear(), oofem::DataStream::read(), and THROW_CIOERR.
Referenced by oofem::MasterDof::restoreContext().
contextIOResultType oofem::Dictionary::saveContext | ( | DataStream & | stream, |
ContextMode | mode, | ||
void * | obj = NULL |
||
) |
Saves the receiver contends (state) to given stream.
throws | an ContextIOERR exception if error encountered |
Definition at line 175 of file dictionary.C.
References oofem::CIO_IOERR, oofem::CIO_OK, first, oofem::Pair::giveKey(), oofem::Pair::giveNext(), oofem::Pair::giveValue(), THROW_CIOERR, and oofem::DataStream::write().
Referenced by oofem::MasterDof::saveContext().
|
friend |
Definition at line 253 of file dictionary.C.
|
protected |
First pair.
Definition at line 62 of file dictionary.h.
Referenced by add(), at(), clear(), formatAsString(), giveSize(), includes(), oofem::operator<<(), printYourself(), and saveContext().
|
protected |