GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmDefaultPCR Class Reference

An "empty" PCR object that will neither partition, color or renumber the mesh. More...

#include <gmDefaultPCR.h>

Inheritance diagram for GmDefaultPCR:
Collaboration diagram for GmDefaultPCR:

Public Member Functions

 GmDefaultPCR (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 
virtual const char * pluginCategory () const
 Returns the plugin category.
 
virtual const char * pluginName () const
 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
 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)
 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.
 
virtual bool hasCapability (QString capabilityName) const
 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
 Returns the mesh that this PCR object is tied to.
 
virtual bool setMesh (GmMesh *mesh)
 Associates this PCR object with a mesh.
 
virtual size_t printMemoryStatistics (const GmLogCategory &logger, GmLogLevel level) const
 Prints memory usage for the PCR object to the given logger. Returns the used memory as reported by usedMemory()
 
virtual size_t usedMemory () const
 Returns the approximate memory used for storing the PCR data structures.
 
virtual ColorType coloringType () const
 Returns the type of coloring for this PCR object.
 
virtual int numPartitions () const
 Returns the number of partitions for the mesh. Will return 1 if the mesh was not partitioned.
 
virtual int partition () const
 Returns the number of the selected partition for the current mesh. Will return 0 if the mesh was not partitioned.
 
virtual int numGlobalNodes () const
 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
 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
 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
 Returns the cell class for the given cell. Will return MY_CELL if the mesh was not partitioned.
 
virtual int cellClassData (int cellId) const
 
virtual int numCellsInClass (CellClass cellClass) const
 Returns the number of cells in the mesh that are classified in the given cellClass.
 
virtual NodeClass nodeClass (int nodeId) const
 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
 
virtual int numNodesInClass (NodeClass nodeClass, GmCellFillMode mode=GM_CELL_NODES) const
 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
 Returns the number of remote ranks sharing the local cell / node for the given template index.
 
virtual const int * remoteRanks (int templateIndex) const
 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
 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)
 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)
 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
 Helper debug function to print the rank template data.
 
virtual void printPartitionClassStatistics (const GmLogCategory &logger) const
 Helper debug function to print class statistics. In "debug mode" prints the statistics for all partitions.
 
virtual ColorState coloringState (const GmCellGroupSet *gs)
 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)
 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)
 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)
 Similar to coloredSets() but including only halo cells from the given group set (if any)
 
virtual const GmCellGroupSetsequentialHaloSet (const GmCellGroupSet *gs)
 Similar to sequentialSet() but including only halo cells from the given group set (if any)
 
virtual bool addColoringAsMeshAttribute (const GmCellGroupSet *gs, QString attrName)
 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)
 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
 Helper debug function to print coloring statistics for the existing colorings.
 
virtual bool nodesRenumbered () const
 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
 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
 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
 An specialization of originalToLocalOrderNode, accepting ONLY geometric nodes (between 0 and num nodes)
 
virtual int originalToLocalOrderGhostNodeHighSet (int originalNodeId) const
 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
 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
 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
 SR version for originalToLocalOrderNode(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGeomNodeSR (int originalNodeId) const
 SR version for originalToLocalOrderGeomNode(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGhostNodeHighSetSR (int originalNodeId) const
 SR version for originalToLocalOrderGhostNodeHighSet(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderGhostNodeHighClearSR (int originalNodeId) const
 SR version for originalToLocalOrderGhostNodeHighClear(). Returns -1 if skipRemote() is true and the node is a remote node.
 
virtual int originalToLocalOrderCellSR (int originalCellId) const
 SR version for originalToLocalOrderCell(). Returns -1 if skipRemote() is true and the cell is a remote halo cell.
 
virtual int localOrderToOriginalNode (int nodeId) const
 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
 An specialization of localOrderToOriginalNode, accepting ONLY geometric nodes (between 0 and num nodes)
 
virtual int localOrderToOriginalGhostNodeHighSet (int nodeId) const
 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
 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
 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
 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
 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)
 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)
 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)
 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 ()
 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)
 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)
 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)
 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 ()
 Informs that the mesh was cleared.
 
