]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Mon, 29 Nov 2010 13:45:49 +0000 (13:45 +0000)
committerageay <ageay>
Mon, 29 Nov 2010 13:45:49 +0000 (13:45 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx

index 8b62afb68503b5a3bded2a0478229f91194716da..1053b727f441931196cb394094b95dffae02fb72 100644 (file)
@@ -572,7 +572,7 @@ void MEDCouplingUMesh::unPolyze()
 {
   checkFullyDefined();
   if(getMeshDimension()<=1)
-    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertDegeneratedCells works on umeshes with meshdim equals to 2 or 3 !");
+    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::unPolyze works on umeshes with meshdim equals to 2 or 3 !");
   int nbOfCells=getNumberOfCells();
   if(nbOfCells<1)
     return ;
@@ -2237,7 +2237,7 @@ void MEDCouplingUMesh::convertDegeneratedCells() throw(INTERP_KERNEL::Exception)
       INTERP_KERNEL::NormalizedCellType newType=simplifyDegeneratedCell(type,conn+posOfCurCell+1,lgthOfCurCell-1,
                                                                         conn+newPos+1,newLgth);
       conn[newPos]=newType;
-      newPos=posOfCurCell+newLgth+1;
+      newPos+=newLgth+1;
       posOfCurCell=index[i+1];
       index[i+1]=newPos;
     }
@@ -3307,7 +3307,10 @@ int *MEDCouplingUMesh::getFullPolyh3DCell(INTERP_KERNEL::NormalizedCellType type
         if(std::find(tmp2,tmp2+newPos,work[k])==tmp2+newPos)
           tmp2[newPos++]=work[k];
       if(newPos<3)
-        continue;
+        {
+          delete [] tmp2;
+          continue;
+        }
       int tmp3;
       faces.push_back(tryToUnPoly2D(tmp2,newPos,work,tmp3));
       delete [] tmp2;
@@ -3336,7 +3339,7 @@ INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::tryToUnPoly3D(const int *con
     {
     case 806:
       return tryToUnPolyHex8(conn,nbOfFaces,lgth,retConn,retLgth);
-    case 506:
+    case 605:
       return tryToUnPolyPenta6(conn,nbOfFaces,lgth,retConn,retLgth);
     case 505:
       return tryToUnPolyPyra5(conn,nbOfFaces,lgth,retConn,retLgth);
@@ -3559,25 +3562,27 @@ INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::tryToUnPolyPyra5(const int *
       bool ok=true;
       int point=-1;
       for(int i=0;i<5 && ok;i++)
-        if(i!=quad4_pos)
-          {
-            std::vector<int> tmp;
-            std::set<int> conn2(w,w+3);
-            std::set_intersection(conn2.begin(),conn2.end(),quad4S.begin(),quad4S.end(),std::back_insert_iterator< std::vector<int> >(tmp));
-            ok=tmp.size()==2;
-            tmp.clear();
-            std::set_difference(conn2.begin(),conn2.end(),quad4S.begin(),quad4S.end(),std::back_insert_iterator< std::vector<int> >(tmp));
-            ok=ok && tmp.size()==1;
-            if(ok)
-              {
-                if(point>=0)
-                  ok=point==tmp[0];
-                else
-                  point=tmp[0];
-              }
-            w=std::find(w,conn+lgth,-1);
-            w++;
-          }
+        {
+          if(i!=quad4_pos)
+            {
+              std::vector<int> tmp;
+              std::set<int> conn2(w,w+3);
+              std::set_intersection(conn2.begin(),conn2.end(),quad4S.begin(),quad4S.end(),std::back_insert_iterator< std::vector<int> >(tmp));
+              ok=tmp.size()==2;
+              tmp.clear();
+              std::set_difference(conn2.begin(),conn2.end(),quad4S.begin(),quad4S.end(),std::back_insert_iterator< std::vector<int> >(tmp));
+              ok=ok && tmp.size()==1;
+              if(ok)
+                {
+                  if(point>=0)
+                    ok=point==tmp[0];
+                  else
+                    point=tmp[0];
+                }
+            }
+          w=std::find(w,conn+lgth,-1);
+          w++;
+        }
       if(ok && point>=0)
         {
           std::copy(quad4,quad4+4,retConn);