]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of MEDFileJointOneStep.clearCorrespondences method to update joints for...
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Dec 2021 10:38:18 +0000 (11:38 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Dec 2021 10:38:18 +0000 (11:38 +0100)
src/MEDLoader/MEDFileJoint.cxx
src/MEDLoader/MEDFileJoint.hxx
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderTest3.py

index 6fc6099603ecfa43ffa67733b4b543dc9fdb17c7..10d7d16a6b9b3f2ab34e1dc00cc3a3244acf90da 100644 (file)
@@ -328,6 +328,11 @@ void MEDFileJointOneStep::pushCorrespondence(MEDFileJointCorrespondence* corresp
   correspondence->incrRef();
 }
 
+void MEDFileJointOneStep::clearCorrespondences()
+{
+  _correspondences.clear();
+}
+
 int MEDFileJointOneStep::getNumberOfCorrespondences() const
 {
   return (int)_correspondences.size();
index 98d4a7e5370737aae26efba8e54b0aee3500ee95..f4f3bdba717288b889f5e0a7d9adb7f8b3ac7136 100644 (file)
@@ -94,6 +94,7 @@ public:
   MEDLOADER_EXPORT void setIteration(int it) { _iteration=it; }
   MEDLOADER_EXPORT int getIteration() const { return _iteration; }
   MEDLOADER_EXPORT void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
+  MEDLOADER_EXPORT void clearCorrespondences();
   MEDLOADER_EXPORT int getNumberOfCorrespondences() const;
   MEDLOADER_EXPORT MEDFileJointCorrespondence *getCorrespondenceAtPos(int i) const;
 
index 1ad2475ede4105d8362abbaaa105f72f1bf5f2b7..6f30f9f7668784aae1eeb063f778afaa7d03676b 100644 (file)
@@ -784,6 +784,7 @@ namespace MEDCoupling
     void setIteration(int it);
     int getIteration() const;
     void pushCorrespondence(MEDFileJointCorrespondence* correspondence);
+    void clearCorrespondences();
     int getNumberOfCorrespondences() const;
     void write(const std::string& fileName, int mode, const std::string& localMeshName, const std::string& jointName) const;
     std::string simpleRepr() const;
index e752d3544eb8acf4e011fc0c6b02013c56374024..d0d9960eccb819ebd113abf3cbee401d1a885ff0 100644 (file)
@@ -4989,6 +4989,9 @@ class MEDLoaderTest3(unittest.TestCase):
         self.assertFalse( joint1st_1.isEqual( joint1st_4 ))
         self.assertFalse( joint1st_4.isEqual( joint1st_5 ))
         self.assertFalse( joint1st_4.isEqual( joint1st_6 ))
+        self.assertEqual(1,joint1st_6.getNumberOfCorrespondences())
+        joint1st_6.clearCorrespondences()
+        self.assertEqual(0,joint1st_6.getNumberOfCorrespondences())
         one_joint=MEDFileJoint()
         one_joint.pushStep(joint1st_1)
         one_joint.setLocalMeshName("maa1")