-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
a1->setInfoOnComponent(3,"dddd");
const int arr2[6]={1,2,1,2,0,0};
std::vector<int> arr2V(arr2,arr2+6);
- DataArrayDouble *a2=a1->keepSelectedComponents(arr2V);
+ DataArrayDouble *a2=static_cast<DataArrayDouble *>(a1->keepSelectedComponents(arr2V));
CPPUNIT_ASSERT_EQUAL(6,a2->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,a2->getNumberOfTuples());
CPPUNIT_ASSERT(std::string(a2->getInfoOnComponent(0))=="bbbb");
for(int i=0;i<30;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i],a2->getIJ(0,i),1e-14);
DataArrayInt *a3=a1->convertToIntArr();
- DataArrayInt *a4=a3->keepSelectedComponents(arr2V);
+ DataArrayInt *a4=static_cast<DataArrayInt *>(a3->keepSelectedComponents(arr2V));
CPPUNIT_ASSERT_EQUAL(6,a4->getNumberOfComponents());
CPPUNIT_ASSERT_EQUAL(5,a4->getNumberOfTuples());
CPPUNIT_ASSERT(std::string(a4->getInfoOnComponent(0))=="bbbb");
// setSelectedComponents
const int arr3[2]={3,2};
std::vector<int> arr3V(arr3,arr3+2);
- DataArrayDouble *a5=a1->keepSelectedComponents(arr3V);
+ DataArrayDouble *a5=static_cast<DataArrayDouble *>(a1->keepSelectedComponents(arr3V));
a5->setInfoOnComponent(0,"eeee");
a5->setInfoOnComponent(1,"ffff");
const int arr4[2]={1,2};
CPPUNIT_ASSERT(!((dbl->reprZip().find("Number of components : 1"))==std::string::npos));
std::ostringstream ret;
- dbl->writeVTK(ret,2,"file.tmp");
+ dbl->writeVTK(ret,2,"file.tmp",0);
CPPUNIT_ASSERT(!((ret.str().find("<DataArray"))==std::string::npos));
CPPUNIT_ASSERT(!((ret.str().find("Float32"))==std::string::npos));
CPPUNIT_ASSERT(!((ret.str().find("16 15 14 13 12 11 10"))==std::string::npos));
MEDCouplingFieldDouble *f=m->getMeasureField(false);
for(int i=0;i<7;i++)
CPPUNIT_ASSERT_DOUBLES_EQUAL(expected1[i]*sqrt(2.),f->getIJ(i,0),1e-10);
- std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllTypes();
+ std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(2,(int)types.size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*(types.begin()));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYGON,*(++(types.begin())));
for(int i=0;i<7;i++)
CPPUNIT_ASSERT_EQUAL(expected2[i],da->getIJ(i,0));
m->checkCoherency();
- types=m->getAllTypes();
+ types=m->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(2,(int)types.size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_TRI3,*(types.begin()));
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POLYGON,*(++(types.begin())));
//
const int vec3[5]={0,1,2,3,4};
MEDCouplingUMesh *m4_1=(MEDCouplingUMesh *)m4->buildPartOfMySelf(vec3,vec3+5,false);
- m4_1->setName(m1->getName());
+ m4_1->setName(m1->getName().c_str());
CPPUNIT_ASSERT(m4_1->isEqual(m1,1e-12));
m4_1->decrRef();
//
CPPUNIT_ASSERT_EQUAL(2,m4_3->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m4_3->getNumberOfNodes());
m3_2->zipCoords();
- m4_3->setName(m3_2->getName());
+ m4_3->setName(m3_2->getName().c_str());
CPPUNIT_ASSERT(m4_3->isEqual(m3_2,1e-12));
m4_3->decrRef();
//
CPPUNIT_ASSERT_EQUAL(4,m->getNumberOfCells());
CPPUNIT_ASSERT_EQUAL(3,m->getSpaceDimension());
CPPUNIT_ASSERT_EQUAL(0,m->getMeshDimension());
- const std::set<INTERP_KERNEL::NormalizedCellType>& types=m->getAllTypes();
+ std::set<INTERP_KERNEL::NormalizedCellType> types=m->getAllGeoTypes();
CPPUNIT_ASSERT_EQUAL(1,(int)types.size());
CPPUNIT_ASSERT_EQUAL(INTERP_KERNEL::NORM_POINT1,*types.begin());
for(int i=0;i<4;i++)