![]() |
GemaCoreLib
The GeMA Core library
|
Inheriting from GmValueSet, this class adds the peculiarities needed for saving values in Gauss points. More...
#include <gmGaussValueSet.h>
Public Member Functions | |
GmGaussValueSet (GmValueInfo *info, GmSimulationData *simData, GmElementMesh *mesh) | |
Creates a Gauss value set, receiving as parameters the data needed for instancing a GmValueSet object. More... | |
virtual | ~GmGaussValueSet () |
Destructor. | |
bool | init (bool releaseInfoOnError=false) |
Initializes the value sets in a similar way to the call to GmValueSet::init(), but in this case the information required for defining the number of elements in the set will be recovered from the mesh. | |
int | pointIndex (int cellId, int ip) const |
Given a cell index and an integration point index, returns the data index in the underlying value sets. | |
int | numPoints (int cellId) const |
Returns the number of integration points for the given cell. | |
const GmMeshGaussIndex * | gaussIndex () const |
Returns the, mesh owned, asssociated Gauss index (equivalent ot querying the mesh for the Gauss index with rule set equal to info()->ruleSet(). | |
![]() | |
GmValueSet (GmValueInfo *info, GmSimulationData *simData, GmMesh *mesh) | |
Constructor. More... | |
virtual | ~GmValueSet () |
Destructor. | |
bool | init (int numValues, bool releaseInfoOnError=false) |
Initializes the ValueSet, beeing responsible for allocating memory and initializing data. More... | |
GmValueInfo * | info () const |
Returns the metadata associated with this value set. | |
int | numValues () const |
Returns the number of values stored in this value set. | |
bool | addValues (int numAddedValues) |
Adds the given number of values to the sets, initializing them to the default value. Returns false on errors. On errors previous values are kept. Keep in mind that either all sets are resized or none are. | |
void | restoreSize (int oldNumValues) |
Restores the size of the set to the previous size before addValues. | |
virtual void | removeValues (int index, int numValues) |
Removes numValues from the set, starting from (and including) index. | |
virtual void | clear () |
Clears the value sets, restoring its size to 0. More... | |
GmValueAccessor * | accessor (const Unit &desiredUnit, const GmLogCategory &logger, const GmMesh *mesh=NULL) |
Returns a locked accessor to the current value set using the desired parameters. Equivalent to calling accessor(0, true, desiredUnit, logger, mesh). | |
GmValueAccessor * | accessor (int snum, bool locked, const Unit &desiredUnit, const GmLogCategory &logger, const GmMesh *mesh=NULL) |
Returns a generic accessor that can cope with any kind of data, scalars, vectors or matrices. More... | |
virtual bool | saveState (SaveStateMode mode, const GmLogCategory &logger) |
Saves the state for the current value set. Creates a new current value set or updates it if in a "rolling history mode". More... | |
int | numSets () const |
Returns the number of saved states for this set. | |
GmValueSetData * | valueSetData (int sindex, bool locked) const |
Returns the value set data object associated with the given index. If locked == true, sindex should be the locked state number. Otherwise it should be the ValueSetData index inside the ValueSet. | |
void | replaceValueSetData (GmValueSetData *oldData, GmValueSetData *newData) |
Replaces the old valueSetData by the new one, emiting the setDataChanged() signal. | |
GmValueSetEvalContext * | evalContext () const |
Returns the function evalution context associated with this value set (will be NULL if the data set does not supports functions) | |
QString | stateTag (int snum) const |
Returns the tag associated to the given state. | |
double | stateTime (int snum) const |
Returns the time associated to the given state. | |
void | setStateTag (int snum, QString tag) |
Updates the tag associated to the given state. | |
void | setStateTime (int snum, double time) |
Updates the time associated to the given state. | |
virtual size_t | printMemoryStatistics (const GmLogCategory &logger, GmLogLevel level) const |
Prints memory usage for this value set to the given logger. Returns the used memory as reported by usedMemory() | |
virtual size_t | usedMemory () const |
Returns an estimative of the memory used by the data set in bytes. More... | |
![]() | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Protected Attributes | |
const GmElementMesh * | _mesh |
The associated mesh object. | |
const GmMeshGaussIndex * | _index |
The index object, owned by the mesh, used to translate (elemId, ip) pairs into a linear index. | |
![]() | |
GmValueInfo * | _info |
Metadata defining the value set. | |
GmValueSetEvalContext * | _evalContext |
The context used by accessors to evaluate function values (can be NULL) | |
QList< GmValueSetData * > | _vsDataList |
The list of value sets. | |
QStringList | _tagList |
A list of tag names associated to each saved state. | |
QList< double > | _timeList |
A list of times associated to each saved state. | |
int | _currentSet |
The index of the current set for rolling histories. | |
Private Member Functions | |
bool | init (int, bool) |
Additional Inherited Members | |
![]() | |
enum | SaveStateMode { VS_NOINIT_VALUES, VS_INIT_VALUES, VS_COPY_VALUES } |
Initialization mode for calls to saveState() More... | |
![]() | |
void | setDataChanged (const GmValueSet *vs) |
Signal emitted whenever a state was added to the set by saveState in a rolling history scenario or when replaceValueSetData() was called. | |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
![]() | |
GmValueSetData * | vd (int snum) const |
Returns the value set data object associated with the given state number. | |
int | t (int index) const |
Get the index in _vsDataList corresponding to the given state index. | |
GmValueSetData * | createDataObject () |
Creates a new GmValueSetData object for storing data described by the associated info object. | |
![]() | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
![]() | |
objectName | |
Inheriting from GmValueSet, this class adds the peculiarities needed for saving values in Gauss points.
This includes providing functions to translate a pair (cellId, IP) into an index into the underlying value set used to store values.
Assuming that when a mesh changes all history states will also have new values added to them, a single mapping can be stored. If the mesh is homogeneous (with respect to the number of integration points per element), this mapping can take the form of a single integer storing the number of integration points per element. If not it will be a full vector with size equal to the number of cells in the mesh and storing the cell offset in the underlying data storage.
The mapping index is now hosted by the mesh and so can be shared among several value sets.
GmGaussValueSet::GmGaussValueSet | ( | GmValueInfo * | info, |
GmSimulationData * | simData, | ||
GmElementMesh * | mesh | ||
) |
Creates a Gauss value set, receiving as parameters the data needed for instancing a GmValueSet object.
Unlike other value set types, the mesh is required for a Gauss value set.