24 #ifndef _GEMA_PLUGIN_FEM_MATRIX_SET_H_ 25 #define _GEMA_PLUGIN_FEM_MATRIX_SET_H_ 77 bool adjustSizes(
int globalNumDofs,
int maxElemDofs,
bool sparseLayoutChanged);
83 void setNumThreads(
int nthreads) { assert(_nthreads >= -1); _nthreads = nthreads; }
87 void clearGlobalMatrices(
bool keepSparseLayout);
89 bool supportsBatchInsert()
const;
90 bool beginBatchInsert(
size_t expectedEntries = 0);
91 bool endBatchInsert(
bool discardData);
93 bool supportsSparseLayouts()
const;
95 bool emptyLayout()
const;
111 assert((_mode == MATRIX_MATCH_MODE &&
index(type) >= 0) || (_mode != MATRIX_MATCH_MODE && type ==
GmpFemMatrix_Eq));
112 return _globalMatrices[tindex(type)]._data;
118 assert(_mode == MATRIX_MATCH_MODE && index >= 0 && index < _nMatrices);
119 return _globalMatrices[
index]._data;
134 assert((_mode == MATRIX_MATCH_MODE &&
index(type) >= 0) || (_mode != MATRIX_MATCH_MODE && type ==
GmpFemMatrix_Eq));
135 return _globalMatrices[tindex(type)]._transposed;
147 assert(_mode == MATRIX_MATCH_MODE && index >= 0 && index < _nMatrices);
148 return _globalMatrices[
index]._transposed;
158 assert(_mode != MATRIX_SINGLE_MODE &&
index(type) >= 0);
159 return (_mode == MATRIX_MATCH_MODE) ? _globalMatrices[
index(type)]._data : _printMatrices[
index(type)];
167 assert(_mode != MATRIX_SINGLE_MODE && index >= 0 && index < _nMatrices);
168 return (_mode == MATRIX_MATCH_MODE) ? _globalMatrices[
index]._data : _printMatrices[
index];
The M matrix in the general equation M u" + C u' + K u = f.
Definition: gmpFemMatrixSet.h:44
GmpFemVectorTypes
Predefined names for vectors used in finite element solvers together with control procedures.
Definition: gmpFemVectorSet.h:32
GmpFemMatrixTypeData()
Constructor.
Definition: gmpFemMatrixSet.h:197
int transposedDofVectorFromIndex(int index) const
Returns the registered vector type for storing transposed values when reducing a matrix due to fixed ...
Definition: gmpFemMatrixSet.h:145
Set stores one global matrix per local matrix.
Definition: gmpFemMatrixSet.h:69
GmpFemMatrixTypes
Predefined names for matrices used in finite element solvers together with control procedures.
Definition: gmpFemMatrixSet.h:39
GmSolverMatrix * globalMatrixFromIndex(int index) const
Returns a global matrix identified by its index in the set. Can NOT be used for "single" or "single d...
Definition: gmpFemMatrixSet.h:116
The equivalent matrix when merging values into a single global matrix.
Definition: gmpFemMatrixSet.h:41
bool supportsParallelAdd() const
Returns true if the solver matrices support parallel assembling (supportedParallelAddMode() !...
Definition: gmpFemMatrixSet.h:98
const GmNumSolver * _solver
The solver used to create global matrices.
Definition: gmpFemMatrixSet.h:184
int index(int type) const
int _nthreads
The configured number of threads that should be used by sparse matrices in batch mode/layout operatio...
Definition: gmpFemMatrixSet.h:185
Set stores a single "equivalent" global matrix.
Definition: gmpFemMatrixSet.h:70
GmpFemMatrixMode mode() const
Returns the mode defining the global matrices stored by the set.
Definition: gmpFemMatrixSet.h:172
int transposedDofVector(GmpFemMatrixTypes type) const
Returns the registered vector type for storing transposed values when reducing a matrix due to fixed ...
Definition: gmpFemMatrixSet.h:132
Aux structure storing the matrix associated with a matrix type.
Definition: gmpFemMatrixSet.h:191
A convenience class that builds a GmMatrixSet with the types given by GmpFemMatrixTypes and also asso...
Definition: gmpFemMatrixSet.h:56
Declaration of the GmpFemVectorSet class.
GmSolverMatrix * _data
The data matrix.
Definition: gmpFemMatrixSet.h:193
bool _parallelSupport
Do solver matrices support parallel assembling ?
Definition: gmpFemMatrixSet.h:187
bool needsLocking() const
Returns true if the solver matrices needs external locking for parallel assembling (supportedParallel...
Definition: gmpFemMatrixSet.h:101
GmpFemMatrixTypes femTypeFromIndex(int index) const
Given a matrix index, returns its type as a GmpFemMatrixTypes. Equivalent to GmMatrixSet::typeFromInd...
Definition: gmpFemMatrixSet.h:175
GmSolverMatrix ** _printMatrices
Vector with debug global matrices associated to element local matrices when _mode equals MATRIX_SINGL...
Definition: gmpFemMatrixSet.h:212
The C matrix in the general equation M u" + C u' + K u = f (u" = d2u/dt2)
Definition: gmpFemMatrixSet.h:43
The K matrix in the general equation M u" + C u' + K u = f (u' = du/dt)
Definition: gmpFemMatrixSet.h:42
GmSolverMatrix * globalMatrix(GmpFemMatrixTypes type) const
Returns a global matrix identified by its type in the set.
Definition: gmpFemMatrixSet.h:109
bool adjustSizes(int maxNodes)
bool initTypes(int numMatrices, va_list typeList)
GmpFemMatrixTypeData * _globalMatrices
Vector storing data for global matrices. Will store one data set per included type in the matrix set ...
Definition: gmpFemMatrixSet.h:207
Set stores an "equivalent" global matrix + another matrix per local matrix for debug purposes.
Definition: gmpFemMatrixSet.h:71
GmSolverMatrix * globalDebugPrintMatrixFromIndex(int index) const
Returns the auxiliar matrix used for storing global matrices matching local ones for debug printing p...
Definition: gmpFemMatrixSet.h:165
bool _needsLock
Do solver matrices needs external locking for parallel assembling ?
Definition: gmpFemMatrixSet.h:188
GmpFemMatrixMode _mode
The mode defining how many global matrices are stored.
Definition: gmpFemMatrixSet.h:183
void setNumThreads(int nthreads)
Sets the number of threads used by sparse matrices in batch/layout operations. Default is the number ...
Definition: gmpFemMatrixSet.h:83
GmpFemMatrixMode
Control mode specifying if the matrix set should have one global matrix per local matrix (MATCH_MODE)...
Definition: gmpFemMatrixSet.h:67
Declaration of usefull configuration definitions for the plugin library.
~GmpFemMatrixTypeData()
Destructor.
Definition: gmpFemMatrixSet.h:200
int typeFromIndex(int index) const
int tindex(GmpFemMatrixTypes type) const
Returns the index in _globalMatrices for the given type, accounting for the selected matrix mode.
Definition: gmpFemMatrixSet.h:181
GmSolverMatrix * globalDebugPrintMatrix(GmpFemMatrixTypes type) const
Returns the auxiliar matrix used for storing global matrices matching local ones for debug printing p...
Definition: gmpFemMatrixSet.h:156
int _transposed
The type of the associated transposed dofs vector or -1 if no vector was associated with this type.
Definition: gmpFemMatrixSet.h:194