virtual bool addStateGeometryData (GmStateDump *state, int groupId)
 
virtual bool fillDumpControlMapData (QVariantMap *map, const GmLogCategory &logger)
 
virtual bool dumpControlMapDataLoaded (QVariantMap *map, const GmLogCategory &logger)
 
- Public Member Functions inherited from GmPCR
 GmPCR (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor.
 
virtual ~GmPCR ()
 Virtual destructor.
 
virtual void printParameters (const GmLogCategory &logger)
 Asks the PCR object to print all of its parameters using the provided logger.
 
- 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().
 

Private Attributes

GmMesh_mesh
 The associated mesh. Must be set by a call to setMesh()
 

Additional Inherited Members

- Public Types inherited from GmPCR
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...
 
- 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

An "empty" PCR object that will neither partition, color or renumber the mesh.

Member Function Documentation

◆ addCells()

virtual bool GmDefaultPCR::addCells ( int numCells)
inlinevirtual

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.

Implements GmPCR.

◆ addColoringAsMeshAttribute() [1/2]

virtual bool GmDefaultPCR::addColoringAsMeshAttribute ( const GmCellGroupSet * gs,
QString attrName )
inlinevirtual

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.

Implements GmPCR.

◆ addColoringAsMeshAttribute() [2/2]

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

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.

Implements GmPCR.

◆ addDebugPartitionInfoAsMeshAttributes()

virtual bool GmDefaultPCR::addDebugPartitionInfoAsMeshAttributes ( QString cellAttrPrefix,
QString nodeAttrPrefix )
inlinevirtual

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.

Implements GmPCR.

◆ addGhostNodes()

virtual bool GmDefaultPCR::addGhostNodes ( int numGhostNodes)
inlinevirtual

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.

Implements GmPCR.

◆ addNodes()

virtual bool GmDefaultPCR::addNodes ( int numNodes)
inlinevirtual

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

Implements GmPCR.

◆ addPartitionInfoAsMeshAttributes()

virtual bool GmDefaultPCR::addPartitionInfoAsMeshAttributes ( QString cellAttrPrefix,
QString nodeAttrPrefix )
inlinevirtual

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.

Implements GmPCR.

◆ addStateGeometryData()

virtual bool GmDefaultPCR::addStateGeometryData ( GmStateDump * state,
int groupId )
inlinevirtual

Implements GmPCR.

◆ cellClass()

virtual CellClass GmDefaultPCR::cellClass ( int cellId) const
inlinevirtual

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

Implements GmPCR.

◆ cellClassData()

virtual int GmDefaultPCR::cellClassData ( int cellId) const
inlinevirtual

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

Implements GmPCR.

◆ cellMappingRequiredGroups()

virtual QStringList GmDefaultPCR::cellMappingRequiredGroups ( )
inlinevirtual

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

Implements GmPCR.

◆ cellsRenumbered()

virtual bool GmDefaultPCR::cellsRenumbered ( ) const
inlinevirtual

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.

Implements GmPCR.

◆ clear()

virtual void GmDefaultPCR::clear ( )
inlinevirtual

Informs that the mesh was cleared.

Implements GmPCR.

◆ coloredHaloSets()

virtual const QVector< GmCellGroupSet * > & GmDefaultPCR::coloredHaloSets ( const GmCellGroupSet * gs)
inlinevirtual

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

Implements GmPCR.

◆ coloredSets()

virtual const QVector< GmCellGroupSet * > & GmDefaultPCR::coloredSets ( const GmCellGroupSet * gs)
inlinevirtual

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.

Implements GmPCR.

◆ coloringState()

virtual ColorState GmDefaultPCR::coloringState ( const GmCellGroupSet * gs)
inlinevirtual

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.

Implements GmPCR.

◆ coloringType()

virtual ColorType GmDefaultPCR::coloringType ( ) const
inlinevirtual

Returns the type of coloring for this PCR object.

Implements GmPCR.

◆ dumpControlMapDataLoaded()

virtual bool GmDefaultPCR::dumpControlMapDataLoaded ( QVariantMap * map,
const GmLogCategory & logger )
inlinevirtual

Implements GmPCR.

◆ fillDumpControlMapData()

virtual bool GmDefaultPCR::fillDumpControlMapData ( QVariantMap * map,
const GmLogCategory & logger )
inlinevirtual

Implements GmPCR.

◆ hasCapability()

virtual bool GmDefaultPCR::hasCapability ( QString capabilityName) const
inlinevirtual

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)?

