NeoPZ
tpznodesetcompute.h
Go to the documentation of this file.
1 
5 //
6 // C++ Interface: tpznodesetcompute
7 //
8 // Description:
9 //
10 //
11 // Author: Philippe R. B. Devloo <phil@fec.unicamp.br>, (C) 2004
12 //
13 // Copyright: See COPYING file that comes with this distribution
14 //
15 //
16 #ifndef TPZNODESETCOMPUTE_H
17 #define TPZNODESETCOMPUTE_H
18 #include "pzvec.h"
19 #include "pzstack.h"
20 #include <set>
21 
22 template<class TVar>
23 class TPZBlock;
24 
33 public:
35 
40  void AnalyseGraph();
41 
43  void BuildNodeGraph(TPZVec<int64_t> &blockgraph, TPZVec<int64_t> &blockgraphindex);
44 
46  void BuildVertexGraph(TPZStack<int64_t> &blockgraph, TPZVec<int64_t> &blockgraphindex);
47 
49  void BuildElementGraph(TPZStack<int64_t> &blockgraph, TPZStack<int64_t> &blockgraphindex);
50 
51  void BuildNodeSet(int64_t node, std::set<int64_t> &nodeset);
52 
54  static void ExpandGraph(TPZVec<int64_t> &graph, TPZVec<int64_t> &graphindex, TPZBlock<STATE> &block,
55  TPZVec<int64_t> &expgraph, TPZVec<int64_t> &expgraphindex);
57  static int ColorGraph(TPZVec<int64_t> &graph, TPZVec<int64_t> &graphindex, int64_t neq,
58  TPZVec<int> &colors);
59 
62  {
63  return fLevel;
64  }
65 
67  int MaxLevel()
68  {
69  return fMaxLevel;
70  }
71 
72  void Print(std::ostream &file) const;
73 
74  static void Print(std::ostream &file, const TPZVec<int64_t> &graphindex, const TPZVec<int64_t> &graph);
75 
76  static void Print(std::ostream &file, const std::set<int64_t> &nodeset, const char *text);
77 
79  return fNodegraph;
80  }
81 
83  return fNodegraphindex;
84  }
85 
87  {
88  return fIsIncluded;
89  }
90 
91 private:
99  int64_t fMaxSeqNum;
101 
110 
115  void AnalyseNode(int64_t node, TPZVec< std::set<int64_t> > &nodeset);
116 
119  void AnalyseForElements(std::set<int64_t> &vertices, std::set< std::set<int64_t> > &elements);
125  void SubstractLowerNodes(int64_t node, std::set<int64_t> &nodeset);
126 };
127 
128 #endif
void AnalyseNode(int64_t node, TPZVec< std::set< int64_t > > &nodeset)
This method will analyse the set inclusion of the current node, calling the method recursively if an...
void AnalyseGraph()
Group the node graph as passed by the parameters.
void Print(std::ostream &file) const
TPZManVector< int64_t > fNodegraphindex
TPZManVector< int64_t > & Nodegraphindex()
TPZVec< int > & IsIncluded()
Templated vector implementation.
static int ColorGraph(TPZVec< int64_t > &graph, TPZVec< int64_t > &graphindex, int64_t neq, TPZVec< int > &colors)
Color the graph into mutually independent blocks.
TPZVec< int > fLevel
Inclusion relation ship between nodes.
void BuildNodeGraph(TPZVec< int64_t > &blockgraph, TPZVec< int64_t > &blockgraphindex)
Build the graph which groups the equations of each node.
void BuildNodeSet(int64_t node, std::set< int64_t > &nodeset)
TPZStack< int64_t > fSeqCard
Number of nodes associated with each sequence number.
TPZManVector< int64_t > fNodegraph
The node graph as passed on by the finite element mesh His node graph is organized by sequence numbe...
Computes the cardinality of a nodegraph, identifying nodes as vertices, lines, faces or volumes...
TPZVec< int > & Levels()
Returns the level of the nodes.
void BuildVertexGraph(TPZStack< int64_t > &blockgraph, TPZVec< int64_t > &blockgraphindex)
build the graph which builds the equations linked to vertices
A simple stack.
int64_t fMaxSeqNum
Counter for the condensed node graph.
TPZVec< int64_t > fSeqNumber
Sequence number associated with each node after condensing.
void BuildElementGraph(TPZStack< int64_t > &blockgraph, TPZStack< int64_t > &blockgraphindex)
Build the graph which groups the equations grouped by elements.
TPZVec< int > fIsIncluded
Vector indicating whether a node connectivity is included in another one.
void AnalyseForElements(std::set< int64_t > &vertices, std::set< std::set< int64_t > > &elements)
Look for elements formed by vertices, intersecting with the intersectvertices, one by one...
Implements block matrices. Matrix utility.
void SubstractLowerNodes(int64_t node, std::set< int64_t > &nodeset)
working a set of vertex nodes with nodes which have to be intersected (tested)
static void ExpandGraph(TPZVec< int64_t > &graph, TPZVec< int64_t > &graphindex, TPZBlock< STATE > &block, TPZVec< int64_t > &expgraph, TPZVec< int64_t > &expgraphindex)
Expand the graph acording to the block structure.
int MaxLevel()
Returns the maximum level.
TPZManVector< int64_t > & Nodegraph()