//
// 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
//
// 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
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "MEDCouplingBasicsTest2.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
#include "MEDCouplingBasicsTest2.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingGaussLocalization.hxx"
CPPUNIT_ASSERT_DOUBLES_EQUAL(27.,f->getIJK(2,5,0),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(16.,f->getIJK(1,5,1),1e-14);
//
f->clearGaussLocalizations();
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
CPPUNIT_ASSERT_DOUBLES_EQUAL(27.,f->getIJK(2,5,0),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(16.,f->getIJK(1,5,1),1e-14);
//
f->clearGaussLocalizations();
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
int ids1[4]={0,1,3,4};
CPPUNIT_ASSERT_THROW(f->setGaussLocalizationOnCells(ids1,ids1+4,_refCoo2,_gsCoo1,_wg1),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
int ids1[4]={0,1,3,4};
CPPUNIT_ASSERT_THROW(f->setGaussLocalizationOnCells(ids1,ids1+4,_refCoo2,_gsCoo1,_wg1),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_EQUAL(0,f->getNbOfGaussLocalization());
CPPUNIT_ASSERT_EQUAL(0,f->getGaussLocalizationIdOfOneCell(0));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(1));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(2));
CPPUNIT_ASSERT_EQUAL(0,f->getGaussLocalizationIdOfOneCell(0));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(1));
CPPUNIT_ASSERT_EQUAL(1,f->getGaussLocalizationIdOfOneCell(2));
f->getCellIdsHavingGaussLocalization(0,tmpIds);
CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size());
CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin()));
f->getCellIdsHavingGaussLocalization(0,tmpIds);
CPPUNIT_ASSERT_EQUAL(2,(int)tmpIds.size());
CPPUNIT_ASSERT(std::equal(ids2,ids2+2,tmpIds.begin()));
- CPPUNIT_ASSERT_THROW(f->checkCoherency(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
- DataArrayDouble *array2=f->getArray()->substr(0,10);
+ CPPUNIT_ASSERT_THROW(f->checkConsistencyLight(),INTERP_KERNEL::Exception);//<- it's always not ok because undelying array not with the good size.
+ DataArrayDouble *array2=f->getArray()->subArray(0,10);
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
MEDCouplingGaussLocalization& gl1=f2->getGaussLocalization(0);
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
MEDCouplingGaussLocalization& gl1=f2->getGaussLocalization(0);
gl1.setGaussCoord(1,1,tmp);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
f->decrRef();
gl1.setGaussCoord(1,1,tmp);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
f->decrRef();
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
CPPUNIT_ASSERT_DOUBLES_EQUAL(21.,f->getIJK(2,0,0),1e-14);
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(f2,1e-14,1e-14));
CPPUNIT_ASSERT_DOUBLES_EQUAL(21.,f->getIJK(2,0,0),1e-14);
CPPUNIT_ASSERT_EQUAL(18,m2->getNumberOfCells());
int cellIds[3]={0,6,12};
std::vector<int> cellIds2(cellIds,cellIds+3);
CPPUNIT_ASSERT_EQUAL(18,m2->getNumberOfCells());
int cellIds[3]={0,6,12};
std::vector<int> cellIds2(cellIds,cellIds+3);
m5->arePolyhedronsNotCorrectlyOriented(res1);
CPPUNIT_ASSERT(res1.empty());
MEDCouplingFieldDouble *f3=m5->getMeasureField(false);
m5->arePolyhedronsNotCorrectlyOriented(res1);
CPPUNIT_ASSERT(res1.empty());
MEDCouplingFieldDouble *f3=m5->getMeasureField(false);
- CPPUNIT_ASSERT_EQUAL(15,f3->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f3->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(15,(int)f3->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f3->getNumberOfComponents());
const double *f3Ptr=f3->getArray()->getConstPointer();
const double expected1[15]={
0.075,0.0375,0.0375,0.075,0.075,
const double *f3Ptr=f3->getArray()->getConstPointer();
const double expected1[15]={
0.075,0.0375,0.0375,0.075,0.075,
- DataArrayDouble *f4=m5->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(15,f4->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,f4->getNumberOfComponents());
+ DataArrayDouble *f4=m5->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(15,(int)f4->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)f4->getNumberOfComponents());
const double *f4Ptr=f4->getConstPointer();
const double expected2[45]={
-0.05,-0.05,0.15, 0.3666666666666667,-0.13333333333333333,0.15, 0.53333333333333333,0.033333333333333333,0.15, -0.05,0.45,0.15, 0.45,0.45,0.15,
const double *f4Ptr=f4->getConstPointer();
const double expected2[45]={
-0.05,-0.05,0.15, 0.3666666666666667,-0.13333333333333333,0.15, 0.53333333333333333,0.033333333333333333,0.15, -0.05,0.45,0.15, 0.45,0.45,0.15,
std::copy(coords,coords+27,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
std::copy(coords,coords+27,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
//
std::vector<int> res1;
meshN->arePolyhedronsNotCorrectlyOriented(res1);
meshN->orientCorrectlyPolyhedrons();
CPPUNIT_ASSERT(res1.empty());
const double *ref,*daPtr;
//
std::vector<int> res1;
meshN->arePolyhedronsNotCorrectlyOriented(res1);
meshN->orientCorrectlyPolyhedrons();
CPPUNIT_ASSERT(res1.empty());
const double *ref,*daPtr;
- DataArrayDouble *da=meshN->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,da->getNumberOfComponents());
+ DataArrayDouble *da=meshN->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)da->getNumberOfComponents());
//
const double center[]={0.,0.,0.};
const double vec[]={0.,2.78,0.};
//
const double center[]={0.,0.,0.};
const double vec[]={0.,2.78,0.};
const double vec2[]={4.5,9.3,2.8};
meshN->rotate(center2,vec2,M_E);
meshN->translate(vec2);
const double vec2[]={4.5,9.3,2.8};
meshN->rotate(center2,vec2,M_E);
meshN->translate(vec2);
- DataArrayDouble *f3=m1->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(4,f3->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f3->getNumberOfComponents());
+ DataArrayDouble *f3=m1->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(4,(int)f3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f3->getNumberOfComponents());
double expected9[4]={0.75,5.105,0.8,5.155};
ptr=f3->getConstPointer();
for(int i=0;i<4;i++)
double expected9[4]={0.75,5.105,0.8,5.155};
ptr=f3->getConstPointer();
for(int i=0;i<4;i++)
- CPPUNIT_ASSERT_EQUAL(4,f2->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
double expected1[4]={0.5,0.21,-0.6,-0.31};
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
double expected1[4]={0.5,0.21,-0.6,-0.31};
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
- CPPUNIT_ASSERT_EQUAL(4,f2->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(sqrt(2.)*expected2[i],ptr[i],1e-12);
f2->decrRef();
f2=m1->getMeasureField(true);
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(sqrt(2.)*expected2[i],ptr[i],1e-12);
f2->decrRef();
f2=m1->getMeasureField(true);
- CPPUNIT_ASSERT_EQUAL(4,f2->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i]*sqrt(2.),ptr[i],1e-12);
f2->decrRef();
//bary
ptr=f2->getArray()->getConstPointer();
for(int i=0;i<4;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i]*sqrt(2.),ptr[i],1e-12);
f2->decrRef();
//bary
- f3=m1->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(4,f3->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f3->getNumberOfComponents());
+ f3=m1->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(4,(int)f3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f3->getNumberOfComponents());
double expected10[8]={0.75,0.75,5.105,5.105,0.8,0.8,5.155,5.155};
ptr=f3->getConstPointer();
for(int i=0;i<8;i++)
double expected10[8]={0.75,0.75,5.105,5.105,0.8,0.8,5.155,5.155};
ptr=f3->getConstPointer();
for(int i=0;i<8;i++)
- CPPUNIT_ASSERT_EQUAL(10,f1->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(10,(int)f1->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
double expected1[10]={-0.5,-1,-1.5,-0.5,-1, 0.5,1,1.5,0.5,1};
const double *ptr=f1->getArray()->getConstPointer();
for(int i=0;i<10;i++)
double expected1[10]={-0.5,-1,-1.5,-0.5,-1, 0.5,1,1.5,0.5,1};
const double *ptr=f1->getArray()->getConstPointer();
for(int i=0;i<10;i++)
- DataArrayDouble *f2=m1->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(10,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
+ DataArrayDouble *f2=m1->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(10,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents());
double expected2[20]={
0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5,
0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5,
double expected2[20]={
0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5,
0.5,0.3333333333333333,0.5,0.5,0.5,0.77777777777777777,0.5,0.3333333333333333,0.5,0.5,
- CPPUNIT_ASSERT_EQUAL(10,f1->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(10,(int)f1->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
ptr=f1->getArray()->getConstPointer();
for(int i=0;i<10;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(std::abs(expected1[i]),ptr[i],1e-12);
f1->decrRef();
ptr=f1->getArray()->getConstPointer();
for(int i=0;i<10;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(std::abs(expected1[i]),ptr[i],1e-12);
f1->decrRef();
- f2=m1->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(10,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,f2->getNumberOfComponents());
+ f2=m1->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(10,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)f2->getNumberOfComponents());
ptr=f2->getConstPointer();
double expected3[30]={
0.5,0.3333333333333333,0.,0.5,0.5,0.,0.5,0.77777777777777777,0.,0.5,0.3333333333333333,0.,0.5,0.5,0.,
ptr=f2->getConstPointer();
double expected3[30]={
0.5,0.3333333333333333,0.,0.5,0.5,0.,0.5,0.77777777777777777,0.,0.5,0.3333333333333333,0.,0.5,0.5,0.,
std::copy(coords,coords+207,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
std::copy(coords,coords+207,myCoords->getPointer());
meshN->setCoords(myCoords);
myCoords->decrRef();
- DataArrayDouble *da=meshN->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(4,da->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,da->getNumberOfComponents());
+ DataArrayDouble *da=meshN->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(4,(int)da->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)da->getNumberOfComponents());
const double *daPtr=da->getConstPointer();
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(barys[i],daPtr[i],1e-12);
const double *daPtr=da->getConstPointer();
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(barys[i],daPtr[i],1e-12);
MEDCouplingFieldDouble *fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
MEDCouplingFieldDouble *fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
fCpy=f->clone(true);
CPPUNIT_ASSERT(f->isEqual(fCpy,1e-12,1e-12));
f->renumberCells(renumber1,false);
arr->decrRef();
const double values1[27]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.,12.,112.,10012.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.};
std::copy(values1,values1+27,arr->getPointer());
arr->decrRef();
const double values1[27]={7.,107.,10007.,8.,108.,10008.,9.,109.,10009.,10.,110.,10010.,11.,111.,10011.,12.,112.,10012.,13.,113.,10013.,14.,114.,10014.,15.,115.,10015.};
std::copy(values1,values1+27,arr->getPointer());
const int renumber1[9]={0,4,1,3,5,2,6,7,8};
double res[3];
const double loc[]={0.5432,-0.2432, 0.5478,0.1528};
const int renumber1[9]={0,4,1,3,5,2,6,7,8};
double res[3];
const double loc[]={0.5432,-0.2432, 0.5478,0.1528};
void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear()
{
MEDCouplingUMesh *mesh=build2DTargetMesh_3();
void MEDCouplingBasicsTest2::testConvertQuadraticCellsToLinear()
{
MEDCouplingUMesh *mesh=build2DTargetMesh_3();
std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(5,(int)types.size());
INTERP_KERNEL::NormalizedCellType expected1[5]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QUAD8};
std::set<INTERP_KERNEL::NormalizedCellType> expected1Bis(expected1,expected1+5);
CPPUNIT_ASSERT(expected1Bis==types);
CPPUNIT_ASSERT(mesh->isPresenceOfQuadratic());
std::set<INTERP_KERNEL::NormalizedCellType> types=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(5,(int)types.size());
INTERP_KERNEL::NormalizedCellType expected1[5]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QUAD8};
std::set<INTERP_KERNEL::NormalizedCellType> expected1Bis(expected1,expected1+5);
CPPUNIT_ASSERT(expected1Bis==types);
CPPUNIT_ASSERT(mesh->isPresenceOfQuadratic());
MEDCouplingFieldDouble *f1=mesh->getMeasureField(false);
//
mesh->convertQuadraticCellsToLinear();
CPPUNIT_ASSERT(!mesh->isPresenceOfQuadratic());
//
MEDCouplingFieldDouble *f1=mesh->getMeasureField(false);
//
mesh->convertQuadraticCellsToLinear();
CPPUNIT_ASSERT(!mesh->isPresenceOfQuadratic());
//
MEDCouplingFieldDouble *f2=mesh->getMeasureField(false);
CPPUNIT_ASSERT(f1->getArray()->isEqual(*f2->getArray(),1e-12));
MEDCouplingFieldDouble *f2=mesh->getMeasureField(false);
CPPUNIT_ASSERT(f1->getArray()->isEqual(*f2->getArray(),1e-12));
std::set<INTERP_KERNEL::NormalizedCellType> types2=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(3,(int)types2.size());
INTERP_KERNEL::NormalizedCellType expected2[3]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4};
std::set<INTERP_KERNEL::NormalizedCellType> types2=mesh->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(3,(int)types2.size());
INTERP_KERNEL::NormalizedCellType expected2[3]={INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4};
CPPUNIT_ASSERT(nodeCor==0);
mesh1->checkGeoEquivalWith(mesh2,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
CPPUNIT_ASSERT(nodeCor==0);
mesh1->checkGeoEquivalWith(mesh2,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
- CPPUNIT_ASSERT_EQUAL(10,cellCor->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,cellCor->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(10,(int)cellCor->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)cellCor->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(renum,renum+10,cellCor->getConstPointer()));
CPPUNIT_ASSERT(nodeCor==0);
cellCor->decrRef();
CPPUNIT_ASSERT(std::equal(renum,renum+10,cellCor->getConstPointer()));
CPPUNIT_ASSERT(nodeCor==0);
cellCor->decrRef();
CPPUNIT_ASSERT(nodeCor==0);
mesh1->checkGeoEquivalWith(mesh2,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
CPPUNIT_ASSERT(nodeCor==0);
mesh1->checkGeoEquivalWith(mesh2,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
- CPPUNIT_ASSERT_EQUAL(10,cellCor->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,cellCor->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(10,(int)cellCor->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)cellCor->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(11,nodeCor->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,nodeCor->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(11,(int)nodeCor->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)nodeCor->getNumberOfComponents());
CPPUNIT_ASSERT(nodeCor==0);
mesh2->checkGeoEquivalWith(mesh1,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
CPPUNIT_ASSERT(nodeCor==0);
mesh2->checkGeoEquivalWith(mesh1,10,1e-12,cellCor,nodeCor);//deepEqual with geo permutations
CPPUNIT_ASSERT(cellCor);
- CPPUNIT_ASSERT_EQUAL(10,cellCor->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,cellCor->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(10,(int)cellCor->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)cellCor->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(11,nodeCor->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,nodeCor->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(11,(int)nodeCor->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)nodeCor->getNumberOfComponents());
a1->fillWithZero();
a1->setInfoOnComponent(0,"c");
a1->setInfoOnComponent(1,"d");
a1->fillWithZero();
a1->setInfoOnComponent(0,"c");
a1->setInfoOnComponent(1,"d");
a2->setInfoOnComponent(0,"e");
a2->setInfoOnComponent(1,"f");
f->setArray(a1);
a2->setInfoOnComponent(0,"e");
a2->setInfoOnComponent(1,"f");
f->setArray(a1);
m->getCoords()->setInfoOnComponent(1,"i");
m->getCoords()->setInfoOnComponent(2,"j");
//
m->getCoords()->setInfoOnComponent(1,"i");
m->getCoords()->setInfoOnComponent(2,"j");
//
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f2->isEqual(f,1e-12,1e-12));
f2->setName("smth");
MEDCouplingFieldDouble *f2=f->clone(true);
CPPUNIT_ASSERT(f2->isEqual(f,1e-12,1e-12));
f2->setName("smth");
//
const double expected1[5]={0.25,0.125,0.125,0.25,0.25};
MEDCouplingFieldDouble *f1=m1->getMeasureField(false);
MEDCouplingFieldDouble *f2=m2->getMeasureField(false);
//
const double expected1[5]={0.25,0.125,0.125,0.25,0.25};
MEDCouplingFieldDouble *f1=m1->getMeasureField(false);
MEDCouplingFieldDouble *f2=m2->getMeasureField(false);
- CPPUNIT_ASSERT_EQUAL(5,f1->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f2->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getArray()->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[0],f2->getIJ(0,0),1e-12);
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[0],f2->getIJ(0,0),1e-12);
m2->tryToShareSameCoordsPermute(*m1,1e-12);
f1=m1->getMeasureField(false);
f2=m2->getMeasureField(false);
m2->tryToShareSameCoordsPermute(*m1,1e-12);
f1=m1->getMeasureField(false);
f2=m2->getMeasureField(false);
- CPPUNIT_ASSERT_EQUAL(5,f1->getArray()->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f2->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getArray()->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[0],f2->getIJ(0,0),1e-12);
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[0],f2->getIJ(0,0),1e-12);
//
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.,f->getMaxValue(),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,f->getMinValue(),1e-14);
//
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.,f->getMaxValue(),1e-14);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,f->getMinValue(),1e-14);
- CPPUNIT_ASSERT_EQUAL(10,f1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(20,f1->getNumberOfValues());
+ CPPUNIT_ASSERT_EQUAL(10,(int)f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(20,(int)f1->getNumberOfValues());
//
const int renum[]={0,2,3,1,4,5,6,8,7,9};
mesh2->renumberCells(renum,false);
//
const int renum[]={0,2,3,1,4,5,6,8,7,9};
mesh2->renumberCells(renum,false);
CPPUNIT_ASSERT_EQUAL((std::size_t)5,da->getNbOfElems());
const int expected1[5]={2,3,5,7,9};
CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer()));
da->decrRef();
CPPUNIT_ASSERT_EQUAL((std::size_t)5,da->getNbOfElems());
const int expected1[5]={2,3,5,7,9};
CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer()));
da->decrRef();
CPPUNIT_ASSERT_EQUAL((std::size_t)4,da->getNbOfElems());
const int expected2[4]={1,4,6,8};
CPPUNIT_ASSERT(std::equal(expected2,expected2+4,da->getConstPointer()));
CPPUNIT_ASSERT_EQUAL((std::size_t)4,da->getNbOfElems());
const int expected2[4]={1,4,6,8};
CPPUNIT_ASSERT(std::equal(expected2,expected2+4,da->getConstPointer()));
const int part1[3]={2,1,4};
MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3);
f2->zipCoords();
const int part1[3]={2,1,4};
MEDCouplingFieldDouble *f2=f1->buildSubPart(part1,part1+3);
f2->zipCoords();
- CPPUNIT_ASSERT_EQUAL(3,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(3,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents());
const double expected1[6]={5.,105.,4.,104.,7.,107.};
for(int i=0;i<6;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected1[i],1e-12);
const double expected1[6]={5.,105.,4.,104.,7.,107.};
for(int i=0;i<6;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected1[i],1e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
MEDCouplingUMesh *m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
MEDCouplingUMesh *m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
const double expected2[12]={0.2, -0.3, 0.7, -0.3, 0.2, 0.2, 0.7, 0.2, 0.2, 0.7, 0.7, 0.7};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
array->decrRef();
const int part2[2]={1,2};
f2=f1->buildSubPart(part2,part2+2);
array->decrRef();
const int part2[2]={1,2};
f2=f1->buildSubPart(part2,part2+2);
- CPPUNIT_ASSERT_EQUAL(4,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents());
const double expected5[8]={4.,104.,5.,105.,7.,107.,8.,108.};
for(int i=0;i<8;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12);
const double expected5[8]={4.,104.,5.,105.,7.,107.,8.,108.};
for(int i=0;i<8;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
std::copy(part3,part3+2,arrr->getPointer());
f2=f1->buildSubPart(arrr);
arrr->decrRef();
std::copy(part3,part3+2,arrr->getPointer());
f2=f1->buildSubPart(arrr);
arrr->decrRef();
- CPPUNIT_ASSERT_EQUAL(4,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents());
for(int i=0;i<8;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getNumberOfCells());
for(int i=0;i<8;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected5[i],1e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
for(int i=0;i<8;i++)//8 is not an error
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
//
const int part4[3]={1,2,4};
f2=f1->buildSubPart(part4,part4+3);
//
const int part4[3]={1,2,4};
f2=f1->buildSubPart(part4,part4+3);
- CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(6,(int)f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f2->getNumberOfComponents());
const double expected6[12]={4.,104.,5.,105.,7.,107.,8.,108.,10.,110.,11.,111.};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected6[i],1e-12);
const double expected6[12]={4.,104.,5.,105.,7.,107.,8.,108.,10.,110.,11.,111.};
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(f2->getIJ(0,i),expected6[i],1e-12);
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(2,f2->getMesh()->getMeshDimension());
m2C=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f2->getMesh()));
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
for(int i=0;i<12;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],m2C->getCoords()->getIJ(0,i),1.e-12);
CPPUNIT_ASSERT(std::equal(expected3,expected3+4,m2C->getNodalConnectivity()->getConstPointer()+4));
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(3906.56,f2->getIJ(i,0),1e-9);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(3906.56,f2->getIJ(i,0),1e-9);
f2->decrRef();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfValues());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfValues());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(-2.42,f2->getIJ(i,0),1e-13);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(-2.42,f2->getIJ(i,0),1e-13);
f2->decrRef();
- CPPUNIT_ASSERT_EQUAL(1,f2->getArray()->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getArray()->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f2->getNumberOfTuples());
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(137.335,f2->getIJ(i,0),1e-10);
f2->decrRef();
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(137.335,f2->getIJ(i,0),1e-10);
f2->decrRef();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f2->getNumberOfTuples());
int it,order;
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.3,f2->getTime(it,order),1e-12);
CPPUNIT_ASSERT_EQUAL(5,it); CPPUNIT_ASSERT_EQUAL(6,order);
int it,order;
CPPUNIT_ASSERT_DOUBLES_EQUAL(2.3,f2->getTime(it,order),1e-12);
CPPUNIT_ASSERT_EQUAL(5,it); CPPUNIT_ASSERT_EQUAL(6,order);
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.8,f2->getTime(it,order),1e-12);
CPPUNIT_ASSERT_EQUAL(10,it); CPPUNIT_ASSERT_EQUAL(2,order);
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.8,f2->getTime(it,order),1e-12);
CPPUNIT_ASSERT_EQUAL(10,it); CPPUNIT_ASSERT_EQUAL(2,order);
for(int i=0;i<5;i++)
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(3,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(3,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(9,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
const double expected1[9]={
0.5424262364180696, 0.5351201064614425, 0.6476266283176001,//eigenvect 0
0.7381111277307373, 0.06458838384003074, -0.6715804522117897,//eigenvect 1
const double expected1[9]={
0.5424262364180696, 0.5351201064614425, 0.6476266283176001,//eigenvect 0
0.7381111277307373, 0.06458838384003074, -0.6715804522117897,//eigenvect 1
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(9,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(9,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
const double expected1[9]={-2.6538108356290113, 2.855831037649208, -1.1111111111111067, 3.461891643709813, -4.775022956841121, 2.2222222222222143, -1.1111111111111054, 2.222222222222214, -1.1111111111111072};
for(int i=0;i<5;i++)
{
const double expected1[9]={-2.6538108356290113, 2.855831037649208, -1.1111111111111067, 3.461891643709813, -4.775022956841121, 2.2222222222222143, -1.1111111111111054, 2.222222222222214, -1.1111111111111072};
for(int i=0;i<5;i++)
{
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(6,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
const double expected3[6]={-0.3617705098531818, -0.8678630828458127, -0.026843764174972983, 0.5539957431465833, 0.13133439560823013, -0.05301294502145887};
for(int i=0;i<5;i++)
{
const double expected3[6]={-0.3617705098531818, -0.8678630828458127, -0.026843764174972983, 0.5539957431465833, 0.13133439560823013, -0.05301294502145887};
for(int i=0;i<5;i++)
{
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(4,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(4,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
const double expected2[4]={-1.8595041322314059, 0.9504132231404963, 1.404958677685951, -0.49586776859504156};
for(int i=0;i<5;i++)
{
const double expected2[4]={-1.8595041322314059, 0.9504132231404963, 1.404958677685951, -0.49586776859504156};
for(int i=0;i<5;i++)
{
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(15.9,f2->getIJ(i,0),1e-13);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(15.9,f2->getIJ(i,0),1e-13);
f2->decrRef();
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(25.8,f2->getIJ(i,0),1e-13);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(25.8,f2->getIJ(i,0),1e-13);
f2->decrRef();
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.7,f2->getIJ(i,0),1e-13);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.7,f2->getIJ(i,0),1e-13);
f2->decrRef();
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(6,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(6,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
const double expected1[6]={-1.1,0.,1.1,4.5,5.6,6.7};
for(int i=0;i<5;i++)
{
const double expected1[6]={-1.1,0.,1.1,4.5,5.6,6.7};
for(int i=0;i<5;i++)
{
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.3606219864313918,f2->getIJ(i,0),1e-13);
f2->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(8.3606219864313918,f2->getIJ(i,0),1e-13);
f2->decrRef();
- f2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f2->getNumberOfTuples());
+ f2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f2->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.6,f2->getIJ(i,0),1e-13);
f2->decrRef();
//
DataArrayInt *d2I=0;
DataArrayDouble *d2=array->maxPerTupleWithCompoId(d2I);
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(5.6,f2->getIJ(i,0),1e-13);
f2->decrRef();
//
DataArrayInt *d2I=0;
DataArrayDouble *d2=array->maxPerTupleWithCompoId(d2I);
- CPPUNIT_ASSERT_EQUAL(1,d2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,d2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)d2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)d2->getNumberOfTuples());
const int expected2[5]={4,3,2,0,1};
for(int i=0;i<5;i++)
{
const int expected2[5]={4,3,2,0,1};
for(int i=0;i<5;i++)
{
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(3,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(3,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
const double expected1[15]={1.2,2.3,3.4, 1.2,3.4,4.5, 3.4,4.5,5.6, 5.6,1.2,2.3, 4.5,5.6,1.2};
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(0,i),1e-13);
f1->changeNbOfComponents(4,7.77);
const double expected1[15]={1.2,2.3,3.4, 1.2,3.4,4.5, 3.4,4.5,5.6, 5.6,1.2,2.3, 4.5,5.6,1.2};
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(0,i),1e-13);
f1->changeNbOfComponents(4,7.77);
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(4,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(4,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
const double expected2[20]={1.2,2.3,3.4,7.77, 1.2,3.4,4.5,7.77, 3.4,4.5,5.6,7.77, 5.6,1.2,2.3,7.77, 4.5,5.6,1.2,7.77};
for(int i=0;i<20;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f1->getIJ(0,i),1e-13);
const double expected2[20]={1.2,2.3,3.4,7.77, 1.2,3.4,4.5,7.77, 3.4,4.5,5.6,7.77, 5.6,1.2,2.3,7.77, 4.5,5.6,1.2,7.77};
for(int i=0;i<20;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f1->getIJ(0,i),1e-13);
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
for(int i=0;i<5;i++)
{
CPPUNIT_ASSERT_DOUBLES_EQUAL(arr1[0],f1->getIJ(i,0),1e-13);
for(int i=0;i<5;i++)
{
CPPUNIT_ASSERT_DOUBLES_EQUAL(arr1[0],f1->getIJ(i,0),1e-13);
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
for(int i=0;i<5;i++)
{
CPPUNIT_ASSERT_DOUBLES_EQUAL(arr1[4],f1->getIJ(i,0),1e-13);
for(int i=0;i<5;i++)
{
CPPUNIT_ASSERT_DOUBLES_EQUAL(arr1[4],f1->getIJ(i,0),1e-13);
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14);
CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b);
CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us"));
CPPUNIT_ASSERT_DOUBLES_EQUAL(3.4,f1->getTime(a,b),1.e-14);
CPPUNIT_ASSERT_EQUAL(5,a); CPPUNIT_ASSERT_EQUAL(6,b);
CPPUNIT_ASSERT_EQUAL(std::string(f1->getTimeUnit()),std::string("us"));
- CPPUNIT_ASSERT_EQUAL(m1->getNumberOfCells(),f1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(m1->getNumberOfCells(),(int)f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
const double expected1[5]={1.,1.4142135623730951, 1.4142135623730951,1.,1.};
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-14);
const double expected1[5]={1.,1.4142135623730951, 1.4142135623730951,1.,1.};
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],f1->getIJ(i,0),1e-14);
- CPPUNIT_ASSERT_EQUAL(m1->getNumberOfCells(),f1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(m1->getNumberOfCells(),(int)f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
const double expected2[5]={1.4142135623730951, 1.7320508075688772, 1.7320508075688772, 1.4142135623730951, 1.4142135623730951};
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f1->getIJ(i,0),1e-14);
const double expected2[5]={1.4142135623730951, 1.7320508075688772, 1.7320508075688772, 1.4142135623730951, 1.4142135623730951};
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected2[i],f1->getIJ(i,0),1e-14);
CPPUNIT_ASSERT(std::string(f1->getName())=="myField");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
CPPUNIT_ASSERT(std::string(f1->getName())=="myField");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
double values1[5]={-0.1,0.23333333333333336,0.56666666666666665,0.4,0.9};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+5,values1,values1,std::minus<double>());
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==CONST_ON_TIME_INTERVAL);
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==CONST_ON_TIME_INTERVAL);
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples());
double values2[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
double values2[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==LINEAR_TIME);
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==LINEAR_TIME);
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples());
tmp=f1->getArray()->getConstPointer();
double values2Bis[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
double values2BisBis[9];
tmp=f1->getArray()->getConstPointer();
double values2Bis[9]={-0.9,0.1,1.1,-0.4,0.6,1.6,0.1,1.1,2.1};
double values2BisBis[9];
f1=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
f1->setMesh(m);
f1->fillFromAnalytic(2,"(x+y)*IVec+2*(x+y)*JVec");
f1=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
f1->setMesh(m);
f1->fillFromAnalytic(2,"(x+y)*IVec+2*(x+y)*JVec");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==NO_TIME);
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==NO_TIME);
- CPPUNIT_ASSERT_EQUAL(2,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples());
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
double values3[18]={-0.6,-1.2,-0.1,-0.2,0.4,0.8,-0.1,-0.2,0.4,0.8,0.9,1.8,0.4,0.8,0.9,1.8,1.4,2.8};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+18,values3,values3,std::minus<double>());
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.07,f1->getIJ(i,0),1e-16);
(*f1)=0.09;
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.07,f1->getIJ(i,0),1e-16);
(*f1)=0.09;
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(5,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)f1->getNumberOfTuples());
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.09,f1->getIJ(i,0),1e-16);
f1->decrRef();
for(int i=0;i<5;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.09,f1->getIJ(i,0),1e-16);
f1->decrRef();
- f1->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(1,f1->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f1->getNumberOfTuples());
+ f1->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f1->getNumberOfTuples());
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.08,f1->getIJ(i,0),1e-16);
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.08,f1->getIJ(i,0),1e-16);
- CPPUNIT_ASSERT_EQUAL(1,f1->getEndArray()->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f1->getEndArray()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f1->getEndArray()->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f1->getEndArray()->getNumberOfTuples());
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.08,f1->getEndArray()->getIJ(i,0),1e-16);
f1->decrRef();
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.08,f1->getEndArray()->getIJ(i,0),1e-16);
f1->decrRef();
std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus<int>(),6));
mesh->insertNextCell(INTERP_KERNEL::NORM_PYRA5,5,tmpConn);
mesh->finishInsertingCells();
std::transform(tmpConn,tmpConn+8,tmpConn,std::bind2nd(std::plus<int>(),6));
mesh->insertNextCell(INTERP_KERNEL::NORM_PYRA5,5,tmpConn);
mesh->finishInsertingCells();
bool isMerged;
int newNebOfNodes;
DataArrayInt *da=mesh->mergeNodes(1e-7,isMerged,newNebOfNodes);
da->decrRef();
CPPUNIT_ASSERT_EQUAL(12,newNebOfNodes);
MEDCouplingFieldDouble *vols=mesh->getMeasureField(true);
bool isMerged;
int newNebOfNodes;
DataArrayInt *da=mesh->mergeNodes(1e-7,isMerged,newNebOfNodes);
da->decrRef();
CPPUNIT_ASSERT_EQUAL(12,newNebOfNodes);
MEDCouplingFieldDouble *vols=mesh->getMeasureField(true);
- CPPUNIT_ASSERT_EQUAL(3,vols->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,vols->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(3,(int)vols->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)vols->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(volHexa8,vols->getIJ(0,0),1e-6);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPenta6,vols->getIJ(1,0),1e-7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPyra5,vols->getIJ(2,0),1e-7);
vols->decrRef();
CPPUNIT_ASSERT_DOUBLES_EQUAL(volHexa8,vols->getIJ(0,0),1e-6);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPenta6,vols->getIJ(1,0),1e-7);
CPPUNIT_ASSERT_DOUBLES_EQUAL(volPyra5,vols->getIJ(2,0),1e-7);
vols->decrRef();
- DataArrayDouble *bary=mesh->getBarycenterAndOwner();
- CPPUNIT_ASSERT_EQUAL(3,bary->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,bary->getNumberOfComponents());
+ DataArrayDouble *bary=mesh->computeCellCenterOfMass();
+ CPPUNIT_ASSERT_EQUAL(3,(int)bary->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)bary->getNumberOfComponents());
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[0],bary->getIJ(0,0),1e-11);
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[1],bary->getIJ(0,1),1e-11);
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[2],bary->getIJ(0,2),1e-11);
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[0],bary->getIJ(0,0),1e-11);
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[1],bary->getIJ(0,1),1e-11);
CPPUNIT_ASSERT_DOUBLES_EQUAL(baryHexa8[2],bary->getIJ(0,2),1e-11);