Salome HOME
Missing wrap of appendFieldProfileFlatly
[tools/medcoupling.git] / src / INTERP_KERNEL / SplitterTetra.cxx
index b5e4999af0cedbfe9162f212a56d979eeb64472a..687c1dfefada01cf2c9e5b28ffb5dfc6dda13032 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,7 +24,7 @@ namespace INTERP_KERNEL
 {
 
   void SplitHexa8IntoTetras(SplittingPolicy policy, const int *nodalConnBg, const int *nodalConnEnd, const double *coords,
-                            std::vector<int>& tetrasNodalConn, std::vector<double>& addCoords) throw(INTERP_KERNEL::Exception)
+                            std::vector<int>& tetrasNodalConn, std::vector<double>& addCoords)
   {
     if(std::distance(nodalConnBg,nodalConnEnd)!=8)
       throw INTERP_KERNEL::Exception("SplitHexa8IntoTetras : input hexa do not have 8 nodes !");
@@ -66,10 +66,11 @@ namespace INTERP_KERNEL
               tmp2[0]=0.; tmp2[1]=0.; tmp2[2]=0.;
               for(int j=0;j<4;j++,conn+=4)
                 {
-                  tmp2[0]+=coords[3*nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+j]]+0];
-                  tmp2[1]+=coords[3*nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+j]]+1];
-                  tmp2[2]+=coords[3*nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+j]]+3];
-                  conn[0]=nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+j]];
+                  int tmp3(nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+j]]);
+                  tmp2[0]+=coords[3*tmp3+0];
+                  tmp2[1]+=coords[3*tmp3+1];
+                  tmp2[2]+=coords[3*tmp3+2];
+                  conn[0]=tmp3;
                   conn[1]=nodalConnBg[GENERAL_24_SUB_NODES_WO[4*i+(j+1)%4]];
                   conn[2]=-(i+1); conn[3]=-7;
                 }
@@ -92,9 +93,9 @@ namespace INTERP_KERNEL
             }
           for(int i=0;i<7;i++,tmp2+=3)
             {
-              tmp2[0]=(tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+24]-8)]+0]+tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+25]-8)]+0])/2.;
-              tmp2[1]=(tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+24]-8)]+1]+tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+25]-8)]+1])/2.;
-              tmp2[2]=(tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+24]-8)]+2]+tmp[3*nodalConnBg[(GENERAL_48_SUB_NODES[2*i+25]-8)]+2])/2.;
+              tmp2[0]=(tmp[3*(GENERAL_48_SUB_NODES[2*i+24]-8)+0]+tmp[3*(GENERAL_48_SUB_NODES[2*i+25]-8)+0])/2.;
+              tmp2[1]=(tmp[3*(GENERAL_48_SUB_NODES[2*i+24]-8)+1]+tmp[3*(GENERAL_48_SUB_NODES[2*i+25]-8)+1])/2.;
+              tmp2[2]=(tmp[3*(GENERAL_48_SUB_NODES[2*i+24]-8)+2]+tmp[3*(GENERAL_48_SUB_NODES[2*i+25]-8)+2])/2.;
             }
           int *conn(&tetrasNodalConn[0]);
           std::vector<double> dummy;
@@ -119,7 +120,7 @@ namespace INTERP_KERNEL
   }
 
   void SplitIntoTetras(SplittingPolicy policy, NormalizedCellType gt, const int *nodalConnBg, const int *nodalConnEnd, const double *coords,
-                       std::vector<int>& tetrasNodalConn, std::vector<double>& addCoords) throw(INTERP_KERNEL::Exception)
+                       std::vector<int>& tetrasNodalConn, std::vector<double>& addCoords)
   {
     switch(gt)
       {