source: XIOS/trunk/src/node/mesh.hpp @ 924

Last change on this file since 924 was 924, checked in by oabramkina, 5 years ago

Parallel version of UGRID norms.

The following connectivity parameters have been implemented:

edge_nodes
face_nodes
face_edges
edge_faces
face_faces.

Test with a regular(structured) quadrilateral mesh (test_regular) has been added.

File size: 2.5 KB
Line 
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"
11#include "dht_auto_indexing.hpp"
12
13namespace 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   
33      int nbNodesGlo;
34      int nbEdgesGlo;
35
36      int node_start;
37      int node_count;
38      int edge_start;
39      int edge_count;
40
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;
55      CArray<int, 2> face_edges;
56      CArray<int, 2> edge_faces;
57      CArray<int, 2> face_faces;
58
59      void createMesh(const CArray<double, 1>&, const CArray<double, 1>&, 
60                      const CArray<double, 2>&, const CArray<double, 2>& );
61                       
62      void createMeshEpsilon(const MPI_Comm&,
63                             const CArray<double, 1>&, const CArray<double, 1>&,
64                             const CArray<double, 2>&, const CArray<double, 2>& );
65           
66      static CMesh* getMesh(StdString, int);
67
68    private:
69
70      int nbNodes;
71      int nbEdges;
72      int nbFaces;
73
74      static std::map <StdString, CMesh> meshList;
75      static std::map <StdString, vector<int> > domainList;
76      CClientClientDHTSizet* pNodeGlobalIndex;                    // pointer to a map <nodeHash, nodeIdxGlo>
77      CClientClientDHTSizet* pEdgeGlobalIndex;                    // pointer to a map <edgeHash, edgeIdxGlo>
78
79      vector<size_t> createHashes (const double, const double);
80
81      size_t nodeIndex (double, double);                           // redundant in parallel version with epsilon precision
82      boost::unordered_map <size_t, size_t> hashed_map_nodes;      // redundant in parallel version with epsilon precision
83      boost::unordered_map <pair<double,double>, int> map_nodes;   // redundant in parallel version with epsilon precision
84      boost::unordered_map <pair<int,int>, int> map_edges;         // redundant in parallel version with epsilon precision
85
86  }; 
87
88} // namespace xios
89
90#endif //__XIOS_CMesh__
Note: See TracBrowser for help on using the repository browser.