Implements GmPCR.

◆ initCellMapping()

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

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().

Implements GmPCR.

◆ initNodeMapping()

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

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).

Implements GmPCR.

◆ initPartitions()

virtual bool GmDefaultPCR::initPartitions ( int numPartitions,
int partition )
inlinevirtual

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().

Implements GmPCR.

◆ loadPrivateData()

virtual bool GmDefaultPCR::loadPrivateData ( LuaTable & table)
inlinevirtual

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.

Implements GmPluginObject.

◆ localOrderToOriginalCell()

virtual int GmDefaultPCR::localOrderToOriginalCell ( int cellId) const
inlinevirtual

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.

Implements GmPCR.

◆ localOrderToOriginalGeomNode()

virtual int GmDefaultPCR::localOrderToOriginalGeomNode ( int nodeId) const
inlinevirtual

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

Implements GmPCR.

◆ localOrderToOriginalGhostNodeHighClear()

virtual int GmDefaultPCR::localOrderToOriginalGhostNodeHighClear ( int nodeId) const
inlinevirtual

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

Implements GmPCR.

◆ localOrderToOriginalGhostNodeHighSet()

virtual int GmDefaultPCR::localOrderToOriginalGhostNodeHighSet ( int nodeId) const
inlinevirtual

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

Implements GmPCR.

◆ localOrderToOriginalNode()

virtual int GmDefaultPCR::localOrderToOriginalNode ( int nodeId) const
inlinevirtual

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!).

Implements GmPCR.

◆ mesh()

virtual GmMesh * GmDefaultPCR::mesh ( ) const
inlinevirtual

Returns the mesh that this PCR object is tied to.

Implements GmPCR.

◆ nodeClass()

virtual NodeClass GmDefaultPCR::nodeClass ( int nodeId) const
inlinevirtual

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.

Implements GmPCR.

◆ nodeClassData()

virtual int GmDefaultPCR::nodeClassData ( int nodeId) const
inlinevirtual

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.

Implements GmPCR.

◆ nodesRenumbered()

virtual bool GmDefaultPCR::nodesRenumbered ( ) const
inlinevirtual

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.

Implements GmPCR.

◆ numCellsInClass()

virtual int GmDefaultPCR::numCellsInClass ( CellClass cellClass) const
inlinevirtual

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

Implements GmPCR.

◆ numGlobalCells()

virtual int GmDefaultPCR::numGlobalCells ( ) const
inlinevirtual

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

Implements GmPCR.

◆ numGlobalGhostNodes()

virtual int GmDefaultPCR::numGlobalGhostNodes ( ) const
inlinevirtual

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().

Implements GmPCR.

◆ numGlobalNodes()

virtual int GmDefaultPCR::numGlobalNodes ( ) const
inlinevirtual

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

Implements GmPCR.

◆ numNodesInClass()

virtual int GmDefaultPCR::numNodesInClass ( NodeClass nodeClass,
GmCellFillMode mode = GM_CELL_NODES ) const
inlinevirtual

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)

Implements GmPCR.

◆ numPartitions()

virtual int GmDefaultPCR::numPartitions ( ) const
inlinevirtual

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

Implements GmPCR.

◆ numRemoteRanks()

virtual int GmDefaultPCR::numRemoteRanks ( int templateIndex) const
inlinevirtual

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

Implements GmPCR.

◆ originalCellTraversalOrder()

virtual int GmDefaultPCR::originalCellTraversalOrder ( int i) const
inlinevirtual

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.

Implements GmPCR.

◆ originalNodeTraversalOrder()

