Salome HOME
remove src/MEDCalc/doc
[modules/med.git] / src / MEDPartitioner / MEDPARTITIONER_Topology.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_TOPOLOGY_HXX__
21 #define __MEDPARTITIONER_TOPOLOGY_HXX__
22
23 #include "MEDPARTITIONER.hxx"
24
25 #include <map>
26 #include <vector>
27
28 namespace ParaMEDMEM
29 {
30   class MEDCouplingUMesh;
31 }
32
33 namespace MEDPARTITIONER
34 {
35   class Graph;
36   class ConnectZone;
37   class MeshCollection;
38   class MEDPARTITIONER_FaceModel;
39     
40   class MEDPARTITIONER_EXPORT Topology
41   {
42   public:
43     Topology() { }
44     Topology(std::vector<ParaMEDMEM::MEDCouplingUMesh*>, std::vector<MEDPARTITIONER::ConnectZone*>) { }
45     virtual ~Topology() { }
46     
47     /*! converts a list of global cell numbers
48      *  to a distributed array with local cell numbers
49      */
50     virtual void convertGlobalNodeList(const int *list, int nb, int *local, int*ip) = 0;
51     virtual void convertGlobalNodeList(const int *list, int nb, int *local, int ip) = 0;
52     //converts a list of global node numbers
53     /*! to a distributed array with local cell numbers */
54     virtual void convertGlobalCellList(const int*list , int nb, int *local, int*ip) = 0;
55     
56     /*! converts a list of global face numbers
57      *  to a distributed array with local face numbers
58      */
59      virtual void convertGlobalFaceList(const int*list , int nb, int* local, int*ip) = 0;
60     virtual void convertGlobalFaceList(const int*list , int nb, int* local, int ip) = 0;
61     virtual void convertGlobalFaceListWithTwins(const int *face_list, int nbface, int*& local, int*& ip, int*& full_array, int& size) = 0;
62     virtual void convertGlobalNodeListWithTwins(const int *face_list, int nbnode, int*& local, int*& ip, int*& full_array, int& size) = 0;
63     /*! number of doamins */
64     virtual int nbDomain() const = 0;
65     /*! number of cells */
66     virtual int nbCells() const = 0;
67     /*! number of nodes */
68     virtual int nbNodes() const = 0;
69     /*! number of cells on a specific domain */
70     virtual int nbCells(int idomain) const = 0;
71     /*! converting node global numberings to local numberings */
72     virtual void convertToLocal2ndVersion(int*,int,int) = 0;
73     virtual int convertNodeToGlobal(int ip,int icell) const = 0;
74     virtual int convertFaceToGlobal(int ip,int icell) const = 0;
75     virtual int convertCellToGlobal(int ip,int icell) const = 0;
76     virtual void convertNodeToGlobal(int ip,const int *local, int n, int *global) const = 0;
77     virtual void convertCellToGlobal(int ip,const int *local, int n, int *global) const = 0;
78     virtual void convertFaceToGlobal(int ip,const int *local, int n, int *global) const = 0;
79     /*! retrieving number of nodes */
80     virtual int getNodeNumber(int idomain) const = 0;
81     virtual int getNodeNumber() const = 0;
82     /*! retrieving list of nodes */
83     virtual void getNodeList(int idomain, int *list) const = 0;
84     virtual std::vector<int> & getFusedCellNumbers(int idomain) = 0;
85     virtual const std::vector<int> & getFusedCellNumbers(int idomain) const = 0;
86     virtual std::vector<int> & getFusedFaceNumbers(int idomain) = 0;
87     virtual const std::vector<int> & getFusedFaceNumbers(int idomain) const = 0;
88     /*! retrieving number of nodes */
89     virtual int getCellNumber(int idomain) const = 0;
90     /*! retrieving list of nodes */
91     virtual void getCellList(int idomain, int *list) const = 0;
92     /*! retrieving number of faces */
93     virtual int getFaceNumber(int idomain) const = 0;
94     virtual int getFaceNumber() const = 0;
95     /*! retrieving list of nodes */
96     virtual void getFaceList(int idomain, int *list) const = 0;
97     /*! adding a face to the mapping */
98     virtual void appendFace(int idomain, int ilocal, int iglobal) = 0;
99     /*! returns max global face number */
100     virtual int getMaxGlobalFace() const = 0;
101     /*! converting a global cell number to a local representation */
102     virtual std::pair<int,int> convertGlobalCell(int iglobal) const = 0;
103     /*! converting a global face number to a local representation */
104     virtual int convertGlobalFace(int iglobal, int idomain) = 0;
105     /*! converting a global node number to a local representation */
106     virtual int convertGlobalNode(int iglobal, int idomain) = 0;
107     /*! getting a reference to connect zones vector */
108     virtual std::vector<MEDPARTITIONER::ConnectZone*>& getCZ() = 0;
109   };
110 }
111
112 #endif