GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmPCR Class Referenceabstract

Base interface class for Partition-Color-Renumber object plugins. More...

#include <gmPCR.h>

Inheritance diagram for GmPCR:
Collaboration diagram for GmPCR:

Public Types

enum  CellClass { MY_CELL = 0 , MY_HALO_CELL = GM_PCR_HALO_BIT , REMOTE_HALO_CELL = GM_PCR_REMOTE_BIT | GM_PCR_HALO_BIT }
 Cell classification enum. More...
 
enum  NodeClass { MY_NODE = 0 , REMOTE_NODE = GM_PCR_REMOTE_BIT , MY_HALO_NODE = GM_PCR_HALO_BIT , REMOTE_HALO_NODE = GM_PCR_REMOTE_BIT | GM_PCR_HALO_BIT }
 Node classification enum. More...
 
enum  ColorType { NO_COLORING , FEM_COLORING , FVM_COLORING }
 Type of coloring. More...
 
enum  ColorState { COLORED , COLORED_WITH_HALO , NOT_COLORED , NOT_SET }
 State of a coloring operation. More...
 

Public Member Functions

 GmPCR (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmPCR ()
 Virtual destructor.
 
virtual const char * pluginCategory () const
 Returns the plugin category.
 
virtual bool hasCapability (QString capabilityName) const =0
 This function should return true or false to indicate whether the PCR object supports the requested capability or not. Capabilities are referred by string names in order to enable derived interfaces to extend the available capabilities that can be queried.
 
virtual GmMeshmesh () const =0
 Returns the mesh that this PCR object is tied to.
 
virtual bool setMesh (GmMesh *mesh)=0
 Function called by the mesh to establish that this PCR object is tied to the given mesh. Can only be called once. This information can NOT be included in the set of PCR attributes due to the need of the mesh also referencing the PCR object. Returns false if the mesh type is incompatible with the PCR object configuration (ex: a node mesh for a PCR object configured for coloring).
 
virtual void printParameters (const GmLogCategory &logger)
 Asks the PCR object to print all of its parameters using the provided logger.
 
virtual size_t printMemoryStatistics (const GmLogCategory &logger, GmLogLevel level) const =0
 Prints memory usage for the PCR object to the given logger. Returns the used memory as reported by usedMemory()
 
virtual size_t usedMemory () const =0
 Returns the approximate memory used for storing the PCR data structures.
 
virtual int numPartitions () const =0
 Returns the number of partitions for the mesh. Will return 1 if the mesh was not partitioned.
 
virtual int partition () const =0
 Returns the number of the selected partition for the current mesh. Will return 0 if the mesh was not partitioned.
 
virtual int numGlobalNodes () const =0
 When working with partitioned meshes, returns the number of nodes in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numNodes().
 
virtual int numGlobalGhostNodes () const =0
 When working with partitioned meshes, returns the number of ghost nodes in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numGhostNodes().
 
virtual int numGlobalCells () const =0
 When working with partitioned meshes, returns the number of cells in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numCells().
 
virtual CellClass cellClass (int cellId) const =0
 Returns the cell class for the given cell. Will return MY_CELL if the mesh was not partitioned.
 
virtual int cellClassData (int cellId) const =0
 
virtual int numCellsInClass (CellClass cellClass) const =0
 Returns the number of cells in the mesh that are classified in the given cellClass.
 
virtual NodeClass nodeClass (int nodeId) const =0
 Returns the node class for the given node. Will return MY_NODE if the mesh was not partitioned. For ghost nodes, cellId can be either a linear index or a value with the ghost bit set.
 
virtual int nodeClassData (int nodeId) const =0
 
virtual int numNodesInClass (NodeClass nodeClass, GmCellFillMode mode=GM_CELL_NODES) const =0
 Returns the number of nodes in the mesh that are classified in the given nodeClass. The mode parameter defines if the statistics apply to geometry nodes (mode = GM_CELL_NODES or GM_CELL_VERTICES), ghost nodes (mode == GM_CELL_GHOST) or both (mode == GM_CELL_ALL)
 
virtual int numRemoteRanks (int templateIndex) const =0
 Returns the number of remote ranks sharing the local cell / node for the given template index.
 
virtual const int * remoteRanks (int templateIndex) const =0
 Returns a vector with size equal to numRemoteRanks(templateIndex) storing the ranks (partitions) sharing the local cell / node for the given template index.
 
virtual bool skipRemote () const =0
 Returns true if the mesh was partitioned, includes remote halo cells and the PCR object was configured to skip remote cells and nodes from being included in cell groups, borders, node sets and boundary conditions.
 
virtual bool addPartitionInfoAsMeshAttributes (QString cellAttrPrefix, QString nodeAttrPrefix)=0
 Adds to the mesh a set of new node and cell attributes with information on node and cell classes plus their associated data. Does nothing if the mesh was not partitioned and returns false. Returns true if the attributes were added to the mesh.
 
virtual bool addDebugPartitionInfoAsMeshAttributes (QString cellAttrPrefix, QString nodeAttrPrefix)=0
 Similar to addPartitionInfoAsMeshAttributes() but adding extra cell and node attributes named by the given prefix + "Owner" will store the partition that owns the node / cell. Partition indices are 1-based (and not 0-based as mpi ranks). Also, there will be a "Class" and a "Data" attribute per partition with the partition number as suffix. This attributes will be added only if the partitioning was done in "debug" mode for gathering the partition information but skipping changing the mesh. Class and data values for nodes and cells not belonging to a partition are filled with -1.
 
virtual void printPartitionRankTemplateData (const GmLogCategory &logger) const =0
 Helper debug function to print the rank template data.
 
virtual void printPartitionClassStatistics (const GmLogCategory &logger) const =0
 Helper debug function to print class statistics. In "debug mode" prints the statistics for all partitions.
 
virtual ColorType coloringType () const =0
 Returns the type of coloring for this PCR object.
 
virtual ColorState coloringState (const GmCellGroupSet *gs)=0
 Returns the coloring state for the given cell group. Will trigger the coloring algorithm if the given group has not been colored before. Important: The group set mesh must be the same mesh associated with this object.
 
virtual const QVector< GmCellGroupSet * > & coloredSets (const GmCellGroupSet *gs)=0
 Returns the set of colored cell sub-groups for the given cell group. Within each sub-group, cells follow the rules defined by the coloring type. Will trigger the coloring algorithm if the given group has not been colored before. Returns an empty vector if there was an error coloring this set. The cell sub-groups are disjoint and their union with the sets returned by sequentialSet(), coloredHaloSets() and sequentialHaloSet() is equal to the given cell group. Important: The group set mesh must be the same mesh associated with this object. Important 2: The colored group sets MUST NOT be registered at the mesh since they don't have associated group sets. The standard GmpGemaCR class also EXPECTS this restriction to be enforced.
 
virtual const GmCellGroupSetsequentialSet (const GmCellGroupSet *gs)=0
 Returns the set of cells from the given cell group that could not be colored and should be treated sequentially. Usually a NULL pointer. See comments on coloredSets(). If there was an error coloring the set, returns the given group set (gs).
 
virtual const QVector< GmCellGroupSet * > & coloredHaloSets (const GmCellGroupSet *gs)=0
 Similar to coloredSets() but including only halo cells from the given group set (if any)
 
virtual const GmCellGroupSetsequentialHaloSet (const GmCellGroupSet *gs)=0
 Similar to sequentialSet() but including only halo cells from the given group set (if any)
 
virtual bool addColoringAsMeshAttribute (const GmCellGroupSet *gs, QString attrName)=0
 Adds to the mesh a new cell attribute, named attrName, with the 1-based coloring index for each cell. Does nothing if there is no coloring associated with the given group set and returns false. Cells not included in the group set will have a coloring index of -1. Cells included in the group set but not colored (belonging to the coloring sequential sets) will have a coloring index of 0. Returns true if the attribute was added to the mesh.
 
virtual bool addColoringAsMeshAttribute (const QVector< const GmCellGroupSet * > &gsets, QString attrName)=0
 Similar to addColoringAsMeshAttribute(const GmCellGroupSet*, QString) but "appending" together several colorings (if the first group has 10 colors, the second index will begin with 11). If a cell belongs to more than one group, it will receive the coloring index of its first cell group.
 
virtual void printColoringStatistics (const GmLogCategory &logger) const =0
 Helper debug function to print coloring statistics for the existing colorings.
 
virtual bool nodesRenumbered () const =0
 Returns true if the nodes where renumbered, false if not. Notice that translation functions work as an identity mapping if there was no node renumbering and can be called anytime.
 
virtual bool cellsRenumbered () const =0
 Returns true if the cells where renumbered, false if not. Notice that translation functions work as an identity mapping if there was no cell renumbering and can be called anytime.
 
virtual int originalToLocalOrderNode (int originalNodeId) const =0
 Translates an original (model) node id into the local, ordered, node id used by the mesh. For ghost nodes, if the given id is a ghost id (value between 0 and num ghost nodes with the ghost bit set), the translated value will also be a ghost id. If the given id is a linear ghost id (value between 0 and total num nodes), the translated value will also be a linear ghost id. When working with partitioned meshes, if the original node does not belong to our current domain, returns -1 (notice that isGhostNode(-1) will return true, but a -1 can not be mistaken by a real ghost node unless we have more than 2 billion ghost nodes!)
 
virtual int originalToLocalOrderGeomNode (int originalNodeId) const =0
 An specialization of originalToLocalOrderNode, accepting ONLY geometric nodes (between 0 and num nodes)
 
virtual int originalToLocalOrderGhostNodeHighSet (int originalNodeId) const =0
 An specialization of originalToLocalOrderNode, accepting ONLY ghost nodes with the high bit SET (between 0 and num ghost nodes)
 
virtual int originalToLocalOrderGhostNodeHighClear (int originalNodeId) const =0
 An specialization of originalToLocalOrderNode, accepting ONLY ghost nodes with the high bit CLEARED (between 0 and num ghost nodes)
 
virtual int originalToLocalOrderCell (int originalCellId) const =0
 Translates an original(model) cell id into the local, ordered, cell id used by the mesh. When working with partitioned meshes, if the original cell does not belong to our current domain, returns -1.
 
virtual int originalToLocalOrderNodeSR (int originalNodeId) const =0
 SR version for originalToLocalOrderNode(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGeomNodeSR (int originalNodeId) const =0
 SR version for originalToLocalOrderGeomNode(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGhostNodeHighSetSR (int originalNodeId) const =0
 SR version for originalToLocalOrderGhostNodeHighSet(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGhostNodeHighClearSR (int originalNodeId) const =0
 SR version for originalToLocalOrderGhostNodeHighClear(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderCellSR (int originalCellId) const =0
 SR version for originalToLocalOrderCell(). Returns -1 if skipRemote() is true and the cell is a remote halo cell.
 
virtual int localOrderToOriginalNode (int nodeId) const =0
 Translates a local, ordered, node id used by the mesh into the original (model) node id. For ghost nodes, if the given id is a ghost id (value between 0 and num ghost nodes with the ghost bit set), the translated value will also be a ghost id. If the given id is a linear ghost id (value between 0 and total num nodes), the translated value will also be a linear ghost id. When working with partitioned meshes, if the internal node does NOT have a corresponding original (model) index, returns -1 (notice that isGhostNode(-1) will return true, but a -1 can not be mistaken by a real ghost node unless we have more than 2 billion ghost nodes!).
 
virtual int localOrderToOriginalGeomNode (int nodeId) const =0
 An specialization of localOrderToOriginalNode, accepting ONLY geometric nodes (between 0 and num nodes)
 
virtual int localOrderToOriginalGhostNodeHighSet (int nodeId) const =0
 An specialization of localOrderToOriginalNode, accepting ONLY ghost nodes with the high bit SET (between 0 and num ghost nodes)
 
virtual int localOrderToOriginalGhostNodeHighClear (int nodeId) const =0
 An specialization of localOrderToOriginalNode, accepting ONLY ghost nodes with the high bit CLEARED (between 0 and num ghost nodes)
 
virtual int localOrderToOriginalCell (int cellId) const =0
 Translates a local, ordered, cell id used by the mesh into the original(model) cell id When working with partitioned meshes, if the internal cell does NOT have a corresponding original (model) index, returns -1.
 
virtual int originalNodeTraversalOrder (int i) const =0
 When traversing the whole set of mesh nodes, one common requirement is for the traversal to produce the nodes in order by their ORIGINAL model node numbering (for printing, for example). This method, when called sequentially with i form 0 to mesh->numTotalNodes(), returns such ordering. For ghost nodes (i >= mesh->numNodes()), the returned value is also in linear format. It is also guaranteed that all geometric nodes are returned before all ghost nodes.
 
virtual int originalCellTraversalOrder (int i) const =0
 When traversing the whole set of mesh cells, one common requirement is for the traversal to produce the nodes in order by their ORIGINAL model cell numbering (for printing, for example). This method, when called sequentially with i form 0 to mesh->numCells(), returns such ordering.
 
virtual bool initPartitions (int numPartitions, int partition)=0
 Breaks the mesh into the specified number of partitions, gathers information about cells, nodes , halo, etc for the given partition and setups the initial node and cell renumbering to include in the mesh only the selected partition.
 
virtual bool initNodeMapping (GmValueAccessor *ac, bool ghost, bool *renumbered, QMap< int, int > &partOrigToLocOrder)=0
 Method called by the mesh to initialize the node renumbering mapping. It will be called once, after partitioning and after node coordinates have been loaded, with an accessor to the geometry set of nodes and ghost = false. If the mesh supports ghost nodes, it will be called a second time with an accessor to the ghost coordinates only, and with ghost = true. This calls are independent on eventual configurations
enabling or disabling node renumbering. Should return false on errors.
 
virtual bool initCellMapping (bool *renumbered, QMap< int, int > &partOrigToLocOrder, QVector< int > &partLocToOrigOrder)=0
 Method called by the mesh to initialize the cell renumbering mapping. It will be called once after cell nodal incidence loading and after loading any cell groups returned by cellMappingRequiredGroups(), independent on eventual configurations enabling or disabling cell renumbering. Should return false on errors.
 
virtual QStringList cellMappingRequiredGroups ()=0
 Method called by the mesh to query if the pcr object needs any cell group information to exist before the call to initCellMapping()
 
virtual bool addNodes (int numNodes)=0
 Informs that the number of nodes has been increased. That does not mean that coordinates have been filled yet. Should return false on errors.
 
virtual bool addGhostNodes (int numGhostNodes)=0
 Informs that the number of ghost nodes has been increased. That does not mean that coordinates have been filled yet. Should return false on errors.
 
virtual bool addCells (int numCells)=0
 Informs that the number of cells has been increased. That does not mean that cell nodes or properties have been filled yet. Should return false on errors.
 
virtual void clear ()=0
 Informs that the mesh was cleared.
 
virtual bool addStateGeometryData (GmStateDump *state, int groupId)=0
 
virtual bool fillDumpControlMapData (QVariantMap *map, const GmLogCategory &logger)=0
 
virtual bool dumpControlMapDataLoaded (QVariantMap *map, const GmLogCategory &logger)=0
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmPluginObject ()
 Destructor.
 
QString id () const
 Returns the object id.
 
QString description () const
 Returns the object description.
 
QString pluginTypeName () const
 Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType().
 
virtual const char * pluginName () const =0
 Returns a string identifying the plugin which implements this object. Should return the SAME string as the one read from the plugin information file in the pluginName field.
 
virtual const char * pluginType () const =0
 Returns the string identifying the plugin object type. Should return the SAME string as the one read from the plugin information file in the objectTypes table.
 
virtual bool loadPrivateData (LuaTable &table)=0
 Function called by the model loader to give the object acess to it's private parameters. Should return false only if the received parameter set makes the use of this object impossible.
 

Additional Inherited Members

- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 Returns the internal logger used by the plugin to emmit messages.
 
GmSimulationDatasimulationData () const
 Returns a reference to the simulation data object keeping global simulation information.
 

Detailed Description

Base interface class for Partition-Color-Renumber object plugins.

Member Enumeration Documentation

◆ CellClass

Cell classification enum.

Enumerator
MY_CELL 

A cell belonging to the current partition that is not a halo cell.

MY_HALO_CELL 

A cell belonging to the current partition that is a halo cell.

REMOTE_HALO_CELL 

A cell belonging to a remote partition that is a halo cell.

◆ ColorState

State of a coloring operation.

Enumerator
COLORED 

All cells have been colored together.

COLORED_WITH_HALO 

Regular cells and halo cells have been colored separately.

NOT_COLORED 

The cells have NOT been colored due to a coloring error.

NOT_SET 

No attempt has been made to color the cells yet.

◆ ColorType

Type of coloring.

Enumerator
NO_COLORING 

No coloring configured.

FEM_COLORING 

Within each color group, cells do not share nodes.

FVM_COLORING 

Within each color group, cells do not share edges for surface meshes or faces for volumetric meshes.

◆ NodeClass

Node classification enum.

Enumerator
MY_NODE 

A node belonging to the current partition that is not a halo node

REMOTE_NODE 

A node belonging to a remote partition that is not a halo node (nodes belonging to remote halo cells that are not remote halo nodes)

MY_HALO_NODE 

A node belonging to the current partition that is a halo node.

REMOTE_HALO_NODE 

A node belonging to a remote partition that is a halo node.

Constructor & Destructor Documentation

◆ GmPCR()

GmPCR::GmPCR ( GmSimulationData * simulation,
QString id,
QString description,
const GmLogCategory & logger )

Constructor.

Parameters
simulationReference to the simulation object.
idSpatial index id.
descriptionSpatial index description.
loggerPlugin logger object used to emmit messages

Member Function Documentation

◆ addCells()

virtual bool GmPCR::addCells ( int numCells)
pure virtual

Informs that the number of cells has been increased. That does not mean that cell nodes or properties have been filled yet. Should return false on errors.

Implemented in GmDefaultPCR.

◆ addColoringAsMeshAttribute() [1/2]

virtual bool GmPCR::addColoringAsMeshAttribute ( const GmCellGroupSet * gs,
QString attrName )
pure virtual

Adds to the mesh a new cell attribute, named attrName, with the 1-based coloring index for each cell. Does nothing if there is no coloring associated with the given group set and returns false. Cells not included in the group set will have a coloring index of -1. Cells included in the group set but not colored (belonging to the coloring sequential sets) will have a coloring index of 0. Returns true if the attribute was added to the mesh.

Implemented in GmDefaultPCR.

◆ addColoringAsMeshAttribute() [2/2]

virtual bool GmPCR::addColoringAsMeshAttribute ( const QVector< const GmCellGroupSet * > & gsets,
QString attrName )
pure virtual

Similar to addColoringAsMeshAttribute(const GmCellGroupSet*, QString) but "appending" together several colorings (if the first group has 10 colors, the second index will begin with 11). If a cell belongs to more than one group, it will receive the coloring index of its first cell group.

Implemented in GmDefaultPCR.

◆ addDebugPartitionInfoAsMeshAttributes()

virtual bool GmPCR::addDebugPartitionInfoAsMeshAttributes ( QString cellAttrPrefix,
QString nodeAttrPrefix )
pure virtual

Similar to addPartitionInfoAsMeshAttributes() but adding extra cell and node attributes named by the given prefix + "Owner" will store the partition that owns the node / cell. Partition indices are 1-based (and not 0-based as mpi ranks). Also, there will be a "Class" and a "Data" attribute per partition with the partition number as suffix. This attributes will be added only if the partitioning was done in "debug" mode for gathering the partition information but skipping changing the mesh. Class and data values for nodes and cells not belonging to a partition are filled with -1.

Implemented in GmDefaultPCR.

◆ addGhostNodes()

virtual bool GmPCR::addGhostNodes ( int numGhostNodes)
pure virtual

Informs that the number of ghost nodes has been increased. That does not mean that coordinates have been filled yet. Should return false on errors.

Implemented in GmDefaultPCR.

◆ addNodes()

virtual bool GmPCR::addNodes ( int numNodes)
pure virtual

Informs that the number of nodes has been increased. That does not mean that coordinates have been filled yet. Should return false on errors.

Implemented in GmDefaultPCR.

◆ addPartitionInfoAsMeshAttributes()

virtual bool GmPCR::addPartitionInfoAsMeshAttributes ( QString cellAttrPrefix,
QString nodeAttrPrefix )
pure virtual

Adds to the mesh a set of new node and cell attributes with information on node and cell classes plus their associated data. Does nothing if the mesh was not partitioned and returns false. Returns true if the attributes were added to the mesh.

Two cell attributes will be added to the mesh: the first, named by cellAttrPrefix

  • "Class", will store the cell class. The second, named cellAttrPrefix + "Data", stores the information returned by cellClassData(), where template indices and partition numbers are converted to 1-based values (zero data for MY_CELL or MY_NODE are kept as zero). Two node attributes will be added with similar semantics and having a base name given by nodeAttrPrefix.

Implemented in GmDefaultPCR.

◆ cellClass()

virtual CellClass GmPCR::cellClass ( int cellId) const
pure virtual

Returns the cell class for the given cell. Will return MY_CELL if the mesh was not partitioned.

Implemented in GmDefaultPCR.

◆ cellClassData()

virtual int GmPCR::cellClassData ( int cellId) const
pure virtual

Returns the class data for the given cell. Its semantics depends on the cell class. MY_CELL: Always 0 MY_HALO_CELL: The template index for the set of remote ranks (partitions) sharing this cell. REMOTE_HALO_CELL: The rank (partition) of the cell owner

Implemented in GmDefaultPCR.

◆ cellMappingRequiredGroups()

virtual QStringList GmPCR::cellMappingRequiredGroups ( )
pure virtual

Method called by the mesh to query if the pcr object needs any cell group information to exist before the call to initCellMapping()

Implemented in GmDefaultPCR.

◆ cellsRenumbered()

virtual bool GmPCR::cellsRenumbered ( ) const
pure virtual

Returns true if the cells where renumbered, false if not. Notice that translation functions work as an identity mapping if there was no cell renumbering and can be called anytime.

Implemented in GmDefaultPCR.

◆ clear()

virtual void GmPCR::clear ( )
pure virtual

Informs that the mesh was cleared.

Implemented in GmDefaultPCR.

◆ coloredHaloSets()

virtual const QVector< GmCellGroupSet * > & GmPCR::coloredHaloSets ( const GmCellGroupSet * gs)
pure virtual

Similar to coloredSets() but including only halo cells from the given group set (if any)

Implemented in GmDefaultPCR.

◆ coloredSets()

virtual const QVector< GmCellGroupSet * > & GmPCR::coloredSets ( const GmCellGroupSet * gs)
pure virtual

Returns the set of colored cell sub-groups for the given cell group. Within each sub-group, cells follow the rules defined by the coloring type. Will trigger the coloring algorithm if the given group has not been colored before. Returns an empty vector if there was an error coloring this set. The cell sub-groups are disjoint and their union with the sets returned by sequentialSet(), coloredHaloSets() and sequentialHaloSet() is equal to the given cell group. Important: The group set mesh must be the same mesh associated with this object. Important 2: The colored group sets MUST NOT be registered at the mesh since they don't have associated group sets. The standard GmpGemaCR class also EXPECTS this restriction to be enforced.

PS: We should really return "const QVector<const GmCellGroupSet*>" but this unfortunately generates an avalanche of const problems down the way that are hard to treat.

Implemented in GmDefaultPCR.

◆ coloringState()

virtual ColorState GmPCR::coloringState ( const GmCellGroupSet * gs)
pure virtual

Returns the coloring state for the given cell group. Will trigger the coloring algorithm if the given group has not been colored before. Important: The group set mesh must be the same mesh associated with this object.

Implemented in GmDefaultPCR.

◆ coloringType()

virtual ColorType GmPCR::coloringType ( ) const
pure virtual

Returns the type of coloring for this PCR object.

Implemented in GmDefaultPCR.

◆ hasCapability()

virtual bool GmPCR::hasCapability ( QString capabilityName) const
pure virtual

This function should return true or false to indicate whether the PCR object supports the requested capability or not. Capabilities are referred by string names in order to enable derived interfaces to extend the available capabilities that can be queried.

Standard capability names: partitioning - Does the PCR object supports mesh partitioning? femColoring - Does the PCR object supports mesh coloring for FEM algorithms? fvmColoring - Does the PCR object supports mesh coloring for FVM algorithms? renumbering - Does the PCR object supports cell and node renumbering (required if partitioning is supported)?

Implemented in GmDefaultPCR.

◆ initCellMapping()

virtual bool GmPCR::initCellMapping ( bool * renumbered,
QMap< int, int > & partOrigToLocOrder,
QVector< int > & partLocToOrigOrder )
pure virtual

Method called by the mesh to initialize the cell renumbering mapping. It will be called once after cell nodal incidence loading and after loading any cell groups returned by cellMappingRequiredGroups(), independent on eventual configurations enabling or disabling cell renumbering. Should return false on errors.

If reordering is based on coloring, any created colorings should be reordered internally.

The renumbered parameter is filled on output with true if the mesh was actually renumbered or with false if not. Notice that if the mesh was partitioned, but no further cell reordering was requested, renumbered will return false but a call to pcr->cellsRenumbered() will return true due to the intrinsic renumbering from the partitioning operation.

If the mesh was partitioned, the 'partOrigToLocOrder' map will be filled with a copy of the current mapping from original model nodes to their ordering after partitioning, but BEFORE renumbering. Similarly, the partLocToOrigOrder will be filled with the inverse transformation. See additional comments on initNodeMapping().

Implemented in GmDefaultPCR.

◆ initNodeMapping()

virtual bool GmPCR::initNodeMapping ( GmValueAccessor * ac,
bool ghost,
bool * renumbered,
QMap< int, int > & partOrigToLocOrder )
pure virtual

Method called by the mesh to initialize the node renumbering mapping. It will be called once, after partitioning and after node coordinates have been loaded, with an accessor to the geometry set of nodes and ghost = false. If the mesh supports ghost nodes, it will be called a second time with an accessor to the ghost coordinates only, and with ghost = true. This calls are independent on eventual configurations
enabling or disabling node renumbering. Should return false on errors.

The renumbered parameter is filled on output with true if the mesh was actually renumbered or with false if not. Notice that if the mesh was partitioned, but no further node reordering was requested, renumbered will return false but a call to pcr->nodesRenumbered() will return true due to the intrinsic renumbering from the partitioning operation.

If the mesh was partitioned, the 'partOrigToLocOrder' map will be filled with a copy of the current mapping from original model nodes to their ordering after partitioning, but BEFORE renumbering. This copy is done before initNodeMapping() updates the mapping with the combined partitioned + renumbered new mapping. The compound transformation given by partOrigToLocOrder[pcr->localOrderToOriginalNode(i)] can be used to reorder the mesh coordinates vector after renumbering in the partitioned case (we can't just use pcr->localOrderToOriginalNode(i) since it maps the new coordinate position to the original model numbering and not the numbering in use by the coordinate vector after partitioning).

Implemented in GmDefaultPCR.

◆ initPartitions()

virtual bool GmPCR::initPartitions ( int numPartitions,
int partition )
pure virtual

Breaks the mesh into the specified number of partitions, gathers information about cells, nodes , halo, etc for the given partition and setups the initial node and cell renumbering to include in the mesh only the selected partition.

If the PCR object was configured with debug settings to partition and gather information for all the partitions, but to keep the mesh unchanged (unpartitioned), this call should still return true, but set the number of partitions to 1. This allows for the user to save the gathered data by calling addDebugPartitionInfoAsMeshAttributes().

Implemented in GmDefaultPCR.

◆ localOrderToOriginalCell()

virtual int GmPCR::localOrderToOriginalCell ( int cellId) const
pure virtual

Translates a local, ordered, cell id used by the mesh into the original(model) cell id When working with partitioned meshes, if the internal cell does NOT have a corresponding original (model) index, returns -1.

Implemented in GmDefaultPCR.

◆ localOrderToOriginalGeomNode()

virtual int GmPCR::localOrderToOriginalGeomNode ( int nodeId) const
pure virtual

An specialization of localOrderToOriginalNode, accepting ONLY geometric nodes (between 0 and num nodes)

Implemented in GmDefaultPCR.

◆ localOrderToOriginalGhostNodeHighClear()

virtual int GmPCR::localOrderToOriginalGhostNodeHighClear ( int nodeId) const
pure virtual

An specialization of localOrderToOriginalNode, accepting ONLY ghost nodes with the high bit CLEARED (between 0 and num ghost nodes)

Implemented in GmDefaultPCR.

◆ localOrderToOriginalGhostNodeHighSet()

virtual int GmPCR::localOrderToOriginalGhostNodeHighSet ( int nodeId) const
pure virtual

An specialization of localOrderToOriginalNode, accepting ONLY ghost nodes with the high bit SET (between 0 and num ghost nodes)

Implemented in GmDefaultPCR.

◆ localOrderToOriginalNode()

virtual int GmPCR::localOrderToOriginalNode ( int nodeId) const
pure virtual

Translates a local, ordered, node id used by the mesh into the original (model) node id. For ghost nodes, if the given id is a ghost id (value between 0 and num ghost nodes with the ghost bit set), the translated value will also be a ghost id. If the given id is a linear ghost id (value between 0 and total num nodes), the translated value will also be a linear ghost id. When working with partitioned meshes, if the internal node does NOT have a corresponding original (model) index, returns -1 (notice that isGhostNode(-1) will return true, but a -1 can not be mistaken by a real ghost node unless we have more than 2 billion ghost nodes!).

Implemented in GmDefaultPCR.

◆ mesh()

virtual GmMesh * GmPCR::mesh ( ) const
pure virtual

Returns the mesh that this PCR object is tied to.

Implemented in GmDefaultPCR.

◆ nodeClass()

virtual NodeClass GmPCR::nodeClass ( int nodeId) const
pure virtual

Returns the node class for the given node. Will return MY_NODE if the mesh was not partitioned. For ghost nodes, cellId can be either a linear index or a value with the ghost bit set.

Implemented in GmDefaultPCR.

◆ nodeClassData()

virtual int GmPCR::nodeClassData ( int nodeId) const
pure virtual

Returns the class data for the given node. Its semantics depends on the node class. MY_NODE: Always 0 REMOTE_NODE: The rank (partition) of the node owner MY_HALO_NODE: The template index for the set of remote ranks (partitions) sharing this node. REMOTE_HALO_NODE: The rank (partition) of the node owner For ghost nodes, cellId can be either a linear index or a value with the ghost bit set.

Implemented in GmDefaultPCR.

◆ nodesRenumbered()

virtual bool GmPCR::nodesRenumbered ( ) const
pure virtual

Returns true if the nodes where renumbered, false if not. Notice that translation functions work as an identity mapping if there was no node renumbering and can be called anytime.

Implemented in GmDefaultPCR.

◆ numCellsInClass()

virtual int GmPCR::numCellsInClass ( CellClass cellClass) const
pure virtual

Returns the number of cells in the mesh that are classified in the given cellClass.

Implemented in GmDefaultPCR.

◆ numGlobalCells()

virtual int GmPCR::numGlobalCells ( ) const
pure virtual

When working with partitioned meshes, returns the number of cells in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numCells().

Implemented in GmDefaultPCR.

◆ numGlobalGhostNodes()

virtual int GmPCR::numGlobalGhostNodes ( ) const
pure virtual

When working with partitioned meshes, returns the number of ghost nodes in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numGhostNodes().

Implemented in GmDefaultPCR.

◆ numGlobalNodes()

virtual int GmPCR::numGlobalNodes ( ) const
pure virtual

When working with partitioned meshes, returns the number of nodes in the global mesh, before partitioning. If numPartitions() is 1, equivalent to mesh->numNodes().

Implemented in GmDefaultPCR.

◆ numNodesInClass()

virtual int GmPCR::numNodesInClass ( NodeClass nodeClass,
GmCellFillMode mode = GM_CELL_NODES ) const
pure virtual

Returns the number of nodes in the mesh that are classified in the given nodeClass. The mode parameter defines if the statistics apply to geometry nodes (mode = GM_CELL_NODES or GM_CELL_VERTICES), ghost nodes (mode == GM_CELL_GHOST) or both (mode == GM_CELL_ALL)

Implemented in GmDefaultPCR.

◆ numPartitions()

virtual int GmPCR::numPartitions ( ) const
pure virtual

Returns the number of partitions for the mesh. Will return 1 if the mesh was not partitioned.

Implemented in GmDefaultPCR.

◆ numRemoteRanks()

virtual int GmPCR::numRemoteRanks ( int templateIndex) const
pure virtual

Returns the number of remote ranks sharing the local cell / node for the given template index.

Implemented in GmDefaultPCR.

◆ originalCellTraversalOrder()

virtual int GmPCR::originalCellTraversalOrder ( int i) const
pure virtual

When traversing the whole set of mesh cells, one common requirement is for the traversal to produce the nodes in order by their ORIGINAL model cell numbering (for printing, for example). This method, when called sequentially with i form 0 to mesh->numCells(), returns such ordering.

Implemented in GmDefaultPCR.

◆ originalNodeTraversalOrder()

virtual int GmPCR::originalNodeTraversalOrder ( int i) const
pure virtual

When traversing the whole set of mesh nodes, one common requirement is for the traversal to produce the nodes in order by their ORIGINAL model node numbering (for printing, for example). This method, when called sequentially with i form 0 to mesh->numTotalNodes(), returns such ordering. For ghost nodes (i >= mesh->numNodes()), the returned value is also in linear format. It is also guaranteed that all geometric nodes are returned before all ghost nodes.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderCell()

virtual int GmPCR::originalToLocalOrderCell ( int originalCellId) const
pure virtual

Translates an original(model) cell id into the local, ordered, cell id used by the mesh. When working with partitioned meshes, if the original cell does not belong to our current domain, returns -1.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderCellSR()

virtual int GmPCR::originalToLocalOrderCellSR ( int originalCellId) const
pure virtual

SR version for originalToLocalOrderCell(). Returns -1 if skipRemote() is true and the cell is a remote halo cell.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGeomNode()

virtual int GmPCR::originalToLocalOrderGeomNode ( int originalNodeId) const
pure virtual

An specialization of originalToLocalOrderNode, accepting ONLY geometric nodes (between 0 and num nodes)

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGeomNodeSR()

virtual int GmPCR::originalToLocalOrderGeomNodeSR ( int originalNodeId) const
pure virtual

SR version for originalToLocalOrderGeomNode(). Returns -1 if skipRemote() is true and the node is a remote node.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGhostNodeHighClear()

virtual int GmPCR::originalToLocalOrderGhostNodeHighClear ( int originalNodeId) const
pure virtual

An specialization of originalToLocalOrderNode, accepting ONLY ghost nodes with the high bit CLEARED (between 0 and num ghost nodes)

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGhostNodeHighClearSR()

virtual int GmPCR::originalToLocalOrderGhostNodeHighClearSR ( int originalNodeId) const
pure virtual

SR version for originalToLocalOrderGhostNodeHighClear(). Returns -1 if skipRemote() is true and the node is a remote node.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGhostNodeHighSet()

virtual int GmPCR::originalToLocalOrderGhostNodeHighSet ( int originalNodeId) const
pure virtual

An specialization of originalToLocalOrderNode, accepting ONLY ghost nodes with the high bit SET (between 0 and num ghost nodes)

Implemented in GmDefaultPCR.

◆ originalToLocalOrderGhostNodeHighSetSR()

virtual int GmPCR::originalToLocalOrderGhostNodeHighSetSR ( int originalNodeId) const
pure virtual

SR version for originalToLocalOrderGhostNodeHighSet(). Returns -1 if skipRemote() is true and the node is a remote node.

Implemented in GmDefaultPCR.

◆ originalToLocalOrderNode()

virtual int GmPCR::originalToLocalOrderNode ( int originalNodeId) const
pure virtual

Translates an original (model) node id into the local, ordered, node id used by the mesh. For ghost nodes, if the given id is a ghost id (value between 0 and num ghost nodes with the ghost bit set), the translated value will also be a ghost id. If the given id is a linear ghost id (value between 0 and total num nodes), the translated value will also be a linear ghost id. When working with partitioned meshes, if the original node does not belong to our current domain, returns -1 (notice that isGhostNode(-1) will return true, but a -1 can not be mistaken by a real ghost node unless we have more than 2 billion ghost nodes!)

Implemented in GmDefaultPCR.

◆ originalToLocalOrderNodeSR()

virtual int GmPCR::originalToLocalOrderNodeSR ( int originalNodeId) const
pure virtual

SR version for originalToLocalOrderNode(). Returns -1 if skipRemote() is true and the node is a remote node.

Implemented in GmDefaultPCR.

◆ partition()

virtual int GmPCR::partition ( ) const
pure virtual

Returns the number of the selected partition for the current mesh. Will return 0 if the mesh was not partitioned.

Implemented in GmDefaultPCR.

◆ pluginCategory()

virtual const char * GmPCR::pluginCategory ( ) const
inlinevirtual

Returns the plugin category.

Implements GmPluginObject.

Reimplemented in GmDefaultPCR.

◆ printColoringStatistics()

virtual void GmPCR::printColoringStatistics ( const GmLogCategory & logger) const
pure virtual

Helper debug function to print coloring statistics for the existing colorings.

Implemented in GmDefaultPCR.

◆ printMemoryStatistics()

virtual size_t GmPCR::printMemoryStatistics ( const GmLogCategory & logger,
GmLogLevel level ) const
pure virtual

Prints memory usage for the PCR object to the given logger. Returns the used memory as reported by usedMemory()

Implemented in GmDefaultPCR.

◆ printParameters()

void GmPCR::printParameters ( const GmLogCategory & logger)
virtual

Asks the PCR object to print all of its parameters using the provided logger.

Implements GmPluginObject.

◆ printPartitionClassStatistics()

virtual void GmPCR::printPartitionClassStatistics ( const GmLogCategory & logger) const
pure virtual

Helper debug function to print class statistics. In "debug mode" prints the statistics for all partitions.

Implemented in GmDefaultPCR.

◆ printPartitionRankTemplateData()

virtual void GmPCR::printPartitionRankTemplateData ( const GmLogCategory & logger) const
pure virtual

Helper debug function to print the rank template data.

Implemented in GmDefaultPCR.

◆ remoteRanks()

virtual const int * GmPCR::remoteRanks ( int templateIndex) const
pure virtual

Returns a vector with size equal to numRemoteRanks(templateIndex) storing the ranks (partitions) sharing the local cell / node for the given template index.

Implemented in GmDefaultPCR.

◆ sequentialHaloSet()

virtual const GmCellGroupSet * GmPCR::sequentialHaloSet ( const GmCellGroupSet * gs)
pure virtual

Similar to sequentialSet() but including only halo cells from the given group set (if any)

Implemented in GmDefaultPCR.

◆ sequentialSet()

virtual const GmCellGroupSet * GmPCR::sequentialSet ( const GmCellGroupSet * gs)
pure virtual

Returns the set of cells from the given cell group that could not be colored and should be treated sequentially. Usually a NULL pointer. See comments on coloredSets(). If there was an error coloring the set, returns the given group set (gs).

Implemented in GmDefaultPCR.

◆ setMesh()

virtual bool GmPCR::setMesh ( GmMesh * mesh)
pure virtual

Function called by the mesh to establish that this PCR object is tied to the given mesh. Can only be called once. This information can NOT be included in the set of PCR attributes due to the need of the mesh also referencing the PCR object. Returns false if the mesh type is incompatible with the PCR object configuration (ex: a node mesh for a PCR object configured for coloring).

Implemented in GmDefaultPCR.

◆ skipRemote()

virtual bool GmPCR::skipRemote ( ) const
pure virtual

Returns true if the mesh was partitioned, includes remote halo cells and the PCR object was configured to skip remote cells and nodes from being included in cell groups, borders, node sets and boundary conditions.

Implemented in GmDefaultPCR.

◆ usedMemory()

virtual size_t GmPCR::usedMemory ( ) const
pure virtual

Returns the approximate memory used for storing the PCR data structures.

Implemented in GmDefaultPCR.


The documentation for this class was generated from the following files: