X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FInterpolationMatrix.cxx;h=352566534c85316348f8c6f4acd54871c633a357;hb=79c404a024c4b00550400f158f89fcc64859e71d;hp=fc6f4161070f8e7dcb0c09a09d34c6b80a67bd9a;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/InterpolationMatrix.cxx b/src/ParaMEDMEM/InterpolationMatrix.cxx index fc6f41610..352566534 100644 --- a/src/ParaMEDMEM/InterpolationMatrix.cxx +++ b/src/ParaMEDMEM/InterpolationMatrix.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2013 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 @@ -110,7 +110,6 @@ namespace ParaMEDMEM interpMethod+=srcMeth; //creating the interpolator structure vector > surfaces; - int colSize=0; //computation of the intersection volumes between source and target elements MEDCouplingUMesh *distant_supportC=dynamic_cast(&distant_support); MEDCouplingUMesh *source_supportC=dynamic_cast(_source_support); @@ -120,19 +119,19 @@ namespace ParaMEDMEM { MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(source_supportC); INTERP_KERNEL::Interpolation2D interpolation(*this); - colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth); } else if(source_supportC->getMeshDimension()==3 && source_supportC->getSpaceDimension()==3) { MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(source_supportC); INTERP_KERNEL::Interpolation3D interpolation(*this); - colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth); } else if(source_supportC->getMeshDimension()==2 && source_supportC->getSpaceDimension()==3) { MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(source_supportC); INTERP_KERNEL::Interpolation3DSurf interpolation(*this); - colSize=interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.fromIntegralUniform(source_mesh_wrapper,surfaces,srcMeth); } else throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of source mesh to -1D targetMesh"); @@ -143,19 +142,19 @@ namespace ParaMEDMEM { MEDCouplingNormalizedUnstructuredMesh<2,2> distant_mesh_wrapper(distant_supportC); INTERP_KERNEL::Interpolation2D interpolation(*this); - colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth); } else if(distant_supportC->getMeshDimension()==3 && distant_supportC->getSpaceDimension()==3) { MEDCouplingNormalizedUnstructuredMesh<3,3> distant_mesh_wrapper(distant_supportC); INTERP_KERNEL::Interpolation3D interpolation(*this); - colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth); } else if(distant_supportC->getMeshDimension()==2 && distant_supportC->getSpaceDimension()==3) { MEDCouplingNormalizedUnstructuredMesh<3,2> distant_mesh_wrapper(distant_supportC); INTERP_KERNEL::Interpolation3DSurf interpolation(*this); - colSize=interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth.c_str()); + interpolation.toIntegralUniform(distant_mesh_wrapper,surfaces,srcMeth); } else throw INTERP_KERNEL::Exception("No para interpolation available for the given mesh and space dimension of distant mesh to -1D sourceMesh"); @@ -167,7 +166,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(distant_supportC); MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation3D2D interpolator (*this); - colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -178,7 +177,18 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<2,2> target_wrapper(distant_supportC); MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation2D1D interpolator (*this); - colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); + target_wrapper.releaseTempArrays(); + source_wrapper.releaseTempArrays(); + } + else if ( distant_support.getMeshDimension() == 3 + && _source_support->getMeshDimension() == 1 + && distant_support.getSpaceDimension() == 3 && _source_support->getSpaceDimension() == 3) + { + MEDCouplingNormalizedUnstructuredMesh<3,3> target_wrapper(distant_supportC); + MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC); + INTERP_KERNEL::Interpolation3D interpolator (*this); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -193,7 +203,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<1,1> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation1D interpolation(*this); - colSize=interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -204,7 +214,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<2,1> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation2DCurve interpolation(*this); - colSize=interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolation.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -215,7 +225,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<3,2> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation3DSurf interpolator (*this); - colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -226,7 +236,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<2,2> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation2D interpolator (*this); - colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); } @@ -237,7 +247,7 @@ namespace ParaMEDMEM MEDCouplingNormalizedUnstructuredMesh<3,3> source_wrapper(source_supportC); INTERP_KERNEL::Interpolation3D interpolator (*this); - colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod.c_str()); + interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces,interpMethod); target_wrapper.releaseTempArrays(); source_wrapper.releaseTempArrays(); }