Salome HOME
Writing binary VTK files in MEDCoupling
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMeshDesc.cxx
1 // Copyright (C) 2007-2013  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.
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 // Author : Anthony Geay (CEA/DEN)
20
21 #include "MEDCouplingUMeshDesc.hxx"
22 #include "CellModel.hxx"
23 #include "MEDCouplingMemArray.hxx"
24 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
25
26 #include <limits>
27 #include <sstream>
28
29 using namespace ParaMEDMEM;
30
31 MEDCouplingUMeshDesc::MEDCouplingUMeshDesc():_mesh_dim(-2),_desc_connec(0),_desc_connec_index(0),
32                                              _nodal_connec_face(0),_nodal_connec_face_index(0)
33 {
34 }
35
36 MEDCouplingUMeshDesc::~MEDCouplingUMeshDesc()
37 {
38   if(_desc_connec)
39     _desc_connec->decrRef();
40   if(_desc_connec_index)
41     _desc_connec_index->decrRef();
42   if(_nodal_connec_face)
43     _nodal_connec_face->decrRef();
44   if(_nodal_connec_face_index)
45     _nodal_connec_face_index->decrRef();
46 }
47
48 MEDCouplingUMeshDesc *MEDCouplingUMeshDesc::New()
49 {
50   return new MEDCouplingUMeshDesc;
51 }
52
53 MEDCouplingUMeshDesc *MEDCouplingUMeshDesc::New(const char *meshName, int meshDim)
54 {
55   MEDCouplingUMeshDesc *ret=new MEDCouplingUMeshDesc;
56   ret->setName(meshName);
57   ret->setMeshDimension(meshDim);
58   return ret;
59 }
60
61 std::size_t MEDCouplingUMeshDesc::getHeapMemorySize() const
62 {
63   std::size_t ret=0;
64   if(_desc_connec)
65     ret+=_desc_connec->getHeapMemorySize();
66   if(_desc_connec_index)
67     ret+=_desc_connec_index->getHeapMemorySize();
68   if(_nodal_connec_face)
69     ret+=_nodal_connec_face->getHeapMemorySize();
70   if(_nodal_connec_face_index)
71     ret+=_nodal_connec_face_index->getHeapMemorySize();
72   return MEDCouplingPointSet::getHeapMemorySize()+ret;
73 }
74
75
76 MEDCouplingMesh *MEDCouplingUMeshDesc::deepCpy() const
77 {
78   throw INTERP_KERNEL::Exception("Not implemented yet !");
79   return 0;
80 }
81
82 MEDCouplingPointSet *MEDCouplingUMeshDesc::deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception)
83 {
84   throw INTERP_KERNEL::Exception("Not implemented yet !");
85 }
86
87 void MEDCouplingUMeshDesc::shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception)
88 {
89   throw INTERP_KERNEL::Exception("Not implemented yet !");
90 }
91
92 void MEDCouplingUMeshDesc::checkCoherency() const throw(INTERP_KERNEL::Exception)
93 {
94   for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iter=_types.begin();iter!=_types.end();iter++)
95     {
96       if((int)INTERP_KERNEL::CellModel::GetCellModel(*iter).getDimension()!=_mesh_dim)
97         {
98           std::ostringstream message;
99           message << "MeshDesc invalid because dimension is " << _mesh_dim << " and there is presence of cell(s) with type " << (*iter);
100           throw INTERP_KERNEL::Exception(message.str().c_str());
101         }
102     }
103 }
104
105 void MEDCouplingUMeshDesc::checkCoherency1(double eps) const throw(INTERP_KERNEL::Exception)
106 {
107   checkCoherency();
108 }
109
110 void MEDCouplingUMeshDesc::checkCoherency2(double eps) const throw(INTERP_KERNEL::Exception)
111 {
112   checkCoherency1(eps);
113 }
114
115 void MEDCouplingUMeshDesc::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
116                                                            DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception)
117 {
118   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::checkDeepEquivalOnSameNodesWith : not implemented yet !");
119 }
120
121 void MEDCouplingUMeshDesc::setMeshDimension(unsigned meshDim)
122 {
123   _mesh_dim=meshDim;
124   declareAsNew();
125 }
126
127 int MEDCouplingUMeshDesc::getNumberOfCells() const
128 {
129   if(_desc_connec_index)
130     return _desc_connec_index->getNumberOfTuples()-1;
131   else
132     throw INTERP_KERNEL::Exception("Unable to get number of cells because no connectivity specified !");
133 }
134
135 int MEDCouplingUMeshDesc::getNumberOfFaces() const
136 {
137   if(_nodal_connec_face_index)
138     return _nodal_connec_face_index->getNumberOfTuples()-1;
139   else
140     throw INTERP_KERNEL::Exception("Unable to get number of faces because no connectivity specified !");
141 }
142
143 int MEDCouplingUMeshDesc::getCellMeshLength() const
144 {
145   return _desc_connec->getNbOfElems();
146 }
147
148 int MEDCouplingUMeshDesc::getFaceMeshLength() const
149 {
150   return _nodal_connec_face->getNbOfElems();
151 }
152
153 INTERP_KERNEL::NormalizedCellType MEDCouplingUMeshDesc::getTypeOfCell(int cellId) const
154 {
155   const int *desc_connec=_desc_connec->getConstPointer();
156   const int *desc_connec_index=_desc_connec_index->getConstPointer();
157   return (INTERP_KERNEL::NormalizedCellType)desc_connec[desc_connec_index[cellId]+1];
158 }
159
160 std::set<INTERP_KERNEL::NormalizedCellType> MEDCouplingUMeshDesc::getAllGeoTypes() const
161 {
162   return _types;
163 }
164
165 DataArrayInt *MEDCouplingUMeshDesc::giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception)
166 {
167   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::giveCellsWithType : not implemented yet !");
168 }
169
170 DataArrayInt *MEDCouplingUMeshDesc::computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception)
171 {
172   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeNbOfNodesPerCell : not implemented yet !");
173 }
174
175 DataArrayInt *MEDCouplingUMeshDesc::computeNbOfFacesPerCell() const throw(INTERP_KERNEL::Exception)
176 {
177   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeNbOfFacesPerCell : not implemented yet !");
178 }
179
180 DataArrayInt *MEDCouplingUMeshDesc::computeEffectiveNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception)
181 {
182   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeEffectiveNbOfNodesPerCell : not implemented yet !");
183 }
184
185 int MEDCouplingUMeshDesc::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const
186 {
187   const int *desc_connec=_desc_connec->getConstPointer();
188   const int *desc_connec_index=_desc_connec_index->getConstPointer();
189   int nbOfCells=getNumberOfCells();
190   int ret=0;
191   for(int i=0;i<nbOfCells;i++)
192     if((INTERP_KERNEL::NormalizedCellType) desc_connec[desc_connec_index[i]]==type)
193       ret++;
194   return ret;
195 }
196
197 void MEDCouplingUMeshDesc::getNodeIdsOfCell(int cellId, std::vector<int>& conn) const
198 {
199   throw INTERP_KERNEL::Exception("Not implemented yet !");
200 }
201
202 std::string MEDCouplingUMeshDesc::simpleRepr() const
203 {
204   std::string ret("Unstructured mesh with descending connectivity : ");
205   ret+=getName();
206   ret+="\n";
207   return ret;
208 }
209
210 std::string MEDCouplingUMeshDesc::advancedRepr() const
211 {
212   std::string ret("Unstructured mesh with descending connectivity : ");
213   ret+=getName();
214   ret+="\n";
215   return ret;
216 }
217
218 void MEDCouplingUMeshDesc::setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx)
219 {
220   DataArrayInt::SetArrayIn(descConn,_desc_connec);
221   DataArrayInt::SetArrayIn(descConnIndex,_desc_connec_index);
222   DataArrayInt::SetArrayIn(nodalFaceConn,_nodal_connec_face);
223   DataArrayInt::SetArrayIn(nodalFaceConnIndx,_nodal_connec_face_index);
224   computeTypes();
225 }
226
227 std::vector<int> MEDCouplingUMeshDesc::getDistributionOfTypes() const throw(INTERP_KERNEL::Exception)
228 {
229   throw INTERP_KERNEL::Exception("Not implemented yet !");
230 }
231
232 DataArrayInt *MEDCouplingUMeshDesc::checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception)
233 {
234   throw INTERP_KERNEL::Exception("Not implemented yet !");
235 }
236
237 void MEDCouplingUMeshDesc::splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception)
238 {
239   throw INTERP_KERNEL::Exception("Not implemented yet !");
240 }
241
242 void MEDCouplingUMeshDesc::getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const
243 {
244   MEDCouplingPointSet::getTinySerializationInformation(tinyInfoD,tinyInfo,littleStrings);
245   tinyInfo.push_back(getMeshDimension());
246   tinyInfo.push_back(getNumberOfNodes());
247   tinyInfo.push_back(getNumberOfCells());
248   tinyInfo.push_back(getCellMeshLength());
249   tinyInfo.push_back(getNumberOfFaces());
250   tinyInfo.push_back(getFaceMeshLength());
251 }
252
253 bool MEDCouplingUMeshDesc::isEmptyMesh(const std::vector<int>& tinyInfo) const
254 {
255   return tinyInfo[5]<=0;
256 }
257
258 void MEDCouplingUMeshDesc::resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const
259 {
260   std::vector<int> tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end());
261   MEDCouplingPointSet::resizeForUnserialization(tinyInfoTmp,a1,a2,littleStrings);
262   a1->alloc(tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7]+tinyInfo[6]+1,1);
263 }
264
265 void MEDCouplingUMeshDesc::serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const
266 {
267   MEDCouplingPointSet::serialize(a1,a2);
268   //
269   a1=DataArrayInt::New();
270   a1->alloc(getCellMeshLength()+getNumberOfCells()+1+getFaceMeshLength()+getNumberOfFaces()+1,1);
271   int *ptA1=a1->getPointer();
272   const int *descConn=_desc_connec->getConstPointer();
273   const int *descConnIndex=_desc_connec_index->getConstPointer();
274   const int *faceConn=_nodal_connec_face->getConstPointer();
275   const int *faceConnIndex=_nodal_connec_face_index->getConstPointer();
276   ptA1=std::copy(descConn,descConn+getCellMeshLength(),ptA1);
277   ptA1=std::copy(descConnIndex,descConnIndex+getNumberOfCells()+1,ptA1);
278   ptA1=std::copy(faceConn,faceConn+getFaceMeshLength(),ptA1);
279   std::copy(faceConnIndex,faceConnIndex+getNumberOfFaces()+1,ptA1);
280 }
281
282 void MEDCouplingUMeshDesc::unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings)
283 {
284   std::vector<int> tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end());
285   MEDCouplingPointSet::unserialization(tinyInfoD,tinyInfoTmp,a1,a2,littleStrings);
286   //
287   const int *recvBuffer=a1->getConstPointer();
288   DataArrayInt *descConn=DataArrayInt::New();
289   descConn->alloc(tinyInfo[5],1);
290   std::copy(recvBuffer,recvBuffer+tinyInfo[5],descConn->getPointer());
291   DataArrayInt *descConnIndex=DataArrayInt::New();
292   descConnIndex->alloc(tinyInfo[4]+1,1);
293   std::copy(recvBuffer+tinyInfo[5],recvBuffer+tinyInfo[5]+tinyInfo[4]+1,descConnIndex->getPointer());
294   DataArrayInt *faceConn=DataArrayInt::New();
295   faceConn->alloc(tinyInfo[7],1);
296   std::copy(recvBuffer+tinyInfo[5]+tinyInfo[4]+1,recvBuffer+tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7],faceConn->getPointer());
297   DataArrayInt *faceConnIndex=DataArrayInt::New();
298   faceConnIndex->alloc(tinyInfo[6]+1,1);
299   std::copy(recvBuffer+tinyInfo[5]+tinyInfo[4]+1+tinyInfo[7],
300             recvBuffer+tinyInfo[5]+tinyInfo[5]+1+tinyInfo[7]+tinyInfo[6]+1,faceConnIndex->getPointer());
301   setConnectivity(descConn,descConnIndex,faceConn,faceConnIndex);
302   descConn->decrRef();
303   descConnIndex->decrRef();
304   faceConn->decrRef();
305   faceConnIndex->decrRef();
306   setMeshDimension(tinyInfo[2]);
307 }
308
309 DataArrayDouble *MEDCouplingUMeshDesc::getBoundingBoxForBBTree() const
310 {
311   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getBoundingBoxForBBTree : not implemented yet !");
312 }
313
314 DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const double *bbox, double eps) const
315 {
316   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
317   int dim=getSpaceDimension();
318   double* elem_bb=new double[2*dim];
319   const int* conn      = _desc_connec->getConstPointer();
320   const int* conn_index= _desc_connec_index->getConstPointer();
321   const int* face      = _nodal_connec_face->getConstPointer();
322   const int* face_index= _nodal_connec_face_index->getConstPointer();
323   const double* coords = getCoords()->getConstPointer();
324   int nbOfCells=getNumberOfCells();
325   for ( int ielem=0; ielem<nbOfCells;ielem++ )
326     {
327       for (int i=0; i<dim; i++)
328         {
329           elem_bb[i*2]=std::numeric_limits<double>::max();
330           elem_bb[i*2+1]=-std::numeric_limits<double>::max();
331         }
332
333       for (int jface=conn_index[ielem]+1; jface<conn_index[ielem+1]; jface++)//+1 due to offset of cell type.
334         {
335           int iface=conn[jface];
336           for(int inode=face_index[iface]+1;inode<face_index[iface+1];inode++)
337             {
338               int node=face[inode];
339               for (int idim=0; idim<dim; idim++)
340                 {
341                   if ( coords[node*dim+idim] < elem_bb[idim*2] )
342                     {
343                       elem_bb[idim*2] = coords[node*dim+idim] ;
344                     }
345                   if ( coords[node*dim+idim] > elem_bb[idim*2+1] )
346                     {
347                       elem_bb[idim*2+1] = coords[node*dim+idim] ;
348                     }
349                 }
350             }
351         }
352       if(intersectsBoundingBox(elem_bb, bbox, dim, eps))
353         elems->pushBackSilent(ielem);
354     }
355   delete [] elem_bb;
356   return elems.retn();
357 }
358
359 DataArrayInt *MEDCouplingUMeshDesc::getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps)
360 {
361   MEDCouplingAutoRefCountObjectPtr<DataArrayInt> elems=DataArrayInt::New(); elems->alloc(0,1);
362   int dim=getSpaceDimension();
363   double* elem_bb=new double[2*dim];
364   const int* conn      = _desc_connec->getConstPointer();
365   const int* conn_index= _desc_connec_index->getConstPointer();
366   const int* face      = _nodal_connec_face->getConstPointer();
367   const int* face_index= _nodal_connec_face_index->getConstPointer();
368   const double* coords = getCoords()->getConstPointer();
369   int nbOfCells=getNumberOfCells();
370   for ( int ielem=0; ielem<nbOfCells;ielem++ )
371     {
372       for (int i=0; i<dim; i++)
373         {
374           elem_bb[i*2]=std::numeric_limits<double>::max();
375           elem_bb[i*2+1]=-std::numeric_limits<double>::max();
376         }
377
378       for (int jface=conn_index[ielem]+1; jface<conn_index[ielem+1]; jface++)//+1 due to offset of cell type.
379         {
380           int iface=conn[jface];
381           for(int inode=face_index[iface]+1;inode<face_index[iface+1];inode++)
382             {
383               int node=face[inode];
384               for (int idim=0; idim<dim; idim++)
385                 {
386                   if ( coords[node*dim+idim] < elem_bb[idim*2] )
387                     {
388                       elem_bb[idim*2] = coords[node*dim+idim] ;
389                     }
390                   if ( coords[node*dim+idim] > elem_bb[idim*2+1] )
391                     {
392                       elem_bb[idim*2+1] = coords[node*dim+idim] ;
393                     }
394                 }
395             }
396         }
397       if (intersectsBoundingBox(bbox, elem_bb, dim, eps))
398         elems->pushBackSilent(ielem);
399     }
400   delete [] elem_bb;
401   return elems.retn();
402 }
403
404 MEDCouplingPointSet *MEDCouplingUMeshDesc::mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const
405 {
406   throw INTERP_KERNEL::Exception("Not implemented yet !");
407 }
408
409 MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const
410 {
411   throw INTERP_KERNEL::Exception("Not implemented yet !");
412   return 0;
413 }
414
415 MEDCouplingPointSet *MEDCouplingUMeshDesc::buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const
416 {
417   throw INTERP_KERNEL::Exception("Not implemented yet !");
418   return 0;
419 }
420
421 MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
422 {
423   throw INTERP_KERNEL::Exception("Not implemented yet !");
424 }
425
426 MEDCouplingPointSet *MEDCouplingUMeshDesc::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
427 {
428   throw INTERP_KERNEL::Exception("Not implemented yet !");
429 }
430
431 void MEDCouplingUMeshDesc::computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const throw(INTERP_KERNEL::Exception)
432 {
433   throw INTERP_KERNEL::Exception("Not implemented yet !");
434 }
435
436 DataArrayInt *MEDCouplingUMeshDesc::simplexize(int policy) throw(INTERP_KERNEL::Exception)
437 {
438   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::simplexize : Not implemented yet !");
439 }
440
441 DataArrayInt *MEDCouplingUMeshDesc::findBoundaryNodes() const
442 {
443   throw INTERP_KERNEL::Exception("Not implemented yet !");
444 }
445
446 MEDCouplingPointSet *MEDCouplingUMeshDesc::buildBoundaryMesh(bool keepCoords) const
447 {
448   throw INTERP_KERNEL::Exception("Not implemented yet !");
449   return 0;
450 }
451
452 MEDCouplingUMesh *MEDCouplingUMeshDesc::buildUnstructured() const throw(INTERP_KERNEL::Exception)
453 {
454   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::buildUnstructured : not implemented yet !");
455 }
456
457 void MEDCouplingUMeshDesc::renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception)
458 {
459   throw INTERP_KERNEL::Exception("Available for UMesh desc but not implemented yet !");
460 }
461
462 void MEDCouplingUMeshDesc::renumberNodesInConn(const int *newNodeNumbersO2N)
463 {
464   throw INTERP_KERNEL::Exception("Not implemented yet !");
465 }
466
467 MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureField(bool isAbs) const
468 {
469   throw INTERP_KERNEL::Exception("Not implemented yet !");
470   return 0;
471 }
472
473 MEDCouplingFieldDouble *MEDCouplingUMeshDesc::getMeasureFieldOnNode(bool isAbs) const
474 {
475   throw INTERP_KERNEL::Exception("Not implemented yet !");
476   return 0;
477 }
478
479 MEDCouplingFieldDouble *MEDCouplingUMeshDesc::buildOrthogonalField() const
480 {
481   if(getMeshDimension()!=2)
482     throw INTERP_KERNEL::Exception("Expected a cmesh with meshDim == 2 !");
483   throw INTERP_KERNEL::Exception("Not implemented yet !");
484   return 0;
485 }
486
487 DataArrayInt *MEDCouplingUMeshDesc::zipCoordsTraducer() throw(INTERP_KERNEL::Exception)
488 {
489   throw INTERP_KERNEL::Exception("Not implemented yet !");
490   return 0;
491 }
492
493 void MEDCouplingUMeshDesc::findCommonCells(int compType, int startCellId, DataArrayInt *& commonCellsArr, DataArrayInt *& commonCellsIArr) const throw(INTERP_KERNEL::Exception)
494 {
495   throw INTERP_KERNEL::Exception("Not implemented yet !");
496 }
497
498 void MEDCouplingUMeshDesc::getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw(INTERP_KERNEL::Exception)
499 {
500   throw INTERP_KERNEL::Exception("Not implemented yet !");
501 }
502
503 void MEDCouplingUMeshDesc::computeTypes()
504 {
505   if(_desc_connec && _desc_connec_index)
506     {
507       _types.clear();
508       const int *conn=_desc_connec->getConstPointer();
509       const int *connIndex=_desc_connec_index->getConstPointer();
510       int nbOfElem=_desc_connec_index->getNbOfElems()-1;
511       for(const int *pt=connIndex;pt!=connIndex+nbOfElem;pt++)
512         _types.insert((INTERP_KERNEL::NormalizedCellType)conn[*pt]);
513     }
514 }
515
516 void MEDCouplingUMeshDesc::checkFullyDefined() const throw(INTERP_KERNEL::Exception)
517 {
518   if(!_desc_connec || !_desc_connec_index || !_nodal_connec_face || !_nodal_connec_face_index || !_coords)
519     throw INTERP_KERNEL::Exception("full connectivity and coordinates not set in unstructured mesh.");
520 }
521
522 MEDCouplingMesh *MEDCouplingUMeshDesc::mergeMyselfWith(const MEDCouplingMesh *other) const
523 {  
524   throw INTERP_KERNEL::Exception("Not implemented yet !");
525   return 0;
526 }
527
528 DataArrayInt *MEDCouplingUMeshDesc::getNodeIdsInUse(int& nbrOfNodesInUse) const throw(INTERP_KERNEL::Exception)
529 {
530   throw INTERP_KERNEL::Exception("Not implemented yet !");
531 }
532
533 void MEDCouplingUMeshDesc::fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const
534 {
535   throw INTERP_KERNEL::Exception("Not implemented yet !");
536 }
537
538 DataArrayDouble *MEDCouplingUMeshDesc::getBarycenterAndOwner() const
539 {
540   throw INTERP_KERNEL::Exception("Not implemented yet !");
541   return 0;
542 }
543
544 int MEDCouplingUMeshDesc::getCellContainingPoint(const double *pos, double eps) const
545 {
546   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getCellContainingPoint : not implemented yet !");
547 }
548
549 void MEDCouplingUMeshDesc::writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception)
550 {
551   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::writeVTKLL : not implemented yet !");
552 }
553
554 std::string MEDCouplingUMeshDesc::getVTKDataSetType() const throw(INTERP_KERNEL::Exception)
555 {
556   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getVTKDataSetType : not implemented yet !");
557 }
558
559 DataArrayDouble *MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception)
560 {
561   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::computeIsoBarycenterOfNodesPerCell : not implemented yet !");
562 }
563
564 void MEDCouplingUMeshDesc::reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception)
565 {
566   stream << "MEDCouplingUMeshDesc C++ instance at " << this << ". Name : \"" << getName() << "\".";
567 }
568
569 int MEDCouplingUMeshDesc::getNumberOfNodesInCell(int cellId) const throw(INTERP_KERNEL::Exception)
570 {
571   throw INTERP_KERNEL::Exception("MEDCouplingUMeshDesc::getNumberOfNodesInCell : not implemented yet !");
572 }