newVorCell->zipCoords();
MCAuto<MEDCouplingUMesh> modifiedCell(cells->buildPartOfMySelfSlice(0,1,1,true));
modifiedCell->zipCoords();
+ l0[poly]=modifiedCell;
+ if(std::find(polygsToIterOn.begin(),polygsToIterOn.end(),poly)!=polygsToIterOn.end())// we iterate on a polyhedron containg the point to add pt -> add cells sharing faces with just computed newVorCell
+ {
+ MCAuto<MEDCouplingUMesh> faces2;
+ {
+ MCAuto<DataArrayInt> d2(DataArrayInt::New()),d2I(DataArrayInt::New()),rd2(DataArrayInt::New()),rd2I(DataArrayInt::New());
+ faces2=newVorCell->buildDescendingConnectivity(d2,d2I,rd2,rd2I);
+ }
+ MCAuto<MEDCouplingUMesh> faces3(faces2->buildPartOfMySelfSlice(1,faces2->getNumberOfCells(),1,true));// suppress internal face
+ MCAuto<MEDCouplingUMesh> facesOfCurSplitPol(faces->buildPartOfMySelf(d->begin()+dI->getIJ(poly,0),d->begin()+dI->getIJ(poly+1,0),true));
+ // intersection between the out faces of newVorCell and the neighbor faces of poly polyhedron -> candidates
+ MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(facesOfCurSplitPol);
+ MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(faces3);
+ INTERP_KERNEL::Interpolation3DSurf interpolation;
+ interpolation.setMinDotBtwPlane3DSurfIntersect(eps2);
+ interpolation.setMaxDistance3DSurfIntersect(eps);
+ interpolation.setPrecision(1e-12);
+ std::vector<std::map<int,double> > matrix;
+ interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix,"P0P0");
+ std::set<int> zeCandidates;
+ for(std::vector<std::map<int,double> >::const_iterator it2=matrix.begin();it2!=matrix.end();it2++)
+ for(std::map<int,double>::const_iterator it3=(*it2).begin();it3!=(*it2).end();it3++)
+ {
+ int faceIdInVorTess(d->getIJ(dI->getIJ(poly,0)+(*it3).first,0));
+ for(const int *it4=rd->begin()+rdI->getIJ(faceIdInVorTess,0);it4!=rd->begin()+rdI->getIJ(faceIdInVorTess+1,0);it4++)
+ {
+ if(*it4!=poly)
+ zeCandidates.insert(*it4);
+ }
+ }
+ std::set<int> tmp2,newElementsToDo;
+ std::set_difference(zeCandidates.begin(),zeCandidates.end(),elemsDone.begin(),elemsDone.end(),std::inserter(tmp2,tmp2.begin()));
+ std::set_union(elemsToDo.begin(),elemsToDo.end(),tmp2.begin(),tmp2.end(),std::inserter(newElementsToDo,newElementsToDo.begin()));
+ elemsToDo=newElementsToDo;
+ }
+ //
newVorCells.push_back(newVorCell);
- ii++;
+ l0[poly]=modifiedCell;
}
l0.push_back(MergeVorCells3D(newVorCells,eps));
}
self.assertRaises(InterpKernelException,m.buildUnstructured().splitProfilePerType,invalidPfl)
##
pfl1=DataArrayInt([1,2,3])
-- a=m.checkTypeConsistencyAndContig([NORM_QUAD4,3,0],[pfl1])
++ a=m.getCellsContainingPointcheckTypeConsistencyAndContig([NORM_QUAD4,3,0],[pfl1])
b=m.buildUnstructured().checkTypeConsistencyAndContig([NORM_QUAD4,3,0],[pfl1])
self.assertTrue(a.isEqual(b) and pfl1.getHiddenCppPointer(),a.getHiddenCppPointer())
#