{
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 ;
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;
}
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;
{
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);
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);