NeoPZ
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
TPZRenumbering Class Reference

This abstract class which defines the behavior which derived classes need to implement
for implementing node sequence numbering optimization. Utility. More...

#include <TPZRenumbering.h>

Inheritance diagram for TPZRenumbering:
[legend]
Collaboration diagram for TPZRenumbering:
[legend]

Public Member Functions

 TPZRenumbering ()
 
 TPZRenumbering (int64_t NElements, int64_t NNodes)
 
virtual ~TPZRenumbering ()
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 read objects from the stream More...
 
void Write (TPZStream &buf, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
void SetElementsNodes (int64_t NElements, int64_t NNodes)
 
void SetElementGraph (TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
 This method declares the element graph to the object. More...
 
void SetNodeWeights (TPZVec< int > &weights)
 Sets the number of equations associated with each node. More...
 
virtual void ClearDataStructures ()
 This will reset all datastructures the object may contain. More...
 
virtual void Resequence (TPZVec< int64_t > &perm, TPZVec< int64_t > &iperm)
 
void ConvertGraph (TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, TPZManVector< int64_t > &nodegraph, TPZManVector< int64_t > &nodegraphindex)
 Will convert an element graph defined by elgraph and elgraphindex into a node graph defined by nodegraph and nodegraphindex. More...
 
void ConvertToElementoToElementGraph (TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, TPZVec< int64_t > &eltotelgraph, TPZVec< int > &eltoelweight, TPZVec< int64_t > &eltoelgraphindex)
 Convert a traditional elgraph to an element to element graph. More...
 
void NodeToElGraph (TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, TPZVec< int64_t > &nodetoelgraph, TPZVec< int64_t > &nodetoelgraphindex)
 Stores the graph of nodes to elements. More...
 
int64_t ColorNodes (TPZVec< int64_t > &nodegraph, TPZVec< int64_t > &nodegraphindex, TPZVec< int > &family, TPZVec< int > &colors)
 Will assign a color to the nodes in the graph such that no two connected nodes have the same color the return value indicates the number of colors in the graph. More...
 
void Print (TPZVec< int64_t > &grapho, TPZVec< int64_t > &graphoindex, const char *name=0, std::ostream &out=std::cout)
 Prints graph. More...
 
void CornerEqs (unsigned int mincorners, int64_t nelconsider, std::set< int > &eligible, std::set< int > &cornernodes)
 Analyzes the graph, finds the corner nodes
Number of elements which should be considered for determining corner nodes. More...
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Static Public Member Functions

static int64_t ColorElements (const TPZCompMesh *cmesh, const TPZVec< int64_t > &elementIndices, TPZVec< int64_t > &elementColors)
 Assigns a color to the elements in the elementIndices list such that two elements that share a connect have different colors. The return value indicates the number of colors. More...
 
- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 

Public Attributes

int fHDivPermute
 

Protected Attributes

int64_t fNElements
 Number of elements in the graph. More...
 
int64_t fNNodes
 Number of nodes in the graph. More...
 
TPZVec< int > fNodeWeights
 Number of equations associated with each node. More...
 
TPZVec< int64_t > fElementGraph
 Node number of each element. More...
 
TPZVec< int64_t > fElementGraphIndex
 Indicates for each element the index of the first entry with fElementGraph for that element The size of this vector is fNElements+1. More...
 

Detailed Description

This abstract class which defines the behavior which derived classes need to implement
for implementing node sequence numbering optimization. Utility.

Definition at line 21 of file TPZRenumbering.h.

Constructor & Destructor Documentation

◆ TPZRenumbering() [1/2]

TPZRenumbering::TPZRenumbering ( )
inline

Definition at line 26 of file TPZRenumbering.h.

◆ TPZRenumbering() [2/2]

TPZRenumbering::TPZRenumbering ( int64_t  NElements,
int64_t  NNodes 
)

Definition at line 111 of file TPZRenumbering.cpp.

◆ ~TPZRenumbering()

virtual TPZRenumbering::~TPZRenumbering ( )
inlinevirtual

Definition at line 32 of file TPZRenumbering.h.

References ClassId(), Read(), and Write().

Member Function Documentation

◆ ClassId()

int TPZRenumbering::ClassId ( ) const
overridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Definition at line 116 of file TPZRenumbering.cpp.

References Hash().

Referenced by ~TPZRenumbering().

◆ ClearDataStructures()

void TPZRenumbering::ClearDataStructures ( )
virtual

This will reset all datastructures the object may contain.

Node resequencing algorithms may require a possibly large amount of temporary data

Definition at line 415 of file TPZRenumbering.cpp.

Referenced by SetNodeWeights().

◆ ColorElements()

int64_t TPZRenumbering::ColorElements ( const TPZCompMesh cmesh,
const TPZVec< int64_t > &  elementIndices,
TPZVec< int64_t > &  elementColors 
)
static

Assigns a color to the elements in the elementIndices list such that two elements that share a connect have different colors. The return value indicates the number of colors.

Definition at line 183 of file TPZRenumbering.cpp.

References TPZVec< T >::begin(), DebugStop, TPZVec< T >::end(), TPZVec< T >::Fill(), TPZThreadPool::globalInstance(), TPZCompMesh::NConnects(), TPZCompMesh::NElements(), TPZStack< T, NumExtAlloc >::push_back(), TPZVec< T >::Resize(), TPZThreadPool::run(), TPZVec< T >::size(), TPZThreadPool::threadCount(), and TPZTaskGroup::Wait().

Referenced by Resequence(), and TPZStructMatrixGCTP::TPZStructMatrixGCTP().

◆ ColorNodes()

int64_t TPZRenumbering::ColorNodes ( TPZVec< int64_t > &  nodegraph,
TPZVec< int64_t > &  nodegraphindex,
TPZVec< int > &  family,
TPZVec< int > &  colors 
)

Will assign a color to the nodes in the graph such that no two connected nodes have the same color the return value indicates the number of colors in the graph.

Definition at line 138 of file TPZRenumbering.cpp.

References DebugStop, TPZVec< T >::Fill(), TPZVec< T >::NElements(), TPZStack< T, NumExtAlloc >::Push(), TPZManVector< T, NumExtAlloc >::Resize(), and TPZVec< T >::Resize().

Referenced by Resequence().

◆ ConvertGraph()

void TPZRenumbering::ConvertGraph ( TPZVec< int64_t > &  elgraph,
TPZVec< int64_t > &  elgraphindex,
TPZManVector< int64_t > &  nodegraph,
TPZManVector< int64_t > &  nodegraphindex 
)

◆ ConvertToElementoToElementGraph()

void TPZRenumbering::ConvertToElementoToElementGraph ( TPZVec< int64_t > &  elgraph,
TPZVec< int64_t > &  elgraphindex,
TPZVec< int64_t > &  eltoelgraph,
TPZVec< int > &  eltoelweight,
TPZVec< int64_t > &  eltoelgraphindex 
)

Convert a traditional elgraph to an element to element graph.

Convert a traditional elgraph to an element to element graph

Definition at line 351 of file TPZRenumbering.cpp.

References LOGPZ_DEBUG, TPZVec< T >::NElements(), TPZVec< T >::Resize(), and TPZVec< T >::size().

Referenced by Resequence(), and TPZMetis::Subdivide().

◆ CornerEqs()

void TPZRenumbering::CornerEqs ( unsigned int  mincorners,
int64_t  nelconsider,
std::set< int > &  eligible,
std::set< int > &  cornernodes 
)

Analyzes the graph, finds the corner nodes
Number of elements which should be considered for determining corner nodes.

Analyse the graph, find the corner nodes

Definition at line 424 of file TPZRenumbering.cpp.

References DebugStop, LOGPZ_DEBUG, TPZVec< T >::NElements(), TPZStack< T, NumExtAlloc >::Push(), and TPZVec< T >::size().

Referenced by TPZDohrStructMatrix::IdentifyCornerNodes(), and Resequence().

◆ NodeToElGraph()

void TPZRenumbering::NodeToElGraph ( TPZVec< int64_t > &  elgraph,
TPZVec< int64_t > &  elgraphindex,
TPZVec< int64_t > &  nodetoelgraph,
TPZVec< int64_t > &  nodetoelgraphindex 
)

Stores the graph of nodes to elements.

Definition at line 29 of file TPZRenumbering.cpp.

References TPZVec< T >::Fill(), PZError, and TPZVec< T >::Resize().

Referenced by Resequence().

◆ Print()

void TPZRenumbering::Print ( TPZVec< int64_t > &  grapho,
TPZVec< int64_t > &  graphoindex,
const char *  name = 0,
std::ostream &  out = std::cout 
)

◆ Read()

void TPZRenumbering::Read ( TPZStream buf,
void *  context 
)
overridevirtual

read objects from the stream

Reimplemented from TPZSavable.

Definition at line 120 of file TPZRenumbering.cpp.

References TPZStream::Read().

Referenced by ~TPZRenumbering().

◆ Resequence()

virtual void TPZRenumbering::Resequence ( TPZVec< int64_t > &  perm,
TPZVec< int64_t > &  iperm 
)
inlinevirtual

◆ SetElementGraph()

void TPZRenumbering::SetElementGraph ( TPZVec< int64_t > &  elgraph,
TPZVec< int64_t > &  elgraphindex 
)

This method declares the element graph to the object.

The first vector contains the element node number
The second vector contains the index where to find the first node number of each element
The size of second vector is fNElements+1

Definition at line 407 of file TPZRenumbering.cpp.

Referenced by TPBSpStructMatrix::Create(), TPZSpStructMatrix::Create(), TPZDohrStructMatrix::Create(), TPZCompMesh::GetNodeToElGraph(), TPZDohrStructMatrix::IdentifyCornerNodes(), TPZAnalysis::OptimizeBandwidth(), SetElementsNodes(), and TPZDohrStructMatrix::SubStructure().

◆ SetElementsNodes()

void TPZRenumbering::SetElementsNodes ( int64_t  NElements,
int64_t  NNodes 
)
inline

◆ SetNodeWeights()

void TPZRenumbering::SetNodeWeights ( TPZVec< int > &  weights)
inline

Sets the number of equations associated with each node.

The derived class may or may not take this data into consideration

Definition at line 57 of file TPZRenumbering.h.

References ClearDataStructures(), and fNodeWeights.

◆ Write()

void TPZRenumbering::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

Writes this object to the TPZStream buffer. Include the classid if withclassid = true.

Writes this object to the TPZStream buffer. Include the classid if withclassid = true

Reimplemented from TPZSavable.

Definition at line 129 of file TPZRenumbering.cpp.

References TPZStream::Write().

Referenced by ~TPZRenumbering().

Member Data Documentation

◆ fElementGraph

TPZVec<int64_t> TPZRenumbering::fElementGraph
protected

◆ fElementGraphIndex

TPZVec<int64_t> TPZRenumbering::fElementGraphIndex
protected

Indicates for each element the index of the first entry with fElementGraph for that element The size of this vector is fNElements+1.

Definition at line 128 of file TPZRenumbering.h.

Referenced by TPZMetis::Print(), TPZMetis::Resequence(), TPZSloan::Resequence(), TPZCutHillMcKee::Resequence(), TPZSloanRenumbering::Resequence(), TPZSloanRenumbering::Resequence2(), and TPZMetis::Subdivide().

◆ fHDivPermute

int TPZRenumbering::fHDivPermute

Definition at line 24 of file TPZRenumbering.h.

◆ fNElements

int64_t TPZRenumbering::fNElements
protected

Number of elements in the graph.

Definition at line 113 of file TPZRenumbering.h.

Referenced by TPZMetis::Print(), TPZSloan::Resequence(), SetElementsNodes(), and TPZSloan::TPZSloan().

◆ fNNodes

int64_t TPZRenumbering::fNNodes
protected

Number of nodes in the graph.

Definition at line 116 of file TPZRenumbering.h.

Referenced by TPZMetis::Print(), TPZMetis::Resequence(), TPZSloan::Resequence(), SetElementsNodes(), and TPZSloan::TPZSloan().

◆ fNodeWeights

TPZVec<int> TPZRenumbering::fNodeWeights
protected

Number of equations associated with each node.

Definition at line 119 of file TPZRenumbering.h.

Referenced by SetNodeWeights().


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