Salome HOME
0c51ac8e22d60e377a6b04cd5ef4d586b516d34e
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_ConnectZone.hxx
1 // Copyright (C) 2007-2016  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, or (at your option) any later version.
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
20 #ifndef __MEDPARTITIONER_CONNECTZONE_HXX__
21 #define __MEDPARTITIONER_CONNECTZONE_HXX__
22
23 #include "MEDPARTITIONER.hxx"
24 #include "MCAuto.hxx"
25
26 namespace MEDCoupling
27 {
28   class MEDCouplingUMesh;
29   class MEDCouplingSkyLineArray;
30 }
31
32 #include <map>
33 #include <vector>
34 #include <string>
35
36 using namespace MEDCoupling;
37
38 namespace MEDPARTITIONER
39 {
40   class MEDPARTITIONER_EXPORT ConnectZone
41   {
42   public :
43     ConnectZone();
44     ~ConnectZone();
45     ConnectZone(const ConnectZone & myConnectZone);
46
47     std::string getName() const ;
48     std::string getDescription() const ;
49     int getDistantDomainNumber() const ;
50     int getLocalDomainNumber() const ;
51     MEDCouplingUMesh *getLocalMesh() const ;
52     MEDCouplingUMesh *getDistantMesh() const ;
53
54     bool isEntityCorrespPresent(int localEntity,int distantEntity) const;
55     const int *getNodeCorrespIndex() const;
56     const int *getNodeCorrespValue() const;
57     int getNodeNumber() const;
58     const MEDCouplingSkyLineArray * getNodeCorresp() const;
59     const int *getFaceCorrespIndex() const;
60     const int *getFaceCorrespValue() const;
61     int getFaceNumber() const;
62     const MEDCouplingSkyLineArray * getFaceCorresp() const;
63     const int *getEntityCorrespIndex(int localEntity,
64                                      int distantEntity) const;
65     const int *getEntityCorrespValue(int localEntity,
66                                      int distantEntity) const;
67     int getEntityCorrespNumber(int localEntity,
68                                int distantEntity) const;
69     int getEntityCorrespLength(int localEntity,
70                                int distantEntity) const;
71     const MEDCouplingSkyLineArray * getEntityCorresp(int localEntity,
72                                                                  int distantEntity) const;
73     std::vector< std::pair< int,int > > getEntities() const;
74
75     void setName(const std::string& name) ;
76     void setDescription(const std::string& description) ;
77     void setDistantDomainNumber(int distantDomainNumber) ;
78     void setLocalDomainNumber(int distantDomainNumber) ;
79     void setLocalMesh(MEDCouplingUMesh * localMesh) ;
80     void setDistantMesh(MEDCouplingUMesh * distantMesh) ;
81
82     void setNodeCorresp(const int * nodeCorresp, int nbnode);
83     void setNodeCorresp(MEDCouplingSkyLineArray* array);
84     void setFaceCorresp(const int * faceCorresp, int nbface);
85     void setFaceCorresp(MEDCouplingSkyLineArray* array);
86     void setEntityCorresp(int localEntity, int distantEntity,
87                           const int * entityCorresp, int nbentity);
88     void setEntityCorresp(int localEntity, int distantEntity,
89                           MEDCouplingSkyLineArray *array);
90   private :
91     std::string _name;
92     std::string _description;
93     int _local_domain_number;
94     int _distant_domain_number;
95
96     MEDCouplingUMesh * _local_mesh;
97     MEDCouplingUMesh * _distant_mesh;
98
99     MCAuto<MEDCouplingSkyLineArray> _node_corresp;
100     MCAuto<MEDCouplingSkyLineArray> _face_corresp;
101   
102     std::map < std::pair <int,int>, MEDCouplingSkyLineArray * > _entity_corresp;
103   };
104 }
105 # endif