![]() |
GemaCoreLib
The GeMA Core library
|
Auxiliar class used to store the complete set of model data for a simulation. More...
#include <gmModelData.h>
Public Member Functions | |
GmModelData () | |
Constructor. | |
~GmModelData () | |
Destructor. | |
void | clear () |
Clears the model data, deleting every model object and restoring the object to its construction state. | |
const QMap< QString, GmStateVar * > & | stateVars () const |
Returns a const reference to the state vars map. | |
const QMap< QString, int > & | stateVarGroupNames () const |
Returns a const reference to the map assigning sequential group ids to group names. | |
const QMap< QString, GmPropertySet * > & | propertySets () const |
Returns a const reference to the property sets map. | |
const QMap< QString, GmMesh * > & | meshes () const |
Returns a const reference to the meshes map. | |
const QMap< QString, GmUserFunction * > & | userFunctions () const |
Returns a const reference to the user functions map. | |
const QMap< QString, GmBoundaryCondition * > & | boundaryConditions () const |
Returns a const reference to the boundary conditions map. | |
const QMap< QString, GmContactBoundaryCondition * > & | contactBoundaryConditions () const |
Returns a const reference to the contact boundary conditions map. | |
const QMap< QString, GmSpatialIndex * > & | spatialIndices () const |
Returns a const reference to the spatial index map. | |
const QMap< QString, GmDiscontinuitySet * > & | discontinuitySets () const |
Returns a const reference to the discontinuity set map. | |
const QMap< QString, QMap< QString, GmPluginData * > > & | pluginData () const |
Returns a const reference to the set of per plugin data type maps. | |
const QMap< QString, GmPluginData * > | pluginData (QString typeName) const |
Returns the plugin data map storing objects of the given type (remember that in Qt maps implicitely copied) | |
bool | addStateVar (GmStateVar *stateVar) |
Adds a state var to the model. Returns false if an object with the same id already exists or if adding this state var would blow the 'dof' limits. The model takes ownership of the object. More... | |
int | numStateVarDofs () const |
Returns the number of global dof's used by the set of state vars. | |
bool | addPropertySet (GmPropertySet *propSet) |
Adds a property set to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addMesh (GmMesh *mesh) |
Adds a mesh to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addUserFunction (GmUserFunction *ufunc) |
Adds a user function to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addBoundaryCondition (GmBoundaryCondition *bc) |
Adds a boundary condition to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addContactBoundaryCondition (GmContactBoundaryCondition *bc) |
Adds a contactboundary condition to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addSpatialIndex (GmSpatialIndex *index) |
Adds a spatial index to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addDiscontinuitySet (GmDiscontinuitySet *dset) |
Adds a spatial index to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
bool | addPluginData (GmPluginData *pdata) |
Adds a plugin data object to the model. Returns false if an object with the same id already exists. The model takes ownership of the object. | |
void | setStateVarGroupName (GmStateVar *stateVar, QString name) |
Updates the state var group name and also its group id based on the group name to id map. | |
void | printInfo (const GmLogCategory &logger, const GmSimulationData *simData) |
Prints information about the simulation using the provided logger (Info category). The simData object is used to search for configured print options. | |
Private Member Functions | |
template<class T > | |
bool | addObjectToMap (T *obj, QMap< QString, T * > &map) |
Adds a new object to the list of existing ones. If an object with the same id already exists, does nothing. More... | |
Private Attributes | |
QMap< QString, GmStateVar * > | _stateVarMap |
Map storing state variables information, keyed by state var id. | |
QMap< QString, GmPropertySet * > | _propertySetMap |
Map storing property sets, keyed by property set id. | |
QMap< QString, GmMesh * > | _meshMap |
Map storing meshes, keyed by mesh id. | |
QMap< QString, GmUserFunction * > | _userFunctionMap |
Map storing user defined functions for evaluating attribute / property values. | |
QMap< QString, GmBoundaryCondition * > | _bcMap |
Map storing boundary conditions, keyed by boundary condition id. | |
QMap< QString, GmContactBoundaryCondition * > | _cbcMap |
Map storing contact boundary conditions, keyed by boundary condition id. | |
QMap< QString, GmSpatialIndex * > | _spatialIndexMap |
Map storing spatial indices, keyed by index id. | |
QMap< QString, GmDiscontinuitySet * > | _discontinuitySetMap |
Map storing discontinuity sets, keyed by index id. | |
QMap< QString, QMap< QString, GmPluginData * > > | _pluginDataMap |
Map sotring per plugin data type (alias), a map with the plugin data objects of that type keyed by object id. | |
QMap< QString, int > | _stateVarGroupNames |
Map translating state var group names into a sequential group id. | |
int | _nextDof |
Next available degree of freedom number. | |
Auxiliar class used to store the complete set of model data for a simulation.
|
private |
Adds a new object to the list of existing ones. If an object with the same id already exists, does nothing.
The model will take the ownership of the added object, which means that it will be deleted by the model data. Returns true if the object was inserted in the list.
bool GmModelData::addStateVar | ( | GmStateVar * | stateVar | ) |
Adds a state var to the model. Returns false if an object with the same id already exists or if adding this state var would blow the 'dof' limits. The model takes ownership of the object.
When adding the state variable, this function also takes care of attributing a base 'dof' (degree of freedom) number to the state var, if its current value is equal to -1 (the default when creating a new state var), and to assign a group id based on the current state var group name.