-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016 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
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "MEDCouplingBasicsTest.hxx"
#include "MEDCouplingUMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingMultiFields.hxx"
#include "MEDCouplingBasicsTestData1.hxx"
#include "Interpolation2D.txx"
-#include "Interpolation3D2D.txx"
+#include "Interpolation2D3D.txx"
#include "Interpolation2D1D.txx"
#include "MEDCouplingNormalizedUnstructuredMesh.txx"
#include "MEDCouplingNormalizedCartesianMesh.txx"
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
typedef std::vector<std::map<int,double> > IntersectionMatrix;
std::copy(coords,coords+22,myCoords->getPointer());
ret->setCoords(myCoords);
myCoords->decrRef();
- ret->checkCoherency();
+ ret->checkConsistencyLight();
return ret;
}
MEDCouplingMultiFields *MEDCouplingBasicsTest::buildMultiFields_1()
{
- ParaMEDMEM::MEDCouplingUMesh *m1=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m1=build2DTargetMesh_1();
m1->setName("m1");
- ParaMEDMEM::MEDCouplingUMesh *m2=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m2=build2DTargetMesh_1();
m2->setName("m2");
const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
const double vals1[]={0.,1.,2.,3.,4.,0.1,0.2,0.3,0.4};
const double vals2[]={5.,6.,7.,8.,9.};
const double vals4[]={15.,16.,17.,18.,19.};
//
- ParaMEDMEM::DataArrayDouble *d0=ParaMEDMEM::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
- ParaMEDMEM::DataArrayDouble *d1=ParaMEDMEM::DataArrayDouble::New(); d1->alloc(9,1); std::copy(vals1,vals1+9,d1->getPointer());
- ParaMEDMEM::DataArrayDouble *d1_1=ParaMEDMEM::DataArrayDouble::New(); d1_1->alloc(9,1); std::copy(vals1_1,vals1_1+9,d1_1->getPointer());
- ParaMEDMEM::DataArrayDouble *d2=ParaMEDMEM::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
- ParaMEDMEM::DataArrayDouble *d4=ParaMEDMEM::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
+ MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
+ MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(9,1); std::copy(vals1,vals1+9,d1->getPointer());
+ MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(9,1); std::copy(vals1_1,vals1_1+9,d1_1->getPointer());
+ MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
+ MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
//
d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
d0->setInfoOnComponent(0,"c1");
d2->setInfoOnComponent(0,"c5");
d4->setInfoOnComponent(0,"c7");
//
- ParaMEDMEM::MEDCouplingFieldDouble *f0=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f0->setMesh(m1);
f0->setArray(d0);
f0->setTime(0.2,5,6);
f0->setName("f0");
- ParaMEDMEM::MEDCouplingFieldDouble *f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES,ParaMEDMEM::LINEAR_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES,MEDCoupling::LINEAR_TIME);
f1->setMesh(m1);
- std::vector<ParaMEDMEM::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
+ std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
f1->setArrays(d1s);
f1->setStartTime(0.7,7,8);
f1->setEndTime(1.2,9,10);
f1->setName("f1");
- ParaMEDMEM::MEDCouplingFieldDouble *f2=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::CONST_ON_TIME_INTERVAL);
+ MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
f2->setMesh(m2);
f2->setArray(d2);
f2->setTime(1.2,11,12);
f2->setEndTime(1.5,13,14);
f2->setName("f2");
- ParaMEDMEM::MEDCouplingFieldDouble *f3=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f3->setMesh(m1);
f3->setArray(d2);
f3->setTime(1.7,15,16);
f3->setName("f3");
- ParaMEDMEM::MEDCouplingFieldDouble *f4=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
f4->setMesh(m2);
f4->setArray(d4);
f4->setName("f4");
//
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> fs(5);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
- ParaMEDMEM::MEDCouplingMultiFields *ret=ParaMEDMEM::MEDCouplingMultiFields::New(fs);
+ MEDCoupling::MEDCouplingMultiFields *ret=MEDCoupling::MEDCouplingMultiFields::New(fs);
//
m1->decrRef();
m2->decrRef();
std::vector<MEDCouplingFieldDouble *> MEDCouplingBasicsTest::buildMultiFields_2()
{
- ParaMEDMEM::MEDCouplingUMesh *m1=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m1=build2DTargetMesh_1();
m1->setName("m1");
- ParaMEDMEM::MEDCouplingUMesh *m2=build2DTargetMesh_1();
+ MEDCoupling::MEDCouplingUMesh *m2=build2DTargetMesh_1();
m2->setName("m2");
const double vals0[]={-0.7,-1.,-2.,-3.,-4.};
const double vals1[]={0.,1.,2.,3.,4.};
const double vals2[]={5.,6.,7.,8.,9.};
const double vals4[]={15.,16.,17.,18.,19.};
//
- ParaMEDMEM::DataArrayDouble *d0=ParaMEDMEM::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
- ParaMEDMEM::DataArrayDouble *d1=ParaMEDMEM::DataArrayDouble::New(); d1->alloc(5,1); std::copy(vals1,vals1+5,d1->getPointer());
- ParaMEDMEM::DataArrayDouble *d1_1=ParaMEDMEM::DataArrayDouble::New(); d1_1->alloc(5,1); std::copy(vals1_1,vals1_1+5,d1_1->getPointer());
- ParaMEDMEM::DataArrayDouble *d2=ParaMEDMEM::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
- ParaMEDMEM::DataArrayDouble *d4=ParaMEDMEM::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
+ MEDCoupling::DataArrayDouble *d0=MEDCoupling::DataArrayDouble::New(); d0->alloc(5,1); std::copy(vals0,vals0+5,d0->getPointer());
+ MEDCoupling::DataArrayDouble *d1=MEDCoupling::DataArrayDouble::New(); d1->alloc(5,1); std::copy(vals1,vals1+5,d1->getPointer());
+ MEDCoupling::DataArrayDouble *d1_1=MEDCoupling::DataArrayDouble::New(); d1_1->alloc(5,1); std::copy(vals1_1,vals1_1+5,d1_1->getPointer());
+ MEDCoupling::DataArrayDouble *d2=MEDCoupling::DataArrayDouble::New(); d2->alloc(5,1); std::copy(vals2,vals2+5,d2->getPointer());
+ MEDCoupling::DataArrayDouble *d4=MEDCoupling::DataArrayDouble::New(); d4->alloc(5,1); std::copy(vals4,vals4+5,d4->getPointer());
//
d0->setName("d0"); d1->setName("d1"); d1_1->setName("d1_1"); d2->setName("d2"); d4->setName("d4");
d0->setInfoOnComponent(0,"c1");
d2->setInfoOnComponent(0,"c5");
d4->setInfoOnComponent(0,"c7");
//
- ParaMEDMEM::MEDCouplingFieldDouble *f0=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f0=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f0->setMesh(m1);
f0->setArray(d0);
f0->setTime(0.2,5,6);
f0->setName("f0");
- ParaMEDMEM::MEDCouplingFieldDouble *f1=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::LINEAR_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f1=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::LINEAR_TIME);
f1->setMesh(m1);
- std::vector<ParaMEDMEM::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
+ std::vector<MEDCoupling::DataArrayDouble *> d1s(2); d1s[0]=d1; d1s[1]=d1_1;
f1->setArrays(d1s);
f1->setStartTime(0.7,7,8);
f1->setEndTime(1.2,9,10);
f1->setName("f1");
- ParaMEDMEM::MEDCouplingFieldDouble *f2=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::CONST_ON_TIME_INTERVAL);
+ MEDCoupling::MEDCouplingFieldDouble *f2=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::CONST_ON_TIME_INTERVAL);
f2->setMesh(m2);
f2->setArray(d2);
f2->setTime(1.2,11,12);
f2->setEndTime(1.5,13,14);
f2->setName("f2");
- ParaMEDMEM::MEDCouplingFieldDouble *f3=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f3=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME);
f3->setMesh(m1);
f3->setArray(d2);
f3->setTime(1.7,15,16);
f3->setName("f3");
- ParaMEDMEM::MEDCouplingFieldDouble *f4=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::NO_TIME);
+ MEDCoupling::MEDCouplingFieldDouble *f4=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::NO_TIME);
f4->setMesh(m2);
f4->setArray(d4);
f4->setName("f4");
//
- std::vector<ParaMEDMEM::MEDCouplingFieldDouble *> fs(5);
+ std::vector<MEDCoupling::MEDCouplingFieldDouble *> fs(5);
fs[0]=f0; fs[1]=f1; fs[2]=f2; fs[3]=f3; fs[4]=f4;
m1->decrRef();
m2->decrRef();
std::cout.precision(16);
const double length = sumAll(matrix);
- LOG(1, "length = " << surf <<" correctLength = " << correctLength );
+ LOG(1, "length = " << length <<" correctLength = " << correctLength );
CPPUNIT_ASSERT_DOUBLES_EQUAL(correctLength, length, prec * std::max(correctLength, length));
- INTERP_KERNEL::Interpolation3D2D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
+ INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
int duplicateFacesNbr = duplicateFaces.size();
LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr);
CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr);
{
MEDCouplingNormalizedUnstructuredMesh<3,3> sourceWrapper(sourceMesh);
MEDCouplingNormalizedUnstructuredMesh<3,3> targetWrapper(targetMesh);
- INTERP_KERNEL::Interpolation3D2D myInterpolator;
+ INTERP_KERNEL::Interpolation2D3D myInterpolator;
myInterpolator.setPrecision(1e-12);
const double prec = 1.0e-5;
IntersectionMatrix matrix;
LOG(1, "surf = " << surf <<" correctSurf = " << correctSurf );
CPPUNIT_ASSERT_DOUBLES_EQUAL(correctSurf, surf, prec * std::max(correctSurf, surf));
- INTERP_KERNEL::Interpolation3D2D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
+ INTERP_KERNEL::Interpolation2D3D::DuplicateFacesType duplicateFaces = myInterpolator.retrieveDuplicateFaces();
int duplicateFacesNbr = duplicateFaces.size();
LOG(1, "duplicateFacesNbr = " << duplicateFacesNbr <<" correctDuplicateFacesNbr = " << correctDuplicateFacesNbr);
CPPUNIT_ASSERT_EQUAL(correctDuplicateFacesNbr, duplicateFacesNbr);