![]() |
FemProcess
The GeMA Fem Process Plugin
|
A convenience class that builds a GmVectorSet with the types given by GmpFemVectorTypes and also associates a global vector to each element vector stored in the set (it can also associate a single global vector, dissociated with vector types) More...
#include <gmpFemVectorSet.h>
Classes | |
struct | GmpFemVectorTypeData |
Aux structure storing the vectors associated with a vector type. More... | |
Public Types | |
enum | GmpFemVectorMode { VECTOR_MATCH_MODE, VECTOR_SINGLE_MODE, VECTOR_SINGLE_DEBUG_MODE } |
Control mode specifying if the vector set should have one global vector per local vector (MATCH_MODE), a single global vector independing of the number of local vectors (SINGLE_MODE) or both: a single global vector + one global vector per configured local vector. This last mode is usefull for debuging purposes only. More... | |
Public Member Functions | |
GmpFemVectorSet () | |
Constructor. | |
~GmpFemVectorSet () | |
Destructor. | |
void | clear () |
Clears the set, restoring it to the state after construction. | |
bool | initTypes (GmpFemVectorMode mode, int numVectors,...) |
Informs the vector set about the local vector types that will be stored on it. It also creates the set of global vectors tied to the element vectors in the set. The number of effectively stored global vectors follows the given mode. More... | |
bool | adjustSizes (int globalNumDofs, int globalNumFixedDofs, int maxElemDofs) |
Adjusts the sizes of local and global vectors according to the given number of dofs. Can be called more than once to update vector sizes on model changes. More... | |
void | addTransposedDofVector (GmpFemVectorTypes type) |
Informs the set that the given type requires an additional vector to store transposed values when reducing a matrix due to fixed dofs. More... | |
void | addSavedDofVector (GmpFemVectorTypes type) |
Informs the set that the given type requires an auxiliar vector to store saved values for fixed dofs. More... | |
void | clearGlobalVectors () |
Clears all ACTIVE global vectors (or the single vector), filling them with zeros. This includes eventual transposed, saved and debug print vectors. | |
GmVector & | globalVector (GmpFemVectorTypes type) const |
Returns a global Vector identified by its type in the set. More... | |
GmVector & | globalVectorFromIndex (int index) const |
Returns a global Vector identified by its index in the set. Can NOT be used for "single" or "single debug" modes. | |
GmVector & | globalTransposedDofVector (GmpFemVectorTypes type) const |
Returns the registered vector, identified by its type in the set, for storing transposed values when reducing a matrix due to fixed dofs. Will be equal to the global vector unless addTransposedDofVector() has been called for this type. More... | |
GmVector & | globalTransposedDofVectorFromIndex (int index) const |
Returns the registered vector, identified by its index in the set, for storing transposed values when reducing a matrix due to fixed dofs. Will be equal to the global vector unless addTransposedDofVector() has been called for this type. Can NOT be used for "single" or "single debug" modes. | |
GmVector & | globalSavedDofVector (GmpFemVectorTypes type) const |
Returns the registered vector, identified by its type in the set, for storing saved values for fixed dofs. Will be an empty vector unless addSavedDofVector() has been called for this type. More... | |
GmVector & | globalSavedDofVectorFromIndex (int index) const |
Returns the registered vector, identified by its index in the set, for storing saved values for fixed dofs. Will be an empty vector unless addSavedDofVector() has been called for this type. Can NOT be used for "single" or "single debug" modes. | |
GmVector & | globalDebugPrintVector (GmpFemVectorTypes type) const |
Returns the auxiliar vector used for storing global vectors matching local ones for debug printing purposes when operating in "single debug" mode or the regular vector when operating in "match" mode. More... | |
GmVector & | globalDebugPrintVectorFromIndex (int index) const |
Returns the auxiliar vector used for storing global vectors matching local ones for debug printing purposes when operating in "single debug" mode or the regular vector when operating in "match" mode. | |
GmpFemVectorMode | mode () const |
Returns the mode defining the global vectors stored by the set. | |
GmpFemVectorTypes | femTypeFromIndex (int index) const |
Given a vector index, returns its type as a GmpFemVectorTypes. Equivalent to GmVectorSet::typeFromIndex() | |
![]() | |
GmVectorSet (int maxVectorTypes, const QStringList &typeNames) | |
bool | init (int maxNodes, int numVectors,...) |
bool | adjustSizes (int maxNodes) |
void | clear () |
void | prepareSet (int nnodes) |
bool | containsType (int type) const |
void | setTypeEnabled (int type, bool enabled) |
int | numEnabledTypes () const |
GmVector & | vector (int type) |
GmVector & | useVector (int type) |
GmVector & | useVector (int type, bool fill) |
void | setFilled (int type, bool filled) |
bool | filled (int type) const |
int | index (int type) const |
int | typeFromIndex (int index) const |
QString | typeName (int type) const |
int | numVectors () const |
const GmVector & | vectorFromIndex (int index) const |
bool | filledFromIndex (int index) const |
Protected Member Functions | |
int | tindex (GmpFemVectorTypes type) const |
Returns the index in _globalVectors for the given type, accounting for the selected vector mode. | |
![]() | |
bool | initTypes (int numVectors, va_list typeList) |
Protected Attributes | |
GmpFemVectorMode | _mode |
The mode defining how many global vectors are stored. | |
GmpFemVectorTypeData * | _globalVectors |
Vector storing data for global vectors. Will store one data set per included type in the vector set when _mode equals VECTOR_MATCH_MODE or a single entry otherwise (even in single debug mode). | |
GmVector * | _printVectors |
Vector with debug global vectors associated to element local vectors when _mode equals VECTOR_SINGLE_DEBUG_MODE. | |
![]() | |
int | _nTypes |
int * | _typeIndex |
int * | _indexType |
bool * | _typeEnabled |
int | _nEnabled |
QStringList | _typeNames |
int | _nVectors |
int | _maxNodes |
GmTLBuffer< double, true > | _vectorMemory |
GmTLBuffer< GmVector, true > | _vectors |
GmTLBuffer< bool, true > | _filled |
A convenience class that builds a GmVectorSet with the types given by GmpFemVectorTypes and also associates a global vector to each element vector stored in the set (it can also associate a single global vector, dissociated with vector types)
Control mode specifying if the vector set should have one global vector per local vector (MATCH_MODE), a single global vector independing of the number of local vectors (SINGLE_MODE) or both: a single global vector + one global vector per configured local vector. This last mode is usefull for debuging purposes only.
void GmpFemVectorSet::addSavedDofVector | ( | GmpFemVectorTypes | type | ) |
Informs the set that the given type requires an auxiliar vector to store saved values for fixed dofs.
The vector will have a size equal to the number of fixed dofs informed in the call to adjustSizes().
This function should be called after initTypes() but before calling adjustSizes().
IMPORTANT: The type MUST belong to the set. In match mode, it can be any of the local vector types added to the vector set. In single and single debug modes, type MUST be equal to GmpFemVector_Eq.
void GmpFemVectorSet::addTransposedDofVector | ( | GmpFemVectorTypes | type | ) |
Informs the set that the given type requires an additional vector to store transposed values when reducing a matrix due to fixed dofs.
The vector will have a size equal to the number of dofs informed in the call to adjustSizes().
This function should be called after initTypes() but before calling adjustSizes().
IMPORTANT: The type MUST belong to the set. In match mode, it can be any of the local vector types added to the vector set. In single and single debug modes, type MUST be equal to GmpFemVector_Eq.
bool GmpFemVectorSet::adjustSizes | ( | int | globalNumDofs, |
int | globalNumFixedDofs, | ||
int | maxElemDofs | ||
) |
Adjusts the sizes of local and global vectors according to the given number of dofs. Can be called more than once to update vector sizes on model changes.
Must be called at least once, after any calls to addTransposedDofVector() and/or addSavedDofVector().
globalNumDofs | The number of free dofs in the system, defining the size of the global vectors. |
globalNumFixedDofs | The number of fixed dofs in the system, defining the size of the saved dofs vectors (if any). |
maxElemDofs | The maximum number of dofs needed by a model element. |
|
inline |
Returns the auxiliar vector used for storing global vectors matching local ones for debug printing purposes when operating in "single debug" mode or the regular vector when operating in "match" mode.
IMPORTANT: The type MUST belong to the set. Can be used only in "single debug" or "match" modes.
|
inline |
Returns the registered vector, identified by its type in the set, for storing saved values for fixed dofs. Will be an empty vector unless addSavedDofVector() has been called for this type.
IMPORTANT: The type MUST belong to the set. In match mode, it can be any of the local vector types added to the vector set. In single and single debug modes, type MUST be equal to GmpFemVector_Eq.
|
inline |
Returns the registered vector, identified by its type in the set, for storing transposed values when reducing a matrix due to fixed dofs. Will be equal to the global vector unless addTransposedDofVector() has been called for this type.
IMPORTANT: The type MUST belong to the set. In match mode, it can be any of the local vector types added to the vector set. In single and single debug modes, type MUST be equal to GmpFemVector_Eq.
|
inline |
Returns a global Vector identified by its type in the set.
IMPORTANT: The type MUST belong to the set. In match mode, it can be any of the local vector types added to the vector set. In single and single debug modes, type MUST be equal to GmpFemVector_Eq.
bool GmpFemVectorSet::initTypes | ( | GmpFemVectorMode | mode, |
int | numVectors, | ||
... | |||
) |
Informs the vector set about the local vector types that will be stored on it. It also creates the set of global vectors tied to the element vectors in the set. The number of effectively stored global vectors follows the given mode.
This function does NOT allocate memory for the vectors. It only prepares the global used structure. Memory allocation is deferred to the adjustSizes() call. Returns false on errors.
IMPORTANT: The vector set initialization must be followed, if needed, by optional calls to addTransposedDofVector() and / or addSavedDofVector() and by a required call to adjustSizes(). The order is important. Calls to the "add" functions MUST be made before adjusting the sizes.
mode | The mode specifying which global vectors should be stored by the set in correspondence to the given set of local vectors. |
numVectors | The number of local vectors stored in the set |
... | The variable list of parameters should contain the types of the stored vectors. The number of parameters should be equal to numVectors. Each value should be a unique type number (between 0 and the maximum number of types given in the constructor) |