]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Correction of bug in extrudedmesh interpolation.
authorageay <ageay>
Mon, 19 Apr 2010 09:58:51 +0000 (09:58 +0000)
committerageay <ageay>
Mon, 19 Apr 2010 09:58:51 +0000 (09:58 +0000)
src/MEDCoupling/MEDCouplingRemapper.cxx
src/MEDCoupling/MEDCouplingRemapper.hxx

index f7306bc368201dbd6388784d6dbe03ee8cc3b914..a4b021eaf1dd15fcd1c665ef546868115074f394 100644 (file)
@@ -294,9 +294,9 @@ int MEDCouplingRemapper::prepareEE(const char *method)
   if(methC!="P0P0")
     throw INTERP_KERNEL::Exception("Only P0P0 method implemented for Extruded/Extruded meshes !");
   INTERP_KERNEL::Interpolation<INTERP_KERNEL::Interpolation3D>::checkAndSplitInterpolationMethod(method,_src_method,_target_method);
-  MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh->getMesh2D());
-  MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh->getMesh2D());
-  INTERP_KERNEL::Interpolation2D interpolation2D(*this);
+  MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(src_mesh->getMesh2D());
+  MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(target_mesh->getMesh2D());
+  INTERP_KERNEL::Interpolation3DSurf interpolation2D(*this);
   std::vector<std::map<int,double> > matrix2D;
   int nbCols2D=interpolation2D.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,method);
   MEDCouplingUMesh *s1D,*t1D;
@@ -552,3 +552,15 @@ void MEDCouplingRemapper::buildFinalInterpolationMatrixByConvolution(const std::
         }
     }
 }
+
+void MEDCouplingRemapper::printMatrix(const std::vector<std::map<int,double> > m)
+{
+  int id=0;
+  for(std::vector<std::map<int,double> >::const_iterator iter1=m.begin();iter1!=m.end();iter1++,id++)
+    {
+      std::cout << "Target Cell # " << id << " : ";
+      for(std::map<int,double>::const_iterator iter2=(*iter1).begin();iter2!=(*iter1).end();iter2++)
+        std::cout << "(" << (*iter2).first << "," << (*iter2).second << "), ";
+      std::cout << std::endl;
+    }
+}
index 5ecef075842e61de4fe07ad6f87331b762eee6b3..ada0ead1c1061cde21975eebd27db3a10030fbcc 100644 (file)
@@ -49,6 +49,8 @@ namespace ParaMEDMEM
     MEDCOUPLINGREMAPPER_EXPORT bool setOptionInt(const std::string& key, int value);
     MEDCOUPLINGREMAPPER_EXPORT bool setOptionDouble(const std::string& key, double value);
     MEDCOUPLINGREMAPPER_EXPORT bool setOptionString(const std::string& key, std::string& value);
+  public:
+    static void printMatrix(const std::vector<std::map<int,double> > m);
   private:
     int prepareUU(const char *method);
     int prepareEE(const char *method);