f1=MEDCouplingFieldInt.New(ON_CELLS,ONE_TIME);
f1.setName("IntVectorFieldOnCells");
f1.setMesh(mesh);
- array=DataArrayInt([0,10,20,1,11,21,2,12,22,3,13,23,4,14,24,5,15,25],nbOfCells ,3)
+ array=DataArrayInt32([0,10,20,1,11,21,2,12,22,3,13,23,4,14,24,5,15,25],nbOfCells ,3)
array.setInfoOnComponent(0,"va1 [MW/m^3]");
array.setInfoOnComponent(1,"va2 [g/cm^3]");
array.setInfoOnComponent(2,"val3 [K]");
f2_int=MEDLoader.ReadFieldCell(fileName,f1_int.getMesh().getName(),0,f1_int.getName(),8,9);
self.assertTrue(f1_int.isEqual(f2_int,1e-12,0)); # exact comparison here
f2_fl=MEDLoader.ReadFieldCell(fileName,f1_fl.getMesh().getName(),0,f1_fl.getName(),8,9);
- self.assertTrue(f1_fl.isEqual(f2_fl,1e-12,1e-12));
+ self.assertTrue(f1_fl.isEqual(f2_fl,1e-12,1e-7)); # float comparison here
#ON NODES
f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1();
fileName2="Pyfile9.med";
MEDCouplingFieldInt *f2_int=dynamic_cast<MEDCouplingFieldInt *>(ReadFieldCell(fileName,f1_int->getMesh()->getName().c_str(),0,f1_int->getName().c_str(),8,9));
CPPUNIT_ASSERT(f1_int->isEqual(f2_int,1e-12,0)); // exact equality for int values
f2_int->decrRef();
+ f1_int->decrRef();
MEDCouplingFieldFloat *f2_fl=dynamic_cast<MEDCouplingFieldFloat *>(ReadFieldCell(fileName,f1_fl->getMesh()->getName().c_str(),0,f1_fl->getName().c_str(),8,9));
- CPPUNIT_ASSERT(f1_fl->isEqual(f2_fl,1e-12,1e-12));
+ CPPUNIT_ASSERT(f1_fl->isEqual(f2_fl,1e-12,1e-07f)); // float comparison
f2_fl->decrRef();
+ f1_fl->decrRef();
//ON NODES
f1=buildVecFieldOnNodes_1();
const char fileName2[]="file9.med";
MEDCouplingFieldInt *f1=MEDCouplingFieldInt::New(ON_CELLS,ONE_TIME);
f1->setName("IntVectorFieldOnCells");
f1->setMesh(mesh);
- DataArrayInt *array=DataArrayInt::New();
+ DataArrayInt32 *array=DataArrayInt32::New();
array->alloc(nbOfCells,3);
array->setInfoOnComponent(0,"val1 [MW/m^3]");
array->setInfoOnComponent(1,"va2 [g/cm^3]");