]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
fix: some errors of clang-tidy
authorSONOLET Aymeric <aymeric.sonolet@cea.fr>
Fri, 12 Apr 2024 13:59:28 +0000 (15:59 +0200)
committerSONOLET Aymeric <aymeric.sonolet@cea.fr>
Fri, 12 Apr 2024 13:59:28 +0000 (15:59 +0200)
ex: transforms InterpKernelException into std::exception

12 files changed:
src/INTERP_KERNEL/ExprEval/InterpKernelExprParser.cxx
src/INTERP_KERNEL/ExprEval/InterpKernelUnit.cxx
src/INTERP_KERNEL/InterpolationCU.txx
src/INTERP_KERNEL/MappedBarycentric2DIntersectorP1P1.txx
src/INTERP_KERNEL/PlanarIntersectorP0P1Bary.txx
src/INTERP_KERNEL/PlanarIntersectorP0P1PL.txx
src/INTERP_KERNEL/PlanarIntersectorP1P0.txx
src/INTERP_KERNEL/PlanarIntersectorP1P0Bary.txx
src/INTERP_KERNEL/PlanarIntersectorP1P0PL.txx
src/INTERP_KERNEL/PlanarIntersectorP1P1.txx
src/INTERP_KERNEL/PlanarIntersectorP1P1PL.txx
src/INTERP_KERNELTest/PerfTest.cxx

index 6db2e5a6a03303a4bc06709d8a965bd42b847428..920c63fc55147a9e08b403ffb9ff8cd51375d692 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <cctype>
 #include <cstddef>
-#include <exception>
 #include <set>
 #include <sstream>
 #include <limits>
@@ -318,7 +317,7 @@ DecompositionInUnitBase ExprParser::evaluateUnit() const
     {
       res=(ValueUnit *)evaluateLowLev(gen);
     }
-  catch(std::exception& e)
+  catch(INTERP_KERNEL::Exception& e)
     {
       delete gen;
       throw e;
@@ -437,7 +436,7 @@ Value *ExprParser::evaluateLowLev(Value *valGen) const
             {
               _leaf->fillValue(ret);
             }
-          catch(std::exception& e)
+          catch(INTERP_KERNEL::Exception& e)
             {
               delete ret;
               throw e;
@@ -455,7 +454,7 @@ Value *ExprParser::evaluateLowLev(Value *valGen) const
       for(auto iter3 : _func_btw_sub_expr)
         iter3->operate(stackOfVal);
     }
-  catch(std::exception& e)
+  catch(INTERP_KERNEL::Exception& e)
     {
       for(auto & iter4 : stackOfVal)
         delete iter4;
index 72d1d9393aaf6e6bc914adf75760bb7a76505dde..b337123bb912a0ffe315bbbd89bb6d18b4ccc570 100644 (file)
@@ -25,7 +25,6 @@
 #include <algorithm>
 #include <cmath>
 #include <cstddef>
-#include <exception>
 #include <map>
 #include <sstream>
 #include <iomanip>
@@ -348,7 +347,7 @@ void Unit::tryToInterprate() const
           _decomp_in_base=expr.evaluateUnit();
           _is_interpretation_ok=true;
         }
-      catch(std::exception&) { }
+      catch(INTERP_KERNEL::Exception&) { }
     }
 }
 
index b765ee44780246aab7c98ed34f62c3c6105e3c1e..5db3a5fd9bf21a8b2b4eabedc6e3f5134bb9afb5 100644 (file)
@@ -119,7 +119,7 @@ namespace INTERP_KERNEL
       {
       case 1: intersector = new IntersectorCU1D<MyCMeshType, MyUMeshType, MatrixType>( src_mesh, tgt_mesh ); break;
       case 2: intersector = new IntersectorCU2D<MyCMeshType, MyUMeshType, MatrixType>( src_mesh, tgt_mesh ); break;
-      case 3: intersector = new IntersectorCU3D<MyCMeshType, MyUMeshType, MatrixType>( src_mesh, tgt_mesh, SplittingPolicy() ); break;
+      case 3: intersector = new IntersectorCU3D<MyCMeshType, MyUMeshType, MatrixType>( src_mesh, tgt_mesh, getSplittingPolicy() ); break;
       }
     // create empty maps for all target elements
     result.resize( intersector->getNumberOfRowsOfResMatrix() );
