1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "MEDMEM_define.hxx"
24 #include "boost/shared_ptr.hpp"
33 class MEDSKYLINEARRAY;
36 namespace MEDSPLITTER {
40 class MEDSPLITTER_FaceModel;
42 typedef std::map<MED_EN::medGeometryElement, std::vector<MEDSPLITTER_FaceModel*> > TGeom2Faces;
43 typedef std::vector< TGeom2Faces > TGeom2FacesByDomian;
49 Topology(std::vector<MEDMEM::MESH*>, std::vector<MEDMEM::CONNECTZONE*>){}
53 //!converts a list of global cell numbers
54 //!to a distributed array with local cell numbers
55 virtual void convertGlobalNodeList(const int* list, int nb, int* local, int*ip)=0;
56 virtual void convertGlobalNodeList(const int* list, int nb, int* local, int ip)=0;
57 //!converts a list of global node numbers
58 //!to a distributed array with local cell numbers
59 virtual void convertGlobalCellList(const int*list , int nb, int* local, int*ip)=0;
61 //!converts a list of global face numbers
62 //!to a distributed array with local face numbers
63 virtual void convertGlobalFaceList(const int*list , int nb, int* local, int*ip)=0;
64 virtual void convertGlobalFaceList(const int*list , int nb, int* local, int ip)=0;
65 virtual void convertGlobalFaceListWithTwins(const int* face_list, int nbface, int*& local, int*& ip, int*& full_array, int& size)=0;
66 virtual void convertGlobalNodeListWithTwins(const int* face_list, int nbnode, int*& local, int*& ip, int*& full_array, int& size)=0;
70 virtual int nbDomain() const =0;
73 virtual int nbCells() const=0;
76 //number of cells on a specific domain
77 virtual int nbCells(int idomain) const=0;
79 ////creating node mapping
80 virtual void createNodeMapping(std::map<MED_EN::medGeometryElement,int*>& type_connectivity,
81 std::map<MED_EN::medGeometryElement,int>& present_type_numbers,
82 std::vector<int>& polygon_conn,
83 std::vector<int>& polygon_conn_index,
84 std::vector<int>& polyhedron_conn,
85 std::vector<int>& polyhedron_conn_index,
86 std::vector<int>& polyhedron_face_index,
89 ////creating face mapping
90 // virtual void createFaceMapping(std::map<MED_EN::medGeometryElement,int*>& type_connectivity,
91 // std::map<MED_EN::medGeometryElement,int>& present_type_numbers,int domain)=0;
93 virtual void createFaceMapping(const MESHCollection&,const MESHCollection&)=0;
95 //converting node global numberings to local numberings
96 virtual void convertToLocal(std::map<MED_EN::medGeometryElement,int*>& type_connectivity,
97 std::map<MED_EN::medGeometryElement,int>& present_type_numbers,
99 MED_EN::medEntityMesh entity)=0;
100 //converting node global numberings to local numberings
101 virtual void convertToLocal2ndVersion(int*,int,int)=0;
103 virtual int convertNodeToGlobal(int ip,int icell)const=0;
104 virtual int convertFaceToGlobal(int ip,int icell)const=0;
105 virtual int convertCellToGlobal(int ip,int icell)const=0;
107 virtual void convertNodeToGlobal(int ip,const int* local, int n, int* global)const=0 ;
108 virtual void convertCellToGlobal(int ip,const int* local, int n, int* global)const=0 ;
109 virtual void convertFaceToGlobal(int ip,const int* local, int n, int* global)const=0 ;
111 //retrieving number of nodes
112 virtual int getNodeNumber(int idomain) const =0;
113 virtual int getNodeNumber() const=0;
114 //retrieving list of nodes
115 virtual void getNodeList(int idomain, int* list) const =0;
117 virtual std::vector<int> & getFusedCellNumbers(int idomain) = 0;
118 virtual const std::vector<int> & getFusedCellNumbers(int idomain) const = 0;
120 virtual std::vector<int> & getFusedFaceNumbers(int idomain) = 0;
121 virtual const std::vector<int> & getFusedFaceNumbers(int idomain) const = 0;
123 //retrieving number of nodes
124 virtual int getCellNumber(int idomain) const =0;
126 //retrieving list of nodes
127 virtual void getCellList(int idomain, int* list) const =0;
129 //retrieving number of faces
130 virtual int getFaceNumber(int idomain) const =0;
131 virtual int getFaceNumber()const =0;
133 //retrieving list of nodes
134 virtual void getFaceList(int idomain, int* list) const =0;
136 //adding a face to the mapping
137 virtual void appendFace(int idomain, int ilocal, int iglobal)=0;
139 //return max global face number
140 virtual int getMaxGlobalFace()const=0;
142 //return next free global face number
143 //virtual int nextGlobalFace(int start_num) const=0;
145 //!converting a global cell number to a local representation
146 virtual std::pair<int,int> convertGlobalCell(int iglobal) const =0;
148 //converting a global face number to a local representation
149 virtual int convertGlobalFace(int iglobal, int idomain)=0;
151 //converting a global node number to a local representation
152 virtual int convertGlobalNode(int iglobal, int idomain)=0;
154 //! computing arrays with node/node correspondencies
155 virtual void computeNodeNodeCorrespondencies(int nbdomain, std::vector<MEDMEM::MEDSKYLINEARRAY*>&) const =0;
157 //! computing arrays with cell/cell correspondencies
158 virtual void computeCellCellCorrespondencies(int nbdomain, std::vector<MEDMEM::MEDSKYLINEARRAY*>&, const Graph*) const =0;
161 virtual boost::shared_ptr<Graph> getGraph() const=0;
163 //!recreating a face mapping from scratch
164 virtual void recreateFaceMapping(const TGeom2FacesByDomian& )=0;
166 //!recreating cell and node mapping after send-reveive and fusion of domain meshes
167 virtual void recreateMappingAfterFusion(const std::vector<MEDMEM::MESH*>& ) = 0;
170 #endif /*TOPOLOGY_HXX_*/