From 4f71ebec43ee3d076a0a829294e3128447f0921f Mon Sep 17 00:00:00 2001 From: Anthony GEAY Date: Wed, 18 Nov 2020 06:56:48 +0100 Subject: [PATCH] Non reg test linked to previous commit --- src/MEDLoader/Swig/MEDLoaderTest3.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index cc6f3ad12..94003d98f 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -6787,6 +6787,33 @@ class MEDLoaderTest3(unittest.TestCase): self.assertTrue( isinstance(f,MEDCouplingFieldInt64) ) self.assertEqual( f.getArray().getIJ(0,0) , v ) + @WriteInTmpDir + def testNonRegUMeshSubParts(self): + """ + Non regression test focuses on accordance between time stamp and active data structure in MEDFileUMeshAggregateCompute class. + """ + fname = "Pyfile121.med" + m0 = MEDCouplingUMesh("mesh",1) + coords = DataArrayDouble([(0,0),(1,0),(2,0)]) + m0.setCoords(coords) + m0.allocateCells() + m0.insertNextCell(NORM_SEG2,[1,2]) + mm = MEDFileUMesh() + mm[0] = m0 + m1 = MEDCoupling1SGTUMesh(m0.getName(), NORM_POINT1) + m1.setCoords(m0.getCoords()) + m1.setNodalConnectivity(DataArrayInt([1,2])) + m1.setName(m0.getName()) + mm[-1] = m1 + fni = mm.computeFetchedNodeIds() # <- This invokation of const method implies 1SGTU parts computation + mm.zipCoords() # <- This call changes the coords and connectivity + mm.write(fname,2) + # + mm = MEDFileMesh.New(fname) + mm[0].checkConsistency() # <- check that correct DS has been taken at write time into MEDFileUMeshAggregateCompute + self.assertTrue( m0.isEqual(mm[0],1e-12) ) + pass + pass if __name__ == "__main__": -- 2.39.2