index abca8c6a00af7f790acc658972f43ec6531fc1db..9be695bccc533b9ea9c4df06e42526fefa5aca2f 100644 (file)
@@ -25,6 +25,7 @@
 #include "MappedBarycentric2DIntersectorP1P1.hxx"
 #include "PlanarIntersector.hxx"
 #include "NormalizedGeometricTypes"
+#include "InterpKernelUtilities.hxx"
 
 #include "PointLocatorAlgos.txx"
 #include <vector>
@@ -44,7 +45,7 @@ namespace INTERP_KERNEL
   {
     std::vector<double> CoordsT;
     PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
-    ConnType nbOfNodesT=ConnType(CoordsT.size())/SPACEDIM;
+    ConnType nbOfNodesT=ToConnType(CoordsT.size())/SPACEDIM;
     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
       {
         NormalizedCellType tS=PlanarIntersector<MyMeshType,MyMatrix>::_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(*iter));
@@ -54,7 +55,7 @@ namespace INTERP_KERNEL
         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],ConnType(CoordsS.size())/SPACEDIM,nbOfNodesT);
+          PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&CoordsS[0],&CoordsTTmp[0],ToConnType(CoordsS.size())/SPACEDIM,nbOfNodesT);
         const ConnType *startOfCellNodeConnT=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
         for(ConnType nodeIdT=0;nodeIdT<nbOfNodesT;nodeIdT++)
           {
index e752cc229acf1303457280fa333f8024eb483b04..d1d4942c67ef2e06545e784db3cba98e29216fb6 100644 (file)
@@ -25,6 +25,7 @@
 #include "PlanarIntersector.hxx"
 #include "PlanarIntersectorP0P1Bary.hxx"
 #include "InterpolationUtils.hxx"
+#include "InterpKernelUtilities.hxx"
 #include "CellModel.hxx"
 #include <vector>
 
@@ -85,7 +86,7 @@ namespace INTERP_KERNEL
       bool isSourceQuad=CellModel::GetCellModel(tS).isQuadratic();
       PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(iS),srcCellCoords);
       std::vector<double> *srcCoords(&srcCellCoords);
-      ConnType srcNbNodes = ConnType(srcCellCoords.size())/SPACEDIM;
+      ConnType srcNbNodes = ToConnType(srcCellCoords.size())/SPACEDIM;
       if(SPACEDIM==3)
         {
           srcCellCoordsTmp=srcCellCoords;
index 6fb21d6269541f04374deda51dc0a201bbb6a99c..8d370645e07cf12817c5a6e6ad3084041be1d2d9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "PlanarIntersector.hxx"
 #include "InterpolationUtils.hxx"
+#include "InterpKernelUtilities.hxx"
 #include "PlanarIntersectorP0P1PL.hxx"
 
 #include "PointLocatorAlgos.txx"
@@ -47,17 +48,17 @@ namespace INTERP_KERNEL
     const ConnType *startOfCellNodeConnT=PlanarIntersector<MyMeshType,MyMatrix>::_connectT+OTT<ConnType,numPol>::conn2C(PlanarIntersector<MyMeshType,MyMatrix>::_connIndexT[icellT]);
     std::vector<double> coordsTarget;
     PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),coordsTarget);
-    ConnType nbNodesT=ConnType(coordsTarget.size())/SPACEDIM;
+    ConnType nbNodesT=ToConnType(coordsTarget.size())/SPACEDIM;
     ii=0;
     for(typename std::vector<ConnType>::const_iterator iter2=icellsS.begin();iter2!=icellsS.end();iter2++,ii++)
       {
         std::vector<double> tmpSource(coordsOfSources[ii]);
         std::vector<double> tmpTarget(coordsTarget);
         if(SPACEDIM==3)
-          PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&tmpSource[0],&tmpTarget[0],ConnType(tmpSource.size())/SPACEDIM,nbNodesT);
+          PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&tmpSource[0],&tmpTarget[0],ToConnType(tmpSource.size())/SPACEDIM,nbNodesT);
         for(ConnType nodeIdT=0;nodeIdT<nbNodesT;nodeIdT++)
           {
-            if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2DSimple(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],ConnType(tmpSource.size())/SPACEDIM,PlanarIntersector<MyMeshType,MyMatrix>::_precision))
+            if(PointLocatorAlgos<MyMeshType>::isElementContainsPointAlg2DSimple(&tmpTarget[0]+nodeIdT*SPACEDIM,&tmpSource[0],ToConnType(tmpSource.size())/SPACEDIM,PlanarIntersector<MyMeshType,MyMatrix>::_precision))
               {
                 ConnType curNodeTInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConnT[nodeIdT]);
                 typename MyMatrix::value_type& resRow=res[curNodeTInCmode];
