GemaCoreLib
The GeMA Core library
Public Member Functions | Private Attributes | List of all members
GmFileNodeRenumbering Class Reference

An auxilliary class for renumbering nodes when filtering cells from an output mesh. Filtering can be done based on active cells, cells belonging to a cell group and/or by cell type (ignoring cells whose type can not be exported to a file format). The renumbered node sequence only includes nodes that belong to unfiltered cells. A second option allows for the renumbering to consider geometry nodes only, ghost nodes only or both. More...

#include <gmFileNodeRenumbering.h>

Collaboration diagram for GmFileNodeRenumbering:
Collaboration graph
[legend]

Public Member Functions

 GmFileNodeRenumbering (const GmCellMesh *mesh, GmAffectedNodes mode=GM_GEOMETRY_NODE)
 Constructor. Gets as parameter the mesh and the definition of which types of nodes should be considered for renumbering. Creates a mapping that does no translation at all. The translation map should be set up by a call to filter()
 
 ~GmFileNodeRenumbering ()
 Destructor.
 
const GmCellMeshmesh () const
 Returns the associated mesh.
 
const GmAffectedNodes mode () const
 Returns the associated node mode.
 
bool filter (bool active, const GmCellGroupSet *group, const GmFileFormat *fileFormat)
 Initializes the node mapping structure to enable saving node data without nodes that are used only by filtered cells. As explained in. More...
 
int numActiveNodes () const
 Returns the number of active nodes in the mesh: the number of nodes belonging to an unfiltered cell and matching the mode criteria (geometry, ghost or both)
 
int numActiveGhostNodes () const
 Returns the number of active nodes (like numActiveNodes()) that are ghost nodes.
 
bool active (int node) const
 Returns true if the node belongs to an active cell, false if not. The node index should be a linear node index for node mode equal to geometry or both and equal to the "ghost index", without the high bit set, if mode is ghost only.
 
int map (int node) const
 Returns the mapping between a node number and its position in the renumbered node set. Returns -1 if the node is not active (and a call to filter() has been done). The node index should be a linear node index for node mode equal to geometry or both and equal to the "ghost index", without the high bit set, if mode is ghost only. For ghost nodes, it can also be a value with the high bit set as returned by GmCell::nodeIndex(), but keep in mind that the returned value will always be a "linear" index.
 

Private Attributes

const GmCellMesh_mesh
 The mesh.
 
GmAffectedNodes _mode
 Which kind of nodes are we dealing with?
 
int _nMeshNodes
 The total number of nodes in the mesh, respecting mode.
 
int _nActiveNodes
 The total number of active nodes in the mesh. Equals _nMeshNodes before filter()
 
int _nActiveGhostNodes
 The number of nodes in _nActiveNodes that are ghost nodes.
 
int * _map
 The mapping between node indices. Size equal to _nMeshNodes. -1 if an index is not active. Equals NULL before filter().
 

Detailed Description

An auxilliary class for renumbering nodes when filtering cells from an output mesh. Filtering can be done based on active cells, cells belonging to a cell group and/or by cell type (ignoring cells whose type can not be exported to a file format). The renumbered node sequence only includes nodes that belong to unfiltered cells. A second option allows for the renumbering to consider geometry nodes only, ghost nodes only or both.

Member Function Documentation

◆ filter()

bool GmFileNodeRenumbering::filter ( bool  active,
const GmCellGroupSet group,
const GmFileFormat fileFormat 
)

Initializes the node mapping structure to enable saving node data without nodes that are used only by filtered cells. As explained in.

the class description the filtering can leave out inactive cells, cells not belonging to the given cell group or cells that are not supported by the given file format. All of them are optional.

In the current implementation, this function should be called only once!


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