GemaCoreLib
The GeMA Core library
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
GmGaussValueSet Class Reference

Inheriting from GmValueSet, this class adds the peculiarities needed for saving values in Gauss points. More...

#include <gmGaussValueSet.h>

Inheritance diagram for GmGaussValueSet:
Inheritance graph
[legend]
Collaboration diagram for GmGaussValueSet:
Collaboration graph
[legend]

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 GmMeshGaussIndexgaussIndex () const
 Returns the, mesh owned, asssociated Gauss index (equivalent ot querying the mesh for the Gauss index with rule set equal to info()->ruleSet().
 
- Public Member Functions inherited from GmValueSet
 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...
 
GmValueInfoinfo () 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...
 
GmValueAccessoraccessor (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).
 
GmValueAccessoraccessor (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.
 
GmValueSetDatavalueSetData (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.
 
GmValueSetEvalContextevalContext () 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...
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () 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)
 
QThreadthread () 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)
 
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 &regExp, 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< QByteArraydynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () 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.
 
- Protected Attributes inherited from GmValueSet
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

- Public Types inherited from GmValueSet
enum  SaveStateMode { VS_NOINIT_VALUES, VS_INIT_VALUES, VS_COPY_VALUES }
 Initialization mode for calls to saveState() More...
 
- Signals inherited from GmValueSet
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.
 
- Static Public Member Functions inherited from QObject
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)
 
- Protected Member Functions inherited from GmValueSet
GmValueSetDatavd (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.
 
GmValueSetDatacreateDataObject ()
 Creates a new GmValueSetData object for storing data described by the associated info object.
 
- Protected Member Functions inherited from QObject
QObjectsender () 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)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GmGaussValueSet()

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.


The documentation for this class was generated from the following files: