An implementation of the PCR (partition, color and renumbering) object interface. The template parameter is the vector type (should be either GmSingleVector or GmDualVector) forwarded to GmpGemaCR.
More...
|
|
| GmpGemaPCRBase (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) |
| | Default plugin object constructor.
|
| |
| virtual const char * | pluginType () const |
| |
| virtual bool | hasCapability (QString capabilityName) const |
| |
| virtual bool | loadPrivateData (LuaTable &table) |
| | Parses configuration options given by the user to create this PCR object. IMPORTANT: This method is called BOFORE the call to setMesh().
|
| |
| virtual void | printParameters (const GmLogCategory &logger) |
| | Print plugin parameters.
|
| |
| virtual int | numPartitions () const |
| |
| virtual int | partition () const |
| |
| virtual int | numGlobalNodes () const |
| |
| virtual int | numGlobalGhostNodes () const |
| |
| virtual int | numGlobalCells () const |
| |
| virtual GmPCR::CellClass | cellClass (int cellId) const |
| |
| virtual int | cellClassData (int cellId) const |
| |
| virtual int | numCellsInClass (GmPCR::CellClass cellClass) const |
| |
| virtual GmPCR::NodeClass | nodeClass (int nodeId) const |
| |
| virtual int | nodeClassData (int nodeId) const |
| |
| virtual int | numNodesInClass (GmPCR::NodeClass nodeClass, GmCellFillMode mode=GM_CELL_NODES) const |
| |
| virtual int | numRemoteRanks (int templateIndex) const |
| |
| virtual const int * | remoteRanks (int templateIndex) const |
| |
| virtual bool | addPartitionInfoAsMeshAttributes (QString cellAttrPrefix, QString nodeAttrPrefix) |
| |
| virtual bool | addDebugPartitionInfoAsMeshAttributes (QString cellAttrPrefix, QString nodeAttrPrefix) |
| |
| virtual void | printPartitionRankTemplateData (const GmLogCategory &logger) const |
| |
| virtual void | printPartitionClassStatistics (const GmLogCategory &logger) const |
| |
| virtual bool | initPartitions (int numPartitions, int partition) |
| |
| virtual bool | initNodeMapping (GmValueAccessor *ac, bool ghost, bool *renumbered, QMap< int, int > &partOrigToLocOrder) |
| | Overload of initNodeMapping from the base class to adjust class data if nodes where further renumbered.
|
| |
| virtual bool | initCellMapping (bool *renumbered, QMap< int, int > &partOrigToLocOrder, QVector< int > &partLocToOrigOrder) |
| | Overload of initCellMapping from the base class to adjust class data if cells where further renumbered.
|
| |
| virtual bool | addNodes (int numNodes) |
| |
| virtual bool | addGhostNodes (int numGhostNodes) |
| |
| virtual bool | addCells (int numCells) |
| |
| virtual void | clear () |
| |
| virtual bool | addStateGeometryData (GmStateDump *state, int groupId) |
| |
| virtual bool | fillDumpControlMapData (QVariantMap *map, const GmLogCategory &logger) |
| |
| virtual bool | dumpControlMapDataLoaded (QVariantMap *map, const GmLogCategory &logger) |
| |
|
| GmpGemaCRBase (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) |
| | Default plugin object constructor.
|
| |
|
virtual | ~GmpGemaCRBase () |
| | Virtual destructor.
|
| |
| virtual const char * | pluginName () const |
| |
| virtual GmMesh * | mesh () const |
| |
| virtual bool | setMesh (GmMesh *mesh) |
| | Associates this PCR object with a mesh. Returns false on errors.
|
| |
| virtual size_t | printMemoryStatistics (const GmLogCategory &logger, GmLogLevel level) const |
| | Prints memory usage for this PCR object to the given logger. Returns the used memory as reported by usedMemory()
|
| |
| virtual size_t | usedMemory () const |
| | Returns an estimate of the used memory by the PCR object. This does not includes fixed (small) sizes.
|
| |
| virtual bool | skipRemote () const |
| |
| virtual ColorType | coloringType () const |
| |
| virtual ColorState | coloringState (const GmCellGroupSet *gs) |
| |
| virtual const QVector< GmCellGroupSet * > & | coloredSets (const GmCellGroupSet *gs) |
| |
| virtual const GmCellGroupSet * | sequentialSet (const GmCellGroupSet *gs) |
| |
| virtual const QVector< GmCellGroupSet * > & | coloredHaloSets (const GmCellGroupSet *gs) |
| |
| virtual const GmCellGroupSet * | sequentialHaloSet (const GmCellGroupSet *gs) |
| |
| virtual bool | addColoringAsMeshAttribute (const GmCellGroupSet *gs, QString attrName) |
| |
| virtual bool | addColoringAsMeshAttribute (const QVector< const GmCellGroupSet * > &gsets, QString attrName) |
| |
| virtual void | printColoringStatistics (const GmLogCategory &logger) const |
| |
| virtual bool | nodesRenumbered () const |
| |
| virtual bool | cellsRenumbered () const |
| |
| virtual int | originalToLocalOrderNode (int originalNodeId) const |
| |
| virtual int | originalToLocalOrderGeomNode (int originalNodeId) const |
| |
| virtual int | originalToLocalOrderGhostNodeHighSet (int originalNodeId) const |
| |
| virtual int | originalToLocalOrderGhostNodeHighClear (int originalNodeId) const |
| |
| virtual int | localOrderToOriginalNode (int nodeId) const |
| |
| virtual int | localOrderToOriginalGeomNode (int nodeId) const |
| |
| virtual int | localOrderToOriginalGhostNodeHighSet (int nodeId) const |
| |
| virtual int | localOrderToOriginalGhostNodeHighClear (int nodeId) const |
| |
| virtual int | originalToLocalOrderCell (int originalCellId) const |
| |
| virtual int | localOrderToOriginalCell (int cellId) const |
| |
|
| MAKE_SR_FUNCTION (originalToLocalOrderNode, nodeClass, REMOTE_NODE) |
| |
|
| MAKE_SR_FUNCTION (originalToLocalOrderGeomNode, nodeClass, REMOTE_NODE) |
| |
|
| MAKE_SR_FUNCTION (originalToLocalOrderGhostNodeHighSet, nodeClass, REMOTE_NODE) |
| |
|
| MAKE_SR_FUNCTION (originalToLocalOrderGhostNodeHighClear, nodeClass, REMOTE_NODE) |
| |
|
| MAKE_SR_FUNCTION (originalToLocalOrderCell, cellClass, REMOTE_HALO_CELL) |
| |
| virtual int | originalNodeTraversalOrder (int i) const |
| |
| virtual int | originalCellTraversalOrder (int i) const |
| |
| virtual QStringList | cellMappingRequiredGroups () |
| |
|
| GmPCR (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) |
| |
| virtual const char * | pluginCategory () const |
| |
| virtual int | originalToLocalOrderNodeSR (int originalNodeId) const=0 |
| |
| virtual int | originalToLocalOrderGeomNodeSR (int originalNodeId) const=0 |
| |
| virtual int | originalToLocalOrderGhostNodeHighSetSR (int originalNodeId) const=0 |
| |
| virtual int | originalToLocalOrderGhostNodeHighClearSR (int originalNodeId) const=0 |
| |
| virtual int | originalToLocalOrderCellSR (int originalCellId) const=0 |
| |
|
| GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) |
| |
|
QString | id () const |
| |
|
QString | description () const |
| |
|
QString | pluginTypeName () const |
| |
|
| virtual size_t | partitionMemory () const |
| | Returns an estimate of the memory used by the partition structures.
|
| |
|
bool | initMappingFromPartition (const IntVector &cells, const IntVector &geomNodes, const IntVector &ghostNodes) |
| | Initializes the renumbering structures from the partition information given by the cells, geomNodes and ghostNodes parameters. They contain an ordered set of the cells and nodes from the original mesh that belong to the current partition.
|
| |
|
virtual size_t | nodeRenumberMemory () const |
| | Returns an estimate of the used memory by the node renumbering structures.
|
| |
|
virtual size_t | cellRenumberMemory () const |
| | Returns an estimate of the used memory by the cell renumbering structures.
|
| |
|
virtual size_t | colorMemory () const |
| | Returns an estimate of the used memory by cell group colorings.
|
| |
|
GmValueAccessor * | addNodeAttributeToMesh (QString name, QString description, GmStorageType type) |
| | Adds to the mesh a new node attribute, with default value equal to -1 and the given name, description and data type. Returns an accessor for the new attribute or NULL on error.
|
| |
|
GmCellAccessor * | addCellAttributeToMesh (QString name, QString description, GmStorageType type) |
| | Like addNodeAttributeToMesh() but adding a cell attribute.
|
| |
|
virtual const GmLogCategory & | logger () const |
| |
|
GmSimulationData * | simulationData () const |
| |
|
|
int | nodeData (int nodeId) const |
| | Returns the value stored in _nodeClass or in _ghostClass depending on the given id.
|
| |
|
bool | classifyNodesAndCells (ClassData *cd, int partition, const QVector< int > &cellPartition) const |
| | Creates the cell and node classification for the given partition, filling cd.
|
| |
| bool | classifyCells (ClassData *cd, int partition, const QVector< int > &cellPartition, RankTemplateBuilder *builder) const |
| | Classifies cells belonging to the given partition, filling cd->_cells and cd->_cellClass in sync. cd->_rankTemplates is updated by way of the given template builder. cd->_cells (and matching _cellClass) is filled ordered by cell id. Returns true on success, false on out of memory situations.
|
| |
| bool | classifyNodes (ClassData *cd, int partition, const QVector< int > &cellPartition, RankTemplateBuilder *builder) const |
| | Traverses all cells from cd, including their used geometric and ghost nodes in cd->_nodes and cd->_ghosts. It also classifies nodes, filling cd->_nodeClass and cd->_cellClass. cd->_rankTemplates is updated by way of the given template builder. Returns true on success, false on out of memory situations.
|
| |
|
bool | adjustClassDataNodeOrder (ClassData *cd, bool ghost, const QMap< int, int > &partOrigToLocOrder) const |
| | Updates the order of nodes/ghost nodes in cd to match the new cell order after a node renumbering.
|
| |
|
bool | adjustClassDataCellOrder (ClassData *cd, const QMap< int, int > &partOrigToLocOrder) const |
| | Updates the order of cells in cd to match the new cell order after a cell renumbering.
|
| |
|
template<template< class > class V, class T , class F > |
| bool | adjustVector (V< T > &vector, F op) const |
| | Helper function used to reorder the contents of the given vector according to the mapping given by newToOld. Returns false if it could not allocate memory for the required temporary vector. The newToOld function should return an index from the new local vector and returns where that information existed in the old vector. Assumes that the given vector has just one buffer, even if it is an instance of GmDualVector.
|
| |
|
bool | addAndInitClassDataVector (ShortVector &v, int numAddedEntries, int val) const |
| | Add num entries to the given vector and init them with the given value. Does nothing if in debug mode.
|
| |
|
bool | auxTemplateBufferLoaded (const GmLogCategory &logger) |
| | Method called after filling _templateDumpData when loading data from the dump.
|
| |
|
void | releaseDumpMemory () |
| | Releases temporary buffers used for dumping.
|
| |
|
|
int | _numPartitions |
| | The number of mesh partitions. Will always equal 1 in debug mode.
|
| |
|
int | _partition |
| | The number of my partition (rank)
|
| |
|
int | _numGlobalNodes |
| | The number of geometric nodes on the mesh, before partitioning.
|
| |
|
int | _numGlobalGhostNodes |
| | The number of ghost nodes on the mesh, before partitioning.
|
| |
|
int | _numGlobalCells |
| | The number of cells on the mesh, before partitioning.
|
| |
|
GmpPartitionMethod * | _partitionMethod |
| | The configured partitioning object. Can be NULL if the user explicitly requested for no partitioning.
|
| |
|
bool | _haloSides |
| | If set to true, a cell belongs to the halo if one of its sides is shared with a remote cell. If false, sharing a node is enough.
|
| |
|
bool | _remoteHalo |
| | When set to true, includes the remote halo (remote cells adjacent to the partition halo cells) in the partition mesh.
|
| |
|
bool | _debugMode |
| | When the debug mode is turned on, the partition algorithm will be executed and cells will be classified, but the mesh will not be changed.
|
| |
|
QVector< ClassData * > | _rankClassData |
| | A vector with class data for each partition. Filled only if _debugMode is true.
|
| |
|
ClassData | _classData |
| | The data set for the current partition. Filled only if _debugMode is false and _numPartitions > 1.
|
| |
|
int * | _templateDumpData |
| | A vector storing a temporary serialized version of _classData._rankTemplates, needed for dumping code. If different from NULL, for a template list with 'n' entries,
it stores n integers with the size of each template, followed by the each template rank data in sequence.
|
| |
|
int | _templateDumpDataSize |
| | The size of the vector _templateDumpData.
|
| |
|
| enum | CellClass |
| |
| enum | NodeClass |
| |
| enum | ColorType |
| |
| enum | ColorState |
| |
|
| MY_CELL |
| |
|
| MY_HALO_CELL |
| |
|
| REMOTE_HALO_CELL |
| |
|
| MY_NODE |
| |
|
| REMOTE_NODE |
| |
|
| MY_HALO_NODE |
| |
|
| REMOTE_HALO_NODE |
| |
|
| NO_COLORING |
| |
|
| FEM_COLORING |
| |
|
| FVM_COLORING |
| |
|
| COLORED |
| |
|
| COLORED_WITH_HALO |
| |
|
| NOT_COLORED |
| |
|
| NOT_SET |
| |
|
using | IntVector |
| | A Vector<int>
|
| |
|
using | IntVectorOrMap |
| | A Vector<int> for Partition = false and a QMap<int, int> for Partition = true.
|
| |
|
using | PartitionT |
| |
|
QVariantMap | _options |
| | The set of user options.
|
| |
|
GmMesh * | _mesh |
| | The associated cell mesh.
|
| |
|
ColorType | _coloringType |
| | The type of coloring produced by this object.
|
| |
|
bool | _nodeRenumberRequested |
| | Is node renumbering requested by the user? Can be false even if Partition is true.
|
| |
|
bool | _cellRenumberRequested |
| | Is cell renumbering requested by the user? Can be false even if Partition is true.
|
| |
|
bool | _isNodeRenumbered |
| | Have we renumbered the set of nodes? Always true if the mesh was partitioned.
|
| |
|
bool | _isCellRenumbered |
| | Have we renumbered the set of cell? Always true if the mesh was partitioned.
|
| |
|
bool | _skipRemote |
| | A flag set to true by GmpGemaPCR if the mesh was partitioned, includes remote halo cells AND the keepRemote user option is false.
|
| |
|
QMap< const GmCellGroupSet *, GmpColorData * > | _gsColorMap |
| | Map storing coloring data for each registered group set.
|
| |
|
GmpColorData * | _noColorData |
| | The GmpColorData object if coloring is disabled.
|
| |
|
GmpColoringMethod * | _colorMethod |
| | The configured coloring object.
|
| |
|
GmpNodeRenumberingMethod< IntVector > * | _nodeRenumberMethod |
| | The configured node reordering object.
|
| |
|
GmpCellRenumberingMethod< IntVector > * | _cellRenumberMethod |
| | The configured cell reordering object.
|
| |
|
int | _numGeomNodes |
| | Cached value for _mesh->numNodes(). Updated whenever new geometry nodes are added to the mesh.
|
| |
|
int | _numOriginalGeomNodes |
| | Cached value for _mesh->numGlobalNodes(). If Partition is false, this is effectively equal to _numGeomNodes and is updated whenever new geometry nodes are added to the mesh. If Partition is true, this value is fixed since we are not currently assigning new global numbers to the nodes added to the mesh. See comments on the class documentation.
|
| |
|
IntVector | _localToOriginalGeomNode |
| | A vector mapping local geometry node numbers to original node numbers. Size equal to _mesh->numNodes(). For nodes added to the mesh at runtime, the stored original node index will be either equal to the local index (Partition = false) or -1 (Partition = true). See comments on the class documentation. Empty if node renumbering is disabled.
|
| |
|
IntVectorOrMap | _originalToLocalGeomNode |
| | If Partition is false, stores a vector indexed by original geometry node numbers, storing their local node numbers. Size equal to _mesh->numNodes(). If Partition is true, the vector is replaced by a map since the known set of original node numbers for this partition might not be continuous. Its contents includes both the geometry nodes owned by
this partition and halo geometry nodes owned by other partitions (shared with this one). Empty if node renumbering is disabled.
|
| |
|
IntVector | _localToOriginalCell |
| | A vector mapping local cell numbers to original cell numbers. Size equal to _mesh->numCells(). Empty if cell renumbering is disabled.
|
| |
|
IntVectorOrMap | _originalToLocalCell |
| | If Partition is false, stores a vector indexed by original cell numbers, storing their local cell numbers. Size equal to _mesh->numCells(). If Partition is true, the vector is replaced by a map since the known set of original cell
numbers for this partition might not be continuous. Its contents includes both the cells owned by this partition and halo cells owned by other partitions that are adjacent to this one. Empty if cell renumbering is disabled.
|
| |
|
PartitionT | _part |
| | Structure storing extra vectors needed when Partition is true, empty otherwise.
|
| |
template<template< class > class Vector>
class GmpGemaPCRBase< Vector >
An implementation of the PCR (partition, color and renumbering) object interface. The template parameter is the vector type (should be either GmSingleVector or GmDualVector) forwarded to GmpGemaCR.
template<template< class > class Vector>
Classifies cells belonging to the given partition, filling cd->_cells and cd->_cellClass in sync. cd->_rankTemplates is updated by way of the given template builder. cd->_cells (and matching _cellClass) is filled ordered by cell id. Returns true on success, false on out of memory situations.
Traverses all cells. If a cell belongs to the partition, it is classified into MY_CELL or MY_HALO_CELL by checking if the cell has any neighbors belonging to a different partition. If _haloSides is true, two cells are neighbors if they share a side. Otherwise, sharing a node with a "remote" cell is enough.
If _remoteHalo is true, traverses halo cells from cd and includes their neighbors into cd->_cells and cd->_cellClass. For REMOTE_HALO_CELL discovery, neighborhood is defined by sharing a node and is NOT influenced by _haloSides (notice that identifying remote halo cells is done together with the first cell traversal)
This seemingly inconsistent behaviour regarding neighborhood definition derives from the usage of halo cells and remote halo cells. The first are mainly used for solver algorithms and match the needs of the numerical methods, like FEM (node neighborhood) or FVM (side neighborhood). The second are mainly used to allow for topological queries for halo cells, and so must include the possibility of node based queries.
template<template< class > class Vector>
Parses configuration options given by the user to create this PCR object. IMPORTANT: This method is called BOFORE the call to setMesh().
Parsed fields: coloringType - Expected values: "fem", "fvm" or "no". Must be present. orderNodes - Boolean. Default when missing is the value of the orderNodes model option. orderCells - Boolean. Default when missing is the value of the orderCells model option.
If Partition is true, the orderNodes and orderCells options control whether nodes and cells will be further renumbered to achieve locality after the mesh partition. Remaining fields (like colorCheck) are interpreted by the coloring / renumber algorithms.
Reimplemented from GmpGemaCRBase< Vector, true >.