self.assertRaises( InterpKernelException, jointsR.getJointAtPos,1)
self.assertRaises( InterpKernelException, jointsR.destroyJointAtPos,1)
jointsR.destroyJointAtPos(0)
- #
+
pass
def testMEDFileJoint2(self):
fileNameWr="Pyfile89.med"
joints.pushJoint(two_joint)
mm.setJoints( joints )
mm.write(fileNameWr,2)
- # #
+ #
mm=MEDFileMesh.New(fileNameWr)
self.assertEqual( mm.getNumberOfJoints(), 2)
jointsR = mm.getJoints();
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()