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.hpp" |
---|
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 | |
---|
33 | int nbNodes; |
---|
34 | int nbEdges; |
---|
35 | int nbFaces; |
---|
36 | int nvertex; |
---|
37 | |
---|
38 | bool nodesAreWritten; |
---|
39 | bool edgesAreWritten; |
---|
40 | bool facesAreWritten; |
---|
41 | |
---|
42 | CArray<double, 1> node_lon; |
---|
43 | CArray<double, 1> node_lat; |
---|
44 | |
---|
45 | CArray<double, 1> edge_lon; |
---|
46 | CArray<double, 1> edge_lat; |
---|
47 | CArray<int, 2> edge_nodes; |
---|
48 | |
---|
49 | CArray<double, 1> face_lon; |
---|
50 | CArray<double, 1> face_lat; |
---|
51 | CArray<int, 2> face_nodes; |
---|
52 | |
---|
53 | void createMesh(const CArray<double, 1>&, const CArray<double, 1>&, |
---|
54 | const CArray<double, 2>&, const CArray<double, 2>& ); |
---|
55 | |
---|
56 | void createMeshEpsilon(const CArray<double, 1>&, const CArray<double, 1>&, |
---|
57 | const CArray<double, 2>&, const CArray<double, 2>& ); |
---|
58 | |
---|
59 | static CMesh* getMesh(StdString); |
---|
60 | |
---|
61 | private: |
---|
62 | |
---|
63 | static std::map <StdString, CMesh> meshList; |
---|
64 | |
---|
65 | size_t nodeIndex (double, double); |
---|
66 | boost::unordered_map <size_t, size_t> hashed_map_nodes; |
---|
67 | boost::unordered_map <pair<double,double>, int> map_nodes; |
---|
68 | boost::unordered_map <pair<int,int>, int> map_edges; |
---|
69 | |
---|
70 | }; |
---|
71 | |
---|
72 | } // namespace xios |
---|
73 | |
---|
74 | #endif //__XIOS_CMesh__ |
---|