![]() |
GemaCoreLib
The GeMA Core library
|
A Gauss index interface always indexing ALL the elements of a mesh, with support for mesh growing. More...
#include <gmGaussIndex.h>
Public Member Functions | |
GmMeshGaussIndex (const GmElementMesh *mesh, int ruleSet) | |
Constructor. The index will only be usable after a call to init() | |
bool | init () |
Initializes the index. Returns false on (memory) errors. | |
bool | addValues (const int *numAddedValues) |
Adds the given number of cells to the index. Returns false on errors. More... | |
bool | addValues (int firstAddedElement) |
Similar to addValues(const int*) but getting the types of the added cells from the mesh. Added elements range from firstAddedElement to the last mesh element. The start offset might overlap with existing index range. | |
void | restoreSize (int oldNumCells) |
Restores the size of the internal index, if necessary, based on the old saved number of cells and integration points. | |
const GmElementMesh * | mesh () const |
Returns the associated mesh. | |
![]() | |
int | numPoints () const |
Returns the number of Gauss points in the index. | |
int | numCells () const |
Returns the number of cells in the index. | |
int | numPoints (int cellId) const |
Returns the number of Gauss points for the given Cell. | |
int | pointIndex (int cellId, int ip) const |
Given a mesh cell index and an integration point index, returns the Gauss point "linear" index, a value between 0 and numPoints()-1. | |
int | cellIp (int gpIndex, int *ip) const |
Given a Gauss point "linear" index (a value from 0 to numPoints()-1), returns the mesh cell index + its integration point index by filling ip. | |
void | clear () |
Clears the index. | |
size_t | usedMemory () const |
Returns the size of the used memory. | |
Private Member Functions | |
bool | addValuesWorker (const int *numAddedValues, int firstAddedElement) |
The work horse for both versions of addValues(). | |
int | numAddedGaussPoints (const int *numTypes, int *pointsPerCell, int *numElem) |
int | numAddedGaussPoints (int firstElement, int *pointsPerCell, int *numElem) |
int | fixedAddedElements (const int *numTypes, int firstElement, int *numElem) const |
For the added elements set, either specified by a vector with the number of added cells per cell type (mesh addCells() style), or by the actual set of elements in the mesh starting with firstElement when numTypes is NULL, returns the fixed number of integration points per cell in the set if it is homogeneous or 0 if not (or if the set is empty). Also fills numElem (if different from NULL) with the number of elements in the set. | |
void | fillOffsetVectorFromMesh (int firstCell=0) |
Fills the offset vector with indices given by the current mesh. Assumes that the vector already has the correct size. If firstCell is different from zero, assumes that the ofsset vector for cells with lower index are ok. | |
void | fillOffsetVectorFromTypes (int firstCell, const int *numTypes, int newFixed) |
Fills the offset vector with indices for the added cells whose types are given by numTypes following the mesh addCells() protocol. Assumes that the vector already has the correct size. If firstCell is different from zero, assumes that the ofsset vector for cells with lower index are ok. If newFixed is different from zero, we know that all numTypes contains a single type with that number of integration points. | |
Private Attributes | |
const GmElementMesh * | _mesh |
The mesh object to which this index is tied to. | |
int | _rule |
The indexed rule set. | |
Additional Inherited Members | |
![]() | |
GmUnfilteredGaussIndexBase () | |
Default empty index constructor. | |
![]() | |
int | _numIp |
The fixed number of integartion points per cell or 0 if index based. | |
int | _numCells |
The number of cells in the index set. | |
QVarLengthArray< int, 2 > | _cellOffset |
A Gauss index interface always indexing ALL the elements of a mesh, with support for mesh growing.
bool GmMeshGaussIndex::addValues | ( | const int * | numAddedValues | ) |
Adds the given number of cells to the index. Returns false on errors.
The numAddedValues parameter should be a list with size equal to GM_NUM_CELL_TYPES, where each entry defines the number of elements of the respective type that will be added to the mesh.
Following the specification in GmCell::addCells(), this function assumes that the new cells where added to the mesh in the order defined by the GmCellType enumeration, i.e, if the numAddedValues list defines that we want 10 new QUAD4 elements and 20 new TRI3 elements, all the QUAD4 elements where added to the mesh before the TRI3 elements since QUAD4 appears before TRI3 in the enumeration.
Important: This function does NOT depend that the new values have been effectivelly added to the mesh, so it can be called before this is effectivelly done in the mesh.