index 3bf8cb26d82689a51c08936c30710b3f3eef8dc1..319c209bf42500f03d7c378bdde64d23f186f4f4 100644 (file)
@@ -24,6 +24,7 @@
 #include "PlanarIntersector.txx"
 #include "PlanarIntersectorP1P0.hxx"
 #include "InterpolationUtils.hxx"
+#include "InterpKernelUtilities.hxx"
 #include "CellModel.hxx"
 #include <vector>
 
@@ -84,7 +85,7 @@ namespace INTERP_KERNEL
                 fillDualCellOfTri<SPACEDIM>(triangle,quadrangle);
                 std::vector<double> targetCellCoordsTmp(targetCellCoords);
                 if(SPACEDIM==3)
-                  orientation=PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&targetCellCoordsTmp[0],quadrangle,ConnType(targetCellCoords.size())/SPACEDIM,4);
+                  orientation=PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&targetCellCoordsTmp[0],quadrangle,ToConnType(targetCellCoords.size())/SPACEDIM,4);
                 double surf=orientation*intersectGeometryWithQuadrangle(quadrangle,targetCellCoordsTmp,isTargetQuad);
                 surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
                 if(surf!=0.)
index 98b6e6e80e9817d1fc3d4f0319f92240beaf5098..2f6fd8c623efd4759271ac17af7c87cb19d4af00 100644 (file)
@@ -24,6 +24,7 @@
 #include "PlanarIntersector.hxx"
 #include "PlanarIntersectorP1P0Bary.hxx"
 #include "InterpolationUtils.hxx"
+#include "InterpKernelUtilities.hxx"
 #include "CellModel.hxx"
 #include <vector>
 
@@ -80,7 +81,7 @@ namespace INTERP_KERNEL
     // target cell data
     PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),tgtCellCoords);
     std::vector<double> * tgtCoords = & tgtCellCoords;
-    ConnType tgtNbNodes = ConnType(tgtCellCoords.size())/SPACEDIM;
+    ConnType tgtNbNodes = ToConnType(tgtCellCoords.size())/SPACEDIM;
     NormalizedCellType tT=PlanarIntersector<MyMeshType,MyMatrix>::_meshT.getTypeOfElement(OTT<ConnType,numPol>::indFC(icellT));
     bool isTargetQuad=CellModel::GetCellModel(tT).isQuadratic();
 
index 054949e554379582c0d900944636c496651dbe42..812282d71cadfed9d2fb5f7a5f5450fb0cdf934c 100644 (file)
@@ -24,6 +24,7 @@
 #include "InterpolationUtils.hxx"
 #include "NormalizedGeometricTypes"
 #include "PlanarIntersectorP1P0PL.hxx"
+#include "InterpKernelUtilities.hxx"
 #include "VolSurfFormulae.hxx"
 
 #include "PointLocatorAlgos.txx"
@@ -48,7 +49,7 @@ namespace INTERP_KERNEL
     PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
     double baryT[SPACEDIM];
     double baryTTmp[SPACEDIM];
