24#ifndef _GEMA_PLUGIN_FEM_VECTOR_SET_H_
25#define _GEMA_PLUGIN_FEM_VECTOR_SET_H_
69 bool initTypes (GmpFemVectorMode mode,
int numVectors, ...);
70 bool adjustSizes(
int globalNumDofs,
int globalNumFixedDofs,
int maxElemDofs);
75 void clearGlobalVectors();
85 assert((_mode == VECTOR_MATCH_MODE &&
index(type) >= 0) || (_mode != VECTOR_MATCH_MODE && type ==
GmpFemVector_Eq));
86 return _globalVectors[tindex(type)]._data;
92 assert(_mode == VECTOR_MATCH_MODE && index >= 0 && index < _nVectors);
93 return _globalVectors[
index]._data;
106 assert((_mode == VECTOR_MATCH_MODE &&
index(type) >= 0) || (_mode != VECTOR_MATCH_MODE && type ==
GmpFemVector_Eq));
107 return *(_globalVectors[tindex(type)]._transposed);
116 assert(_mode == VECTOR_MATCH_MODE && index >= 0 && index < _nVectors);
117 return *(_globalVectors[
index]._transposed);
129 assert((_mode == VECTOR_MATCH_MODE &&
index(type) >= 0) || (_mode != VECTOR_MATCH_MODE && type ==
GmpFemVector_Eq));
130 return _globalVectors[tindex(type)]._saved;
139 assert(_mode == VECTOR_MATCH_MODE && index >= 0 && index < _nVectors);
140 return _globalVectors[
index]._saved;
150 assert(_mode != VECTOR_SINGLE_MODE &&
index(type) >= 0);
151 return (_mode == VECTOR_MATCH_MODE) ? _globalVectors[
index(type)]._data : _printVectors[
index(type)];
159 assert(_mode != VECTOR_SINGLE_MODE && index >= 0 && index < _nVectors);
160 return (_mode == VECTOR_MATCH_MODE) ? _globalVectors[
index]._data : _printVectors[
index];
196 if(_transposed != &_data)
197 _transposed->zeros();
bool initTypes(int numVectors, va_list typeList)
int index(int type) const
bool adjustSizes(int maxNodes)
int typeFromIndex(int index) const
A convenience class that builds a GmVectorSet with the types given by GmpFemVectorTypes and also asso...
Definition gmpFemVectorSet.h:50
GmVector & globalDebugPrintVectorFromIndex(int index) const
Returns the auxiliar vector used for storing global vectors matching local ones for debug printing pu...
Definition gmpFemVectorSet.h:157
GmpFemVectorMode _mode
The mode defining how many global vectors are stored.
Definition gmpFemVectorSet.h:175
GmVector & globalDebugPrintVector(GmpFemVectorTypes type) const
Returns the auxiliar vector used for storing global vectors matching local ones for debug printing pu...
Definition gmpFemVectorSet.h:148
GmVector & globalSavedDofVector(GmpFemVectorTypes type) const
Returns the registered vector, identified by its type in the set, for storing saved values for fixed ...
Definition gmpFemVectorSet.h:127
GmpFemVectorTypes femTypeFromIndex(int index) const
Given a vector index, returns its type as a GmpFemVectorTypes. Equivalent to GmVectorSet::typeFromInd...
Definition gmpFemVectorSet.h:167
GmpFemVectorMode mode() const
Returns the mode defining the global vectors stored by the set.
Definition gmpFemVectorSet.h:164
GmVector & globalTransposedDofVectorFromIndex(int index) const
Returns the registered vector, identified by its index in the set, for storing transposed values when...
Definition gmpFemVectorSet.h:114
GmVector & globalTransposedDofVector(GmpFemVectorTypes type) const
Returns the registered vector, identified by its type in the set, for storing transposed values when ...
Definition gmpFemVectorSet.h:104
GmpFemVectorMode
Control mode specifying if the vector set should have one global vector per local vector (MATCH_MODE)...
Definition gmpFemVectorSet.h:61
@ VECTOR_MATCH_MODE
Set stores one global vector per local vector.
Definition gmpFemVectorSet.h:62
@ VECTOR_SINGLE_MODE
Set stores a single "equivalent" global vector.
Definition gmpFemVectorSet.h:63
@ VECTOR_SINGLE_DEBUG_MODE
Set stores an "equivalent" global vector + another vector per local vector for debug purposes.
Definition gmpFemVectorSet.h:64
GmVector & globalVectorFromIndex(int index) const
Returns a global Vector identified by its index in the set. Can NOT be used for "single" or "single d...
Definition gmpFemVectorSet.h:90
GmVector * _printVectors
Vector with debug global vectors associated to element local vectors when _mode equals VECTOR_SINGLE_...
Definition gmpFemVectorSet.h:210
int tindex(GmpFemVectorTypes type) const
Returns the index in _globalVectors for the given type, accounting for the selected vector mode.
Definition gmpFemVectorSet.h:173
GmpFemVectorTypeData * _globalVectors
Vector storing data for global vectors. Will store one data set per included type in the vector set w...
Definition gmpFemVectorSet.h:205
GmVector & globalSavedDofVectorFromIndex(int index) const
Returns the registered vector, identified by its index in the set, for storing saved values for fixed...
Definition gmpFemVectorSet.h:137
GmVector & globalVector(GmpFemVectorTypes type) const
Returns a global Vector identified by its type in the set.
Definition gmpFemVectorSet.h:83
Declaration of useful configuration definitions for the plugin library.
GmpFemVectorTypes
Predefined names for vectors used in finite element solvers together with control procedures.
Definition gmpFemVectorSet.h:33
@ GmpFemVector_RHS
The right hand side vector in the general equation.
Definition gmpFemVectorSet.h:37
@ GmpFemVector_Fe
The external force vector Fe in the general equation Fi(u, u', u'') = Fe(t) (u' = du/dt)
Definition gmpFemVectorSet.h:35
@ GmpFemVector_Fi
The internal force vector Fi in the general equation Fi(u, u', u'') = Fe(t) (u' = du/dt)
Definition gmpFemVectorSet.h:36
@ GmpFemVector_Eq
The equivalent force vector when merging values into a single global vector.
Definition gmpFemVectorSet.h:34
Aux structure storing the vectors associated with a vector type.
Definition gmpFemVectorSet.h:179
bool _hasSaved
Flag used to distinguish if an empty _saved vector is due to no saved vector or to a 0 fixed dof sett...
Definition gmpFemVectorSet.h:183
GmVector _data
The data vector.
Definition gmpFemVectorSet.h:180
GmVector _saved
The saved fixed dofs vector. Can be empty.
Definition gmpFemVectorSet.h:182
void zeros()
Clears all vectors, filling them with zeros.
Definition gmpFemVectorSet.h:192
~GmpFemVectorTypeData()
Destructor.
Definition gmpFemVectorSet.h:189
GmVector * _transposed
The transposed vector. Either points to _data or to a new vector.
Definition gmpFemVectorSet.h:181
GmpFemVectorTypeData()
Constructor.
Definition gmpFemVectorSet.h:186