[879] | 1 | /*! |
---|
| 2 | \file mesh.hpp |
---|
| 3 | \author Olga Abramkina |
---|
| 4 | \brief Declaration of class CMesh. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef __XIOS_CMesh__ |
---|
| 8 | #define __XIOS_CMesh__ |
---|
| 9 | |
---|
| 10 | #include "array_new.hpp" |
---|
[900] | 11 | #include "dht_auto_indexing.hpp" |
---|
[879] | 12 | |
---|
| 13 | namespace xios { |
---|
| 14 | |
---|
| 15 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 16 | |
---|
| 17 | class CMesh; |
---|
| 18 | |
---|
| 19 | ///-------------------------------------------------------------- |
---|
| 20 | |
---|
| 21 | /*! |
---|
| 22 | \class CMesh |
---|
| 23 | \brief CMesh class. |
---|
| 24 | */ |
---|
| 25 | class CMesh |
---|
| 26 | { |
---|
| 27 | |
---|
| 28 | public: |
---|
| 29 | |
---|
| 30 | CMesh(void); |
---|
| 31 | ~CMesh(void); |
---|
| 32 | |
---|
[924] | 33 | int nbNodesGlo; |
---|
| 34 | int nbEdgesGlo; |
---|
[900] | 35 | |
---|
[924] | 36 | int node_start; |
---|
| 37 | int node_count; |
---|
| 38 | int edge_start; |
---|
| 39 | int edge_count; |
---|
| 40 | |
---|
[879] | 41 | bool nodesAreWritten; |
---|
| 42 | bool edgesAreWritten; |
---|
| 43 | bool facesAreWritten; |
---|
| 44 | |
---|
| 45 | CArray<double, 1> node_lon; |
---|
| 46 | CArray<double, 1> node_lat; |
---|
| 47 | |
---|
| 48 | CArray<double, 1> edge_lon; |
---|
| 49 | CArray<double, 1> edge_lat; |
---|
| 50 | CArray<int, 2> edge_nodes; |
---|
| 51 | |
---|
| 52 | CArray<double, 1> face_lon; |
---|
| 53 | CArray<double, 1> face_lat; |
---|
| 54 | CArray<int, 2> face_nodes; |
---|
[900] | 55 | CArray<int, 2> face_edges; |
---|
| 56 | CArray<int, 2> edge_faces; |
---|
| 57 | CArray<int, 2> face_faces; |
---|
[879] | 58 | |
---|
[929] | 59 | void createMesh(const CArray<double, 1>&, const CArray<double, 1>&, |
---|
[924] | 60 | const CArray<double, 2>&, const CArray<double, 2>& ); |
---|
[879] | 61 | |
---|
[1639] | 62 | void createMeshEpsilon(const MPI_Comm&, |
---|
[924] | 63 | const CArray<double, 1>&, const CArray<double, 1>&, |
---|
| 64 | const CArray<double, 2>&, const CArray<double, 2>& ); |
---|
[929] | 65 | |
---|
[1639] | 66 | void getGlobalNghbFaces(const int, const MPI_Comm&, const CArray<int, 1>&, |
---|
[929] | 67 | const CArray<double, 2>&, const CArray<double, 2>&, |
---|
| 68 | CArray<int, 2>&); |
---|
[931] | 69 | |
---|
| 70 | void getLocalNghbFaces(const int, const CArray<int, 1>&, |
---|
| 71 | const CArray<double, 2>&, const CArray<double, 2>&, |
---|
| 72 | CArray<int, 2>&, CArray<int, 1>&); |
---|
[879] | 73 | |
---|
[924] | 74 | static CMesh* getMesh(StdString, int); |
---|
[879] | 75 | |
---|
[881] | 76 | private: |
---|
[879] | 77 | |
---|
[1542] | 78 | typedef std::pair<double, double> pairDouble; |
---|
| 79 | typedef std::pair<int, int> pairInt; |
---|
| 80 | |
---|
[929] | 81 | int nbNodes_; |
---|
| 82 | int nbEdges_; |
---|
| 83 | int nbFaces_; |
---|
[924] | 84 | |
---|
[881] | 85 | static std::map <StdString, CMesh> meshList; |
---|
[924] | 86 | static std::map <StdString, vector<int> > domainList; |
---|
| 87 | CClientClientDHTSizet* pNodeGlobalIndex; // pointer to a map <nodeHash, nodeIdxGlo> |
---|
| 88 | CClientClientDHTSizet* pEdgeGlobalIndex; // pointer to a map <edgeHash, edgeIdxGlo> |
---|
[1639] | 89 | void getGloNghbFacesNodeType(const MPI_Comm&, const CArray<int, 1>&, const CArray<double, 2>&, const CArray<double, 2>&, CArray<int, 2>&); |
---|
| 90 | void getGloNghbFacesEdgeType(const MPI_Comm&, const CArray<int, 1>&, const CArray<double, 2>&, const CArray<double, 2>&, CArray<int, 2>&); |
---|
[931] | 91 | void getLocNghbFacesNodeType(const CArray<int, 1>&, const CArray<double, 2>&, const CArray<double, 2>&, CArray<int, 2>&, CArray<int, 1>&); |
---|
| 92 | void getLocNghbFacesEdgeType(const CArray<int, 1>&, const CArray<double, 2>&, const CArray<double, 2>&, CArray<int, 2>&, CArray<int, 1>&); |
---|
[881] | 93 | |
---|
[924] | 94 | vector<size_t> createHashes (const double, const double); |
---|
| 95 | |
---|
[879] | 96 | }; |
---|
| 97 | |
---|
| 98 | } // namespace xios |
---|
| 99 | |
---|
| 100 | #endif //__XIOS_CMesh__ |
---|