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