X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNELTest%2FInterpolation3DTest.cxx;h=ae0069c13349ec35d29303a1820dee2ffdbc39b9;hb=1a9af3cb21941312cdda3f0466677b61beba7ade;hp=5b6376e06ef6a5fe7bebac67fbbe0e52a52c484a;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNELTest/Interpolation3DTest.cxx b/src/INTERP_KERNELTest/Interpolation3DTest.cxx index 5b6376e06..ae0069c13 100644 --- a/src/INTERP_KERNELTest/Interpolation3DTest.cxx +++ b/src/INTERP_KERNELTest/Interpolation3DTest.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 @@ -18,19 +18,19 @@ // #include "Interpolation3DTest.hxx" -#include "MEDMEM_Mesh.hxx" -#include +#include "MEDFileMesh.hxx" +#include "MEDCouplingUMesh.hxx" +#include "MEDCouplingFieldDouble.hxx" + #include -#include #include +#include +#include #include #include "VectorUtils.hxx" -#include "MEDMEM_Field.hxx" -#include "MEDMEM_Support.hxx" - // levels : // 1 - titles and volume results // 2 - symmetry / diagonal results and intersection matrix output @@ -42,9 +42,8 @@ //#define VOL_PREC 1.0e-6 -using namespace MEDMEM; +using namespace ParaMEDMEM; using namespace INTERP_KERNEL; -using namespace MED_EN; double Interpolation3DTest::sumRow(const IntersectionMatrix& m, int i) const { @@ -72,13 +71,10 @@ double Interpolation3DTest::sumCol(const IntersectionMatrix& m, int i) const } -void Interpolation3DTest::getVolumes(MESH& mesh, double* tab) const +void Interpolation3DTest::getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double *tab) const { - SUPPORT *sup=new SUPPORT(&mesh,"dummy",MED_CELL); - FIELD* f=mesh.getVolume(sup); - const double *tabS=f->getValue(); - std::copy(tabS,tabS+mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS),tab) - delete sup; + MEDCouplingAutoRefCountObjectPtr vol=mesh->getMeasureField(true); + std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab); } double Interpolation3DTest::sumVolume(const IntersectionMatrix& m) const @@ -102,15 +98,15 @@ double Interpolation3DTest::sumVolume(const IntersectionMatrix& m) const return vol; } -bool Interpolation3DTest::testVolumes(const IntersectionMatrix& m, MESH& sMesh, MESH& tMesh) const +bool Interpolation3DTest::testVolumes(const IntersectionMatrix& m, MEDCouplingUMesh& sMesh, MEDCouplingUMesh& tMesh) const { bool ok = true; // source elements - double* sVol = new double[sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)]; + double* sVol = new double[sMesh.getNumberOfCells()]; getVolumes(sMesh, sVol); - for(int i = 0; i < sMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i) + for(int i = 0; i < sMesh.getNumberOfCells(); ++i) { const double sum_row = sumRow(m, i+1); if(!epsilonEqualRelative(sum_row, sVol[i], VOL_PREC)) @@ -122,9 +118,9 @@ bool Interpolation3DTest::testVolumes(const IntersectionMatrix& m, MESH& sMesh, } // target elements - double* tVol = new double[tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)]; + double* tVol = new double[tMesh.getNumberOfCells()]; getVolumes(tMesh, tVol); - for(int i = 0; i < tMesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS); ++i) + for(int i = 0; i < tMesh.getNumberOfCells(); ++i) { const double sum_col = sumCol(m, i); if(!epsilonEqualRelative(sum_col, tVol[i], VOL_PREC))