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;
}
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;
// 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() ) {
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();
}
}
# 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.
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
"""
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