From 8a021468c95b4086cceef0ed606a03b163ad78ab Mon Sep 17 00:00:00 2001 From: ageay Date: Wed, 15 Feb 2012 14:57:03 +0000 Subject: [PATCH] IntersectMesh with quadratic elements --- .../InterpKernelGeo2DQuadraticPolygon.cxx | 122 +++++++++--------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx index d98427222..0e4fc6181 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DQuadraticPolygon.cxx @@ -224,7 +224,7 @@ void QuadraticPolygon::splitAbs(QuadraticPolygon& other, const std::map& edgesThis, int cellIdThis, std::vector< std::vector >& edgesInOtherColinearWithThis, std::vector< std::vector >& subDivOther, std::vector& addCoo) { double xBaryBB, yBaryBB; - double fact=normalize(&other, xBaryBB, yBaryBB); + double fact=normalizeExt(&other, xBaryBB, yBaryBB); // IteratorOnComposedEdge it1(this),it3(&other); MergePoints merge; @@ -232,21 +232,21 @@ void QuadraticPolygon::splitAbs(QuadraticPolygon& other, const std::map mapAddCoo; - for(it3.first();!it3.finished();it3.next(),i++) + for(it3.first();!it3.finished();it3.next(),i++)//iteration over 'other' _sub_edges { QuadraticPolygon otherTmp; ElementaryEdge* curE3=it3.current(); otherTmp.pushBack(new ElementaryEdge(curE3->getPtr(),curE3->getDirection())); curE3->getPtr()->incrRef(); IteratorOnComposedEdge it2(&otherTmp); - for(it2.first();!it2.finished();it2.next()) + for(it2.first();!it2.finished();it2.next())//iteration on subedges of 'other->_sub_edge' { ElementaryEdge* curE2=it2.current(); if(!curE2->isThereStartPoint()) it1.first(); else it1=curE2->getIterator(); - for(;!it1.finished();) - { + for(;!it1.finished();)//iteration over 'this' _sub_edges + { ElementaryEdge* curE1=it1.current(); merge.clear(); if(curE1->getPtr()->intersectWith(curE2->getPtr(),merge,*c1,*c2)) @@ -307,49 +307,49 @@ void QuadraticPolygon::buildFromCrudeDataArray(const std::map& mapp, bool isQuad, const int *nodalBg, const double *coords, const int *descBg, const int *descEnd, const std::vector >& intersectEdges) { - if(!isQuad) - { - bool direct=descBg[edgePos]>0; - int edgeId=abs(descBg[edgePos])-1; - const std::vector& subEdge=intersectEdges[edgeId]; - std::size_t nbOfSubEdges=subEdge.size()/2; - for(std::size_t j=0;j0; - int edgeId=abs(descBg[edgePos])-1; - const std::vector& subEdge=intersectEdges[edgeId]; - std::size_t nbOfSubEdges=subEdge.size()/2; - if(colinearity) - { - for(std::size_t j=0;jdecrRef(); - } - st0->decrRef(); endd0->decrRef(); middle0->decrRef(); - } + if(!isQuad) + { + bool direct=descBg[edgePos]>0; + int edgeId=abs(descBg[edgePos])-1; + const std::vector& subEdge=intersectEdges[edgeId]; + std::size_t nbOfSubEdges=subEdge.size()/2; + for(std::size_t j=0;j0; + int edgeId=abs(descBg[edgePos])-1; + const std::vector& subEdge=intersectEdges[edgeId]; + std::size_t nbOfSubEdges=subEdge.size()/2; + if(colinearity) + { + for(std::size_t j=0;jdecrRef(); + } + st0->decrRef(); endd0->decrRef(); middle0->decrRef(); + } } void QuadraticPolygon::appendSubEdgeFromCrudeDataArray(Edge *baseEdge, std::size_t j, bool direct, int edgeId, const std::vector& subEdge, const std::map& mapp) @@ -357,19 +357,19 @@ void QuadraticPolygon::appendSubEdgeFromCrudeDataArray(Edge *baseEdge, std::size std::size_t nbOfSubEdges=subEdge.size()/2; if(!baseEdge) {//it is not a quadratic subedge - Node *start=(*mapp.find(direct?subEdge[2*j]:subEdge[2*nbOfSubEdges-2*j-1])).second; - Node *end=(*mapp.find(direct?subEdge[2*j+1]:subEdge[2*nbOfSubEdges-2*j-2])).second; - ElementaryEdge *e=ElementaryEdge::BuildEdgeFromCrudeDataArray(true,start,end); - pushBack(e); - } - else - {//it is a quadratic subedge - Node *start=(*mapp.find(direct?subEdge[2*j]:subEdge[2*nbOfSubEdges-2*j-1])).second; - Node *end=(*mapp.find(direct?subEdge[2*j+1]:subEdge[2*nbOfSubEdges-2*j-2])).second; - Edge *ee=baseEdge->buildEdgeLyingOnMe(start,end); - ElementaryEdge *eee=new ElementaryEdge(ee,true); - pushBack(eee); - } + Node *start=(*mapp.find(direct?subEdge[2*j]:subEdge[2*nbOfSubEdges-2*j-1])).second; + Node *end=(*mapp.find(direct?subEdge[2*j+1]:subEdge[2*nbOfSubEdges-2*j-2])).second; + ElementaryEdge *e=ElementaryEdge::BuildEdgeFromCrudeDataArray(true,start,end); + pushBack(e); + } + else + {//it is a quadratic subedge + Node *start=(*mapp.find(direct?subEdge[2*j]:subEdge[2*nbOfSubEdges-2*j-1])).second; + Node *end=(*mapp.find(direct?subEdge[2*j+1]:subEdge[2*nbOfSubEdges-2*j-2])).second; + Edge *ee=baseEdge->buildEdgeLyingOnMe(start,end); + ElementaryEdge *eee=new ElementaryEdge(ee,true); + pushBack(eee); + } } /*! -- 2.39.2