From: ageay Date: Fri, 23 Oct 2009 05:42:52 +0000 (+0000) Subject: removing bug. MEDMEM test coming soon. X-Git-Tag: V5_1_main_FINAL~299 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00c1f4d0ff6edaeb30c63e383fe17cd344464994;p=tools%2Fmedcoupling.git removing bug. MEDMEM test coming soon. --- diff --git a/src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx b/src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx index 2f71ccc85..2018d980f 100644 --- a/src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx +++ b/src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx @@ -41,10 +41,10 @@ namespace INTERP_KERNEL std::vector< std::vector > coordsOfSources(icellsS.size()); int ii=0; for(typename std::vector::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++,ii++) - PlanarIntersector::getRealSourceCoordinates(*iter,coordsOfSources[ii]); - const ConnType *startOfCellNodeConn=PlanarIntersector::_connectT+OTT::conn2C(PlanarIntersector::_connIndexT[icellT]); + PlanarIntersector::getRealSourceCoordinates(OTT::indFC(*iter),coordsOfSources[ii]); + const ConnType *startOfCellNodeConnT=PlanarIntersector::_connectT+OTT::conn2C(PlanarIntersector::_connIndexT[icellT]); std::vector coordsTarget; - PlanarIntersector::getRealTargetCoordinates(icellT,coordsTarget); + PlanarIntersector::getRealTargetCoordinates(OTT::indFC(icellT),coordsTarget); int nbNodesT=coordsTarget.size()/SPACEDIM; ii=0; for(typename std::vector::const_iterator iter2=icellsS.begin();iter2!=icellsS.end();iter2++,ii++) @@ -55,9 +55,9 @@ namespace INTERP_KERNEL PlanarIntersector::projectionThis(&tmpSource[0],&tmpTarget[0],tmpSource.size()/SPACEDIM,nbNodesT); for(int nodeIdT=0;nodeIdT::isElementContainsPointAlg2D(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],tmpSource.size()/SPACEDIM) ) + if(PointLocatorAlgos::isElementContainsPointAlg2D(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],tmpSource.size()/SPACEDIM,PlanarIntersector::_precision)) { - ConnType curNodeTInCmode=OTT::coo2C(startOfCellNodeConn[nodeIdT]); + ConnType curNodeTInCmode=OTT::coo2C(startOfCellNodeConnT[nodeIdT]); typename MyMatrix::value_type& resRow=res[curNodeTInCmode]; typename MyMatrix::value_type::const_iterator iterRes=resRow.find(OTT::indFC(*iter2)); if(iterRes==resRow.end()) diff --git a/src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx b/src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx index fbc655c9c..be634a069 100644 --- a/src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx +++ b/src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx @@ -42,17 +42,17 @@ namespace INTERP_KERNEL { std::vector CoordsT; typename MyMatrix::value_type& resRow=res[icellT]; - PlanarIntersector::getRealTargetCoordinates(icellT,CoordsT); + PlanarIntersector::getRealTargetCoordinates(OTT::indFC(icellT),CoordsT); double baryT[SPACEDIM]; double baryTTmp[SPACEDIM]; calculateBarycenterDyn2(&CoordsT[0],CoordsT.size()/SPACEDIM,baryT); for(typename std::vector::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++) { - NormalizedCellType tS=PlanarIntersector::_meshS.getTypeOfElement(*iter); + NormalizedCellType tS=PlanarIntersector::_meshS.getTypeOfElement(OTT::indFC(*iter)); if(tS!=NORM_TRI3) throw INTERP_KERNEL::Exception("Invalid source cell detected for meshdim==2. Only TRI3 supported !"); std::vector CoordsS; - PlanarIntersector::getRealSourceCoordinates(*iter,CoordsS); + PlanarIntersector::getRealSourceCoordinates(OTT::indFC(*iter),CoordsS); if(SPACEDIM==2) { std::copy(baryT,baryT+SPACEDIM,baryTTmp); @@ -66,16 +66,16 @@ namespace INTERP_KERNEL PlanarIntersector::projectionThis(&CoordsS[0],littleTargetCell,3,3); std::copy(littleTargetCell,littleTargetCell+3,baryTTmp); } - if( PointLocatorAlgos::isElementContainsPointAlg2D(baryTTmp,&CoordsS[0],3) ) + if(PointLocatorAlgos::isElementContainsPointAlg2D(baryTTmp,&CoordsS[0],3,PlanarIntersector::_precision)) { double resLoc[3]; barycentric_coords(&CoordsS[0],baryTTmp,resLoc); - const ConnType *startOfCellNodeConn=PlanarIntersector::_connectS+OTT::conn2C(PlanarIntersector::_connIndexS[*iter]); + const ConnType *startOfCellNodeConnS=PlanarIntersector::_connectS+OTT::conn2C(PlanarIntersector::_connIndexS[*iter]); for(int nodeIdS=0;nodeIdS<3;nodeIdS++) { if(fabs(resLoc[nodeIdS])>PlanarIntersector::_precision) { - ConnType curNodeSInCmode=OTT::coo2C(startOfCellNodeConn[nodeIdS]); + ConnType curNodeSInCmode=OTT::coo2C(startOfCellNodeConnS[nodeIdS]); typename MyMatrix::value_type::const_iterator iterRes=resRow.find(OTT::indFC(curNodeSInCmode)); if(iterRes==resRow.end()) resRow.insert(std::make_pair(OTT::indFC(curNodeSInCmode),resLoc[nodeIdS])); diff --git a/src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx b/src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx index 294091f91..18bf10789 100644 --- a/src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx +++ b/src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx @@ -40,15 +40,15 @@ namespace INTERP_KERNEL void PlanarIntersectorP1P1PL::intersectCells(ConnType icellT, const std::vector& icellsS, MyMatrix& res) { std::vector CoordsT; - PlanarIntersector::getRealTargetCoordinates(icellT,CoordsT); + PlanarIntersector::getRealTargetCoordinates(OTT::indFC(icellT),CoordsT); int nbOfNodesT=CoordsT.size()/SPACEDIM; for(typename std::vector::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++) { - NormalizedCellType tS=PlanarIntersector::_meshS.getTypeOfElement(*iter); + NormalizedCellType tS=PlanarIntersector::_meshS.getTypeOfElement(OTT::indFC(*iter)); if(tS!=NORM_TRI3) throw INTERP_KERNEL::Exception("Invalid source cell detected for meshdim==2. Only TRI3 supported !"); std::vector CoordsS; - PlanarIntersector::getRealSourceCoordinates(*iter,CoordsS); + PlanarIntersector::getRealSourceCoordinates(OTT::indFC(*iter),CoordsS); std::vector CoordsTTmp(CoordsT); if(SPACEDIM==3) PlanarIntersector::projectionThis(&CoordsS[0],&CoordsTTmp[0],CoordsS.size()/SPACEDIM,nbOfNodesT); @@ -56,7 +56,7 @@ namespace INTERP_KERNEL for(int nodeIdT=0;nodeIdT::ind2C(startOfCellNodeConnT[nodeIdT])]; - if( PointLocatorAlgos::isElementContainsPointAlg2D(&CoordsTTmp[nodeIdT*SPACEDIM],&CoordsS[0],3) ) + if( PointLocatorAlgos::isElementContainsPointAlg2D(&CoordsTTmp[nodeIdT*SPACEDIM],&CoordsS[0],3,PlanarIntersector::_precision) ) { double resLoc[3]; barycentric_coords(&CoordsS[0],&CoordsTTmp[nodeIdT*SPACEDIM],resLoc); diff --git a/src/INTERP_KERNEL/PointLocator2DIntersector.txx b/src/INTERP_KERNEL/PointLocator2DIntersector.txx index c88e9be52..bb45fabb8 100644 --- a/src/INTERP_KERNEL/PointLocator2DIntersector.txx +++ b/src/INTERP_KERNEL/PointLocator2DIntersector.txx @@ -56,7 +56,7 @@ namespace INTERP_KERNEL double baryT[SPACEDIM]; pT->getBarycenter(baryT); delete pT; - if( PointLocatorAlgos::isElementContainsPointAlg2D(baryT,&CoordsS[0],nbNodesS) ) + if(PointLocatorAlgos::isElementContainsPointAlg2D(baryT,&CoordsS[0],nbNodesS,InterpType::_precision)) return 1.; return 0.; }