Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/smesh
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 19 Feb 2018 15:29:01 +0000 (16:29 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 19 Feb 2018 15:29:01 +0000 (16:29 +0100)
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i_1.cxx
src/SMESH_SWIG/smeshBuilder.py

index e8cd0a3df3dbaa072a35ba7617e73c430da65960..a32d4db78fd67900433e0f1a6bf434f5406e7f15 100644 (file)
@@ -178,7 +178,23 @@ PortableServer::ServantBase_var SMESH_Gen_i::GetServant( CORBA::Object_ptr theOb
     PortableServer::Servant aServant = GetPOA()->reference_to_servant( theObject );
     return aServant;
   }
-  catch (...) {
+  catch (PortableServer::POA::ObjectNotActive &ex)
+  {
+    INFOS("GetServant: ObjectNotActive");
+    return NULL;
+  }
+  catch (PortableServer::POA::WrongAdapter &ex)
+  {
+    INFOS("GetServant: WrongAdapter: OK when several servants used to build several mesh in parallel...");
+    return NULL;
+  }
+  catch (PortableServer::POA::WrongPolicy &ex)
+  {
+    INFOS("GetServant: WrongPolicy");
+    return NULL;
+  }
+  catch (...)
+  {
     INFOS( "GetServant - Unknown exception was caught!!!" );
     return NULL;
   }
@@ -629,9 +645,11 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
                                    bool                theStudyIsBeingClosed)
 {
   int curStudyId = GetCurrentStudyID();
+  MESSAGE("curStudyId " << curStudyId);
   myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
   // create study context, if it doesn't exist and set current study
   int studyId = GetCurrentStudyID();
+  MESSAGE("studyId " << studyId);
   if ( myStudyContextMap.find( studyId ) == myStudyContextMap.end() )
     myStudyContextMap[ studyId ] = new StudyContext;
 
@@ -645,6 +663,7 @@ void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
     // Let meshes update their data depending on GEOM groups that could change
     if ( curStudyId != studyId )
     {
+      MESSAGE("curStudyId " << curStudyId << " studyId " << studyId);
       CORBA::String_var compDataType = ComponentDataType();
       SALOMEDS::SComponent_wrap me = myCurrentStudy->FindComponent( compDataType.in() );
       if ( !me->_is_nil() ) {
index bb3703de1e845356f5cfd2a60390b33586a57167..6444617c7f744bba743461d5be8ec288fe33fe43 100644 (file)
@@ -298,10 +298,10 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr   theStudy,
     if ( !sameIOR )
     {
       iorAttr->SetValue( objStr.in() );
-      // UnRegister() !!!
-      SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
-      if ( !genObj->_is_nil() )
-        genObj->UnRegister();
+      // UnRegister() !!! --> No: random problems when meshing in parallel (yacs foreach) in distributed python scripts
+//      SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR );
+//      if ( !genObj->_is_nil() )
+//        genObj->UnRegister();
     }
   }
 
index f2641f7c8360cd45195eea05b7849614117c6e8f..bd9966d40f171d4387c7768332265cfa5b6f17e6 100644 (file)
@@ -1183,11 +1183,12 @@ omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder)
 #    from salome.smesh import smeshBuilder
 #    smesh = smeshBuilder.New(salome.myStudy)
 #  \endcode
-#  @param  study     SALOME study, generally obtained by salome.myStudy.
-#  @param  instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
+#  @param  study         SALOME study, generally obtained by salome.myStudy.
+#  @param  instance      CORBA proxy of SMESH Engine. If None, the default Engine is used.
+#  @param  instanceGeom  CORBA proxy of GEOM  Engine. If None, the default Engine is used.
 #  @return smeshBuilder instance
 
-def New( study, instance=None):
+def New( study, instance=None, instanceGeom=None):
     """
     Create a new smeshBuilder instance.The smeshBuilder class provides the Python
     interface to create or load meshes.
@@ -1199,8 +1200,9 @@ def New( study, instance=None):
         smesh = smeshBuilder.New(salome.myStudy)
 
     Parameters:
-        study     SALOME study, generally obtained by salome.myStudy.
-        instance  CORBA proxy of SMESH Engine. If None, the default Engine is used.
+        study         SALOME study, generally obtained by salome.myStudy.
+        instance      CORBA proxy of SMESH Engine. If None, the default Engine is used.
+        instanceGeom  CORBA proxy of GEOM  Engine. If None, the default Engine is used.
     Returns:
         smeshBuilder instance
     """
@@ -1212,7 +1214,7 @@ def New( study, instance=None):
       doLcc = True
     smeshInst = smeshBuilder()
     assert isinstance(smeshInst,smeshBuilder), "Smesh engine class is %s but should be smeshBuilder.smeshBuilder. Import salome.smesh.smeshBuilder before creating the instance."%smeshInst.__class__
-    smeshInst.init_smesh(study)
+    smeshInst.init_smesh(study, instanceGeom)
     return smeshInst