blitzdg
an open-source project aiming to implement parallel discontinuous Galerkin (dg) solvers for common partial differential equations systems using blitz++ for array and tensor manipulations and MPI for distributed parallelism.
MeshManager.hpp
1 #pragma once
2 #include <blitz/array.h>
3 #include <boost/algorithm/string.hpp>
4 
5 using namespace std;
6 using namespace boost;
7 
8 class MeshManager {
9  double * Vert;
10  int * EToV;
11  int Dim;
12  int NumVerts;
13  int ElementType;
14  int NumElements;
15  string CsvDelimeters;
16 
17  int * ElementPartitionMap;
18  int * VertexPartitionMap;
19 
20  template<typename T>
21  vector<int> readCsvFile(string csvFile, string delimiters, T * & result);
22 
23  template<typename T>
24  void printArray(T * & arr, int numRows, int numCols);
25 
26  public:
27  MeshManager();
28 
29  int get_Index(int row, int col, int numCols);
30 
31  // Read gmsh .msh file.
32  void readMesh(string gmshInputFile);
33 
34  void readVertices(string vertFile);
35 
36  void readElements(string E2VFile);
37 
38  // Split up with metis.
39  void partitionMesh(int numPartitions);
40 
41  double * & get_Vertices();
42 
43  int get_Dim();
44 
45  int get_NumVerts();
46 
47  int * & get_Elements();
48 
49  int get_NumElements();
50  int get_ElementType();
51 
52  int * & get_ElementPartitionMap();
53  int * & get_VertexPartitionMap();
54 
55  void printVertices();
56  void printElements();
57 
58  ~MeshManager();
59 };
60 
Definition: MeshManager.hpp:8