From 0b553e5604013a4173e45c405fa109468b94f62a Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 19 Apr 2010 09:58:51 +0000 Subject: [PATCH] Correction of bug in extrudedmesh interpolation. --- src/MEDCoupling/MEDCouplingRemapper.cxx | 18 +++++++++++++++--- src/MEDCoupling/MEDCouplingRemapper.hxx | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingRemapper.cxx b/src/MEDCoupling/MEDCouplingRemapper.cxx index f7306bc36..a4b021eaf 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.cxx +++ b/src/MEDCoupling/MEDCouplingRemapper.cxx @@ -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::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 > 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 > m) +{ + int id=0; + for(std::vector >::const_iterator iter1=m.begin();iter1!=m.end();iter1++,id++) + { + std::cout << "Target Cell # " << id << " : "; + for(std::map::const_iterator iter2=(*iter1).begin();iter2!=(*iter1).end();iter2++) + std::cout << "(" << (*iter2).first << "," << (*iter2).second << "), "; + std::cout << std::endl; + } +} diff --git a/src/MEDCoupling/MEDCouplingRemapper.hxx b/src/MEDCoupling/MEDCouplingRemapper.hxx index 5ecef0758..ada0ead1c 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.hxx +++ b/src/MEDCoupling/MEDCouplingRemapper.hxx @@ -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 > m); private: int prepareUU(const char *method); int prepareEE(const char *method); -- 2.39.2