NeoPZ
|
This abstract class which defines the behavior which derived classes need to implement
for implementing node sequence numbering optimization. Utility.
More...
#include <TPZRenumbering.h>
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 TPZSavable * | CreateInstance (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... | |
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.
|
inline |
Definition at line 26 of file TPZRenumbering.h.
TPZRenumbering::TPZRenumbering | ( | int64_t | NElements, |
int64_t | NNodes | ||
) |
Definition at line 111 of file TPZRenumbering.cpp.
|
inlinevirtual |
Definition at line 32 of file TPZRenumbering.h.
|
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().
|
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().
|
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().
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().
void TPZRenumbering::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.
Definition at line 75 of file TPZRenumbering.cpp.
References TPZVec< T >::Fill(), TPZVec< T >::NElements(), TPZManVector< T, NumExtAlloc >::Resize(), TPZVec< T >::size(), TPZTimer::start(), and TPZTimer::stop().
Referenced by TPZAnalysis::BuildPreconditioner(), TPZCompMesh::ComputeFillIn(), TPBSpStructMatrix::Create(), TPZSpStructMatrix::Create(), TPZGenSubStruct::IdentifyCornerNodes(), TPZMetis::Print(), TPZMetis::Resequence(), Resequence(), TPZCutHillMcKee::Resequence(), TPZSloanRenumbering::Resequence(), and TPZSloanRenumbering::Resequence2().
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().
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().
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().
void TPZRenumbering::Print | ( | TPZVec< int64_t > & | grapho, |
TPZVec< int64_t > & | graphoindex, | ||
const char * | name = 0 , |
||
std::ostream & | out = std::cout |
||
) |
Prints graph.
Definition at line 275 of file TPZRenumbering.cpp.
References TPZVec< T >::NElements().
Referenced by TPZDohrStructMatrix::IdentifyCornerNodes(), TPZAnalysis::OptimizeBandwidth(), Resequence(), and TPZMetis::Subdivide().
|
overridevirtual |
read objects from the stream
Reimplemented from TPZSavable.
Definition at line 120 of file TPZRenumbering.cpp.
References TPZStream::Read().
Referenced by ~TPZRenumbering().
|
inlinevirtual |
Reimplemented in TPZSloanRenumbering, TPZCutHillMcKee, TPZSloan, and TPZMetis.
Definition at line 66 of file TPZRenumbering.h.
References ColorElements(), ColorNodes(), ConvertGraph(), ConvertToElementoToElementGraph(), CornerEqs(), DebugStop, NodeToElGraph(), and Print().
Referenced by TPZAnalysis::OptimizeBandwidth().
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().
|
inline |
Definition at line 39 of file TPZRenumbering.h.
References fNElements, fNNodes, and SetElementGraph().
Referenced by TPBSpStructMatrix::Create(), TPZSpStructMatrix::Create(), and TPZAnalysis::OptimizeBandwidth().
|
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.
|
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().
|
protected |
Node number of each element.
Definition at line 122 of file TPZRenumbering.h.
Referenced by TPZMetis::Print(), TPZMetis::Resequence(), TPZSloan::Resequence(), TPZCutHillMcKee::Resequence(), TPZSloanRenumbering::Resequence(), TPZSloanRenumbering::Resequence2(), and TPZMetis::Subdivide().
|
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().
int TPZRenumbering::fHDivPermute |
Definition at line 24 of file TPZRenumbering.h.
|
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().
|
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().
|
protected |
Number of equations associated with each node.
Definition at line 119 of file TPZRenumbering.h.
Referenced by SetNodeWeights().