GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
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:
Collaboration diagram for GmGaussValueSet:

Public Member Functions

 GmGaussValueSet (GmValueInfo *info, GmPackedBuffer *pack, GmSimulationData *simData, GmElementMesh *mesh)
 Creates a Gauss value set, receiving as parameters the data needed for instancing a GmValueSet object.

 
virtual ~GmGaussValueSet ()
 Destructor.
 
virtual bool init (int numValues, bool releaseInfoOnError=false)
 Initializes the ValueSet, being responsible for allocating memory and initializing data. When associated to a pack, expects the pack to have been already initialized.
 
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, associated 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, GmPackedBuffer *pack, GmSimulationData *simData, GmMesh *mesh)
 Constructor.

 
virtual ~GmValueSet ()
 Destructor.
 
GmValueInfoinfo () const
 Returns the metadata associated with this value set.
 
void releaseInfo ()
 Releases the value set hold on the info object by setting it to NULL. Use very carefully for error treatment only. For the ones who know what they are doing.
 
GmPackedBufferpack () const
 Returns the associated packed buffer if this value set is tied to one. Returns NULL otherwise.
 
void packLayoutUpdated ()
 Updates the layout of assoicated packed value set data objects in response to a layout change in the pack buffer.
 
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. Ignored for value sets belonging to a pack.
 
void restoreSize (int oldNumValues)
 Restores the size of the set to the previous size before addValues. Can be called with the current size if addValues was not called. Ignored for value sets belonging to a pack.
 
virtual void removeValues (int index, int numValues)
 Removes numValues from the set, starting from(and including) index. Ignored for value sets belonging to a pack.
 
virtual void clear ()
 Clears the value sets, restoring its size to 0. Ignored for value sets belonging to a pack.
 
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.

 
virtual bool saveState (GmTaskManager *tm, 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".
 
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. The returned pointer is a GmValueSetPackedData* if pack() returns a a non NULL value and a GmValueSetStoredData* if pack() returns NULL.
 
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.
 
- Public Member Functions inherited from QObject
virtual const QMetaObjectmetaObject () const const
 
 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 QObjectListchildren () 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 ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 

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)
 
GmPackedBuffer_pack
 The packed buffer containing the data vector if the value set belongs to a pack. NULL otherwise.
 
QList< GmValueSetData * > _vsDataList
 The list of value sets. Stores either GmValueSetStoredData or GmValueSetPackedData pointers depending on _pack.
 
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.
 

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...
 
- Public Types inherited from QObject
typedef  QObjectList
 
- 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 (int state, bool dual)
 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,
GmPackedBuffer * pack,
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.

Member Function Documentation

◆ init()

bool GmGaussValueSet::init ( int numValues,
bool releaseInfoOnError = false )
virtual

Initializes the ValueSet, being responsible for allocating memory and initializing data. When associated to a pack, expects the pack to have been already initialized.

Returns false if it was not possible to allocate memory. If releaseInfoOnError is true and there was an error allocating memory, the ValueSet releases its ownership claim over the information object, that will not be released by the value set anymore. It also sets its internal info pointer to NULL.

Reimplemented from GmValueSet.


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