-// Copyright (C) 2007-2015 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
#include "MEDCouplingBasicsTest1.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingCMesh.hxx"
-#include "MEDCouplingExtrudedMesh.hxx"
+#include "MEDCouplingMappedExtrudedMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingMemArray.hxx"
#include <algorithm>
#include <functional>
-using namespace ParaMEDMEM;
+#ifdef WIN32
+#include "MEDCouplingMemArray.txx"
+#endif
+
+using namespace MEDCoupling;
void MEDCouplingBasicsTest1::testArray()
{
arr->setInfoOnComponent(1,"hhhh");
arr->setInfoOnComponent(2,"jj");
arr->setInfoOnComponent(3,"kkkkkk");
- DataArrayInt *arr2=arr->convertToIntArr();
- DataArrayDouble *arr3=arr2->convertToDblArr();
- arr2->decrRef();
+ MCAuto<DataArrayInt> arr2(arr->convertToIntArr());
+ MCAuto<DataArrayDouble> arr3(arr2->convertToDblArr());
CPPUNIT_ASSERT(arr->isEqual(*arr3,1e-14));
- arr3->decrRef();
arr->decrRef();
}
int *tmp=arr1->getPointer();
const int arr1Ref[14]={0,10,1,11,2,12,3,13,4,14,5,15,6,16};
std::copy(arr1Ref,arr1Ref+14,tmp);
- CPPUNIT_ASSERT_EQUAL(7,arr1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(7,(int)arr1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr1->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref,arr1Ref+14,arr1->getConstPointer()));
- DataArrayInt *arr2=arr1->substr(3);
- CPPUNIT_ASSERT_EQUAL(4,arr2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr2->getNumberOfComponents());
+ DataArrayInt *arr2=arr1->subArray(3);
+ CPPUNIT_ASSERT_EQUAL(4,(int)arr2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr2->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref+6,arr1Ref+14,arr2->getConstPointer()));
arr2->decrRef();
- DataArrayInt *arr3=arr1->substr(2,5);
- CPPUNIT_ASSERT_EQUAL(3,arr3->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr3->getNumberOfComponents());
+ DataArrayInt *arr3=arr1->subArray(2,5);
+ CPPUNIT_ASSERT_EQUAL(3,(int)arr3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr3->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr1Ref+4,arr1Ref+10,arr3->getConstPointer()));
arr1->decrRef();
arr3->decrRef();
double *tmp2=arr4->getPointer();
const double arr4Ref[14]={0.8,10.8,1.9,11.9,2.1,12.1,3.2,13.2,4.3,14.3,5.4,15.4,6.5,16.5};
std::copy(arr4Ref,arr4Ref+14,tmp2);
- CPPUNIT_ASSERT_EQUAL(7,arr4->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr4->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(7,(int)arr4->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr4->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref,arr4Ref+14,arr4->getConstPointer()));
- DataArrayDouble *arr5=arr4->substr(3);
- CPPUNIT_ASSERT_EQUAL(4,arr5->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr5->getNumberOfComponents());
+ DataArrayDouble *arr5=arr4->subArray(3);
+ CPPUNIT_ASSERT_EQUAL(4,(int)arr5->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr5->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref+6,arr4Ref+14,arr5->getConstPointer()));
arr5->decrRef();
- DataArrayDouble *arr6=arr4->substr(2,5);
- CPPUNIT_ASSERT_EQUAL(3,arr6->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(2,arr6->getNumberOfComponents());
+ DataArrayDouble *arr6=arr4->subArray(2,5);
+ CPPUNIT_ASSERT_EQUAL(3,(int)arr6->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr6->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(arr4Ref+4,arr4Ref+10,arr6->getConstPointer()));
arr4->decrRef();
arr6->decrRef();
mesh->insertNextCell(INTERP_KERNEL::NORM_QUAD4,4,curConn);
mesh->finishInsertingCells();
CPPUNIT_ASSERT_EQUAL((std::size_t)30,mesh->getNodalConnectivity()->getNbOfElems());
- CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells());
//test 0 - no copy no ownership
DataArrayDouble *myCoords=DataArrayDouble::New();
myCoords->useArray(coords,false,CPP_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
mesh->setCoords(myCoords);
myCoords->decrRef();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells());
- mesh->checkCoherency();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells());
+ mesh->checkConsistencyLight();
//test 1 - no copy ownership C++
myCoords=DataArrayDouble::New();
double *tmp=new double[3*nbOfNodes];
myCoords->useArray(tmp,true,CPP_DEALLOC,nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh->getNumberOfCells());
- mesh->checkCoherency();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh->getNumberOfCells());
+ mesh->checkConsistencyLight();
//test 2 - no copy ownership C
myCoords=DataArrayDouble::New();
tmp=(double *)malloc(3*nbOfNodes*sizeof(double));
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//test 3 - copy.
myCoords=DataArrayDouble::New();
myCoords->alloc(nbOfNodes,3);
mesh->setCoords(myCoords);
myCoords->decrRef();
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh->getNumberOfNodes());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,mesh->getSpaceDimension());
// test clone not recursively
MEDCouplingUMesh *mesh2=mesh->clone(false);
CPPUNIT_ASSERT(mesh2!=mesh);
- mesh2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh2->getNumberOfCells());
+ mesh2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh2->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,mesh2->getSpaceDimension());
CPPUNIT_ASSERT(mesh!=mesh2);
// test clone not recursively
MEDCouplingUMesh *mesh3=mesh->clone(true);
CPPUNIT_ASSERT(mesh3!=mesh);
- mesh3->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,mesh3->getNumberOfCells());
+ mesh3->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)mesh3->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(nbOfNodes,mesh3->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(3,mesh3->getSpaceDimension());
CPPUNIT_ASSERT(mesh!=mesh3);
std::fill(tmp,tmp+9*nbOfCells,7.);
//content of field changed -> declare it.
fieldOnCells->declareAsNew();
- fieldOnCells->checkCoherency();
+ fieldOnCells->checkConsistencyLight();
// testing clone of fields - no recursive
MEDCouplingFieldDouble *fieldOnCells2=fieldOnCells->clone(false);
CPPUNIT_ASSERT(fieldOnCells2!=fieldOnCells);
- fieldOnCells2->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells2->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(9,fieldOnCells2->getNumberOfComponents());
+ fieldOnCells2->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)fieldOnCells2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(9,(int)fieldOnCells2->getNumberOfComponents());
CPPUNIT_ASSERT(fieldOnCells2->getArray()==fieldOnCells->getArray());
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells2->getArray()->getIJ(3,7),1e-14);
CPPUNIT_ASSERT(fieldOnCells2->getMesh()==fieldOnCells->getMesh());
// testing clone of fields - recursive
MEDCouplingFieldDouble *fieldOnCells3=fieldOnCells->clone(true);
CPPUNIT_ASSERT(fieldOnCells3!=fieldOnCells);
- fieldOnCells3->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(nbOfCells,fieldOnCells3->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(9,fieldOnCells3->getNumberOfComponents());
+ fieldOnCells3->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(nbOfCells,(int)fieldOnCells3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(9,(int)fieldOnCells3->getNumberOfComponents());
CPPUNIT_ASSERT(fieldOnCells3->getArray()!=fieldOnCells->getArray());
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,fieldOnCells3->getArray()->getIJ(3,7),1e-14);
CPPUNIT_ASSERT(fieldOnCells3->getMesh()==fieldOnCells->getMesh());
targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+6);
targetMesh->insertNextCell(INTERP_KERNEL::NORM_POINT1,1,targetConn+7);
targetMesh->finishInsertingCells();
- CPPUNIT_ASSERT_THROW(targetMesh->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(targetMesh->checkConsistencyLight(),INTERP_KERNEL::Exception);
DataArrayDouble *myCoords=DataArrayDouble::New();
myCoords->alloc(9,3);
std::copy(targetCoords,targetCoords+27,myCoords->getPointer());
targetMesh->setCoords(myCoords);
myCoords->decrRef();
//
- targetMesh->checkCoherency();
+ targetMesh->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(3,targetMesh->getSpaceDimension());
- CPPUNIT_ASSERT_EQUAL(8,targetMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(8,(int)targetMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(9,targetMesh->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(0,targetMesh->getMeshDimension());
//
CPPUNIT_ASSERT_THROW(meshM1D->getNumberOfCells(),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(meshM1D->setMeshDimension(-2),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(meshM1D->setMeshDimension(-10),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(meshM1D->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(meshM1D->checkConsistencyLight(),INTERP_KERNEL::Exception);
meshM1D->setMeshDimension(-1);
- meshM1D->checkCoherency();
+ meshM1D->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(-1,meshM1D->getMeshDimension());
- CPPUNIT_ASSERT_EQUAL(1,meshM1D->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(1,(int)meshM1D->getNumberOfCells());
CPPUNIT_ASSERT_THROW(meshM1D->getNumberOfNodes(),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT_THROW(meshM1D->getSpaceDimension(),INTERP_KERNEL::Exception);
MEDCouplingUMesh *cpy=meshM1D->clone(true);
double *tmp=array->getPointer();
array->decrRef();
std::fill(tmp,tmp+6,7.);
- fieldOnCells->checkCoherency();
+ fieldOnCells->checkConsistencyLight();
//
fieldOnCells->decrRef();
meshM1D->decrRef();
std::fill(array->getPointer(),array->getPointer()+5*3,7.);
CPPUNIT_ASSERT_DOUBLES_EQUAL(7.,array->getIJ(3,2),1e-14);
double *tmp1=array->getPointer();
- DataArrayDouble *array2=array->deepCpy();
+ DataArrayDouble *array2=array->deepCopy();
double *tmp2=array2->getPointer();
CPPUNIT_ASSERT(tmp1!=tmp2);
array->decrRef();
std::fill(array3->getPointer(),array3->getPointer()+5*3,17);
CPPUNIT_ASSERT_EQUAL(17,array3->getIJ(3,2));
int *tmp3=array3->getPointer();
- DataArrayInt *array4=array3->deepCpy();
+ DataArrayInt *array4=array3->deepCopy();
int *tmp4=array4->getPointer();
CPPUNIT_ASSERT(tmp3!=tmp4);
array3->decrRef();
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(23,mesh->getNodalConnectivity()->getNumberOfTuples());
+ mesh->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(23,(int)mesh->getNodalConnectivity()->getNumberOfTuples());
const int *pt=mesh->getNodalConnectivity()->getConstPointer();
const int expected1[23]={4, 0, 3, 4, 1, 5, 1, 4, 2, 3, 4, 5, 2, 5, 6, 7, 4, 3, 4, 7, 8, 5, 4};
CPPUNIT_ASSERT(std::equal(expected1,expected1+23,pt));
////// 3D
mesh=build3DTargetMesh_1();
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
+ mesh->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(8,(int)mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(114,(int)mesh->getNodalConnectivity()->getNumberOfTuples());
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
- CPPUNIT_ASSERT_EQUAL(8,mesh->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(114,mesh->getNodalConnectivity()->getNumberOfTuples());
+ mesh->checkConsistencyLight();
+ CPPUNIT_ASSERT_EQUAL(8,(int)mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(114,(int)mesh->getNodalConnectivity()->getNumberOfTuples());
//
mesh->decrRef();
}
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension());
- CPPUNIT_ASSERT_EQUAL(13,mesh2->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,revDescIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,descIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,desc->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,revDesc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(13,(int)mesh2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples());
const int expected1[18]={0,1,2,3, 2,4,5, 6,7,4, 8,9,1,10, 11,12,6,9};
CPPUNIT_ASSERT(std::equal(expected1,expected1+18,desc->getConstPointer()));
const int expected2[6]={0,4,7,10,14,18};
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
//
desc=DataArrayInt::New();
descIndx=DataArrayInt::New();
revDescIndx=DataArrayInt::New();
//
mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(1,mesh2->getMeshDimension());
- CPPUNIT_ASSERT_EQUAL(13,mesh2->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,revDescIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,descIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,desc->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,revDesc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(13,(int)mesh2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)14,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(14,(int)revDescIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)6,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(6,(int)descIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)18,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)desc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)18,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(18,(int)revDesc->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(expected1,expected1+18,desc->getConstPointer()));
CPPUNIT_ASSERT(std::equal(expected2,expected2+6,descIndx->getConstPointer()));
CPPUNIT_ASSERT(std::equal(expected3,expected3+14,revDescIndx->getConstPointer()));
DataArrayInt *revDescIndx=DataArrayInt::New();
//
MEDCouplingUMesh *mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension());
- CPPUNIT_ASSERT_EQUAL(36,mesh2->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,revDescIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,descIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,desc->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,revDesc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(36,(int)mesh2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples());
const int expected1[9]={0, 6, 12, 18, 24, 30, 36, 42, 48};
const int expected2[48]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 11, 12, 4, 13, 14, 15, 16, 17, 10, 18, 19, 13, 1, 20, 21, 22, 23, 24, 7, 25, 26, 27, 28, 22, 12, 29, 23, 30, 31, 32, 17, 33, 28, 34, 35, 30};
const int expected3[37]={0, 1, 3, 4, 6, 8, 9, 10, 12, 13, 14, 16, 17, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 48};
const int elts[2]={1,3};
std::vector<int> eltsV(elts,elts+2);
mesh->convertToPolyTypes(&eltsV[0],&eltsV[0]+eltsV.size());
- mesh->checkCoherency();
+ mesh->checkConsistencyLight();
desc=DataArrayInt::New();
descIndx=DataArrayInt::New();
revDesc=DataArrayInt::New();
revDescIndx=DataArrayInt::New();
mesh2=mesh->buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
- mesh2->checkCoherency();
+ mesh2->checkConsistencyLight();
CPPUNIT_ASSERT_EQUAL(2,mesh2->getMeshDimension());
- CPPUNIT_ASSERT_EQUAL(36,mesh2->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,revDescIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,descIndx->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,desc->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,revDesc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(36,(int)mesh2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)37,revDescIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(37,(int)revDescIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)9,descIndx->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(9,(int)descIndx->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)48,desc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)desc->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL((std::size_t)48,revDesc->getNbOfElems()); CPPUNIT_ASSERT_EQUAL(48,(int)revDesc->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(expected1,expected1+9,descIndx->getConstPointer()));
CPPUNIT_ASSERT(std::equal(expected2,expected2+48,desc->getConstPointer()));
CPPUNIT_ASSERT(std::equal(expected3,expected3+37,revDescIndx->getConstPointer()));
{
MEDCouplingUMesh *mesh=build3DTargetMesh_1();
DataArrayInt *boundaryNodes=mesh->findBoundaryNodes();
- CPPUNIT_ASSERT_EQUAL(26,boundaryNodes->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,boundaryNodes->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(26,(int)boundaryNodes->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)boundaryNodes->getNumberOfComponents());
const int expected1[26]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
CPPUNIT_ASSERT(std::equal(expected1,expected1+26,boundaryNodes->begin()));
boundaryNodes->decrRef();
{
MEDCouplingUMesh *mesh=build3DTargetMesh_1();
MEDCouplingPointSet *mesh2=mesh->buildBoundaryMesh(false);
- CPPUNIT_ASSERT_EQUAL(24,mesh2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(24,(int)mesh2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(26,mesh2->getNumberOfNodes());
mesh2->decrRef();
mesh->decrRef();
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
CPPUNIT_ASSERT(name=="Toto");
CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords());
- CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells());
const int subConn[10]={4,0,3,4,1,4,7,8,5,4};
const int subConnIndex[3]={0,5,10};
CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++(subMesh->getAllGeoTypes().begin())));
CPPUNIT_ASSERT(name=="Toto");
CPPUNIT_ASSERT(mesh->getCoords()==subMesh->getCoords());
- CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)subMesh->getNumberOfCells());
const int subConn2[14]={4,0,3,4,1,3,4,5,2,4,6,7,4,3};
const int subConnIndex2[4]={0,5,9,14};
CPPUNIT_ASSERT_EQUAL((std::size_t)14,subMesh->getNodalConnectivity()->getNbOfElems());
CPPUNIT_ASSERT(subMesh);
CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getAllGeoTypes().size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
- CPPUNIT_ASSERT_EQUAL(1,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(1,(int)subMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)5,subMesh->getNodalConnectivity()->getNbOfElems());
CPPUNIT_ASSERT_EQUAL((std::size_t)2,subMesh->getNodalConnectivityIndex()->getNbOfElems());
const int subConn[5]={4,7,8,5,4};
CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllGeoTypes().size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllGeoTypes().begin()));
- CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)subMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL((std::size_t)14,subMesh->getNodalConnectivity()->getNbOfElems());
CPPUNIT_ASSERT_EQUAL((std::size_t)4,subMesh->getNodalConnectivityIndex()->getNbOfElems());
const int subConn2[14]={3,4,5,2,4,6,7,4,3,4,7,8,5,4};
CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getAllGeoTypes().size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*subMesh->getAllGeoTypes().begin());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*(++subMesh->getAllGeoTypes().begin()));
- CPPUNIT_ASSERT_EQUAL(3,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)subMesh->getNumberOfCells());
subMeshSimple->decrRef();
//
mesh->decrRef();
CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells());
std::vector<int> oldConn(mesh->getNodalConnectivity()->getNbOfElems());
std::vector<int> oldConnIndex(mesh->getNumberOfCells()+1);
std::copy(mesh->getNodalConnectivity()->getPointer(),mesh->getNodalConnectivity()->getPointer()+oldConn.size(),oldConn.begin());
CPPUNIT_ASSERT_EQUAL(2,(int)mesh->getAllGeoTypes().size());
CPPUNIT_ASSERT_EQUAL(2,mesh->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(9,mesh->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(5,mesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(5,(int)mesh->getNumberOfCells());
CPPUNIT_ASSERT(mesh->getCoords()!=oldCoords);
CPPUNIT_ASSERT(std::equal(mesh->getCoords()->getPointer(),mesh->getCoords()->getPointer()+2*9,oldCoords->getPointer()));
CPPUNIT_ASSERT(std::equal(oldConn.begin(),oldConn.end(),mesh->getNodalConnectivity()->getPointer()));
CPPUNIT_ASSERT(std::equal(expectedTraducer,expectedTraducer+9,traducer->getPointer()));
traducer->decrRef();
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
- CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells());
const int subConn[10]={4,0,2,3,1,4,5,6,4,3};
const int subConnIndex[3]={0,5,10};
CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes());
subMesh=dynamic_cast<MEDCouplingUMesh *>(subMeshPtSet);
CPPUNIT_ASSERT(subMesh);
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_QUAD4,*subMesh->getAllGeoTypes().begin());
- CPPUNIT_ASSERT_EQUAL(2,subMesh->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(2,(int)subMesh->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(7,subMesh->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL((std::size_t)10,subMesh->getNodalConnectivity()->getNbOfElems());
CPPUNIT_ASSERT_EQUAL((std::size_t)3,subMesh->getNodalConnectivityIndex()->getNbOfElems());
//
bool areNodesMerged;
int newNbOfNodes;
- CPPUNIT_ASSERT_EQUAL(10,m6->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(10,(int)m6->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(22,m6->getNumberOfNodes());
DataArrayInt *arr=m6->mergeNodes(1e-13,areNodesMerged,newNbOfNodes);
arr->decrRef();
CPPUNIT_ASSERT(areNodesMerged);
- CPPUNIT_ASSERT_EQUAL(10,m6->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(10,(int)m6->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(9,m6->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(9,newNbOfNodes);
//
arr=m6->zipConnectivityTraducer(0);
- CPPUNIT_ASSERT_EQUAL(7,m6->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(7,(int)m6->getNumberOfCells());
arr->decrRef();
MEDCouplingUMesh *m7=m6->clone(true);
arr=m6->zipConnectivityTraducer(0);
CPPUNIT_ASSERT(m7->isEqual(m6,1e-12));
- CPPUNIT_ASSERT_EQUAL(7,m6->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(7,(int)m6->getNumberOfCells());
arr->decrRef();
//
m7->decrRef();
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
CPPUNIT_ASSERT(fieldOnCells2->isEqual(fieldOnCells1,1e-12,1e-15));
//
- DataArrayDouble *arr2=arr->deepCpy();
+ DataArrayDouble *arr2=arr->deepCopy();
fieldOnCells2->setArray(arr2);
arr2->decrRef();
CPPUNIT_ASSERT(fieldOnCells1->isEqual(fieldOnCells2,1e-12,1e-15));
void MEDCouplingBasicsTest1::testNatureChecking()
{
MEDCouplingFieldDouble *field=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
- field->setNature(Integral);
- field->setNature(ConservativeVolumic);
- field->setNature(IntegralGlobConstraint);
+ field->setNature(ExtensiveMaximum);
+ field->setNature(IntensiveMaximum);
+ field->setNature(ExtensiveConservation);
field->decrRef();
field=MEDCouplingFieldDouble::New(ON_NODES,NO_TIME);
- field->setNature(ConservativeVolumic);
- CPPUNIT_ASSERT_THROW(field->setNature(Integral),INTERP_KERNEL::Exception);
- CPPUNIT_ASSERT_THROW(field->setNature(IntegralGlobConstraint),INTERP_KERNEL::Exception);
+ field->setNature(IntensiveMaximum);
+ CPPUNIT_ASSERT_THROW(field->setNature(ExtensiveMaximum),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(field->setNature(ExtensiveConservation),INTERP_KERNEL::Exception);
field->decrRef();
}
const int elts[3]={1,2,4};
DataArrayInt *di;
MEDCouplingMesh *ret1=fieldCells->buildSubMeshData(elts,elts+3,di);
- CPPUNIT_ASSERT_EQUAL(3,ret1->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)ret1->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(9,ret1->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(3,di->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,di->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(3,(int)di->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)di->getNumberOfComponents());
const int *toCheck=di->getConstPointer();
CPPUNIT_ASSERT(std::equal(elts,elts+3,toCheck));
MEDCouplingUMesh *ret1DC=dynamic_cast<MEDCouplingUMesh *>(ret1);
MEDCouplingMesh *ret2=fieldNodes->buildSubMeshData(elts,elts+3,di);
MEDCouplingUMesh *ret2DC=dynamic_cast<MEDCouplingUMesh *>(ret2);
CPPUNIT_ASSERT(ret2DC);
- CPPUNIT_ASSERT_EQUAL(3,ret2->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)ret2->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(6,ret2->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(6,di->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,di->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(6,(int)di->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)di->getNumberOfComponents());
toCheck=di->getConstPointer();
const int expected[6]={1,2,4,5,7,8};
CPPUNIT_ASSERT(std::equal(expected,expected+6,toCheck));
{
MEDCouplingUMesh *mesh2D=0;
MEDCouplingUMesh *mesh3D=build3DExtrudedUMesh_1(mesh2D);
- MEDCouplingExtrudedMesh *ext=MEDCouplingExtrudedMesh::New(mesh3D,mesh2D,1);
- CPPUNIT_ASSERT_EQUAL(18,ext->getNumberOfCells());
+ MEDCouplingMappedExtrudedMesh *ext=MEDCouplingMappedExtrudedMesh::New(mesh3D,mesh2D,1);
+ CPPUNIT_ASSERT_EQUAL(18,(int)ext->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(60,ext->getNumberOfNodes());
DataArrayInt *ids3D=ext->getMesh3DIds();
const int ids3DExpected[18]={5,4,3,2,1,0, 11,10,9,8,7,6, 17,16,15,14,13,12};
- CPPUNIT_ASSERT_EQUAL(18,ids3D->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,ids3D->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(18,(int)ids3D->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)ids3D->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(ids3DExpected,ids3DExpected+18,ids3D->getConstPointer()));
MEDCouplingUMesh *mesh1D=ext->getMesh1D();
CPPUNIT_ASSERT_EQUAL(4,mesh1D->getNumberOfNodes());
- CPPUNIT_ASSERT_EQUAL(3,mesh1D->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)mesh1D->getNumberOfCells());
const double mesh1DExpected[12]={0.66666666666666663, 1.4583333333333333, 0, 0.66666666666666663, 1.4583333333333333, 1, 0.66666666666666663, 1.4583333333333333, 2, 0.66666666666666663, 1.4583333333333333, 3};
DataArrayDouble *mesh1DCoords=mesh1D->getCoords();
- CPPUNIT_ASSERT_EQUAL(4,mesh1DCoords->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,mesh1DCoords->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)mesh1DCoords->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)mesh1DCoords->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(mesh1DExpected,mesh1DExpected+12,mesh1DCoords->getConstPointer()));
DataArrayInt *conn1D=mesh1D->getNodalConnectivity();
- CPPUNIT_ASSERT_EQUAL(9,conn1D->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,conn1D->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)conn1D->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)conn1D->getNumberOfComponents());
const int conn1DExpected[9]={1,0,1,1,1,2,1,2,3};
CPPUNIT_ASSERT(std::equal(conn1DExpected,conn1DExpected+9,conn1D->getConstPointer()));
ext->decrRef();
mTT->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(43,(int)n.size());
MEDCouplingUMesh *mTT3dSurf=(MEDCouplingUMesh *)mTT->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meTT=MEDCouplingExtrudedMesh::New(mTT,mTT3dSurf,0);
- CPPUNIT_ASSERT_EQUAL(200,meTT->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(10,meTT->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(20,meTT->getMesh1D()->getNumberOfCells());
+ MEDCouplingMappedExtrudedMesh *meTT=MEDCouplingMappedExtrudedMesh::New(mTT,mTT3dSurf,0);
+ CPPUNIT_ASSERT_EQUAL(200,(int)meTT->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(10,(int)meTT->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(20,(int)meTT->getMesh1D()->getNumberOfCells());
mTT3dSurf->decrRef();
//
b=false;
mN->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(30,(int)n.size());
MEDCouplingUMesh *mN3dSurf=(MEDCouplingUMesh *)mN->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meN=MEDCouplingExtrudedMesh::New(mN,mN3dSurf,0);
- CPPUNIT_ASSERT_EQUAL(40,meN->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(20,meN->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(2,meN->getMesh1D()->getNumberOfCells());
+ MEDCouplingMappedExtrudedMesh *meN=MEDCouplingMappedExtrudedMesh::New(mN,mN3dSurf,0);
+ CPPUNIT_ASSERT_EQUAL(40,(int)meN->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(20,(int)meN->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(2,(int)meN->getMesh1D()->getNumberOfCells());
mN3dSurf->decrRef();
//
b=false;
mTF->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(27,(int)n.size());
MEDCouplingUMesh *mTF3dSurf=(MEDCouplingUMesh *)mTF->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *meTF=MEDCouplingExtrudedMesh::New(mTF,mTF3dSurf,0);
- CPPUNIT_ASSERT_EQUAL(340,meTF->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(17,meTF->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(20,meTF->getMesh1D()->getNumberOfCells());
+ MEDCouplingMappedExtrudedMesh *meTF=MEDCouplingMappedExtrudedMesh::New(mTF,mTF3dSurf,0);
+ CPPUNIT_ASSERT_EQUAL(340,(int)meTF->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(17,(int)meTF->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(20,(int)meTF->getMesh1D()->getNumberOfCells());
mTF3dSurf->decrRef();
//
meTT->decrRef();
m2->rotate(center,vector,-M_PI/2.);
MEDCouplingUMesh *m3=m1->buildExtrudedMesh(m2,0);
//
- MEDCouplingExtrudedMesh *m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
- CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
+ MEDCouplingMappedExtrudedMesh *m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
+ CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(5,(int)m4->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)m4->getMesh1D()->getNumberOfCells());
const int *m3DIds=m4->getMesh3DIds()->getConstPointer();
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_EQUAL(i,m3DIds[i]);
//some random in cells to check that extrusion alg find it correctly
const int expected1[15]={1,3,2,0,6,5,7,10,11,8,12,9,14,13,4};
m3->renumberCells(expected1,false);
- m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
- CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
+ m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
+ CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(5,(int)m4->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)m4->getMesh1D()->getNumberOfCells());
m3DIds=m4->getMesh3DIds()->getConstPointer();
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_EQUAL(expected1[i],m3DIds[i]);
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_POLYHED,(int)m3->getTypeOfCell(3));
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_HEXA8,(int)m3->getTypeOfCell(4));
m3->renumberCells(expected1,false);
- m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
- CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(5,m4->getMesh2D()->getNumberOfCells());
- CPPUNIT_ASSERT_EQUAL(3,m4->getMesh1D()->getNumberOfCells());
+ m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
+ CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(5,(int)m4->getMesh2D()->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(3,(int)m4->getMesh1D()->getNumberOfCells());
m3DIds=m4->getMesh3DIds()->getConstPointer();
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_EQUAL(expected1[i],m3DIds[i]);
}
/*!
- * This test check MEDCouplingUMesh::buildExtrudedMesh method, but also, MEDCouplingExtrudedMesh following methods :
+ * This test check MEDCouplingUMesh::buildExtrudedMesh method, but also, MEDCouplingMappedExtrudedMesh following methods :
* getCellContainingPoint getMeasureField getNodeIdsOfCell getCoordinateOfNode getTypeOfCell build3DUnstructuredMesh.
*/
void MEDCouplingBasicsTest1::testExtrudedMesh4()
const int expected1[15]= {1,3,2,0,6,5,7,10,11,8,12,9,14,13,4};
const int rexpected1[15]={3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12};
m3->renumberCells(expected1,false);
- MEDCouplingExtrudedMesh *m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
+ MEDCouplingMappedExtrudedMesh *m4=MEDCouplingMappedExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,m4->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,m4->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYHED,m4->getTypeOfCell(2));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_PENTA6,m4->getTypeOfCell(7));
MEDCouplingFieldDouble *f=m4->getMeasureField(true);
DataArrayDouble *arr=f->getArray();
- CPPUNIT_ASSERT_EQUAL(15,arr->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,arr->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(15,(int)arr->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr->getNumberOfComponents());
const double *arrPtr=arr->getConstPointer();
const double expected2[15]={0.075,0.0375,0.0375,0.075,0.075, 0.1125,0.05625,0.05625,0.1125,0.1125, 0.0625,0.03125,0.03125,0.0625,0.0625};
for(int i=0;i<15;i++)
DataArrayInt *comm,*commI;
MEDCouplingUMesh *targetMesh=build3DTargetMesh_1();
targetMesh->findCommonNodes(1e-10,-1,comm,commI);
- CPPUNIT_ASSERT_EQUAL(1,commI->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(0,comm->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)commI->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(0,(int)comm->getNumberOfTuples());
int newNbOfNodes;
DataArrayInt *o2n=targetMesh->buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes);
CPPUNIT_ASSERT_EQUAL(27,newNbOfNodes);
- CPPUNIT_ASSERT_EQUAL(27,o2n->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(27,(int)o2n->getNumberOfTuples());
const int o2nExp1[27]=
{
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
targetMesh=build3DTargetMeshMergeNode_1();
CPPUNIT_ASSERT_EQUAL(31,targetMesh->getNumberOfNodes());
targetMesh->findCommonNodes(1e-10,-1,comm,commI);
- CPPUNIT_ASSERT_EQUAL(3,commI->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(6,comm->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)commI->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(6,(int)comm->getNumberOfTuples());
const int commExpected[6]={1,27,28,29,23,30};
const int commIExpected[3]={0,4,6};
CPPUNIT_ASSERT(std::equal(commExpected,commExpected+6,comm->getConstPointer()));
CPPUNIT_ASSERT(std::equal(commIExpected,commIExpected+3,commI->getConstPointer()));
o2n=targetMesh->buildNewNumberingFromCommonNodesFormat(comm,commI,newNbOfNodes);
- CPPUNIT_ASSERT_EQUAL(31,o2n->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(31,(int)o2n->getNumberOfTuples());
CPPUNIT_ASSERT_EQUAL(27,newNbOfNodes);
const int o2nExp2[31]=
{
18,4,5,8,7,13,14,17,16,
18,9,10,13,12,18,19,22,21, 18,10,11,14,13,19,20,23,22, 18,12,13,16,15,21,22,25,24,
18,13,14,17,16,22,23,26,25};
- CPPUNIT_ASSERT_EQUAL(72,targetMesh->getNodalConnectivity()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(72,(int)targetMesh->getNodalConnectivity()->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(connExp,connExp+72,targetMesh->getNodalConnectivity()->getConstPointer()));
- CPPUNIT_ASSERT_EQUAL(27,targetMesh->getCoords()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(27,(int)targetMesh->getCoords()->getNumberOfTuples());
double coordsExp[81]={ 0., 0., 0., 50., 0., 0. , 200., 0., 0. , 0., 50., 0., 50., 50., 0. ,
200., 50., 0., 0., 200., 0., 50., 200., 0. , 200., 200., 0. ,
0., 0., 50., 50., 0., 50. , 200., 0., 50. , 0., 50., 50., 50.,
CPPUNIT_ASSERT(areNodesMerged);
CPPUNIT_ASSERT_EQUAL(9,targetMesh->getNumberOfNodes());
int connExp2[23]={4,0,4,3,1, 3,1,3,2, 3,3,5,2, 4,4,6,7,3, 4,7,8,5,3};
- CPPUNIT_ASSERT_EQUAL(23,targetMesh->getNodalConnectivity()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(23,(int)targetMesh->getNodalConnectivity()->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(connExp2,connExp2+23,targetMesh->getNodalConnectivity()->getConstPointer()));
double coordsExp2[18]={-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, 0.2,0.2, -0.3,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7};
- CPPUNIT_ASSERT_EQUAL(9,targetMesh->getCoords()->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(9,(int)targetMesh->getCoords()->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(coordsExp2,coordsExp2+18,targetMesh->getCoords()->getConstPointer()));
targetMesh->decrRef();
o2n->decrRef();
MEDCouplingMesh *m3=m1->mergeMyselfWith(m2);
MEDCouplingUMesh *m3C=dynamic_cast<MEDCouplingUMesh *>(m3);
CPPUNIT_ASSERT(m3C);
- m3->checkCoherency();
+ m3->checkConsistencyLight();
MEDCouplingUMesh *m4=build2DTargetMeshMerged_1();
CPPUNIT_ASSERT(m3->isEqual(m4,1.e-12));
m4->decrRef();
std::vector<const MEDCouplingUMesh *> meshes;
meshes.push_back(m1); meshes.push_back(m2); meshes.push_back(m3);
MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes);
- m4->checkCoherency();
+ m4->checkConsistencyLight();
CPPUNIT_ASSERT(m4->getCoords()==m1->getCoords());
- CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(15,(int)m4->getNumberOfCells());
const int cells1[5]={0,1,2,3,4};
MEDCouplingPointSet *m1_1=m4->buildPartOfMySelf(cells1,cells1+5,true);
m1_1->setName(m1->getName().c_str());
MEDCouplingFieldDouble *f1=m1->getMeasureField(true);
MEDCouplingFieldDouble *f2=m2->getMeasureField(true);
MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MergeFields(f1,f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
MEDCouplingUMesh *m4=build2DTargetMeshMerged_1();
CPPUNIT_ASSERT(f3->getMesh()->isEqual(m4,1.e-12));
std::string name=f3->getName();
CPPUNIT_ASSERT(name=="MeasureOfMesh_");
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_CELLS);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
- CPPUNIT_ASSERT_EQUAL(1,f3->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(7,f3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f3->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(7,(int)f3->getNumberOfTuples());
double values[7]={0.25,0.125,0.125,0.25,0.25,0.5,0.5};
const double *tmp=f3->getArray()->getConstPointer();
std::transform(tmp,tmp+7,values,values,std::minus<double>());
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"));
- f1->checkCoherency();
+ f1->checkConsistencyLight();
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>());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,1,func1);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
double values2[9]={-0.6,-0.1,0.4,-0.1,0.4,0.9,0.4,0.9,1.4};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values2,values2,std::minus<double>());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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>());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_CELLS,1,"y+x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
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>());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,1,"y+2*x");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
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_DOUBLES_EQUAL(0.,max,1.e-12);
f1->decrRef();
f1=m->fillFromAnalytic(ON_NODES,1,"2.*x+y");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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};
std::transform(tmp,tmp+9,values2Bis,values2Bis,std::minus<double>());
f1->decrRef();
//
f1=m->fillFromAnalytic(ON_NODES,2,"(x+y)*IVec+2*(x+y)*JVec");
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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>());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
f1->applyFunc(1,func1);
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
const double *tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
{
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,2,func2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
//
MEDCouplingFieldDouble *f2=f1->clone(true);
CPPUNIT_ASSERT_THROW(f2->applyFunc(1,"a+b+c+d"),INTERP_KERNEL::Exception);
f2->applyFunc("abs(u)^2.4+2*u");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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 values2[18]={-0.9065304805418678, -0.85105859001709905, -0.19601892829446504, -0.37898777756476987,
0.91090317490482353, 2.1853504664669781, -0.19601892829446504, -0.37898777756476987,
0.91090317490482353, 2.1853504664669781, 2.5765725275664879, 7.6987743736515295,
f1->applyFunc(1,"x+y");
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_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());
double values1[9]={-1.8,-0.3,1.2,-0.3,1.2,2.7,1.2,2.7,4.2};
tmp=f1->getArray()->getConstPointer();
std::transform(tmp,tmp+9,values1,values1,std::minus<double>());
MEDCouplingUMesh *m=build2DTargetMesh_1();
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,func1);
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,func1);
- f1->checkCoherency();
- f2->checkCoherency();
+ f1->checkConsistencyLight();
+ f2->checkConsistencyLight();
MEDCouplingFieldDouble *f3=(*f1)+(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
double values1[9]={-1.2,-0.2,0.8,-0.2,0.8,1.8,0.8,1.8,2.8};
f3->decrRef();
//
f3=(*f1)*(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
double values2[9]={0.36,0.01,0.16,0.01,0.16,0.81,0.16,0.81,1.96};
//
f3=(*f1)+(*f2);
MEDCouplingFieldDouble *f4=(*f1)-(*f3);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==ONE_TIME);
double values3[9]={0.6,0.1,-0.4,0.1,-0.4,-0.9,-0.4,-0.9,-1.4};
//
f3=(*f1)+(*f2);
f4=(*f3)/(*f2);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==ONE_TIME);
tmp=f4->getArray()->getConstPointer();
f4->decrRef();
//
f4=f2->buildNewTimeReprFromThis(NO_TIME,false);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getArray()==f2->getArray());
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==NO_TIME);
f3->decrRef();
//
f4=f2->buildNewTimeReprFromThis(NO_TIME,true);
- f4->checkCoherency();
+ f4->checkConsistencyLight();
CPPUNIT_ASSERT(f4->getArray()!=f2->getArray());
CPPUNIT_ASSERT(f4->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f4->getTimeDiscretization()==NO_TIME);
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,"x+y+z");
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
MEDCouplingFieldDouble *f3=(*f1)/(*f2);
- f3->checkCoherency();
+ f3->checkConsistencyLight();
CPPUNIT_ASSERT(f3->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f3->getTimeDiscretization()==ONE_TIME);
const double expected1[9]={-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
0.7407407407407407, 1.129032258064516, 0.81632653061224492,
0.86538461538461531, 1.0919540229885056, 0.84302325581395343};
- CPPUNIT_ASSERT_EQUAL(1,f3->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(9,f3->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)f3->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(9,(int)f3->getNumberOfTuples());
const double *val=f3->getArray()->getConstPointer();
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],val[i],1.e-12);
MEDCouplingFieldDouble *f1=m->fillFromAnalytic(ON_NODES,1,"x+y+z");
MEDCouplingFieldDouble *f2=m->fillFromAnalytic(ON_NODES,1,"a*a+b+c*c");
(*f1)/=(*f2);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
CPPUNIT_ASSERT(f1->getTypeOfField()==ON_NODES);
CPPUNIT_ASSERT(f1->getTimeDiscretization()==ONE_TIME);
const double expected1[9]={-2.4999999999999991, 1.2162162162162162, 0.77868852459016391,
0.7407407407407407, 1.129032258064516, 0.81632653061224492,
0.86538461538461531, 1.0919540229885056, 0.84302325581395343};
- 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());
const double *val=f1->getArray()->getConstPointer();
for(int i=0;i<9;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],val[i],1.e-12);
std::copy(arr1,arr1+15,tmp);
f1->setStartTime(2.,0,0);
f1->setEndTime(3.,0,0);
- f1->checkCoherency();
+ f1->checkConsistencyLight();
double res[3];
const double pos[2]={0.3,-0.2};
f1->getValueOn(pos,res);
f2->setArray(f1->getArray());
f2->setStartTime(2.,3,0);
f2->setEndTime(4.,13,0);
- CPPUNIT_ASSERT_THROW(f2->checkCoherency(),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(f2->checkConsistencyLight(),INTERP_KERNEL::Exception);
DataArrayDouble *array2=DataArrayDouble::New();
array2->alloc(nbOfCells,3);
tmp=array2->getPointer();
std::copy(arr2,arr2+15,tmp);
f2->setEndArray(array2);
array2->decrRef();
- f2->checkCoherency();
+ f2->checkConsistencyLight();
//
std::fill(res,res+3,0.);
f2->getValueOn(pos,3.21,res);
CPPUNIT_ASSERT(!targetMesh->checkConsecutiveCellTypesAndOrder(order1,order1+2));
CPPUNIT_ASSERT(!targetMesh->checkConsecutiveCellTypesAndOrder(order2,order2+2));
DataArrayInt *da=targetMesh->getRenumArrForConsecutiveCellTypesSpec(order1,order1+2);
- CPPUNIT_ASSERT_EQUAL(5,da->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)da->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents());
const int expected1[5]={2,0,1,3,4};
CPPUNIT_ASSERT(std::equal(expected1,expected1+5,da->getConstPointer()));
da->decrRef();
da=targetMesh->getRenumArrForConsecutiveCellTypesSpec(order2,order2+2);
- CPPUNIT_ASSERT_EQUAL(5,da->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,da->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)da->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)da->getNumberOfComponents());
const int expected2[5]={0,3,4,1,2};
CPPUNIT_ASSERT(std::equal(expected2,expected2+5,da->getConstPointer()));
da->decrRef();
MEDCouplingUMesh *m1_2=build2DSourceMesh_1();
CPPUNIT_ASSERT(m1_2->isEqual(m1_1,1e-12));
const int expected1[2]={0,1};
- CPPUNIT_ASSERT_EQUAL(2,arr1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,arr1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(2,(int)arr1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(expected1,expected1+2,arr1->getConstPointer()));
arr1->decrRef();
const int expected2[5]={0,3,4,1,2};
arr1=m2_1->rearrange2ConsecutiveCellTypes();
- CPPUNIT_ASSERT_EQUAL(5,arr1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,arr1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)arr1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(expected2,expected2+5,arr1->getConstPointer()));
MEDCouplingUMesh *m2_2=build2DTargetMesh_1();
- CPPUNIT_ASSERT_EQUAL(5,arr1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(1,arr1->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)arr1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr1->getNumberOfComponents());
CPPUNIT_ASSERT(std::equal(expected2,expected2+5,arr1->getConstPointer()));
CPPUNIT_ASSERT(!m2_2->isEqual(m2_1,1e-12));
m2_2->renumberCells(expected2,false);
//
std::vector<DataArrayInt *> corr;
MEDCouplingUMesh *m7=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
- CPPUNIT_ASSERT_EQUAL(4,m7->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(4,(int)m7->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,(int)corr.size());
const int expectedVals1[3]={3,3,2};
const int expectedVals2[3][3]={{0,1,2},{3,0,2},{3,0,111111}};
for(int i=0;i<3;i++)
{
DataArrayInt *arr=corr[i];
- CPPUNIT_ASSERT_EQUAL(1,arr->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr->getNumberOfComponents());
int nbOfVals=expectedVals1[i];
- CPPUNIT_ASSERT_EQUAL(nbOfVals,arr->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(nbOfVals,(int)arr->getNumberOfTuples());
const int *vals=arr->getConstPointer();
for(int j=0;j<nbOfVals;j++)
CPPUNIT_ASSERT_EQUAL(expectedVals2[i][j],vals[j]);
const int fidExp[4]={5,1,3,4};
const int fidsGrp[3][3]={{1,3,5},{3,4,5},{4,5,23344}};
CPPUNIT_ASSERT_EQUAL(3,(int)fidsOfGroups.size());
- CPPUNIT_ASSERT_EQUAL(1,arr2->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(4,arr2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)arr2->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(4,(int)arr2->getNumberOfTuples());
CPPUNIT_ASSERT(std::equal(fidExp,fidExp+4,arr2->getConstPointer()));
for(int i=0;i<3;i++)
{
meshes.push_back(m4);
std::vector<DataArrayInt *> corr;
MEDCouplingUMesh *m5=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
- CPPUNIT_ASSERT_EQUAL(18,m5->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(18,(int)m5->getNumberOfCells());
std::vector<DataArrayInt *>::iterator it=corr.begin();
const int exp1[4]={18,5,5,4};
const int exp2[4][18]={
MEDCouplingUMesh *targetMesh=build3DSurfTargetMesh_1();
MEDCouplingFieldDouble *field=targetMesh->buildOrthogonalField();
double expected[3]={0.70710678118654746,0.,-0.70710678118654746};
- CPPUNIT_ASSERT_EQUAL(5,field->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,field->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(5,(int)field->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)field->getNumberOfComponents());
const double *vals=field->getArray()->getConstPointer();
for(int i=0;i<15;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected[i%3],vals[i],1e-12);
targetMesh->setCoords(myCoords);
myCoords->decrRef();
field=targetMesh->buildOrthogonalField();
- CPPUNIT_ASSERT_EQUAL(1,field->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(3,field->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(1,(int)field->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(3,(int)field->getNumberOfComponents());
vals=field->getArray()->getConstPointer();
CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.70710678118654746,vals[0],1e-12);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.,vals[1],1e-12);
{
MEDCouplingUMesh *targetMesh=build2DTargetMesh_1();
double pos[12]={0.,0.,0.4,0.4,0.,0.4,0.1,0.1,0.25,0.,0.65,0.};
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> t1,t2;
+ MCAuto<DataArrayInt> t1,t2;
//2D basic
targetMesh->getCellsContainingPoints(pos,6,1e-12,t1,t2);
CPPUNIT_ASSERT_EQUAL(6,(int)t1->getNbOfElems());
CPPUNIT_ASSERT(std::equal(t2->begin(),t2->end(),expectedValues2));
//2D with no help of bounding box.
double center[2]={0.2,0.2};
- MEDCouplingPointSet::Rotate2DAlg(center,0.78539816339744830962,6,pos);
+ DataArrayDouble::Rotate2DAlg(center,0.78539816339744830962,6,pos,pos);
targetMesh->rotate(center,0,0.78539816339744830962);
targetMesh->getCellsContainingPoints(pos,6,1e-12,t1,t2);
CPPUNIT_ASSERT_EQUAL(6,(int)t1->getNbOfElems());
coordsZ->decrRef();
//
MEDCouplingFieldDouble *fieldOnNodes=mesh->fillFromAnalytic(ON_NODES,1,"x+y/2.+z/3.");
- CPPUNIT_ASSERT_EQUAL(1,fieldOnNodes->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(64,fieldOnNodes->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)fieldOnNodes->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(64,(int)fieldOnNodes->getNumberOfTuples());
const double expected1[64]={-3., -1., 0., 2., -1., 1., 2., 4., 0., 2., 3., 5., 2., 4., 5., 7., -1., 1., 2.,
4., 1., 3., 4., 6., 2., 4., 5., 7., 4., 6., 7., 9., 0., 2., 3., 5., 2., 4., 5.,
7., 3., 5., 6., 8., 5., 7., 8., 10., 2., 4., 5.,
fieldOnNodes->decrRef();
//
MEDCouplingFieldDouble *fieldOnCells=mesh->fillFromAnalytic(ON_CELLS,1,"x+y/2.+z/3.");
- CPPUNIT_ASSERT_EQUAL(1,fieldOnCells->getNumberOfComponents());
- CPPUNIT_ASSERT_EQUAL(27,fieldOnCells->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(1,(int)fieldOnCells->getNumberOfComponents());
+ CPPUNIT_ASSERT_EQUAL(27,(int)fieldOnCells->getNumberOfTuples());
val=fieldOnCells->getArray()->getConstPointer();
const double expected2[27]={0, 1.5, 3, 1.5, 3, 4.5, 3, 4.5, 6, 1.5, 3, 4.5, 3, 4.5,
6, 4.5, 6, 7.5, 3, 4.5, 6, 4.5, 6, 7.5, 6, 7.5, 9};
CPPUNIT_ASSERT_DOUBLES_EQUAL(6.,res[0],1e-12);
fieldOnCells->decrRef();
//
- MEDCouplingMesh* meshDeepCopy=mesh->deepCpy();
+ MEDCouplingMesh* meshDeepCopy=mesh->deepCopy();
MEDCouplingCMesh* meshClone=mesh->clone(false);
CPPUNIT_ASSERT_THROW(meshEmpty->copyTinyStringsFrom(0),INTERP_KERNEL::Exception);
CPPUNIT_ASSERT(mesh1->isEqual(mesh2,1e-5));
CPPUNIT_ASSERT(!mesh1->isEqual(mesh2,1e-7));
- CPPUNIT_ASSERT_THROW(mesh3->checkCoherency1(1e-12),INTERP_KERNEL::Exception);
- mesh1->checkCoherency1(1e-12);
+ CPPUNIT_ASSERT_THROW(mesh3->checkConsistency(1e-12),INTERP_KERNEL::Exception);
+ mesh1->checkConsistency(1e-12);
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,mesh1->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_HEXA8,*((mesh1->getAllGeoTypes()).begin()));
- CPPUNIT_ASSERT_EQUAL(27,mesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
+ CPPUNIT_ASSERT_EQUAL(27,(int)mesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
CPPUNIT_ASSERT_THROW(mesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_QUAD4),INTERP_KERNEL::Exception);
std::vector<double> coo;
MEDCouplingUMesh *partMesh1=
dynamic_cast<MEDCouplingUMesh *>(mesh1->buildPart(cells1,cells1+4));
CPPUNIT_ASSERT(partMesh1);
- CPPUNIT_ASSERT_EQUAL(4,partMesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
+ CPPUNIT_ASSERT_EQUAL(4,(int)partMesh1->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
CPPUNIT_ASSERT_EQUAL(64,mesh1->getNumberOfNodes());
CPPUNIT_ASSERT_EQUAL(64,partMesh1->getNumberOfNodes());
MEDCouplingCMesh *partMesh2=
dynamic_cast<MEDCouplingCMesh *>(mesh1->buildPartAndReduceNodes(cells2,cells2+2,arr1));
CPPUNIT_ASSERT(partMesh2);
- CPPUNIT_ASSERT_EQUAL(2,partMesh2->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
+ CPPUNIT_ASSERT_EQUAL(2,(int)partMesh2->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
CPPUNIT_ASSERT_EQUAL(12,partMesh2->getNumberOfNodes());
int cells3[2]={2,3};
MEDCouplingUMesh *partMesh3=
dynamic_cast<MEDCouplingUMesh *>(partMesh1->buildPartAndReduceNodes(cells3,cells3+2,arr2));
CPPUNIT_ASSERT(partMesh3);
- CPPUNIT_ASSERT_EQUAL(2,partMesh3->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
+ CPPUNIT_ASSERT_EQUAL(2,(int)partMesh3->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8));
CPPUNIT_ASSERT_EQUAL(12,partMesh3->getNumberOfNodes());
CPPUNIT_ASSERT_THROW(mesh1->simplexize(0),INTERP_KERNEL::Exception);
DataArrayInt* d1=DataArrayInt::New();
DataArrayDouble* d2=DataArrayDouble::New();
mesh2d->resizeForUnserialization(tinyInfo, d1, d2, littleStrings);
- CPPUNIT_ASSERT_EQUAL(0,d1->getNumberOfTuples());
- CPPUNIT_ASSERT_EQUAL(8,d2->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(0,(int)d1->getNumberOfTuples());
+ CPPUNIT_ASSERT_EQUAL(8,(int)d2->getNumberOfTuples());
partMesh1->decrRef();
partMesh2->decrRef();
mesh->findNodesOnPlane(pt,v,1e-12,n);
CPPUNIT_ASSERT_EQUAL(9,(int)n.size());
MEDCouplingUMesh *m3dSurf=(MEDCouplingUMesh *)mesh->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
- MEDCouplingExtrudedMesh *me=MEDCouplingExtrudedMesh::New(mesh,m3dSurf,0);
+ MEDCouplingMappedExtrudedMesh *me=MEDCouplingMappedExtrudedMesh::New(mesh,m3dSurf,0);
const DataArrayInt *da=me->getMesh3DIds();
- CPPUNIT_ASSERT_EQUAL(8,me->getNumberOfCells());
+ CPPUNIT_ASSERT_EQUAL(8,(int)me->getNumberOfCells());
const int expected[8]={0,1,2,3,4,5,6,7};
const int *val=da->getConstPointer();
for(int i=0;i<8;i++)