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