virtual int GmDefaultPCR::originalNodeTraversalOrder ( int i) const
inlinevirtual

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.

Implements GmPCR.

◆ originalToLocalOrderCell()

virtual int GmDefaultPCR::originalToLocalOrderCell ( int originalCellId) const
inlinevirtual

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.

Implements GmPCR.

◆ originalToLocalOrderCellSR()

virtual int GmDefaultPCR::originalToLocalOrderCellSR ( int originalCellId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGeomNode()

virtual int GmDefaultPCR::originalToLocalOrderGeomNode ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGeomNodeSR()

virtual int GmDefaultPCR::originalToLocalOrderGeomNodeSR ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGhostNodeHighClear()

virtual int GmDefaultPCR::originalToLocalOrderGhostNodeHighClear ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGhostNodeHighClearSR()

virtual int GmDefaultPCR::originalToLocalOrderGhostNodeHighClearSR ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGhostNodeHighSet()

virtual int GmDefaultPCR::originalToLocalOrderGhostNodeHighSet ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderGhostNodeHighSetSR()

virtual int GmDefaultPCR::originalToLocalOrderGhostNodeHighSetSR ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ originalToLocalOrderNode()

virtual int GmDefaultPCR::originalToLocalOrderNode ( int originalNodeId) const
inlinevirtual

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!)

Implements GmPCR.

◆ originalToLocalOrderNodeSR()

virtual int GmDefaultPCR::originalToLocalOrderNodeSR ( int originalNodeId) const
inlinevirtual

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

Implements GmPCR.

◆ partition()

virtual int GmDefaultPCR::partition ( ) const
inlinevirtual

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

Implements GmPCR.

◆ pluginCategory()

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

Returns the plugin category.

Reimplemented from GmPCR.

◆ pluginName()

virtual const char * GmDefaultPCR::pluginName ( ) const
inlinevirtual

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.

Implements GmPluginObject.

◆ pluginType()

virtual const char * GmDefaultPCR::pluginType ( ) const
inlinevirtual

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.

Notice that this function DOES NOT return the hierarchical name of the plugin object, which is composed by pluginName() + '.' + pluginType(). The hierarchical name can be obtained by a call to pluginTypeName().

Implements GmPluginObject.

◆ printColoringStatistics()

virtual void GmDefaultPCR::printColoringStatistics ( const GmLogCategory & logger) const
inlinevirtual

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

Implements GmPCR.

◆ printMemoryStatistics()

virtual size_t GmDefaultPCR::printMemoryStatistics ( const GmLogCategory & logger,
GmLogLevel level ) const
inlinevirtual

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

Implements GmPCR.

◆ printPartitionClassStatistics()

virtual void GmDefaultPCR::printPartitionClassStatistics ( const GmLogCategory & logger) const
inlinevirtual

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

Implements GmPCR.

◆ printPartitionRankTemplateData()

virtual void GmDefaultPCR::printPartitionRankTemplateData ( const GmLogCategory & logger) const
inlinevirtual

Helper debug function to print the rank template data.

Implements GmPCR.

◆ remoteRanks()

virtual const int * GmDefaultPCR::remoteRanks ( int templateIndex) const
inlinevirtual

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

Implements GmPCR.

◆ sequentialHaloSet()

virtual const GmCellGroupSet * GmDefaultPCR::sequentialHaloSet ( const GmCellGroupSet * gs)
inlinevirtual

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

Implements GmPCR.

◆ sequentialSet()

virtual const GmCellGroupSet * GmDefaultPCR::sequentialSet ( const GmCellGroupSet * gs)
inlinevirtual

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).

Implements GmPCR.

◆ setMesh()

virtual bool GmDefaultPCR::setMesh ( GmMesh * mesh)
inlinevirtual

Associates this PCR object with a mesh.

Implements GmPCR.

◆ skipRemote()

virtual bool GmDefaultPCR::skipRemote ( ) const
inlinevirtual

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.

Implements GmPCR.

◆ usedMemory()

virtual size_t GmDefaultPCR::usedMemory ( ) const
inlinevirtual

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

Implements GmPCR.


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