Salome HOME
0022172: [CEA 790] create the groups corresponding to domains
authoreap <eap@opencascade.com>
Fri, 24 May 2013 12:01:17 +0000 (12:01 +0000)
committereap <eap@opencascade.com>
Fri, 24 May 2013 12:01:17 +0000 (12:01 +0000)
Allow calling Create() and Assign() with geom == None

src/SMESH_SWIG/smesh_algorithm.py

index caad9bb1a85d5b949d60fb840c5ed65ff832a8e3..6dc35e6b28fcb875897d737332e4c2b11096620c 100644 (file)
@@ -180,7 +180,7 @@ class Mesh_Algorithm:
 
     ## Private method.
     def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
 
     ## Private method.
     def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
-        if geom is None:
+        if geom is None and mesh.mesh.HasShapeToMesh():
             raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape"
         algo = self.FindAlgorithm(hypo, mesh.smeshpyD)
         if algo is None:
             raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape"
         algo = self.FindAlgorithm(hypo, mesh.smeshpyD)
         if algo is None:
@@ -192,7 +192,7 @@ class Mesh_Algorithm:
     ## Private method
     def Assign(self, algo, mesh, geom):
         from salome.smesh.smeshBuilder import AssureGeomPublished, TreatHypoStatus, GetName
     ## Private method
     def Assign(self, algo, mesh, geom):
         from salome.smesh.smeshBuilder import AssureGeomPublished, TreatHypoStatus, GetName
-        if geom is None:
+        if geom is None and mesh.mesh.HasShapeToMesh():
             raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
         self.mesh = mesh
         name = ""
             raise RuntimeError, "Attemp to create " + algo + " algoritm on None shape"
         self.mesh = mesh
         name = ""