From: ageay Date: Wed, 29 Sep 2010 07:25:08 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V5_1_main_FINAL~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d8b04275e593e1638531be5c454c6d7f37f0ce1;p=tools%2Fmedcoupling.git *** empty log message *** --- diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index a40b4922b..b8b61edc9 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -683,6 +683,18 @@ void MEDLoaderNS::readFieldDoubleDataInMedFile(const char *fileName, const char if(found2) time=dt; } + if(!found2) + { + std::ostringstream oss; oss << "FieldDouble in file \""<< fileName<< "\" with name \"" << fieldName << "\" on mesh \"" << meshName; + oss << "\" does not have such time step : iteration=" << iteration << " order=" << order << std::endl; + delete [] valr; + delete [] comp; + delete [] unit; + delete [] dt_unit; + delete [] maa_ass; + MEDfermer(fid); + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } MEDchampLire(fid,(char *)meshName,(char *)fieldName,(unsigned char*)valr,MED_FULL_INTERLACE,MED_ALL,locname, pflname,MED_COMPACT,tabEnt[typeOfOutField],tabType[typeOfOutField][j],iteration,order); std::string tmp(locname); @@ -1543,26 +1555,26 @@ ParaMEDMEM::MEDCouplingUMesh *MEDLoader::ReadUMeshFromGroups(const char *fileNam return ret; } -ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldDouble(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) { CheckFileForRead(fileName); switch(type) { case ON_CELLS: - return ReadFieldDoubleCell(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); + return ReadFieldCell(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); case ON_NODES: - return ReadFieldDoubleNode(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); + return ReadFieldNode(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); case ON_GAUSS_PT: - return ReadFieldDoubleGauss(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); + return ReadFieldGauss(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); case ON_GAUSS_NE: - return ReadFieldDoubleGaussNE(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); + return ReadFieldGaussNE(fileName,meshName,meshDimRelToMax,fieldName,iteration,order); default: throw INTERP_KERNEL::Exception("Type of field specified not managed ! manages are ON_NODES, ON_CELLS, ON_GAUSS_PT or ON_GAUSS_NE !"); } } -std::vector MEDLoader::ReadFieldsDoubleOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception) +std::vector MEDLoader::ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + const std::vector >& its) throw(INTERP_KERNEL::Exception) { CheckFileForRead(fileName); std::vector ret(its.size()); @@ -1606,46 +1618,46 @@ std::vector MEDLoader::ReadFieldsDoubleOnS return ret; } -std::vector MEDLoader::ReadFieldsDoubleCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, +std::vector MEDLoader::ReadFieldsCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception) { - return ReadFieldsDoubleOnSameMesh(ON_CELLS,fileName,meshName,meshDimRelToMax,fieldName,its); + return ReadFieldsOnSameMesh(ON_CELLS,fileName,meshName,meshDimRelToMax,fieldName,its); } -std::vector MEDLoader::ReadFieldsDoubleNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception) +std::vector MEDLoader::ReadFieldsNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + const std::vector >& its) throw(INTERP_KERNEL::Exception) { - return ReadFieldsDoubleOnSameMesh(ON_NODES,fileName,meshName,meshDimRelToMax,fieldName,its); + return ReadFieldsOnSameMesh(ON_NODES,fileName,meshName,meshDimRelToMax,fieldName,its); } -std::vector MEDLoader::ReadFieldsDoubleGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception) +std::vector MEDLoader::ReadFieldsGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + const std::vector >& its) throw(INTERP_KERNEL::Exception) { - return ReadFieldsDoubleOnSameMesh(ON_GAUSS_PT,fileName,meshName,meshDimRelToMax,fieldName,its); + return ReadFieldsOnSameMesh(ON_GAUSS_PT,fileName,meshName,meshDimRelToMax,fieldName,its); } -std::vector MEDLoader::ReadFieldsDoubleGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception) +std::vector MEDLoader::ReadFieldsGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + const std::vector >& its) throw(INTERP_KERNEL::Exception) { - return ReadFieldsDoubleOnSameMesh(ON_GAUSS_NE,fileName,meshName,meshDimRelToMax,fieldName,its); + return ReadFieldsOnSameMesh(ON_GAUSS_NE,fileName,meshName,meshDimRelToMax,fieldName,its); } -ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldDoubleCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) { return MEDLoaderNS::readFieldDoubleLev1(fileName,meshName,meshDimRelToMax,fieldName,iteration,order,ON_CELLS); } -ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldDoubleNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) { return MEDLoaderNS::readFieldDoubleLev1(fileName,meshName,meshDimRelToMax,fieldName,iteration,order,ON_NODES); } -ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldDoubleGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) { return MEDLoaderNS::readFieldDoubleLev1(fileName,meshName,meshDimRelToMax,fieldName,iteration,order,ON_GAUSS_PT); } -ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldDoubleGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) { return MEDLoaderNS::readFieldDoubleLev1(fileName,meshName,meshDimRelToMax,fieldName,iteration,order,ON_GAUSS_NE); } diff --git a/src/MEDLoader/MEDLoader.hxx b/src/MEDLoader/MEDLoader.hxx index 2efb99927..f302c023c 100644 --- a/src/MEDLoader/MEDLoader.hxx +++ b/src/MEDLoader/MEDLoader.hxx @@ -99,21 +99,21 @@ class MEDLOADER_EXPORT MEDLoader static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception); static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception); static int ReadUMeshDimFromFile(const char *fileName, const char *meshName) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDouble(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsDoubleOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static std::vector ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsDoubleCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + static std::vector ReadFieldsCellOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsDoubleNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + static std::vector ReadFieldsNodeOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsDoubleGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + static std::vector ReadFieldsGaussOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsDoubleGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, + static std::vector ReadFieldsGaussNEOnSameMesh(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, const std::vector >& its) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception); static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception); static void WriteUMeshesPartition(const char *fileName, const char *meshName, const std::vector& meshes, bool writeFromScratch) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/Swig/MEDLoaderTest.py b/src/MEDLoader/Swig/MEDLoaderTest.py index 5f1adc330..1b1103bed 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest.py +++ b/src/MEDLoader/Swig/MEDLoaderTest.py @@ -67,12 +67,12 @@ class MEDLoaderTest(unittest.TestCase): def testFieldRW1(self): f1=MEDLoaderDataForTest.buildVecFieldOnCells_1(); MEDLoader.WriteField("Pyfile6.med",f1,True); - f2=MEDLoader.ReadFieldDoubleCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1); + f2=MEDLoader.ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); # f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); MEDLoader.WriteField("Pyfile7.med",f1,True); - f2=MEDLoader.ReadFieldDoubleNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3); + f2=MEDLoader.ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); pass @@ -89,17 +89,19 @@ class MEDLoaderTest(unittest.TestCase): f1.getArray().setIJ(0,0,VAL2); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); #retrieving time steps... - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9); f1.setTime(10.,8,9); f1.getArray().setIJ(0,0,VAL1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1); f3=MEDLoaderDataForTest.buildVecFieldOnCells_1(); self.assertTrue(f3.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19); f1.setTime(10.14,18,19); f1.getArray().setIJ(0,0,VAL2); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); + #test of throw on invalid (dt,it) + self.assertRaises(Exception,MEDLoader.ReadFieldCell,fileName,f1.getMesh().getName(),0,f1.getName(),28,19); #ON NODES f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); fileName2="Pyfile9.med"; @@ -111,14 +113,14 @@ class MEDLoaderTest(unittest.TestCase): f1.setTime(210.,208,209); f1.getArray().setIJ(0,3,VAL2); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109); f1.setTime(110.,108,109); f1.getArray().setIJ(0,3,VAL1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3); f3=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); self.assertTrue(f3.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209); f1.setTime(210.,208,209); f1.getArray().setIJ(0,3,VAL2); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); @@ -186,22 +188,22 @@ class MEDLoaderTest(unittest.TestCase): self.assertTrue(len(it4)==0); # # - f1=MEDLoader.ReadFieldDoubleCell(fileName,name3,0,name1,8,9); + f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,8,9); self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name3,0,name1,18,19); + f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,18,19); self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,28,29); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,28,29); self.assertAlmostEqual(3*VAL1,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,38,39); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,38,39); self.assertAlmostEqual(3*VAL2,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,48,49); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,48,49); self.assertAlmostEqual(4*VAL2,f1.getArray().getIJ(0,0),13); # - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,8,9); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,8,9); self.assertAlmostEqual(71.,f1.getArray().getIJ(0,3),13); - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,108,109); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,108,109); self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,3),13); - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,208,209); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,208,209); self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,3),13); pass @@ -283,7 +285,7 @@ class MEDLoaderTest(unittest.TestCase): # MEDLoader.WriteField(fileName,f1,False);#<- False important for the test # - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),2,7); f2.checkCoherency(); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); # @@ -293,7 +295,7 @@ class MEDLoaderTest(unittest.TestCase): fileName="Pyfile13.med"; f1=MEDLoaderDataForTest.buildVecFieldOnGauss_1(); MEDLoader.WriteField(fileName,f1,True); - f2=MEDLoader.ReadFieldDouble(ON_GAUSS_PT,fileName,f1.getMesh().getName(),0,f1.getName(),1,5); + f2=MEDLoader.ReadField(ON_GAUSS_PT,fileName,f1.getMesh().getName(),0,f1.getName(),1,5); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); pass @@ -301,7 +303,7 @@ class MEDLoaderTest(unittest.TestCase): fileName="Pyfile14.med"; f1=MEDLoaderDataForTest.buildVecFieldOnGaussNE_1(); MEDLoader.WriteField(fileName,f1,True); - f2=MEDLoader.ReadFieldDouble(ON_GAUSS_NE,fileName,f1.getMesh().getName(),0,f1.getName(),1,5); + f2=MEDLoader.ReadField(ON_GAUSS_NE,fileName,f1.getMesh().getName(),0,f1.getName(),1,5); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); pass @@ -343,7 +345,7 @@ class MEDLoaderTest(unittest.TestCase): MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); # Reading its=[(1,2),(3,4),(5,6)]; - fs=MEDLoader.ReadFieldsDoubleOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its); + fs=MEDLoader.ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its); self.assertEqual(3,len(fs)); self.assertTrue(fs[0].isEqual(f_1,1e-12,1e-12)); self.assertTrue(fs[1].isEqual(f_2,1e-12,1e-12)); @@ -382,7 +384,7 @@ class MEDLoaderTest(unittest.TestCase): f1.setTime(3.14,2,7); f1.checkCoherency(); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7); self.assertTrue(f2.isEqual(f1,1e-12,1e-12)); pass pass diff --git a/src/MEDLoader/Swig/MEDLoaderTest2.py b/src/MEDLoader/Swig/MEDLoaderTest2.py index 868421a91..bc39c1bc0 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest2.py +++ b/src/MEDLoader/Swig/MEDLoaderTest2.py @@ -67,12 +67,12 @@ class MEDLoaderTest(unittest.TestCase): def testFieldRW1(self): f1=MEDLoaderDataForTest.buildVecFieldOnCells_1(); MEDLoader.WriteFieldDep("Pyfile6.med",f1,False); - f2=MEDLoader.ReadFieldDoubleCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1); + f2=MEDLoader.ReadFieldCell("Pyfile6.med",f1.getMesh().getName(),0,f1.getName(),0,1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); # f1=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); MEDLoader.WriteFieldDep("Pyfile7.med",f1,False); - f2=MEDLoader.ReadFieldDoubleNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3); + f2=MEDLoader.ReadFieldNode("Pyfile7.med",f1.getMesh().getName(),0,f1.getName(),2,3); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); pass @@ -89,14 +89,14 @@ class MEDLoaderTest(unittest.TestCase): f1.getArray().setIJ(0,0,VAL2); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); #retrieving time steps... - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),8,9); f1.setTime(10.,8,9); f1.getArray().setIJ(0,0,VAL1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),0,1); f3=MEDLoaderDataForTest.buildVecFieldOnCells_1(); self.assertTrue(f3.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),0,f1.getName(),18,19); f1.setTime(10.14,18,19); f1.getArray().setIJ(0,0,VAL2); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); @@ -111,14 +111,14 @@ class MEDLoaderTest(unittest.TestCase): f1.setTime(210.,208,209); f1.getArray().setIJ(0,3,VAL2); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName2,f1); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),108,109); f1.setTime(110.,108,109); f1.getArray().setIJ(0,3,VAL1); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),2,3); f3=MEDLoaderDataForTest.buildVecFieldOnNodes_1(); self.assertTrue(f3.isEqual(f2,1e-12,1e-12)); - f2=MEDLoader.ReadFieldDoubleNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209); + f2=MEDLoader.ReadFieldNode(fileName2,f1.getMesh().getName(),0,f1.getName(),208,209); f1.setTime(210.,208,209); f1.getArray().setIJ(0,3,VAL2); self.assertTrue(f1.isEqual(f2,1e-12,1e-12)); @@ -186,22 +186,22 @@ class MEDLoaderTest(unittest.TestCase): self.assertTrue(len(it4)==0); # # - f1=MEDLoader.ReadFieldDoubleCell(fileName,name3,0,name1,8,9); + f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,8,9); self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name3,0,name1,18,19); + f1=MEDLoader.ReadFieldCell(fileName,name3,0,name1,18,19); self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,28,29); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,28,29); self.assertAlmostEqual(3*VAL1,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,38,39); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,38,39); self.assertAlmostEqual(3*VAL2,f1.getArray().getIJ(0,0),13); - f1=MEDLoader.ReadFieldDoubleCell(fileName,name2,0,name1,48,49); + f1=MEDLoader.ReadFieldCell(fileName,name2,0,name1,48,49); self.assertAlmostEqual(4*VAL2,f1.getArray().getIJ(0,0),13); # - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,8,9); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,8,9); self.assertAlmostEqual(71.,f1.getArray().getIJ(0,3),13); - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,108,109); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,108,109); self.assertAlmostEqual(VAL1,f1.getArray().getIJ(0,3),13); - f1=MEDLoader.ReadFieldDoubleNode(fileName,name2,0,name1,208,209); + f1=MEDLoader.ReadFieldNode(fileName,name2,0,name1,208,209); self.assertAlmostEqual(VAL2,f1.getArray().getIJ(0,3),13); pass @@ -297,7 +297,7 @@ class MEDLoaderTest(unittest.TestCase): MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); # Reading its=[(1,2),(3,4),(5,6)]; - fs=MEDLoader.ReadFieldsDoubleOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its); + fs=MEDLoader.ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1.getMesh().getName(),0,f_1.getName(),its); self.assertEqual(3,len(fs)); self.assertTrue(fs[0].isEqual(f_1,1e-12,1e-12)); self.assertTrue(fs[1].isEqual(f_2,1e-12,1e-12)); @@ -336,7 +336,7 @@ class MEDLoaderTest(unittest.TestCase): f1.setTime(3.14,2,7); f1.checkCoherency(); MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fileName,f1); - f2=MEDLoader.ReadFieldDoubleCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7); + f2=MEDLoader.ReadFieldCell(fileName,f1.getMesh().getName(),-1,f1.getName(),2,7); self.assertTrue(f2.isEqual(f1,1e-12,1e-12)); pass pass diff --git a/src/MEDLoader/Swig/libMEDLoader_Swig.i b/src/MEDLoader/Swig/libMEDLoader_Swig.i index 70e3043a6..37648ec84 100644 --- a/src/MEDLoader/Swig/libMEDLoader_Swig.i +++ b/src/MEDLoader/Swig/libMEDLoader_Swig.i @@ -36,11 +36,11 @@ %newobject MEDLoader::ReadUMeshFromFamilies; %newobject MEDLoader::ReadUMeshFromGroups; %newobject MEDLoader::ReadUMeshFromFile; -%newobject MEDLoader::ReadFieldDouble; -%newobject MEDLoader::ReadFieldDoubleCell; -%newobject MEDLoader::ReadFieldDoubleNode; -%newobject MEDLoader::ReadFieldDoubleGauss; -%newobject MEDLoader::ReadFieldDoubleGaussNE; +%newobject MEDLoader::ReadField; +%newobject MEDLoader::ReadFieldCell; +%newobject MEDLoader::ReadFieldNode; +%newobject MEDLoader::ReadFieldGauss; +%newobject MEDLoader::ReadFieldGaussNE; class MEDLoader { @@ -99,11 +99,11 @@ public: } return ret; } - static PyObject *ReadFieldsDoubleOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, - const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception) + static PyObject *ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, + const char *fieldName, PyObject *liIts) throw(INTERP_KERNEL::Exception) { std::vector > its=convertTimePairIdsFromPy(liIts); - std::vector res=MEDLoader::ReadFieldsDoubleOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its); + std::vector res=MEDLoader::ReadFieldsOnSameMesh(type,fileName,meshName,meshDimRelToMax,fieldName,its); return convertFieldDoubleVecToPy(res); } static void WriteUMeshesPartition(const char *fileName, const char *meshName, PyObject *li, bool writeFromScratch) throw(INTERP_KERNEL::Exception) @@ -127,11 +127,11 @@ public: static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const char *fileName, const char *meshName, int meshDimRelToMax, const std::vector& grps) throw(INTERP_KERNEL::Exception); static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception); static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDouble(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldDoubleGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const char *fileName, const char *meshName, int meshDimRelToMax, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); static void WriteUMesh(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception); static void WriteUMeshDep(const char *fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch) throw(INTERP_KERNEL::Exception); static void WriteField(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/Test/MEDLoaderTest.cxx b/src/MEDLoader/Test/MEDLoaderTest.cxx index bab43105e..7c3451419 100644 --- a/src/MEDLoader/Test/MEDLoaderTest.cxx +++ b/src/MEDLoader/Test/MEDLoaderTest.cxx @@ -90,14 +90,14 @@ void MEDLoaderTest::testFieldRW1() { MEDCouplingFieldDouble *f1=buildVecFieldOnCells_1(); MEDLoader::WriteField("file6.med",f1,true); - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDoubleCell("file6.med",f1->getMesh()->getName(),0,f1->getName(),0,1); + MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell("file6.med",f1->getMesh()->getName(),0,f1->getName(),0,1); CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f1->decrRef(); f2->decrRef(); // f1=buildVecFieldOnNodes_1(); MEDLoader::WriteField("file7.med",f1,true); - f2=MEDLoader::ReadFieldDoubleNode("file7.med",f1->getMesh()->getName(),0,f1->getName(),2,3); + f2=MEDLoader::ReadFieldNode("file7.med",f1->getMesh()->getName(),0,f1->getName(),2,3); CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f1->decrRef(); f2->decrRef(); @@ -121,20 +121,22 @@ void MEDLoaderTest::testFieldRW2() tmp[0]=VAL2; MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1); //retrieving time steps... - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDoubleCell(fileName,f1->getMesh()->getName(),0,f1->getName(),8,9); + MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),8,9); f1->setTime(10.,8,9); tmp[0]=VAL1; CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f2->decrRef(); - f2=MEDLoader::ReadFieldDoubleCell(fileName,f1->getMesh()->getName(),0,f1->getName(),0,1); + f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),0,1); MEDCouplingFieldDouble *f3=buildVecFieldOnCells_1(); CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12)); f3->decrRef(); f2->decrRef(); - f2=MEDLoader::ReadFieldDoubleCell(fileName,f1->getMesh()->getName(),0,f1->getName(),18,19); + f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),18,19); f1->setTime(10.14,18,19); tmp[0]=VAL2; CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); + //test of throw on invalid (dt,it) + CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),28,19),INTERP_KERNEL::Exception); f2->decrRef(); f1->decrRef(); //ON NODES @@ -148,17 +150,17 @@ void MEDLoaderTest::testFieldRW2() f1->setTime(210.,208,209); tmp[3]=VAL2; MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName2,f1); - f2=MEDLoader::ReadFieldDoubleNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),108,109); + f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),108,109); f1->setTime(110.,108,109); tmp[3]=VAL1; CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f2->decrRef(); - f2=MEDLoader::ReadFieldDoubleNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),2,3); + f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),2,3); f3=buildVecFieldOnNodes_1(); CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12)); f3->decrRef(); f2->decrRef(); - f2=MEDLoader::ReadFieldDoubleNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),208,209); + f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),208,209); f1->setTime(210.,208,209); tmp[3]=VAL2; CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); @@ -231,29 +233,29 @@ void MEDLoaderTest::testFieldRW3() // f1->decrRef(); // - f1=MEDLoader::ReadFieldDoubleCell(fileName,name3,0,name1,8,9); + f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,8,9); CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL1,f1->getArray()->getConstPointer()[0],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleCell(fileName,name3,0,name1,18,19); + f1=MEDLoader::ReadFieldCell(fileName,name3,0,name1,18,19); CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL2,f1->getArray()->getConstPointer()[0],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleCell(fileName,name2,0,name1,28,29); + f1=MEDLoader::ReadFieldCell(fileName,name2,0,name1,28,29); CPPUNIT_ASSERT_DOUBLES_EQUAL(3*VAL1,f1->getArray()->getConstPointer()[0],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleCell(fileName,name2,0,name1,38,39); + f1=MEDLoader::ReadFieldCell(fileName,name2,0,name1,38,39); CPPUNIT_ASSERT_DOUBLES_EQUAL(3*VAL2,f1->getArray()->getConstPointer()[0],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleCell(fileName,name2,0,name1,48,49); + f1=MEDLoader::ReadFieldCell(fileName,name2,0,name1,48,49); CPPUNIT_ASSERT_DOUBLES_EQUAL(4*VAL2,f1->getArray()->getConstPointer()[0],1e-13); f1->decrRef(); // - f1=MEDLoader::ReadFieldDoubleNode(fileName,name2,0,name1,8,9); + f1=MEDLoader::ReadFieldNode(fileName,name2,0,name1,8,9); CPPUNIT_ASSERT_DOUBLES_EQUAL(71.,f1->getArray()->getConstPointer()[3],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleNode(fileName,name2,0,name1,108,109); + f1=MEDLoader::ReadFieldNode(fileName,name2,0,name1,108,109); CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL1,f1->getArray()->getConstPointer()[3],1e-13); f1->decrRef(); - f1=MEDLoader::ReadFieldDoubleNode(fileName,name2,0,name1,208,209); + f1=MEDLoader::ReadFieldNode(fileName,name2,0,name1,208,209); CPPUNIT_ASSERT_DOUBLES_EQUAL(VAL2,f1->getArray()->getConstPointer()[3],1e-13); f1->decrRef(); } @@ -360,7 +362,7 @@ void MEDLoaderTest::testFieldProfilRW1() // MEDLoader::WriteField(fileName,f1,false);//<- false important for the test // - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDoubleCell(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7); + MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7); f2->checkCoherency(); CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); // @@ -375,7 +377,7 @@ void MEDLoaderTest::testFieldGaussRW1() const char fileName[]="file13.med"; MEDCouplingFieldDouble *f1=buildVecFieldOnGauss_1(); MEDLoader::WriteField(fileName,f1,true); - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDouble(ON_GAUSS_PT,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5); + MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_PT,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5); CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f2->decrRef(); f1->decrRef(); @@ -386,7 +388,7 @@ void MEDLoaderTest::testFieldGaussNERW1() const char fileName[]="file14.med"; MEDCouplingFieldDouble *f1=buildVecFieldOnGaussNE_1(); MEDLoader::WriteField(fileName,f1,true); - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDouble(ON_GAUSS_NE,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5); + MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5); CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12)); f2->decrRef(); f1->decrRef(); @@ -433,7 +435,7 @@ void MEDLoaderTest::testFieldShuffleRW1() const int renumber1[6]={2,1,5,0,3,4}; f1->renumberCells(renumber1,false); MEDLoader::WriteField(fileName,f1,true); - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDoubleCell(fileName,mesh->getName(),0,f1->getName(),2,7); + MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,mesh->getName(),0,f1->getName(),2,7); CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12)); f2->decrRef(); // @@ -475,7 +477,7 @@ void MEDLoaderTest::testMultiFieldShuffleRW1() its.push_back(std::pair(1,2)); its.push_back(std::pair(3,4)); its.push_back(std::pair(5,6)); - std::vector fs=MEDLoader::ReadFieldsDoubleOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName(),0,f_1->getName(),its); + std::vector fs=MEDLoader::ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName(),0,f_1->getName(),its); CPPUNIT_ASSERT_EQUAL(3,(int)fs.size()); const MEDCouplingMesh *mm=fs[0]->getMesh(); CPPUNIT_ASSERT(fs[0]->isEqual(f_1,1e-12,1e-12)); @@ -531,7 +533,7 @@ void MEDLoaderTest::testWriteUMeshesRW1() f1->setTime(3.14,2,7); f1->checkCoherency(); MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1); - MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldDoubleCell(fileName,f1->getMesh()->getName(),-1,f1->getName(),2,7); + MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),-1,f1->getName(),2,7); CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12)); f1->decrRef(); f2->decrRef();