Salome HOME
Debug on GENERAL_24 and GENERAL_48
[tools/medcoupling.git] / src / INTERP_KERNEL / SplitterTetra.txx
index 573f07f2abbd19bd287b8e88cbb3807b667fef77..38aab3c233bce06edbf49a475325afa7f9460575 100644 (file)
@@ -38,6 +38,9 @@
 
 namespace INTERP_KERNEL
 {
+  template<class MyMeshType> 
+  const double SplitterTetra<MyMeshType>::SPARSE_TRUNCATION_LIMIT=1.0e-14;
+
   /*!
    * output is expected to be allocated with 24*sizeof(void*) in order to store the 24 tetras.
    * These tetras have to be deallocated.
@@ -56,6 +59,13 @@ namespace INTERP_KERNEL
   }
 
   /**
+   * SplitterTetra class computes for a list of cell ids of a given mesh \a srcMesh (badly named) the intersection with a 
+   * single TETRA4 cell given by \a tetraCorners (of length 4) and \a nodesId (of length 4 too). \a nodedIds is given only to establish
+   * if a partial computation of a triangle has already been performed (to increase performance).
+   *
+   * The \a srcMesh can contain polyhedron cells.
+   * 
+   * 
    * Constructor creating object from the four corners of the tetrahedron.
    *
    * @param srcMesh       mesh containing the source elements
@@ -72,7 +82,7 @@ namespace INTERP_KERNEL
     _coords[6]=tetraCorners[2][0]; _coords[7]=tetraCorners[2][1]; _coords[8]=tetraCorners[2][2];
     _coords[9]=tetraCorners[3][0]; _coords[10]=tetraCorners[3][1]; _coords[11]=tetraCorners[3][2];
     // create the affine transform
-    createAffineTransform(tetraCorners);
+    _t=new TetraAffineTransform(_coords);
   }
   
   /**
@@ -527,10 +537,7 @@ namespace INTERP_KERNEL
               counter++;
             }
         }
-      if (counter == 3)
-        return true;
-      else
-        return false;
+      return counter == 3;
   }
 
   /**
@@ -550,7 +557,6 @@ namespace INTERP_KERNEL
    * @param polyNodesNbr number of the nodes of the polygon source face
    * @param polyNodes numbers of the nodes of the polygon source face
    * @param polyCoords coordinates of the nodes of the polygon source face
-   * @param polyCoords coordinates of the nodes of the polygon source face
    * @param dimCaracteristic characteristic size of the meshes containing the triangles
    * @param precision precision for double float data used for comparison
    * @param listOfTetraFacesTreated list of tetra faces treated
@@ -590,9 +596,6 @@ namespace INTERP_KERNEL
         const int globalNodeNum = polyNodes[i];
         if(_nodes.find(globalNodeNum) == _nodes.end())
           {
-            //for(HashMap< int , double* >::iterator iter3=_nodes.begin();iter3!=_nodes.end();iter3++)
-            //  std::cout << (*iter3).first << " ";
-            //std::cout << std::endl << "*** " << globalNodeNum << std::endl;
             calculateNode2(globalNodeNum, polyCoords[i]);
           }
 
@@ -1081,25 +1084,10 @@ namespace INTERP_KERNEL
    */
   template<class MyMeshTypeT, class MyMeshTypeS>
   void SplitterTetra2<MyMeshTypeT, MyMeshTypeS>::calculateGeneral48Tetra(typename std::vector< SplitterTetra<MyMeshTypeS>* >& tetra)
-  {
-    // Define 8 hexahedral subzones as in Grandy, p449
-    // the values correspond to the nodes that correspond to nodes 1,2,3,4,5,6,7,8 in the subcell
-    // For the correspondance of the nodes, see the GENERAL_48_SUB_NODES table in calculateSubNodes
-    static const int subZones[64] = 
-      {
-        0,8,21,12,9,20,26,22,
-        8,1,13,21,20,10,23,26,
-        12,21,16,3,22,26,25,17,
-        21,13,2,16,26,23,18,25,
-        9,20,26,22,4,11,24,14,
-        20,10,23,26,11,5,15,24,
-        22,26,25,17,14,24,19,7,
-        26,23,18,25,24,15,6,19
-      };
-    
+  { 
     for(int i = 0; i < 8; ++i)
       {
-        sixSplit(&subZones[8*i],tetra);
+        sixSplit(GENERAL_48_SUBZONES+8*i,tetra);
       }
   }
   
@@ -1234,33 +1222,6 @@ namespace INTERP_KERNEL
 
           case GENERAL_48:
             {
-              // Each sub-node is the barycenter of two other nodes.
-              // For the edges, these lie on the original mesh.
-              // For the faces, these are the edge sub-nodes.
-              // For the cell these are two face sub-nodes.
-              static const int GENERAL_48_SUB_NODES[38] = 
-                {
-                  0,1,   // sub-node 9 (edge)
-                  0,4,   // sub-node 10 (edge)
-                  1,5,   // sub-node 11 (edge)
-                  4,5,   // sub-node 12 (edge)
-                  0,3,   // sub-node 13 (edge)
-                  1,2,   // sub-node 14 (edge)
-                  4,7,   // sub-node 15 (edge)
-                  5,6,   // sub-node 16 (edge)
-                  2,3,   // sub-node 17 (edge)
-                  3,7,   // sub-node 18 (edge)
-                  2,6,   // sub-node 19 (edge)
-                  6,7,   // sub-node 20 (edge)
-                  8,11,  // sub-node 21 (face)
-                  12,13, // sub-node 22 (face)
-                  9,17,  // sub-node 23 (face)
-                  10,18, // sub-node 24 (face)
-                  14,15, // sub-node 25 (face)
-                  16,19, // sub-node 26 (face)
-                  20,25  // sub-node 27 (cell)
-                };
-
               for(int i = 0; i < 19; ++i)
                 {
                   double* barycenter = new double[3];