-    calculateBarycenterDyn2<SPACEDIM>(&CoordsT[0],ConnType(CoordsT.size())/SPACEDIM,baryT);
+    calculateBarycenterDyn2<SPACEDIM>(&CoordsT[0],ToConnType(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(OTT<ConnType,numPol>::indFC(*iter));
index a9c11974a498b1efb0ce88b698322c83c30d083c..6445ad357a77f6a863ef4424ed227fc632517a6b 100644 (file)
@@ -23,6 +23,7 @@
 #include "PlanarIntersector.txx"
 #include "PlanarIntersectorP1P1.hxx"
 #include "InterpolationUtils.hxx"
+#include "InterpKernelUtilities.hxx"
 #include <vector>
 
 namespace INTERP_KERNEL
@@ -63,7 +64,7 @@ namespace INTERP_KERNEL
         ConnType curNodeTInCmode=OTT<ConnType,numPol>::coo2C(startOfCellNodeConn[nodeIdT]);
         PlanarIntersector<MyMeshType,MyMatrix>::getRealTargetCoordinatesPermute(OTT<ConnType,numPol>::indFC(icellT),nodeIdT,polygT);
         std::vector<double> polygDualT(SPACEDIM*2*(nbNodesT-1));
-        fillDualCellOfPolyg<SPACEDIM>(&polygT[0],ConnType(polygT.size())/SPACEDIM,&polygDualT[0]);
+        fillDualCellOfPolyg<SPACEDIM>(&polygT[0],ToConnType(polygT.size())/SPACEDIM,&polygDualT[0]);
         typename MyMatrix::value_type& resRow=res[curNodeTInCmode];
         for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
           {
@@ -76,10 +77,10 @@ namespace INTERP_KERNEL
                 std::vector<double> polygS;
                 PlanarIntersector<MyMeshType,MyMatrix>::getRealSourceCoordinatesPermute(OTT<ConnType,numPol>::indFC(iS),nodeIdS,polygS);
                 std::vector<double> polygDualS(SPACEDIM*2*(nbNodesS-1));
-                fillDualCellOfPolyg<SPACEDIM>(&polygS[0],ConnType(polygS.size())/SPACEDIM,&polygDualS[0]);
+                fillDualCellOfPolyg<SPACEDIM>(&polygS[0],ToConnType(polygS.size())/SPACEDIM,&polygDualS[0]);
                 std::vector<double> polygDualTTmp(polygDualT);
                 if(SPACEDIM==3)
-                  orientation=PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&polygDualS[0],&polygDualTTmp[0],ConnType(polygDualS.size())/SPACEDIM,ConnType(polygDualT.size())/SPACEDIM);
+                  orientation=PlanarIntersector<MyMeshType,MyMatrix>::projectionThis(&polygDualS[0],&polygDualTTmp[0],ToConnType(polygDualS.size())/SPACEDIM,ToConnType(polygDualT.size())/SPACEDIM);
                 double surf=orientation*intersectGeometryGeneral(polygDualTTmp,polygDualS);
                 surf=PlanarIntersector<MyMeshType,MyMatrix>::getValueRegardingOption(surf);
                 if(surf!=0.)
index 7cbb512af201320ae945cf702e6eea90175f2359..f57ac773912ca3730628310f39c74fefd63208ed 100644 (file)
@@ -24,6 +24,7 @@
 #include "InterpolationUtils.hxx"
 #include "NormalizedGeometricTypes"
 #include "PlanarIntersectorP1P1PL.hxx"
+#include "InterpKernelUtilities.hxx"
 
 #include "PointLocatorAlgos.txx"
 #include <vector>
@@ -44,7 +45,7 @@ namespace INTERP_KERNEL
   {
     std::vector<double> CoordsT;
     this->getRealTargetCoordinates(OTT<ConnType,numPol>::indFC(icellT),CoordsT);
-    ConnType nbOfNodesT=ConnType(CoordsT.size())/SPACEDIM;
+    ConnType nbOfNodesT=ToConnType(CoordsT.size())/SPACEDIM;
     for(typename std::vector<ConnType>::const_iterator iter=icellsS.begin();iter!=icellsS.end();iter++)
       {
         NormalizedCellType tS=this->_meshS.getTypeOfElement(OTT<ConnType,numPol>::indFC(*iter));
@@ -54,7 +55,7 @@ namespace INTERP_KERNEL
         this->getRealSourceCoordinates(OTT<ConnType,numPol>::indFC(*iter),CoordsS);
         std::vector<double> CoordsTTmp(CoordsT);
         if(SPACEDIM==3)
-          this->projectionThis(CoordsS.data(),CoordsTTmp.data(),ConnType(CoordsS.size())/SPACEDIM,nbOfNodesT);
+          this->projectionThis(CoordsS.data(),CoordsTTmp.data(),ToConnType(CoordsS.size())/SPACEDIM,nbOfNodesT);
         const ConnType *startOfCellNodeConnT=this->_connectT+OTT<ConnType,numPol>::conn2C(this->_connIndexT[icellT]);
         for(int nodeIdT=0;nodeIdT<nbOfNodesT;nodeIdT++)
           {
index a6868ec8fbe0d50ae1803a445e8bf327376d0638..9b2c4a51f69f7fe954aaf999f8d06eda25d83e4b 100644 (file)
@@ -131,7 +131,7 @@ namespace INTERP_TEST
  * @param argc  number of arguments given to the program (should be 3, the user giving 2 mesh names)
  * @param argv  vector to the arguments as strings.
  */
-int main(int  /*argc*/, char** argv)
+int main(int argc, char** argv)
 {
   using INTERP_TEST::PerfTestToolkit;