]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
22875: EDF 7690 MED: Creating joints with medpartitioner in the MEDCoupling API imn/EDF7690
authoreap <eap@opencascade.com>
Fri, 29 May 2015 17:29:55 +0000 (20:29 +0300)
committereap <eap@opencascade.com>
Fri, 29 May 2015 17:29:55 +0000 (20:29 +0300)
 More tests of Joints

src/MEDLoader/Swig/MEDLoaderTest3.py

index 2c0d40bf0222528beeb9401b5e17813342f07264..28a2ba0fe3fa1b5f6128e54bdd0e468aebf76d2f 100644 (file)
@@ -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()