]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
OK for first tests in 3D.
authorgeay <anthony.geay@cea.fr>
Thu, 22 May 2014 15:18:25 +0000 (17:18 +0200)
committergeay <anthony.geay@cea.fr>
Thu, 22 May 2014 15:18:25 +0000 (17:18 +0200)
src/MEDCoupling/MEDCouplingCartesianAMRMesh.cxx
src/MEDCoupling/MEDCouplingStructuredMesh.cxx

index b73244d43865857ece1f9624656d0e5d15643f2e..9436290c9a2bcc955938d9444387f68259403b41 100644 (file)
@@ -291,14 +291,13 @@ void FindHole(const INTERP_KERNEL::BoxSplittingOptions& bso, const InternalPatch
         if(signature[i]==0)
           if(len>= 2*minCellDirection && i >= minCellDirection-1 && i <= len-minCellDirection-1)
             hole.push_back(i);
-      if (hole.size()>0)
+      if(!hole.empty())
         {
           double center(((double)len/2.));
           for(std::size_t i=0;i<hole.size();i++)
             distance.push_back(fabs(hole[i]+1.-center));
 
-          double distanceMin=*std::min_element(distance.begin(),distance.end());
-          int posDistanceMin=std::find(distance.begin(),distance.end(),distanceMin)-distance.begin()-1;
+          std::size_t posDistanceMin(std::distance(distance.begin(),std::min_element(distance.begin(),distance.end())));
           cutFound=true;
           axisId=id;
           cutPlace=hole[posDistanceMin]+patchToBeSplit->getConstPart()[axisId].first+1;
@@ -331,6 +330,8 @@ void FindInflection(const INTERP_KERNEL::BoxSplittingOptions& bso, const Interna
       // Gradient absolute value
       for ( unsigned int i=1;i<derivate_second_order.size();i++)
         gradient_absolute.push_back(fabs(derivate_second_order[i]-derivate_second_order[i-1])) ;
+      if(derivate_second_order.empty())//tony -> si empty le reste plante !
+        continue;
       for (unsigned int i=0;i<derivate_second_order.size()-1;i++)
         {
           if (derivate_second_order[i]*derivate_second_order[i+1] < 0 )
@@ -478,7 +479,6 @@ void MEDCouplingCartesianAMRMesh::createPatchesFromCriterion(const INTERP_KERNEL
           if(cutFound)
             { DealWithCut(*it,axisId,cutPlace,listOfPatchesTmp); continue; }//action 3
           TryAction4(bso,*it,axisId,rangeOfAxisId,cutFound,cutPlace);
-          std::cerr << axisId << std::endl;
           if(cutFound)
             { DealWithCut(*it,axisId,cutPlace,listOfPatchesTmp); continue; }//action 4
           listOfPatchesOK.push_back(DealWithNoCut(*it));
index 8db11f5a821d89de73a0280329e870591acf42fd..19e7690e380596fa7a3213f5db1d5d4f33a6e6b3 100644 (file)
@@ -1014,7 +1014,7 @@ int MEDCouplingStructuredMesh::FindMinimalPartOf3D(const std::vector<int>& st, c
             {
               nxMin=std::min(nxMin,k); nxMax=std::max(nxMax,k);
               nyMin=std::min(nyMin,j); nyMax=std::max(nyMax,j);
-              nzMin=std::min(nyMin,i); nzMax=std::max(nyMax,i);
+              nzMin=std::min(nzMin,i); nzMax=std::max(nzMax,i);
               ret++;
             }
         }