GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmRegularGridMesh Class Referenceabstract

Base interface class for Regular Grid Mesh type plugins. More...

#include <gmRegularGridMesh.h>

Inheritance diagram for GmRegularGridMesh:
Collaboration diagram for GmRegularGridMesh:

Public Member Functions

 GmRegularGridMesh (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Basic contructor.
 
virtual ~GmRegularGridMesh ()
 Basic destructor.
 
virtual double nodeSpacing (int dim) const =0
 Returns the spacing between grid nodes in the given dimension (0 <= dim < nodeCoordInfo()->size())
 
virtual int nodeCount (int dim) const =0
 Returns the number of nodes in the mesh in the given dimension (0 <= dim < nodeCoordInfo()->size())
 
virtual bool nodeWrap (int dim) const =0
 Returns true if for the given dimension the first node at the direction is conected to the last one (0 <= dim < nodeCoordInfo()->size())
 
virtual int nodeFromIndex (int x, int y=-1, int z=-1) const =0
 Given a set of node column, line and depth indices, returns the correspondent node index. Parameters y and z are optional and should be provided according to the grid dimension.
 
virtual void indexFromNode (int node, int *x, int *y=NULL, int *z=NULL) const =0
 Given a node index, returns in x, y and z the corresponding grid indices. Parameters y and z should be different from NULL according to the grid dimension.
 
virtual int neighbor (int node, int xoffset, int yoffset=0, int zoffset=0) const =0
 Returns the index of the neighbor node given the current node and the offset in each dimension. Offsets can be negative. If the neighbor does not exist (offset passes the grid border and nodeWrap is not active for that dimension), returns -1.
 
- Public Member Functions inherited from GmMesh
 GmMesh (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmMesh ()
 Virtual destructor.
 
virtual const char * pluginCategory () const
 Returns the plugin category.
 
virtual bool hasCapability (QString capabilityName) const =0
 This function should return true or false to indicate whether the mesh implementation supports the requested capability or not. Capabilities are refered by string names in order to enable derived interfaces to extend the available capabilities that can be queried.
 
virtual bool useDualVectors () const =0
 Returns true if the mesh data is stored in a "dual" vector, instead of a single one.
 
virtual void pushProxy (lua_State *L, const GmLogCategory &logger)=0
 Pushes a proxy object for the current mesh onto the Lua stack.

 
virtual GmValueInfonodeCoordInfo () const =0
 Returns metadata with information about node coordinates.
 
virtual GmValueAccessornodeCoordAccessor (Unit desiredUnit, const GmLogCategory &logger) const =0
 Returns an accessor object used to access node coordinates.
 
virtual int numNodes () const =0
 Returns the number of nodes in the mesh.
 
virtual int numGhostNodes () const
 Returns the number of ghost nodes in the mesh.
 
int totalNumNodes () const
 Returns the total number of nodes in the mesh, including normal nodes & ghost nodes.
 
virtual int numGlobalNodes () const
 When working with partitioned meshes, returns the number of nodes in the global mesh, before partitioning.
 
virtual int numGlobalGhostNodes () const
 When working with partitioned meshes, returns the number of ghost nodes in the global mesh, before partitioning.
 
int totalNumGlobalNodes () const
 Returns the total number of nodes in the mesh, including normal nodes & ghost nodes.
 
int toLinearGhostIndex (int nodeIndex) const
 If nodeIndex is a value with its high bit set, returns the index (high bit cleared)
 
int toLocalGhostIndex (int nodeIndex) const
 Given a global ghost index (a value >= numNodes() and < totalNumNodes()), returns a zero based version of the index. If index is a 'geometry index' (nodeIndex < numNodes()), returns a negative value.
 
virtual const QMap< QString, GmNodeSet * > & nodeSets () const =0
 Returns a map of node sets registered within the mesh. Each entry in the returned map contains a group of nodes, indexed by group name.
 
QStringList nodeValueIds (int filter=-1) const
 Returns a list with the id names for every attribute or state var associated with mesh nodes, depending on the filter parameter. No special order is enforced. If filter is -1, includes both of them, first state vars and then node attributes
since that is the order used by printing routines.
 
virtual GmValueInfonodeValueInfo (QString id, int filter=-1) const
 Returns the metadata describing the values (attribute / state var) associated with the value id.
 
virtual GmValueAccessornodeValueAccessor (QString id, Unit desiredUnit, const GmLogCategory &logger) const
 Creates an accessor object for the values (attribute / state var) associated with the value id.
 
virtual GmValueAccessornodeValueAccessor (QString id, int snum, bool locked, Unit desiredUnit, const GmLogCategory &logger) const
 Overloads nodeValueAccessor(QString, Unit, ...) to return an accessor for the requested previous state of a value.
 
virtual GmValueAccessornodeStateVarAccessorFromDof (int dof, Unit desiredUnit, GmStateVar **stateVar) const
 Creates an accessor object for the state var associated with the requested degree of freedom number. Returns NULL if the dof number is invalid or if that state var is not associated with this mesh.
 
virtual bool addNodeValueSet (GmValueInfo *info)
 Creates a new value set for storing data associated with the metadata information received as a parameter.
 
virtual void removeNodeValueSet (QString id)
 Removes node value set associated to the specified id. Do nothing if such node value set is not stored in the mesh.
 
virtual bool initNodeValueSets ()
 Initializes all the value set groups after the addition of node attributes by calls to addNodeValueSet(). MUST be called even if the mesh initially does not have any node attribute / stat var, AFTER the number of mesh nodes and ghost nodes has been correctky initialized!
 
virtual void beginAddingNodeAttributeSets ()
 Initializes a block where calls to addNodeValueSet() will only initialize the new attribute value set at the call to endAddingGaussAttributeSets(). See the comments at addNodeValueSet(). Only makes sense after mesh initialization.
 
virtual bool endAddingNodeAttributeSets ()
 Ends the block started by the call to beginAddingGaussAttributeSets(), initializing all the value sets that where added in between. See the comments at addNodeValueSet(). Returns false in case of errors.
 
virtual void clearNodeValueSets ()
 Removes every valueSet stored in the mesh (attributes and state variables). Handy for plugins to cleanup on errors.
 
virtual void clearNodeValueSetsData ()
 An auxiliary function used to remove all data from every valueSet stored in the mesh (the value sets themselves remain).
 
virtual bool saveState (GmValueSet::SaveStateMode mode, const GmLogCategory &logger)
 Simmilar to saveNodeValueState(), saves the current state of all values that support state saving. See saveNodeValueState() for more details.
 
virtual bool saveNodeValueState (QString id, GmValueSet::SaveStateMode mode, const GmLogCategory &logger)
 Saves the current state for the requested id, creating a new current state.
 
virtual int numNodeValueStates (QString id) const
 Returns the number of existing states for the requested id or -1 if the id doesn't exists.
 
virtual QString nodeValueStateTag (QString id, int snum) const
 Returns the state tag attached to the requested state of the named value or "" if the id doesn't exists.
 
virtual double nodeValueStateTime (QString id, int snum) const
 Returns the time tag attached to the requested state of the named value or -1 if the id doesn't exists.
 
virtual void setNodeValueStateTag (QString id, int snum, QString tag)
 Sets a tag name for the requested state of the named value. Does nothing if the id doesn't exists.
 
virtual void setNodeValueStateTime (QString id, int snum, double time)
 Sets a time tag for the requested state of the named value. Does nothing if the id doesn't exists.
 
virtual int addNodes (int numNodes)
 Adds numNodes to the mesh, WHITHOUT initializing their coordinates or attributes.
 
virtual int addGhostNodes (int numNodes)
 Similar to addNodes, this function adds ghost nodes to the mesh, WHITHOUT initializing their coordinates or attributes. This function should be reimplemented by mesh implementations that support ghost nodes (hasCapability("ghostNodes") returns true).
 
virtual void clear ()
 Clears mesh nodes (and cells + other mesh related information depending on the concrete mesh type) if the mesh supports this operation (hasCapability("clear") returns true).
 
QMap< QString, GmPhysicsUserFunctions * > & userFunctionsObjMap () const
 Returns the mesh map storing physics user function objects.
 
virtual void printParameters (const GmLogCategory &logger)
 Asks the mesh to print all of its parameters using the provided logger.
 
virtual void printValues (const GmLogCategory &logger, int options=GM_PRINT_DEFAULT)
 Asks the mesh to print all of its node and cell data using the provided logger and requested options.
 
virtual size_t nodeMemory () const =0
 Returns the approximate memory used for storing mesh nodes (does not include memory for s.v./attributes)
 
virtual size_t nodeSetsMemory () const =0
 Returns the approximate memory used for storing node sets.
 
virtual GmPCRpcrObject () const =0
 Returns the PCR(Partition - Color - Renumber) object associated with this mesh. Should NEVER return NULL. If no PCR plugin object has been explicitely associated with the mesh by the user, or implicitely associated by default configuration options, a default object with no partition, coloring or renumbering MUST be returned. This default object is useful to keep code simple, without unnecessary conditions.
 
GmValueSetGroupnodeValueSetGroup () const
 Returns the ValueSetGroup object used to store the set of mesh node value sets. This is a very specialized function. Use only if you know what you are doing...
 
GmValueSetnodeValueSet (QString id) const
 Returns the node value set associated with the given cell attribute. Might be NULL. See comments for nodeValueSetGroup()
 
GmValueSetGroupghostNodeValueSetGroup () const
 Returns the ValueSetGroup object used to store the set of mesh ghost node value sets. This is a very specialized function. Use only if you know what you are doing...
 
GmValueSetghostNodeValueSet (QString id) const
 Returns the ghost node value set associated with the given cell attribute. Might be NULL. See comments for ghostNodeValueSetGroup()
 
virtual void emitMeshChanged ()
 Emmits the signal meshChanged to signal other objects that the mesh has changed. Should be called by other processes after editions to the mesh like adding new nodes / cells or changing cell geometry.
 
- 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
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmPluginObject ()
 Destructor.
 
QString id () const
 Returns the object id.
 
QString description () const
 Returns the object description.
 
QString pluginTypeName () const
 Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType().
 
virtual const char * pluginName () const =0
 Returns a string identifying the plugin which implements this object. Should return the SAME string as the one read from the plugin information file in the pluginName field.
 
virtual const char * pluginType () const =0
 Returns the string identifying the plugin object type. Should return the SAME string as the one read from the plugin information file in the objectTypes table.
 
virtual bool loadPrivateData (LuaTable &table)=0
 Function called by the model loader to give the object acess to it's private parameters. Should return false only if the received parameter set makes the use of this object impossible.
 
- Public Member Functions inherited from GmGroupDumpItem
virtual ~GmGroupDumpItem ()
 Virtual destructor.
 
virtual bool stateAboutToBeSaved (GmStateDump *state)
 Virtual method called just before starting a save operation on the given state. Returning false aborts the operation.
 
virtual bool stateSaved (GmStateDump *state)
 Virtual method called just after succesfully completing a save operation on the given state. Returning false aborts the operation.
 
virtual bool stateAboutToBeLoaded (GmStateDump *state)
 Virtual method called just before starting a load operation on the given state. Returning false aborts the operation.
 
virtual bool stateLoaded (GmStateDump *state)
 Virtual method called just after succesfully completing a load operation on the given state. Returning false aborts the operation.
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Signals inherited from GmMesh
void meshChanged ()
 Signal emmited by emitMeshChanged(). See comments on that function.
 
- Static Public Member Functions inherited from GmMesh
static bool isGhostNode (int nodeIndex)
 Returns true if the given index is a ghost node index, false if not.
 
static int setGhostFlag (int nodeIndex)
 Returns the given index with the ghost node bit set.
 
static int clearGhostFlag (int nodeIndex)
 Returns the given index with the ghost node bit cleared.
 
- 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 GmMesh
GmValueSetanyVsFromId (QString id) const
 Helper function that, given an id, returns the node value set for that id if it exists. Otherwise returns the ghost value set for that id(which may also be NULL for an invalid id).
 
void printValueInfo (const GmLogCategory &logger, QString title, const QStringList &idList)
 Auxiliary function to print information about state variables or attributes.
 
virtual bool addStateItemsToGroup (GmStateDump *state, int groupId)
 Adds to 'state' a data item storing a control map, followed by geometry data filled by addStateGeometryData(), followed by mesh attribute data filled by addStateAccessorData(). All the items are added to the given group. Returns true on success or false on error.
 
virtual int controlMapStateItemType ()
 Virtual function that needs to be implemented by concrete implementation classes supporting the stateDump capability. It should return a dump type that identifies the mesh implementation.
 
virtual bool addStateGeometryData (GmStateDump *state, int groupId)
 Virtual function that needs to be implemented by concrete implementation classes supporting the stateDump capability. It should add the needed additional items to the state. Keep in mind that some of the needed control data can be added/loaded from the control map, already added to the state by the standard implementation of addStateItemsToGroup(), through the fillDumpControlMapData() / dumpControlMapDataLoaded() pair of functions.
 
virtual bool addStateAccessorData (GmStateDump *state, int groupId)
 Adds to 'state' accessors for all the data stored on state variables or node attributes associated with this mesh. This includes all histories. Returns true on success or false on error.
 
virtual bool fillDumpControlMapData (QVariantMap *map, const GmLogCategory &logger)
 Fills the dump control data map with mesh data prior to a save operation On errors, should return false and report the error through the provided state dump logger.
 
virtual bool dumpControlMapDataLoaded (QVariantMap *map, const GmLogCategory &logger)
 Sanity checks + processing of the dump control data map after a load operation.
 
- 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)
 
- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 Returns the internal logger used by the plugin to emmit messages.
 
GmSimulationDatasimulationData () const
 Returns a reference to the simulation data object keeping global simulation information.
 
- Protected Attributes inherited from GmMesh
int _stateDumpControlMapItem
 The dump item index for the control map. Used to make sure that there are no mesh data accessors prior to the map on the state.
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Base interface class for Regular Grid Mesh type plugins.


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