From 8466d6cbcbfdf1c70c7cea9f6863f444a9d8b805 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 15 Jan 2010 16:11:15 +0000 Subject: [PATCH] *** empty log message *** --- src/MEDCoupling/MEDCouplingCMesh.cxx | 18 +++ src/MEDCoupling/MEDCouplingCMesh.hxx | 2 + src/MEDCoupling/MEDCouplingExtrudedMesh.cxx | 12 ++ src/MEDCoupling/MEDCouplingExtrudedMesh.hxx | 2 + src/MEDCoupling/MEDCouplingMesh.hxx | 2 + src/MEDCoupling/MEDCouplingRemapper.cxx | 137 ++++++++++-------- src/MEDCoupling/MEDCouplingRemapper.hxx | 9 +- .../Test/MEDCouplingRemapperTest.cxx | 96 ++++++++++++ .../Test/MEDCouplingRemapperTest.hxx | 3 + 9 files changed, 220 insertions(+), 61 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 19deae8d1..a48facf7d 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -180,3 +180,21 @@ MEDCouplingFieldDouble *MEDCouplingCMesh::getMeasureField(bool isAbs) const //not implemented yet ! return 0; } + +void MEDCouplingCMesh::rotate(const double *center, const double *vector, double angle) +{ + throw INTERP_KERNEL::Exception("No rotation available on CMesh : Traduce it to StructuredMesh to apply it !"); +} + +void MEDCouplingCMesh::translate(const double *vector) +{ + if(_x_array) + std::transform(_x_array->getConstPointer(),_x_array->getConstPointer()+_x_array->getNbOfElems(), + _x_array->getPointer(),std::bind2nd(std::plus(),vector[0])); + if(_y_array) + std::transform(_y_array->getConstPointer(),_y_array->getConstPointer()+_y_array->getNbOfElems(), + _y_array->getPointer(),std::bind2nd(std::plus(),vector[1])); + if(_z_array) + std::transform(_z_array->getConstPointer(),_z_array->getConstPointer()+_z_array->getNbOfElems(), + _z_array->getPointer(),std::bind2nd(std::plus(),vector[2])); +} diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index 4fc89be7c..de79089e5 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -46,6 +46,8 @@ namespace ParaMEDMEM // tools void getBoundingBox(double *bbox) const; MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; + void rotate(const double *center, const double *vector, double angle); + void translate(const double *vector); private: MEDCouplingCMesh(); ~MEDCouplingCMesh(); diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 76e23d912..919cedc5b 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -259,6 +259,18 @@ int MEDCouplingExtrudedMesh::findCorrespCellByNodalConn(const std::vector& throw INTERP_KERNEL::Exception(ostr.str().c_str()); } +void MEDCouplingExtrudedMesh::rotate(const double *center, const double *vector, double angle) +{ + _mesh2D->rotate(center,vector,angle); + _mesh1D->rotate(center,vector,angle); +} + +void MEDCouplingExtrudedMesh::translate(const double *vector) +{ + _mesh2D->translate(vector); + _mesh1D->translate(vector); +} + void MEDCouplingExtrudedMesh::computeExtrusionAlg(MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception) { _mesh3D_ids->alloc(mesh3D->getNumberOfCells(),1); diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index db0d863f8..22c13ed72 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -49,6 +49,8 @@ namespace ParaMEDMEM MEDCouplingFieldDouble *getMeasureField(bool) const; static int findCorrespCellByNodalConn(const std::vector& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception); + void rotate(const double *center, const double *vector, double angle); + void translate(const double *vector); private: MEDCouplingExtrudedMesh(MEDCouplingUMesh *mesh3D, MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception); void computeExtrusion(MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingMesh.hxx b/src/MEDCoupling/MEDCouplingMesh.hxx index cf65062c0..590a71ca1 100644 --- a/src/MEDCoupling/MEDCouplingMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMesh.hxx @@ -52,6 +52,8 @@ namespace ParaMEDMEM // tools virtual void getBoundingBox(double *bbox) const = 0; virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const = 0; + virtual void rotate(const double *center, const double *vector, double angle) = 0; + virtual void translate(const double *vector) = 0; protected: MEDCouplingMesh() { } MEDCouplingMesh(const MEDCouplingMesh& other):_name(other._name) { } diff --git a/src/MEDCoupling/MEDCouplingRemapper.cxx b/src/MEDCoupling/MEDCouplingRemapper.cxx index d73c0d6a2..b458704b0 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.cxx +++ b/src/MEDCoupling/MEDCouplingRemapper.cxx @@ -37,69 +37,21 @@ MEDCouplingRemapper::~MEDCouplingRemapper() releaseData(false); } -int MEDCouplingRemapper::prepare(const MEDCouplingUMesh *srcMesh, const MEDCouplingUMesh *targetMesh, const char *method) +int MEDCouplingRemapper::prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method) { releaseData(true); - _src_mesh=(MEDCouplingUMesh *)srcMesh; _target_mesh=(MEDCouplingUMesh *)targetMesh; + _src_mesh=(MEDCouplingMesh *)srcMesh; _target_mesh=(MEDCouplingMesh *)targetMesh; _src_mesh->incrRef(); _target_mesh->incrRef(); - INTERP_KERNEL::Interpolation::checkAndSplitInterpolationMethod(method,_src_method,_target_method); - const int srcMeshDim=_src_mesh->getMeshDimension(); - const int srcSpaceDim=_src_mesh->getSpaceDimension(); - const int trgMeshdim=_target_mesh->getMeshDimension(); - const int trgSpaceDim=_target_mesh->getSpaceDimension(); - if(trgSpaceDim!=srcSpaceDim) - throw INTERP_KERNEL::Exception("Incoherent space dimension detected between target and source."); - int nbCols; - if(srcMeshDim==2 && trgMeshdim==2 && srcSpaceDim==2) - { - MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(_src_mesh); - MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(_target_mesh); - INTERP_KERNEL::Interpolation2D interpolation(*this); - nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); - } - else if(srcMeshDim==3 && trgMeshdim==3 && srcSpaceDim==3) - { - MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(_src_mesh); - MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(_target_mesh); - INTERP_KERNEL::Interpolation3D interpolation(*this); - nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); - } - else if(srcMeshDim==2 && trgMeshdim==2 && srcSpaceDim==3) - { - MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(_src_mesh); - MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(_target_mesh); - INTERP_KERNEL::Interpolation3DSurf interpolation(*this); - nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); - } - else if(srcMeshDim==3 && trgMeshdim==1 && srcSpaceDim==3) - { - if(getIntersectionType()!=INTERP_KERNEL::PointLocator) - throw INTERP_KERNEL::Exception("Invalid interpolation requested between 3D and 1D ! Select PointLocator as intersection type !"); - MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(_src_mesh); - MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(_target_mesh); - INTERP_KERNEL::Interpolation3D interpolation(*this); - nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); - } - else if(srcMeshDim==1 && trgMeshdim==3 && srcSpaceDim==3) + int meshInterpType=((int)_src_mesh->getType()*16)+(int)_target_mesh->getType(); + switch(meshInterpType) { - if(getIntersectionType()!=INTERP_KERNEL::PointLocator) - throw INTERP_KERNEL::Exception("Invalid interpolation requested between 3D and 1D ! Select PointLocator as intersection type !"); - MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(_src_mesh); - MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(_target_mesh); - INTERP_KERNEL::Interpolation3D interpolation(*this); - std::vector > matrixTmp; - nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method); - reverseMatrix(matrixTmp,nbCols,_matrix); - nbCols=matrixTmp.size(); + case 85://Unstructured-Unstructured + return prepareUU(method); + case 136://Extruded-Extruded + return prepareEE(method); + default: + throw INTERP_KERNEL::Exception("Not managed type of meshes !"); } - else - throw INTERP_KERNEL::Exception("No interpolation available for the given mesh and space dimension"); - _deno_multiply.clear(); - _deno_multiply.resize(_matrix.size()); - _deno_reverse_multiply.clear(); - _deno_reverse_multiply.resize(nbCols); - declareAsNew(); - return 1; } void MEDCouplingRemapper::transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue) @@ -195,6 +147,75 @@ bool MEDCouplingRemapper::setOptionString(const std::string& key, std::string& v return INTERP_KERNEL::InterpolationOptions::setOptionString(key,value); } +int MEDCouplingRemapper::prepareUU(const char *method) +{ + MEDCouplingUMesh *src_mesh=(MEDCouplingUMesh *)_src_mesh; + MEDCouplingUMesh *target_mesh=(MEDCouplingUMesh *)_target_mesh; + INTERP_KERNEL::Interpolation::checkAndSplitInterpolationMethod(method,_src_method,_target_method); + const int srcMeshDim=src_mesh->getMeshDimension(); + const int srcSpaceDim=src_mesh->getSpaceDimension(); + const int trgMeshdim=target_mesh->getMeshDimension(); + const int trgSpaceDim=target_mesh->getSpaceDimension(); + if(trgSpaceDim!=srcSpaceDim) + throw INTERP_KERNEL::Exception("Incoherent space dimension detected between target and source."); + int nbCols; + if(srcMeshDim==2 && trgMeshdim==2 && srcSpaceDim==2) + { + MEDCouplingNormalizedUnstructuredMesh<2,2> source_mesh_wrapper(src_mesh); + MEDCouplingNormalizedUnstructuredMesh<2,2> target_mesh_wrapper(target_mesh); + INTERP_KERNEL::Interpolation2D interpolation(*this); + nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); + } + else if(srcMeshDim==3 && trgMeshdim==3 && srcSpaceDim==3) + { + MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh); + MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh); + INTERP_KERNEL::Interpolation3D interpolation(*this); + nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); + } + else if(srcMeshDim==2 && trgMeshdim==2 && srcSpaceDim==3) + { + MEDCouplingNormalizedUnstructuredMesh<3,2> source_mesh_wrapper(src_mesh); + MEDCouplingNormalizedUnstructuredMesh<3,2> target_mesh_wrapper(target_mesh); + INTERP_KERNEL::Interpolation3DSurf interpolation(*this); + nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); + } + else if(srcMeshDim==3 && trgMeshdim==1 && srcSpaceDim==3) + { + if(getIntersectionType()!=INTERP_KERNEL::PointLocator) + throw INTERP_KERNEL::Exception("Invalid interpolation requested between 3D and 1D ! Select PointLocator as intersection type !"); + MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh); + MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh); + INTERP_KERNEL::Interpolation3D interpolation(*this); + nbCols=interpolation.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,_matrix,method); + } + else if(srcMeshDim==1 && trgMeshdim==3 && srcSpaceDim==3) + { + if(getIntersectionType()!=INTERP_KERNEL::PointLocator) + throw INTERP_KERNEL::Exception("Invalid interpolation requested between 3D and 1D ! Select PointLocator as intersection type !"); + MEDCouplingNormalizedUnstructuredMesh<3,3> source_mesh_wrapper(src_mesh); + MEDCouplingNormalizedUnstructuredMesh<3,3> target_mesh_wrapper(target_mesh); + INTERP_KERNEL::Interpolation3D interpolation(*this); + std::vector > matrixTmp; + nbCols=interpolation.interpolateMeshes(target_mesh_wrapper,source_mesh_wrapper,matrixTmp,method); + reverseMatrix(matrixTmp,nbCols,_matrix); + nbCols=matrixTmp.size(); + } + else + throw INTERP_KERNEL::Exception("No interpolation available for the given mesh and space dimension"); + _deno_multiply.clear(); + _deno_multiply.resize(_matrix.size()); + _deno_reverse_multiply.clear(); + _deno_reverse_multiply.resize(nbCols); + declareAsNew(); + return 1; +} + +int MEDCouplingRemapper::prepareEE(const char *method) +{ + return 0; +} + void MEDCouplingRemapper::updateTime() { } diff --git a/src/MEDCoupling/MEDCouplingRemapper.hxx b/src/MEDCoupling/MEDCouplingRemapper.hxx index 7b0e99d8c..8ad284a1c 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.hxx +++ b/src/MEDCoupling/MEDCouplingRemapper.hxx @@ -29,6 +29,7 @@ namespace ParaMEDMEM { + class MEDCouplingMesh; class MEDCouplingUMesh; class MEDCouplingFieldDouble; } @@ -40,7 +41,7 @@ namespace ParaMEDMEM public: MEDCouplingRemapper(); ~MEDCouplingRemapper(); - int prepare(const MEDCouplingUMesh *srcMesh, const MEDCouplingUMesh *targetMesh, const char *method); + int prepare(const MEDCouplingMesh *srcMesh, const MEDCouplingMesh *targetMesh, const char *method); void transfer(const MEDCouplingFieldDouble *srcField, MEDCouplingFieldDouble *targetField, double dftValue); void reverseTransfer(MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *targetField, double dftValue); MEDCouplingFieldDouble *transferField(const MEDCouplingFieldDouble *srcField, double dftValue); @@ -49,6 +50,8 @@ namespace ParaMEDMEM bool setOptionDouble(const std::string& key, double value); bool setOptionString(const std::string& key, std::string& value); private: + int prepareUU(const char *method); + int prepareEE(const char *method); void updateTime(); void releaseData(bool matrixSuppression); void computeDeno(NatureOfField nat, const MEDCouplingFieldDouble *srcField, const MEDCouplingFieldDouble *trgField); @@ -62,8 +65,8 @@ namespace ParaMEDMEM static void computeColSumAndRowSum(const std::vector >& matrixDeno, std::vector >& deno, std::vector >& denoReverse); private: - MEDCouplingUMesh *_src_mesh; - MEDCouplingUMesh *_target_mesh; + MEDCouplingMesh *_src_mesh; + MEDCouplingMesh *_target_mesh; std::string _src_method; std::string _target_method; NatureOfField _nature_of_deno; diff --git a/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx b/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx index f258600ee..ae907888d 100644 --- a/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx +++ b/src/MEDCoupling/Test/MEDCouplingRemapperTest.cxx @@ -18,6 +18,7 @@ // #include "MEDCouplingRemapperTest.hxx" #include "MEDCouplingUMesh.hxx" +#include "MEDCouplingExtrudedMesh.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingMemArray.hxx" #include "MEDCouplingRemapper.hxx" @@ -528,6 +529,25 @@ void MEDCouplingRemapperTest::testNatureOfField() targetMesh->decrRef(); } +void MEDCouplingRemapperTest::testExtruded() +{ + MEDCouplingUMesh *mesh2DS=0; + MEDCouplingUMesh *mesh3DS=build3DExtrudedUMesh_1(mesh2DS); + MEDCouplingExtrudedMesh *extS=MEDCouplingExtrudedMesh::New(mesh3DS,mesh2DS,1); + mesh3DS->decrRef(); + mesh2DS->decrRef(); + MEDCouplingUMesh *mesh2DT=0; + MEDCouplingUMesh *mesh3DT=build3DExtrudedUMesh_1(mesh2DT); + MEDCouplingExtrudedMesh *extT=MEDCouplingExtrudedMesh::New(mesh3DT,mesh2DT,1); + // + // + mesh3DT->decrRef(); + mesh2DT->decrRef(); + // + extS->decrRef(); + extT->decrRef(); +} + MEDCouplingUMesh *MEDCouplingRemapperTest::build3DSourceMesh_2() { double sourceCoords[84]={100.0, 100.0, 0.0, 100.0, 100.0, 100.0, 100.0, 0.0, 100.0, 100.0, 0.0, 0.0, 0.0, 100.0, 0.0, 0.0, 100.0, 100.0, 0.0, @@ -855,6 +875,82 @@ MEDCouplingUMesh *MEDCouplingRemapperTest::build3DTargetMesh_1() return targetMesh; } +MEDCouplingUMesh *MEDCouplingRemapperTest::build3DExtrudedUMesh_1(MEDCouplingUMesh *&mesh2D) +{ + double coords[180]={ + 0.,0.,0., 1.,1.,0., 1.,1.25,0., 0.,1.,0., 1.,1.5,0., 2.,0.,0., 2.,1.,0., 1.,2.,0., 0.,2.,0., 3.,1.,0., + 3.,2.,0., 0.,1.,0., 1.,3.,0., 2.,2.,0., 2.,3.,0., + 0.,0.,1., 1.,1.,1., 1.,1.25,1., 0.,1.,1., 1.,1.5,1., 2.,0.,1., 2.,1.,1., 1.,2.,1., 0.,2.,1., 3.,1.,1., + 3.,2.,1., 0.,1.,1., 1.,3.,1., 2.,2.,1., 2.,3.,1., + 0.,0.,2., 1.,1.,2., 1.,1.25,2., 0.,1.,2., 1.,1.5,2., 2.,0.,2., 2.,1.,2., 1.,2.,2., 0.,2.,2., 3.,1.,2., + 3.,2.,2., 0.,1.,2., 1.,3.,2., 2.,2.,2., 2.,3.,2., + 0.,0.,3., 1.,1.,3., 1.,1.25,3., 0.,1.,3., 1.,1.5,3., 2.,0.,3., 2.,1.,3., 1.,2.,3., 0.,2.,3., 3.,1.,3., + 3.,2.,3., 0.,1.,3., 1.,3.,3., 2.,2.,3., 2.,3.,3.}; + + int conn[354]={ + // 0 + 0,11,1,3,15,26,16,18, 1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17, + 1,6,5,3,16,21,20,18, 13,10,9,6,28,25,24,21, + 11,8,7,4,2,1,-1,11,26,16,1,-1,1,16,17,2,-1,2,17,19,4,-1,4,19,22,7,-1,7,8,23,22,-1,8,11,26,23,-1,26,16,17,19,22,23, + 7,12,14,13,22,27,29,28, + // 1 + 15,26,16,18,30,41,31,33, 16,17,19,22,28,21,-1,16,31,36,21,-1,21,36,43,28,-1,28,22,37,43,-1,22,19,34,37,-1,19,17,32,34,-1,17,16,31,32,-1,31,36,43,37,34,32, + 16,21,20,18,31,36,35,33, 28,25,24,21,43,40,39,36, + 26,23,22,19,17,16,-1,26,41,31,16,-1,16,31,32,17,-1,17,32,34,19,-1,19,34,37,22,-1,22,23,38,37,-1,23,26,41,38,-1,41,31,32,34,37,38, + 22,27,29,28,37,42,44,43, + // 2 + 30,41,31,33,45,56,46,48, 31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47, + 31,36,35,33,46,51,50,48, 43,40,39,36,58,55,54,51, + 41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53, + 37,42,44,43,52,57,59,58 + }; + int conn2[28]={7,12,14,13, 11,8,7,4,2,1, 13,10,9,6, 1,6,5,3, 1,2,4,7,13,6, 0,11,1,3}; + // + MEDCouplingUMesh *ret=MEDCouplingUMesh::New(); + ret->setMeshDimension(3); + ret->allocateCells(18); + // + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+8); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+51); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+59); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+67); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+110); + // + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+118); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+126); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+169); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+177); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+185); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+228); + // + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+236); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+244); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+287); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+295); + ret->insertNextCell(INTERP_KERNEL::NORM_POLYHED,43,conn+303); + ret->insertNextCell(INTERP_KERNEL::NORM_HEXA8,8,conn+346); + // + ret->finishInsertingCells(); + DataArrayDouble *myCoords=DataArrayDouble::New(); + myCoords->alloc(60,3); + std::copy(coords,coords+180,myCoords->getPointer()); + ret->setCoords(myCoords); + // + mesh2D=MEDCouplingUMesh::New(); + mesh2D->setMeshDimension(2); + mesh2D->allocateCells(6); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn2); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_POLYGON,6,conn2+4); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn2+10); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn2+14); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_POLYGON,6,conn2+18); + mesh2D->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,conn2+24); + mesh2D->setCoords(myCoords); + myCoords->decrRef(); + return ret; +} + double MEDCouplingRemapperTest::sumAll(const std::vector< std::map >& matrix) { double ret=0.; diff --git a/src/MEDCoupling/Test/MEDCouplingRemapperTest.hxx b/src/MEDCoupling/Test/MEDCouplingRemapperTest.hxx index 1c41f1b43..3cba550c5 100644 --- a/src/MEDCoupling/Test/MEDCouplingRemapperTest.hxx +++ b/src/MEDCoupling/Test/MEDCouplingRemapperTest.hxx @@ -36,6 +36,7 @@ namespace ParaMEDMEM CPPUNIT_TEST( test2DInterpMultiMethods ); CPPUNIT_TEST( testMultiDimCombi ); CPPUNIT_TEST( testNatureOfField ); + CPPUNIT_TEST( testExtruded ); CPPUNIT_TEST_SUITE_END(); public: void test2DInterpP0P0_1(); @@ -43,6 +44,7 @@ namespace ParaMEDMEM void test2DInterpMultiMethods(); void testMultiDimCombi(); void testNatureOfField(); + void testExtruded(); private: MEDCouplingUMesh *build3DSourceMesh_2(); MEDCouplingUMesh *build3DTargetMesh_2(); @@ -59,6 +61,7 @@ namespace ParaMEDMEM MEDCouplingUMesh *build3DSurfTargetMesh_2(); MEDCouplingUMesh *build3DSourceMesh_1(); MEDCouplingUMesh *build3DTargetMesh_1(); + MEDCouplingUMesh *build3DExtrudedUMesh_1(MEDCouplingUMesh *&mesh2D); double sumAll(const std::vector< std::map >& matrix); }; } -- 2.39.2