From: eap Date: Fri, 29 May 2015 17:29:55 +0000 (+0300) Subject: 22875: EDF 7690 MED: Creating joints with medpartitioner in the MEDCoupling API X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fimn%2FEDF7690;p=tools%2Fmedcoupling.git 22875: EDF 7690 MED: Creating joints with medpartitioner in the MEDCoupling API More tests of Joints --- diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 2c0d40bf0..28a2ba0fe 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -4217,7 +4217,7 @@ class MEDLoaderTest(unittest.TestCase): self.assertRaises( InterpKernelException, jointsR.getJointAtPos,1) self.assertRaises( InterpKernelException, jointsR.destroyJointAtPos,1) jointsR.destroyJointAtPos(0) - # + pass def testMEDFileJoint2(self): fileNameWr="Pyfile89.med" @@ -4253,7 +4253,7 @@ class MEDLoaderTest(unittest.TestCase): joints.pushJoint(two_joint) mm.setJoints( joints ) mm.write(fileNameWr,2) - # # + # mm=MEDFileMesh.New(fileNameWr) self.assertEqual( mm.getNumberOfJoints(), 2) jointsR = mm.getJoints(); @@ -4267,6 +4267,44 @@ class MEDLoaderTest(unittest.TestCase): self.assertTrue( jointR2.isEqual( two_joint )) pass + def testMEDFileJoint1(self): + node_correspond=MEDFileJointCorrespondence(DataArrayInt([1,2,3,4,5,6,7,8])) + cell_correspond=MEDFileJointCorrespondence(DataArrayInt([9,10,11,12]),NORM_TRI3,NORM_TRI3) + cell_correspon2=MEDFileJointCorrespondence(DataArrayInt([9,10,11]),NORM_TRI3,NORM_TRI3) + cell_correspon3=MEDFileJointCorrespondence(DataArrayInt([9,10,11,12]),NORM_TRI3,NORM_QUAD4) + joint1st_1=MEDFileJointOneStep() + joint1st_1.pushCorrespondence(cell_correspond) + joint1st_1.pushCorrespondence(node_correspond) + joint1st_2=MEDFileJointOneStep() + joint1st_2.pushCorrespondence(cell_correspond) + joint1st_2.pushCorrespondence(node_correspond) + joint1st_3=MEDFileJointOneStep() + joint1st_3.pushCorrespondence(node_correspond) + joint1st_3.pushCorrespondence(cell_correspond) + joint1st_4=MEDFileJointOneStep() + joint1st_4.pushCorrespondence(cell_correspond) + joint1st_5=MEDFileJointOneStep() + joint1st_5.pushCorrespondence(cell_correspon2) + joint1st_6=MEDFileJointOneStep() + joint1st_6.pushCorrespondence(cell_correspon3) + self.assertTrue( joint1st_1.isEqual( joint1st_2 )) + self.assertTrue( joint1st_1.isEqual( joint1st_3 )) + self.assertFalse( joint1st_1.isEqual( joint1st_4 )) + self.assertFalse( joint1st_4.isEqual( joint1st_5 )) + self.assertFalse( joint1st_4.isEqual( joint1st_6 )) + one_joint=MEDFileJoint() + one_joint.pushStep(joint1st_1) + one_joint.setLocalMeshName("maa1") + one_joint.setRemoteMeshName("maa2") + one_joint.setDescription("joint_description") + one_joint.setJointName("joint_1") + one_joint.setDomainNumber(1) + self.assertEqual( "maa1", one_joint.getLocalMeshName()) + self.assertEqual( "maa2", one_joint.getRemoteMeshName()) + self.assertEqual( "joint_description", one_joint.getDescription()) + self.assertEqual( 1, one_joint.getDomainNumber()) + self.assertEqual( "joint_1", one_joint.getJointName()) + pass pass unittest.main()