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

Last change on this file since 903 was 900, checked in by oabramkina, 8 years ago

Sequential version of new functionalities for mesh connectivity:

edge_faces
face_edges
face_face.

File size: 2.1 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 "client_client_dht_template_impl.hpp"
12#include "dht_auto_indexing.hpp"
13
14namespace xios {
15 
16   /// ////////////////////// Déclarations ////////////////////// ///
17
18   class CMesh;
19
20   ///--------------------------------------------------------------
21
22/*!
23  \class CMesh
24  \brief CMesh class.
25*/ 
26  class CMesh
27  {
28 
29    public:
30
31      CMesh(void);
32      ~CMesh(void);
33   
34      int nbNodes;
35      int nbEdges;
36      int nbFaces;
37      int nvertex; 
38
39      bool nodesAreWritten;
40      bool edgesAreWritten;
41      bool facesAreWritten;
42     
43      CArray<double, 1> node_lon;
44      CArray<double, 1> node_lat;
45     
46      CArray<double, 1> edge_lon;
47      CArray<double, 1> edge_lat;
48      CArray<int, 2> edge_nodes;
49
50      CArray<double, 1> face_lon;
51      CArray<double, 1> face_lat;
52      CArray<int, 2> face_nodes;
53      CArray<int, 2> face_edges;
54      CArray<int, 2> edge_faces;
55      CArray<int, 2> face_faces;
56
57      void createMesh(const CArray<double, 1>&, const CArray<double, 1>&, 
58            const CArray<double, 2>&, const CArray<double, 2>& );
59                       
60      void createMeshEpsilon(const MPI_Comm&, const CArray<double, 1>&, const CArray<double, 1>&,
61            const CArray<double, 2>&, const CArray<double, 2>& );
62           
63      static CMesh* getMesh(StdString);
64
65    private:
66
67      static std::map <StdString, CMesh> meshList;
68      vector<size_t> createHashes (double, double);
69
70      size_t nodeIndex (double, double);                           // redundant in parallel version with epsilon precision
71      boost::unordered_map <size_t, size_t> hashed_map_nodes;      // redundant in parallel version with epsilon precision
72      boost::unordered_map <pair<double,double>, int> map_nodes;   // redundant in parallel version with epsilon precision
73      boost::unordered_map <pair<int,int>, int> map_edges;         // redundant in parallel version with epsilon precision
74
75  }; 
76
77} // namespace xios
78
79#endif //__XIOS_CMesh__
Note: See TracBrowser for help on using the repository browser.