EnGPar
Partitioning using the N-Graph
apfGraph.h
1 
2 #ifndef APF_MESH
3 #define APF_MESH
4 
5 #include "ngraph.h"
6 #include <apfMesh2.h>
7 #include <map>
8 namespace agi {
9 
15  Ngraph* createAPFGraph(apf::Mesh* m, const char* name, int primary_dimension,int secondary_dimension);
22  Ngraph* createAPFGraph(apf::Mesh* m, const char* name, int primary_dimension,int* secondary_dimensions,
23  int num_dimensions);
24 
30  Ngraph* createSerendipityGraph(apf::Mesh* m, const char* name, int order);
31 
35 class apfGraph : public Ngraph {
36  protected:
37  apf::Mesh* m;
38  const char* name;
39  apf::GlobalNumbering* global_nums;
40  apf::GlobalNumbering* edge_nums[MAX_TYPES];
41  std::vector<gid_t> ghosts;
42  std::vector<part_t> owns;
43 
44  apfGraph();
45  public:
46  // \cond INTERFACE
47  apfGraph(apf::Mesh*, const char* name, int primary_dimension, int secondary_dimension);
48  apfGraph(apf::Mesh*, const char* name, int primary_dimension, int* secondary_dimensions,int n);
49  ~apfGraph();
50 
51  //Utility
52  void migrate(std::map<GraphVertex*,int>&) {};
53  // \endcond
54  protected:
55  void checkDims(int dim,int primary,int second);
56  void setupPrimary(int primary);
57  etype setupSecondary(int second);
58  void connectToEdges(int primary,int second, etype type);
59  void connectToPins(int primary,int second, etype type);
60  void constructGhostVerts();
61 };
62 
63 class dofGraph : public apfGraph {
64 private:
65  int order;
66  gid_t offset_global_edges[4];
67 public:
68 
69  dofGraph(apf::Mesh*, const char* name, int ord);
70  ~dofGraph();
71 private:
72  //Finite Element Functions
73  bool hasDOFs(int dim);
74  int numDOFs(int dim);
75 
76  etype setupHyperedges();
77  void connectToEdges(etype t);
78  void connectPins(etype t);
79 };
80 }//agi namespace
81 
82 #endif
An extension of the N-Graph for SCOREC meshes.
Definition: apfGraph.h:35
Definition: apfGraph.h:63
The N-Graph interface.