X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingUMesh_intersection.cxx;h=649d2aac44b75f9b67391ebbf8e9595d16a36571;hb=e7835cba1eb17f50ef4e130c2cb8d0f54bc25083;hp=75b2b1683c14f368a2996cac8a6a6257fc42a003;hpb=e12ff086a9d3d6c1eb2b69d55e9a86a31c646764;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index 75b2b1683..649d2aac4 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -282,7 +282,7 @@ namespace MEDCoupling } /** - * Construct a mapping between set of Nodes and the standart MEDCoupling connectivity format (c, cI). + * Construct a mapping between set of Nodes and the standard MEDCoupling connectivity format (c, cI). */ void MEDCouplingUMeshBuildQPFromMesh3(const double *coo1, int offset1, const double *coo2, int offset2, const std::vector& addCoo, const int *desc1Bg, const int *desc1End, const std::vector >& intesctEdges1, @@ -337,7 +337,7 @@ bool MEDCouplingUMesh::Colinearize2DCell(const double *coords, const int *connBg // This initializes posBaseElt. if(nbOfTurn==0) { - for(unsigned i=1;i >& intersectEdge1, * (Only present for its coords in case of 'subDiv' shares some nodes of 'm1') * \param m2 is expected to be a mesh of meshDimension equal to 1 and spaceDim equal to 2. No check of that is performed by this method. * \param addCoo input parameter with additional nodes linked to intersection of the 2 meshes. - * \param[out] intersectEdge the same content as subDiv, but correclty oriented. + * \param[out] intersectEdge the same content as subDiv, but correctly oriented. */ void MEDCouplingUMesh::BuildIntersectEdges(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, const std::vector& addCoo, @@ -1174,7 +1174,7 @@ void MEDCouplingUMesh::Intersect1DMeshes(const MEDCouplingUMesh *m1Desc, const M INTERP_KERNEL::QuadraticPlanarArcDetectionPrecision arcPrec(eps); const int *c1(m1Desc->getNodalConnectivity()->begin()),*ci1(m1Desc->getNodalConnectivityIndex()->begin()); // Build BB tree of all edges in the tool mesh (second mesh) - MCAuto bbox1Arr(m1Desc->getBoundingBoxForBBTree()),bbox2Arr(m2Desc->getBoundingBoxForBBTree()); + MCAuto bbox1Arr(m1Desc->getBoundingBoxForBBTree(eps)),bbox2Arr(m2Desc->getBoundingBoxForBBTree(eps)); const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin()); int nDescCell1(m1Desc->getNumberOfCells()),nDescCell2(m2Desc->getNumberOfCells()); intersectEdge1.resize(nDescCell1); @@ -1206,7 +1206,7 @@ void MEDCouplingUMesh::Intersect1DMeshes(const MEDCouplingUMesh *m1Desc, const M for(std::size_t iii=0;iiiincrRef(); nodesSafe[iii]=*itt; } // end of protection - // Performs egde cutting: + // Performs edge cutting: pol1->splitAbs(*pol2,map1,map2,offset1,offset2,candidates2,intersectEdge1[i],i,colinear2,subDiv2,addCoo,mergedNodes); delete pol2; delete pol1; @@ -1252,7 +1252,7 @@ void MEDCouplingUMesh::IntersectDescending2DMeshes(const MEDCouplingUMesh *m1, c * (newly created) nodes corresponding to the edge intersections. * Output params: * @param[out] cr, crI connectivity of the resulting mesh - * @param[out] cNb1, cNb2 correspondance arrays giving for the merged mesh the initial cells IDs in m1 / m2 + * @param[out] cNb1, cNb2 correspondence arrays giving for the merged mesh the initial cells IDs in m1 / m2 * TODO: describe input parameters */ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCouplingUMesh *m1, const int *desc1, const int *descIndx1, @@ -1269,7 +1269,7 @@ void MEDCouplingUMesh::BuildIntersecting2DCellsFromEdges(double eps, const MEDCo const int *conn2(m2->getNodalConnectivity()->begin()),*connI2(m2->getNodalConnectivityIndex()->begin()); int offset2(offset1+m2->getNumberOfNodes()); int offset3(offset2+((int)addCoords.size())/2); - MCAuto bbox1Arr(m1->getBoundingBoxForBBTree()),bbox2Arr(m2->getBoundingBoxForBBTree()); + MCAuto bbox1Arr(m1->getBoundingBoxForBBTree(eps)),bbox2Arr(m2->getBoundingBoxForBBTree(eps)); const double *bbox1(bbox1Arr->begin()),*bbox2(bbox2Arr->begin()); // Here a BBTree on 2D-cells, not on segments: BBTree myTree(bbox2,0,0,m2->getNumberOfCells(),eps); @@ -1431,7 +1431,7 @@ void MEDCouplingUMesh::buildSubCellsFromCut(const std::vector< std::pair desc1(DataArrayInt::New()),descIndx1(DataArrayInt::New()),revDesc1(DataArrayInt::New()),revDescIndx1(DataArrayInt::New()); MCAuto mDesc(buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1)); const int *c(mDesc->getNodalConnectivity()->begin()),*ci(mDesc->getNodalConnectivityIndex()->begin()),*rd(revDesc1->begin()),*rdi(revDescIndx1->begin()); - MCAuto bboxArr(mDesc->getBoundingBoxForBBTree()); + MCAuto bboxArr(mDesc->getBoundingBoxForBBTree(eps)); const double *bbox(bboxArr->begin()),*coords(getCoords()->begin()); int nCell(getNumberOfCells()),nDescCell(mDesc->getNumberOfCells()); std::vector< std::vector > intersectEdge(nDescCell),overlapEdge(nDescCell); @@ -1952,7 +1952,7 @@ DataArrayInt *MEDCouplingUMesh::conformize2D(double eps) * If yes, the cell is "repaired" to minimize at most its number of edges. So this method do not change the overall shape of cells in \a this (with eps precision). * This method do not take care of shared edges between cells, so this method can lead to a non conform mesh (\a this). If a conform mesh is required you're expected * to invoke MEDCouplingUMesh::mergeNodes and MEDCouplingUMesh::conformize2D right after this call. - * This method works on any 2D geometric types of cell (even static one). If a cell is touched its type becomes dynamic automaticaly. For 2D "repaired" quadratic cells + * This method works on any 2D geometric types of cell (even static one). If a cell is touched its type becomes dynamic automatically. For 2D "repaired" quadratic cells * new nodes for center of merged edges is are systematically created and appended at the end of the previously existing nodes. * * If the returned array is empty it means that nothing has changed in \a this (as if it were a const method). If the array is not empty the connectivity of \a this is modified @@ -2088,7 +2088,7 @@ void MEDCouplingUMesh::ReplaceEdgeInFace(const int * sIdxConn, const int * sIdxC throw INTERP_KERNEL::Exception("MEDCouplingUMesh::ReplaceEdgeInFace: internal error, should never happen!"); int d = distance(startPos, endPos); if (d == 1 || d == (1-dst)) // don't use modulo, for neg numbers, result is implementation defined ... - modifiedFace.insert(++startPos, ++insidePoints.begin(), --insidePoints.end()); // insidePoints also contains start and end node. Those dont need to be inserted. + modifiedFace.insert(++startPos, ++insidePoints.begin(), --insidePoints.end()); // insidePoints also contains start and end node. Those don't need to be inserted. else modifiedFace.insert(++endPos, ++insidePoints.rbegin(), --insidePoints.rend()); } @@ -2142,7 +2142,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) MCAuto connSlaDesc(MEDCouplingSkyLineArray::New(mDesc->getNodalConnectivityIndex(), mDesc->getNodalConnectivity())); // Build BBTree - MCAuto bboxArr(mDesc->getBoundingBoxForBBTree()); + MCAuto bboxArr(mDesc->getBoundingBoxForBBTree(eps)); const double *bbox(bboxArr->begin()); getCoords()->begin(); int nDescCell(mDesc->getNumberOfCells()); BBTree myTree(bbox,0,0,nDescCell,-eps); @@ -2166,7 +2166,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) fill(hit.begin(), hit.end(), false); vector hitPoly; // the final result: which 3D cells have been modified. - for( vector>::const_iterator it = S.begin(); it != S.end(); it++) + for( vector >::const_iterator it = S.begin(); it != S.end(); it++) { int faceIdx = (*it).second; if (hit[faceIdx]) continue; @@ -2264,7 +2264,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) { if (packsIds[jj] == -1) // The below should never happen - if a face is used several times, with a different layout of the nodes - // it means that is is already conform, so it is *not* hit by the algorithm. The algorithm only hits + // it means that it is already conform, so it is *not* hit by the algorithm. The algorithm only hits // faces which are actually used only once, by a single cell. This is different for edges below. throw INTERP_KERNEL::Exception("MEDCouplingUMesh::conformize3D: Could not find face in connectivity! Internal error."); else @@ -2312,7 +2312,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) // mDesc2->writeVTK("/tmp/toto_desc2_confInter.vtu"); const int *revDescIP2(revDescI2->getConstPointer()), *revDescP2(revDesc2->getConstPointer()); const int *cDesc2(mDesc2->getNodalConnectivity()->begin()),*cIDesc2(mDesc2->getNodalConnectivityIndex()->begin()); - MCAuto bboxArr(mDesc2->getBoundingBoxForBBTree()); + MCAuto bboxArr(mDesc2->getBoundingBoxForBBTree(eps)); const double *bbox2(bboxArr->begin()); int nDesc2Cell=mDesc2->getNumberOfCells(); BBTree myTree2(bbox2,0,0,nDesc2Cell,-eps); @@ -2322,7 +2322,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) DataArrayDouble * lens = lenF->getArray(); // Sort edges by decreasing length: - vector> S; + vector > S; for(std::size_t i=0;i < lens->getNumberOfTuples();i++) { pair p = make_pair(lens->getIJ(i, 0), i); @@ -2333,7 +2333,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) vector hit(nDesc2Cell); fill(hit.begin(), hit.end(), false); - for( vector>::const_iterator it = S.begin(); it != S.end(); it++) + for( vector >::const_iterator it = S.begin(); it != S.end(); it++) { int eIdx = (*it).second; if (hit[eIdx]) @@ -2401,7 +2401,7 @@ DataArrayInt *MEDCouplingUMesh::conformize3D(double eps) mPartCand->getNodalConnectivity()->begin(), mPartCand->getNodalConnectivityIndex()->begin(), idsGoodLine->begin(), idsGoodLine->end(), /*out*/insidePoints, hitSegs); - // Optim: smaller segments completly included in eIdx and not split won't need any further treatment: + // Optim: smaller segments completely included in eIdx and not split won't need any further treatment: for (vector::const_iterator its=hitSegs.begin(); its != hitSegs.end(); ++its) hit[cands2[*its]] = true;