]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
staffan :
authorvbd <vbd>
Thu, 13 Sep 2007 08:38:06 +0000 (08:38 +0000)
committervbd <vbd>
Thu, 13 Sep 2007 08:38:06 +0000 (08:38 +0000)
* added TargetIntersector.hxx
* update IntersectorTetra

src/INTERP_KERNEL/IntersectorTetra.cxx
src/INTERP_KERNEL/IntersectorTetra.hxx
src/INTERP_KERNEL/TargetIntersector.hxx [new file with mode: 0644]

index eb2b089efa0943d68af8bd386365913bd91eec9d..2df69a7d517960abfd2d214db8c4f2c2a64e6d11 100644 (file)
@@ -35,7 +35,6 @@ namespace INTERP_UTILS
   {
     const medGeometryElement targetType = targetMesh.getElementType(MED_CELL, targetCell);
     
-    // maybe we should do something more civilized here
     assert(targetType == MED_TETRA4);
     
     // get array of corners of target tetraeder
@@ -126,7 +125,7 @@ namespace INTERP_UTILS
        const int globalNodeNum = getGlobalNumberOfNode(i, element, _srcMesh);
        if(_nodes.find(globalNodeNum) == _nodes.end()) 
          {
-           const double* node = calculateNode(globalNodeNum);
+           calculateNode(globalNodeNum);
          }
 
        checkIsOutside(_nodes[globalNodeNum], isOutside);       
index 6ebf415887957f493dca185c65e8e271a80a94d7..d09af0b38334393a5ae8ea37b40b3a6870f2b8fb 100644 (file)
@@ -4,7 +4,7 @@
 #include "MEDMEM_define.hxx"
 #include "MEDMEM_Mesh.hxx"
 
-#include "Intersector.hxx"
+#include "TargetIntersector.hxx"
 #include <vector>
 #include <ext/hash_map>
 #include <functional>
@@ -152,7 +152,7 @@ namespace INTERP_UTILS
    * source elements with triangular or quadratilateral faces.
    *
    */
-  class IntersectorTetra
+  class IntersectorTetra : public TargetIntersector
   {
 
   public: 
@@ -168,7 +168,7 @@ namespace INTERP_UTILS
   private:
     
     // member functions
-    inline void createAffineTransform(const double* corners);
+    inline void createAffineTransform(const double** corners);
     inline void checkIsOutside(const double* pt, bool* isOutside) const;
     inline void calculateNode(int globalNodeNum);
     inline void calculateVolume(TransformedTriangle& tri, const TriangleFaceKey& key);
@@ -203,7 +203,7 @@ namespace INTERP_UTILS
   inline void IntersectorTetra::createAffineTransform(const double** corners)
   {
     // create AffineTransform from tetrahedron
-    _t = new TetraAffineTransform( tetraCorners );
+    _t = new TetraAffineTransform( corners );
   }
 
   /**
diff --git a/src/INTERP_KERNEL/TargetIntersector.hxx b/src/INTERP_KERNEL/TargetIntersector.hxx
new file mode 100644 (file)
index 0000000..ffd4b07
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __TARGET_INTERSECTOR__HXX__
+#define __TARGET_INTERSECTOR__HXX__
+
+namespace INTERP_UTILS
+{
+  class TargetIntersector
+  {
+  public:
+    virtual ~TargetIntersector() {}
+    
+    /**
+     * Calculate the volume of the intersection of two cells
+     *
+     * @param srcCell     global number of the source cell
+     */
+    virtual double intersectSourceCell(int srcCell) = 0;
+  };
+};
+
+#endif