]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
removing bug. MEDMEM test coming soon.
authorageay <ageay>
Fri, 23 Oct 2009 05:42:52 +0000 (05:42 +0000)
committerageay <ageay>
Fri, 23 Oct 2009 05:42:52 +0000 (05:42 +0000)
src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx
src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx
src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx
src/INTERP_KERNEL/PointLocator2DIntersector.txx

index 2f71ccc85cdee52d4b0afc7f85155cecfeedb348..2018d980fd9eb2163a6016b25b4b3b7f4a0aad3c 100644 (file)
@@ -41,10 +41,10 @@ namespace INTERP_KERNEL
     std::vector< std::vector<double> > coordsOfSources(icellsS.size());
     int ii=0;
     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++,ii++)
-      PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(*iter,coordsOfSources[ii]);
-    const ConnType *startOfCellNodeConn=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
+      PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(*iter),coordsOfSources[ii]);
+    const ConnType *startOfCellNodeConnT=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
     std::vector<double> coordsTarget;
-    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(icellT,coordsTarget);
+    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),coordsTarget);
     int nbNodesT=coordsTarget.size()/SPACEDIM;
     ii=0;
     for(typename std::vector<ConnType>::const_iterator iter2=icellsS.begin();iter2!=icellsS.end();iter2++,ii++)
@@ -55,9 +55,9 @@ namespace INTERP_KERNEL
           PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&tmpSource[0],&tmpTarget[0],tmpSource.size()/SPACEDIM,nbNodesT);
         for(int nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
           {
-            if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],tmpSource.size()/SPACEDIM) )
+            if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],tmpSource.size()/SPACEDIM,PlanarIntersector<MyMeshType,MyMatrix>::_precision))
               {
-                ConnType curNodeTInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[nodeIdT]);
+                ConnType curNodeTInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConnT[nodeIdT]);
                 typename MyMatrix::value_type& resRow=res[curNodeTInCmode];
                 typename MyMatrix::value_type::const_iterator iterRes=resRow.find(OTT<ConnType,numPol>::indFC(*iter2));
                 if(iterRes==resRow.end())
index fbc655c9c5bc191a7178588730ef49263a605c0b..be634a069648c8fb67381445d28516721d98d57d 100644 (file)
@@ -42,17 +42,17 @@ namespace INTERP_KERNEL
   {
     std::vector<double> CoordsT;
     typename MyMatrix::value_type& resRow=res[icellT];
-    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(icellT,CoordsT);
+    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
     double baryT[SPACEDIM];
     double baryTTmp[SPACEDIM];
     calculateBarycenterDyn2<SPACEDIM>(&CoordsT[0],CoordsT.size()/SPACEDIM,baryT);
     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
       {
-        NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(*iter);
+        NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(*iter));
         if(tS!=NORM_TRI3)
           throw INTERP_KERNEL::Exception("Invalid source cell detected for meshdim==2. Only TRI3 supported !");
         std::vector<double> CoordsS;
-        PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(*iter,CoordsS);
+        PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(*iter),CoordsS);
         if(SPACEDIM==2)
           {
             std::copy(baryT,baryT+SPACEDIM,baryTTmp);
@@ -66,16 +66,16 @@ namespace INTERP_KERNEL
             PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&CoordsS[0],littleTargetCell,3,3);
             std::copy(littleTargetCell,littleTargetCell+3,baryTTmp);
           }
-        if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(baryTTmp,&CoordsS[0],3) )
+        if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(baryTTmp,&CoordsS[0],3,PlanarIntersector<MyMeshType,MyMatrix>::_precision))
           {
             double resLoc[3];
             barycentric_coords<SPACEDIM>(&CoordsS[0],baryTTmp,resLoc);
-            const ConnType *startOfCellNodeConn=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[*iter]);
+            const ConnType *startOfCellNodeConnS=PlanarIntersector<MyMeshType,MyMatrix>::_connectS+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexS[*iter]);
             for(int nodeIdS=0;nodeIdS<3;nodeIdS++)
               {
                 if(fabs(resLoc[nodeIdS])>PlanarIntersector<MyMeshType,MyMatrix>::_precision)
                   {
-                    ConnType curNodeSInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[nodeIdS]);
+                    ConnType curNodeSInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConnS[nodeIdS]);
                     typename MyMatrix::value_type::const_iterator iterRes=resRow.find(OTT<ConnType,numPol>::indFC(curNodeSInCmode));
                     if(iterRes==resRow.end())
                       resRow.insert(std::make_pair(OTT<ConnType,numPol>::indFC(curNodeSInCmode),resLoc[nodeIdS]));
index 294091f91eadd6f0aa8aef79b5abc8fd71c70dbf..18bf10789a652c1958b43a747bfdf3e0ba9ebd78 100644 (file)
@@ -40,15 +40,15 @@ namespace INTERP_KERNEL
   void PlanarIntersectorP1P1PL<MyMeshType,MyMatrix>::intersectCells(ConnType icellT, const std::vector<ConnType>& icellsS, MyMatrix& res)
   {
     std::vector<double> CoordsT;
-    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(icellT,CoordsT);
+    PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
     int nbOfNodesT=CoordsT.size()/SPACEDIM;
     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
       {
-        NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(*iter);
+        NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(*iter));
         if(tS!=NORM_TRI3)
           throw INTERP_KERNEL::Exception("Invalid source cell detected for meshdim==2. Only TRI3 supported !");
         std::vector<double> CoordsS;
-        PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(*iter,CoordsS);
+        PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(*iter),CoordsS);
         std::vector<double> CoordsTTmp(CoordsT);
         if(SPACEDIM==3)
           PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&CoordsS[0],&CoordsTTmp[0],CoordsS.size()/SPACEDIM,nbOfNodesT);
@@ -56,7 +56,7 @@ namespace INTERP_KERNEL
         for(int nodeIdT=0;nodeIdT<nbOfNodesT;nodeIdT++)
           {
             typename MyMatrix::value_type& resRow=res[OTT<ConnType,numPol>::ind2C(startOfCellNodeConnT[nodeIdT])];
-            if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&CoordsTTmp[nodeIdT*SPACEDIM],&CoordsS[0],3) )
+            if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(&CoordsTTmp[nodeIdT*SPACEDIM],&CoordsS[0],3,PlanarIntersector<MyMeshType,MyMatrix>::_precision) )
               {
                 double resLoc[3];
                 barycentric_coords<SPACEDIM>(&CoordsS[0],&CoordsTTmp[nodeIdT*SPACEDIM],resLoc);
index c88e9be52821ca556a22f080ca5174dc355b34a5..bb45fabb868c038a48b823c2e547c81f4da43ede 100644 (file)
@@ -56,7 +56,7 @@ namespace INTERP_KERNEL
     double baryT[SPACEDIM];
     pT->getBarycenter(baryT);
     delete pT;
-    if( PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(baryT,&CoordsS[0],nbNodesS) )
+    if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2D(baryT,&CoordsS[0],nbNodesS,InterpType<MyMeshType,MyMatrix,PTLOC2D_INTERSECTOR >::_precision))
       return 1.;
     return 0.;
   }