Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / MEDSPLITTER / MEDSPLITTER_SequentialTopology.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef SequentialTOPOLOGY_HXX_
20 #define SequentialTOPOLOGY_HXX_
21
22 #include "MEDSPLITTER.hxx"
23
24 namespace MEDSPLITTER {
25   class SequentialTopology:public Topology
26   {
27
28   public:
29
30     SequentialTopology();
31     SequentialTopology(std::vector<MEDMEM::MESH*>, std::vector<MEDMEM::CONNECTZONE*>);
32
33     //!converts a list of global cell numbers
34     //!to a distributed array with local cell numbers
35     void convertGlobalNodeList(const int*, int,int*,int*);
36
37     //!converts a list of global node numbers
38     //!to a distributed array with local cell numbers
39     void convertGlobalCellList(const int*, int , int*, int *);
40
41     //number of doamins
42     int nbDomain() const;
43
44     //number of cells
45     int nbCells() const;
46
47     //number of cells on a specific domain
48     int nbCells(int idomain) const;
49
50     //!creating node mapping 
51     void createNodeMapping(vector<int*> type_connectivity,int* present_type_numbers, int idomain);
52
53     //!converting node global numberings to local numberings
54     void convertToLocal(vector<int*> type_connectivity,int* present_type_numbers);
55
56     //!retrieving number of nodes
57     int getNodeNumber(int idomain) const ;
58
59     //!retrieving list of nodes
60     void getNodeList(int idomain, int* list) const;
61
62     //!retrieving number of cells
63     int getCellNumber(int idomain) const ;
64
65     //!retrieving list of cells
66     void getCellList(int idomain, int* list) const;
67
68   private:
69     //!mapping global -> local
70     map<int,pair<int,int> > m_glob_to_loc;
71
72     //!mapping local -> global
73     map<pair<int,int>,int> m_loc_to_glob;
74
75     //!mapping global -> local
76     multimap<int,pair<int,int> > m_node_glob_to_loc;
77
78     //!mapping local -> global
79     map<pair<int,int>,int> m_node_loc_to_glob;
80
81     vector<int> m_nb_cells;
82
83     vector<int> m_nb_nodes;
84
85     int m_nb_total_cells;
86
87     int m_nb_total_nodes;
88   };
89 }
90 #endif /*SequentialTOPOLOGY_HXX_*/