-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathapfGraph.h
82 lines (70 loc) · 2.51 KB
/
apfGraph.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef APF_MESH
#define APF_MESH
#include "ngraph.h"
#include <apfMesh2.h>
#include <map>
namespace agi {
/** \brief Create the ngraph for a SCOREC mesh with one edge type
* \param m the mesh
* \param primary_dimension the mesh dimension to use for graph vertices
* \param secondary_dimension the mesh dimension to use for graph hyperedges
*/
Ngraph* createAPFGraph(apf::Mesh* m, const char* name, int primary_dimension,int secondary_dimension);
/** \brief Create the ngraph for a SCOREC mesh with multiple edge type
* \param m the mesh
* \param primary_dimension the mesh dimension to use for graph vertices
* \param secondary_dimensions the mesh dimensions to use for each type of graph hyperedges
* \param num_dimensions the number of edge types to be used (should be the size of secondary_dimensions
*/
Ngraph* createAPFGraph(apf::Mesh* m, const char* name, int primary_dimension,int* secondary_dimensions,
int num_dimensions);
/** \brief Create the ngraph for a SCOREC mesh with one edge type for DOF holders given serendipity? finite elements
* \param m the mesh
* \param name a string to define the graph
* \param The order of the serendipity finite elements
*/
Ngraph* createSerendipityGraph(apf::Mesh* m, const char* name, int order);
/** \brief An extension of the N-Graph for SCOREC meshes
*/
class apfGraph : public Ngraph {
protected:
apf::Mesh* m;
const char* name;
apf::GlobalNumbering* global_nums;
apf::GlobalNumbering* edge_nums[MAX_TYPES];
std::vector<gid_t> ghosts;
std::vector<part_t> owns;
apfGraph();
public:
// \cond INTERFACE
apfGraph(apf::Mesh*, const char* name, int primary_dimension, int secondary_dimension);
apfGraph(apf::Mesh*, const char* name, int primary_dimension, int* secondary_dimensions,int n);
~apfGraph();
//Utility
void migrate(std::map<GraphVertex*,int>&) {};
// \endcond
protected:
void checkDims(int dim,int primary,int second);
void setupPrimary(int primary);
etype setupSecondary(int second);
void connectToEdges(int primary,int second, etype type);
void connectToPins(int primary,int second, etype type);
void constructGhostVerts();
};
class dofGraph : public apfGraph {
private:
int order;
gid_t offset_global_edges[4];
public:
dofGraph(apf::Mesh*, const char* name, int ord);
~dofGraph();
private:
//Finite Element Functions
bool hasDOFs(int dim);
int numDOFs(int dim);
etype setupHyperedges();
void connectToEdges(etype t);
void connectPins(etype t);
};
}//agi namespace
#endif