Salome HOME
22487: EDF 2778 SMESH: Add a GUI for the flat elements generation
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 7c4acfad49e67aa0dc5f2b692c91a7cdd0351267..223cf9130641d3992182d67b70e9cba067548986 100644 (file)
@@ -1563,25 +1563,26 @@ class Mesh:
             if not geom:
                 geom = self.mesh.GetShapeToMesh()
             pass
-        hyp_name = GetName( hyp )
-        geom_name = ""
-        if geom:
-            geom_name = geom.GetName()
         isApplicable = True
         if self.mesh.HasShapeToMesh():
             hyp_type     = hyp.GetName()
             lib_name     = hyp.GetLibName()
-            isSubMesh    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
-            isApplicable = self.smeshpyD.IsApplicable(hyp_name, lib_name, geom, isSubMesh)
+            checkAll    = ( not geom.IsSame( self.mesh.GetShapeToMesh() ))
+            if checkAll and geom:
+                checkAll = geom.GetType() == 37
+            isApplicable = self.smeshpyD.IsApplicable(hyp_type, lib_name, geom, checkAll)
         if isApplicable:
             AssureGeomPublished( self, geom, "shape for %s" % hyp.GetName())
             status = self.mesh.AddHypothesis(geom, hyp)
-            isAlgo = hyp._narrow( SMESH_Algo )
-            TreatHypoStatus( status, hyp_name, geom_name, isAlgo )
-            return status
         else:
-            TreatHypoStatus( HYP_BAD_GEOMETRY, hyp_name, geom_name, isAlgo )
-            return HYP_BAD_GEOMETRY
+            status = HYP_BAD_GEOMETRY
+        hyp_name = GetName( hyp )
+        geom_name = ""
+        if geom:
+            geom_name = geom.GetName()
+        isAlgo = hyp._narrow( SMESH_Algo )
+        TreatHypoStatus( status, hyp_name, geom_name, isAlgo )
+        return status
 
     ## Return True if an algorithm of hypothesis is assigned to a given shape
     #  @param hyp a hypothesis to check
@@ -4502,9 +4503,11 @@ class Mesh:
     # Triangles are transformed in prisms, and quadrangles in hexahedrons.
     # @param theDomains - list of groups of volumes
     # @param createJointElems - if TRUE, create the elements
+    # @param onAllBoundaries - if TRUE, the nodes and elements are also created on
+    #        the boundary between \a theDomains and the rest mesh
     # @return TRUE if operation has been completed successfully, FALSE otherwise
-    def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems ):
-       return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems )
+    def DoubleNodesOnGroupBoundaries(self, theDomains, createJointElems, onAllBoundaries=False ):
+       return self.editor.DoubleNodesOnGroupBoundaries( theDomains, createJointElems, onAllBoundaries )
 
     ## Double nodes on some external faces and create flat elements.
     # Flat elements are mainly used by some types of mechanic calculations.