Salome HOME
Check result of Compute() in test and examples
authorFrederic Pons <frederic.pons@opencascade.com>
Tue, 21 Feb 2023 13:59:44 +0000 (14:59 +0100)
committerFrederic Pons <frederic.pons@opencascade.com>
Wed, 29 Mar 2023 12:18:23 +0000 (14:18 +0200)
143 files changed:
doc/examples/a3DmeshOnModified2Dmesh.py
doc/examples/cartesian_algo.py
doc/examples/create_dual_mesh.py
doc/examples/creating_meshes_ex01.py
doc/examples/creating_meshes_ex02.py
doc/examples/creating_meshes_ex03.py
doc/examples/creating_meshes_ex04.py
doc/examples/creating_meshes_ex05.py
doc/examples/creating_meshes_ex06.py
doc/examples/creating_meshes_ex07.py
doc/examples/creating_meshes_ex08.py
doc/examples/creating_parallel_mesh.py
doc/examples/defining_hypotheses_adaptive1d.py
doc/examples/defining_hypotheses_ex01.py
doc/examples/defining_hypotheses_ex02.py
doc/examples/defining_hypotheses_ex03.py
doc/examples/defining_hypotheses_ex04.py
doc/examples/defining_hypotheses_ex05.py
doc/examples/defining_hypotheses_ex06.py
doc/examples/defining_hypotheses_ex07.py
doc/examples/defining_hypotheses_ex08.py
doc/examples/defining_hypotheses_ex09.py
doc/examples/defining_hypotheses_ex10.py
doc/examples/defining_hypotheses_ex11.py
doc/examples/defining_hypotheses_ex12.py
doc/examples/defining_hypotheses_ex13.py
doc/examples/defining_hypotheses_ex14.py
doc/examples/defining_hypotheses_ex15.py
doc/examples/defining_hypotheses_ex16.py
doc/examples/defining_hypotheses_ex17.py
doc/examples/defining_hypotheses_len_near_vertex.py
doc/examples/filters_ex09.py
doc/examples/filters_ex10.py
doc/examples/filters_ex16.py
doc/examples/filters_ex17.py
doc/examples/filters_ex18.py
doc/examples/filters_ex39.py
doc/examples/generate_flat_elements.py
doc/examples/grouping_elements_ex02.py
doc/examples/grouping_elements_ex03.py
doc/examples/measurements_ex01.py
doc/examples/measurements_ex02.py
doc/examples/measurements_ex03.py
doc/examples/mechanic.py
doc/examples/mesh_3d.py
doc/examples/modifying_meshes_ex11.py
doc/examples/modifying_meshes_ex15.py
doc/examples/modifying_meshes_ex23.py
doc/examples/modifying_meshes_ex25.py
doc/examples/modifying_meshes_ex26.py
doc/examples/notebook_smesh.py
doc/examples/prism_3d_algo.py
doc/examples/quad_medial_axis_algo.py
doc/examples/quality_controls_defl.py
doc/examples/quality_controls_ex01.py
doc/examples/quality_controls_ex02.py
doc/examples/quality_controls_ex03.py
doc/examples/quality_controls_ex05.py
doc/examples/quality_controls_ex06.py
doc/examples/quality_controls_ex07.py
doc/examples/quality_controls_ex11.py
doc/examples/quality_controls_ex12.py
doc/examples/radial_prism_3d_algo.py
doc/examples/split_biquad.py
doc/examples/test_homard_adapt.py
doc/examples/test_uniform_refinement.py
doc/examples/transforming_meshes_ex03.py
doc/examples/transforming_meshes_ex06.py
doc/examples/transforming_meshes_ex07.py
doc/examples/transforming_meshes_ex08.py
doc/examples/transforming_meshes_ex09.py
doc/examples/transforming_meshes_ex10.py
doc/examples/transforming_meshes_ex11.py
doc/examples/transforming_meshes_ex13.py
doc/examples/use_existing_faces.py
doc/examples/viewing_meshes_ex01.py
doc/examples/viewing_meshes_ex02.py
src/SMESH_PY/smeshstudytools.py
test/PAL_MESH_041_mesh.py
test/PAL_MESH_043_2D.py
test/PAL_MESH_043_3D.py
test/SMESH_BelongToGeom.py
test/SMESH_BuildCompound.py
test/SMESH_GroupFromGeom.py
test/SMESH_GroupFromGeom2.py
test/SMESH_GroupLyingOnGeom.py
test/SMESH_Nut.py
test/SMESH_Partition1_tetra.py
test/SMESH_Sphere.py
test/SMESH_box.py
test/SMESH_box2_tetra.py
test/SMESH_box3_tetra.py
test/SMESH_box_tetra.py
test/SMESH_create_dual_mesh_adapt.py
test/SMESH_create_dual_mesh_tpipe.py
test/SMESH_demo_hexa2_upd.py
test/SMESH_fixation_hexa.py
test/SMESH_fixation_netgen.py
test/SMESH_fixation_tetra.py
test/SMESH_flight_skin.py
test/SMESH_freebord.py
test/SMESH_hexaedre.py
test/SMESH_mechanic.py
test/SMESH_mechanic_editor.py
test/SMESH_mechanic_netgen.py
test/SMESH_mechanic_tetra.py
test/SMESH_test.py
test/SMESH_test1_AndDisplay.py
test/SMESH_test2.py
test/SMESH_test4.py
test/basic_geom_smesh_without_session.py
test/basic_shaper_smesh_without_session.py
test/basic_smesh_output_with_mc_field.py
test/doublenodes_polyhedra.py
test/ex01_cube2build.py
test/ex02_cube2primitive.py
test/ex03_cube2partition.py
test/ex04_cube5tetraHexa.py
test/ex05_hole1build.py
test/ex06_hole1boolean.py
test/ex07_hole1partition.py
test/ex08_hole2build.py
test/ex09_grid4build.py
test/ex10_grid4geometry.py
test/ex11_grid3partition.py
test/ex12_grid17partition.py
test/ex13_hole1partial.py
test/ex14_cyl1holed.py
test/ex15_cyl2geometry.py
test/ex16_cyl2complementary.py
test/ex17_dome1.py
test/ex18_dome2.py
test/ex19_sphereINcube.py
test/ex21_lamp.py
test/ex24_cylinder.py
test/ex29_refine.py
test/ex30_groupsOp.py
test/ex30_tepal.py
test/ex31_dimGroup.py
test/ex_MakePolyLine.py
test/extrusion_penta_biquad.py
test/netgen_runner.py
test/test_polyhedron_per_solid.py

index fb49f873c8b79525782bc063b1129dd9ec460592..4e830b7f4472c5ab584d6056f249d60bdb2c42b4 100644 (file)
@@ -48,15 +48,19 @@ algo_2D.SetMinSize( 7. )
 
 # 2) Compute 2D mesh
 isDone = Mesh_1.Compute()
+if not isDone:
+  raise Exception("Error when computing Mesh")
 
 # 3) Split quadrangles into triangles
-isDone = Mesh_1.SplitQuadObject( Mesh_1, Diag13=True )
+Mesh_1.SplitQuadObject( Mesh_1, Diag13=True )
 
 # 4) Define a 3D mesher
 Mesh_1.Tetrahedron()
 
 # 5) Compute 3D mesh
-Mesh_1.Compute()
+isDone = Mesh_1.Compute()
+if not isDone:
+  raise Exception("Error when computing Mesh")
 
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser()
index 584d667152d34a84135a4315884e802932369da3..690aaff8ae4ac7cd843544a04298b4c2e62fd605 100644 (file)
@@ -25,7 +25,7 @@ coords = list(range(-100,100,10))
 cartHyp = cartAlgo.SetGrid( coords,coords,coords, 1000000)
 
 # compute the mesh
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("nb hexahedra",mesh.NbHexas())
 print("nb tetrahedra",mesh.NbTetras())
 print("nb polyhedra",mesh.NbPolyhedrons())
@@ -34,7 +34,7 @@ print()
 # define the grid by setting constant spacing
 cartHyp = cartAlgo.SetGrid( "10","10","10", 1000000)
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("nb hexahedra",mesh.NbHexas())
 print("nb tetrahedra",mesh.NbTetras())
 print("nb polyhedra",mesh.NbPolyhedrons())
@@ -44,7 +44,7 @@ print()
 # activate creation of faces
 cartHyp.SetToCreateFaces( True )
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("nb hexahedra",mesh.NbHexas())
 print("nb tetrahedra",mesh.NbTetras())
 print("nb polyhedra",mesh.NbPolyhedrons())
@@ -53,7 +53,7 @@ print()
 
 # enable consideration of shared faces
 cartHyp.SetToConsiderInternalFaces( True )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("nb hexahedra",mesh.NbHexas())
 print("nb tetrahedra",mesh.NbTetras())
 print("nb polyhedra",mesh.NbPolyhedrons())
@@ -64,7 +64,7 @@ print()
 spaceFuns = ["5","10+10*t"]
 cartAlgo.SetGrid( [spaceFuns, [0.5]], [spaceFuns, [0.5]], [spaceFuns, [0.25]], 10 )
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("nb hexahedra",mesh.NbHexas())
 print("nb tetrahedra",mesh.NbTetras())
 print("nb polyhedra",mesh.NbPolyhedrons())
@@ -85,24 +85,24 @@ spc = "0.1" # spacing
 mesh = smesh_builder.Mesh( box, "custom axes")
 algo = mesh.BodyFitted()
 algo.SetGrid( spc, spc, spc, 10000 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("Default axes")
 print("   nb hex:",mesh.NbHexas())
 
 # set axes using edges of the box
 algo.SetAxesDirs( xDir, [-0.1,1,0], zDir )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("Manual axes")
 print("   nb hex:",mesh.NbHexas())
 
 # set optimal orthogonal axes
 algo.SetOptimalAxesDirs( isOrthogonal=True )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("Optimal orthogonal axes")
 print("   nb hex:",mesh.NbHexas())
 
 # set optimal non-orthogonal axes
 algo.SetOptimalAxesDirs( isOrthogonal=False )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("Optimal non-orthogonal axes")
 print("   nb hex:",mesh.NbHexas())
index 08dfea8229654a80f5b9eef73014e66798d4640a..d65e9bd16f1273ab759c4a1f572f065ef538d4f8 100644 (file)
@@ -45,15 +45,14 @@ Mesh_1 = smesh.Mesh(Sphere_1,'Mesh_1')
 status = Mesh_1.AddHypothesis( Sphere_1, NETGEN_3D_Parameters_1 )
 NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
 isDone = Mesh_1.Compute()
-
+if not isDone:
+  raise Exception("Error when computing Mesh")
 
 # Creating Dual mesh
 dual_Mesh_1 = smesh.CreateDualMesh( Mesh_1, 'dual_Mesh_1', True)
 
-
 assert(dual_Mesh_1.NbPolyhedrons() > 0)
 assert(dual_Mesh_1.NbTetras() == 0)
 
-
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser()
index e5cb0e9346c827763f539c3b9f573d0dd97966cb..0a174d8a3c71ea3027abc6ebd0f7f501ed66ec75 100644 (file)
@@ -27,8 +27,7 @@ algo3D.MaxElementVolume(900.)
 
 # compute the mesh
 ret = tetra.Compute()
-if ret == 0:
-    print("problem when computing the mesh")
-else:
-    print("mesh computed")
-    pass
+if not ret:
+    raise Exception("problem when computing the mesh")
+
+print("mesh computed")
index 676708c68e51b46b630c0b4b56aad2d5f576abc6..bb03588378d392f487a3a938f83ac4f9874387e2 100644 (file)
@@ -52,11 +52,11 @@ mesh.Hexahedron()
 surfaces = geom_builder.SubShapeAll(box, geom_builder.ShapeType["FACE"])
 
 # method 1: no sub-mesh is created
-mesh.Compute( surfaces[0] )
+if not mesh.Compute( surfaces[0] ): raise Exception("Error when computing Mesh")
 
 # method 2: a sub-mesh is created
 submesh = mesh.GetSubMesh( surfaces[2], "submesh 2" )
-submesh.Compute()
+if not submesh.Compute(): raise Exception("Error when computing Mesh")
 
 # compute the whole mesh
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 03a1804a130d876205f22ef1b0a17acec875d7b4..88b3d0b1afee1886ca1cfaef928cc5f116c8579a 100644 (file)
@@ -35,14 +35,17 @@ mesh.Triangle(geom=Face_3)
 # get existing sub-mesh priority order: F1 -> F2 -> F3
 [[SubMesh_F1, SubMesh_F3, SubMesh_F2]] = mesh.GetMeshOrder()
 isDone = mesh.Compute()
+if not isDone: raise Exception("Error when computing Mesh")
 print("Nb elements at initial order of sub-meshes:", mesh.NbElements())
 
 # set new sub-mesh order: F2 -> F1 -> F3
 isDone = mesh.SetMeshOrder([[SubMesh_F2, SubMesh_F1, SubMesh_F3]])
 isDone = mesh.Compute()
+if not isDone: raise Exception("Error when computing Mesh")
 print("Nb elements at new order of sub-meshes:", mesh.NbElements())
 
 # compute with other sub-mesh order: F3 -> F2 -> F1
 isDone = mesh.SetMeshOrder([[SubMesh_F3, SubMesh_F2, SubMesh_F1]])
 isDone = mesh.Compute()
+if not isDone: raise Exception("Error when computing Mesh")
 print("Nb elements at another order of sub-meshes:", mesh.NbElements())
index 3298e971c0f0bc5e3d214c568fa74507fc6dcddd..405fcd9eeb6af828a92f036f22c7c9b130a4511e 100644 (file)
@@ -41,19 +41,19 @@ hyp3 = algo_local.Arithmetic1D(1, 6)
 hyp4 = algo_local.Propagation()
 
 # compute the mesh
-tria.Compute()
+if not tria.Compute(): raise Exception("Error when computing Mesh")
 PrintMeshInfo(tria)
 
 # remove a local hypothesis
 tria.RemoveHypothesis(hyp4, edge)
 
 # compute the mesh
-tria.Compute()
+if not tria.Compute(): raise Exception("Error when computing Mesh")
 PrintMeshInfo(tria)
 
 # change the value of the 2D hypothesis
 hyp2.SetMaxElementArea(2.)
 
 # compute the mesh
-tria.Compute()
+if not tria.Compute(): raise Exception("Error when computing Mesh")
 PrintMeshInfo(tria)
index 5c2ab863baa0b5d5cb837a5318bb13dc64e6863e..4f4f6d171d83748a3fee183010a7163843cfc96a 100644 (file)
@@ -24,7 +24,7 @@ tetra.Triangle()
 tetra.Tetrahedron()
 
 # compute the mesh
-tetra.Compute()
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
 
 # export the mesh in a MED file
 medFile = tempfile.NamedTemporaryFile(suffix=".med").name
index a460eeb8b9933171ba76c71cd15a8db33c9aca47..0d706851ebdcf5566f385c796b7c3ea94b053a69 100644 (file)
@@ -113,7 +113,7 @@ algo.Propagation()
 hexa.Quadrangle()
 hexa.Hexahedron()
 
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
 
 hexa.Group(group_a)
 hexa.Group(group_b)
index 4a181c237a6f80584601bd153d12df93f0951912..d0d4c8e9f9472c409f529ec71dca1668833f8352 100644 (file)
@@ -46,7 +46,7 @@ algo1D_1=Mesh_inf.Segment()
 algo1D_1.NumberOfSegments(10)
 algo2D_1=Mesh_inf.Quadrangle()
 algo3D_1=Mesh_inf.Hexahedron()
-Mesh_inf.Compute()
+if not Mesh_inf.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group on the top face
 Gsup1=Mesh_inf.Group(Fsup1, "Sup")
@@ -59,7 +59,7 @@ algo1D_2=Mesh_sup.Segment()
 algo1D_2.NumberOfSegments(5)
 algo2D_2=Mesh_sup.Quadrangle()
 algo3D_2=Mesh_sup.Hexahedron()
-Mesh_sup.Compute()
+if not Mesh_sup.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group on the top face
 Gsup2=Mesh_sup.Group(Fsup2, "Sup")
index 71fdff73b2b8bdc127b36db231f23baecd8e22f2..aa671433975f3a8cd6684824793d0c9050975307 100644 (file)
@@ -20,7 +20,7 @@ localAlgo = mesh.Triangle(face)
 mesh.Segment().NumberOfSegments( 3 )
 mesh.Quadrangle()
 mesh.Prism()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # objects to copy
 fGroup = mesh.GroupOnGeom( face, "2D on face")
@@ -56,4 +56,4 @@ smallBox = geom_builder.MakeScaleAlongAxes( box, None, 1, 0.5, 0.5 )
 cutBox = geom_builder.MakeCut( box, smallBox, theName="box - smallBox" )
 
 ok, newMesh, groups, submehses, hyps, invIDs = smesh_builder.CopyMeshWithGeom( mesh, cutBox, "cutBox" )
-newMesh.Compute()
+if not newMesh.Compute(): raise Exception("Error when computing Mesh")
index 6b9006e0c619b3d47a836739dea16f9949c599fb..809d8ef6922968d293d8c1cb7da87fb142ee300d 100644 (file)
@@ -113,14 +113,18 @@ def run_test(nbox=2, boxsize=100):
     print("Starting sequential compute")
     start = time.monotonic()
     is_done = seq_mesh.Compute()
-    assert is_done
+    if not is_done:
+        raise Exception("Error when computing Mesh")
+
     stop = time.monotonic()
     time_seq = stop-start
 
     print("Starting parallel compute")
     start = time.monotonic()
     is_done = par_mesh.Compute()
-    assert is_done
+    if not is_done:
+        raise Exception("Error when computing Mesh")
+
     stop = time.monotonic()
     time_par = stop-start
 
index d28342a199ab83d274696e0daaeb0a8f9e3798ed..e0f567a2ae524c9425542050e7e8a93e3a7e2297 100644 (file)
@@ -31,4 +31,4 @@ deflection = 0.05
 mesh = smesh_builder.Mesh( shape )
 mesh.Segment().Adaptive( minSize, maxSize, deflection )
 mesh.Triangle().MaxElementArea( 300 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 734c7ea02e9b2e73926e2168ac531bb90b961cc8..48571de5fc53f37cc4c9ded8d7ddbf39fedd0144 100644 (file)
@@ -40,4 +40,4 @@ hexa.Quadrangle()
 hexa.Hexahedron()
 
 # compute the mesh
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
index 29e15745d559c539225758ceb19200f124f76d6d..b98b1a185865be12b6f2664491f76645de127fcb 100644 (file)
@@ -43,4 +43,4 @@ algo_local = hexa.Segment(e_arc)
 algo_local.Deflection1D(1.0)
 
 # compute the mesh
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
index 21be409db38a5cc06ac3d459a83f066879489d3a..56be06deee6930fb5f1d97ccf4dc74771e0af35d 100644 (file)
@@ -40,4 +40,4 @@ algo_local.StartEndLength(1, 6)
 algo_local.Propagation()
 
 # compute the mesh
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
index 043ff1e44f39b9f56ac12ae0574a45c786506570..f27cb3b4c30c7cf7575f3ad079e96a5c912d74f3 100644 (file)
@@ -40,4 +40,4 @@ algo_local.LocalLength(2.)
 algo_local.Propagation()
 
 # compute the mesh
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
index 4b2d1a75bcdd3dc543d3c516cb2340c62da312ff..e18ccebb802ea04baa3e2881a66b7472e3336a7f 100644 (file)
@@ -40,4 +40,4 @@ algo = tria_mesh.Triangle()
 algo.MaxElementArea(100)
 
 # compute the mesh
-tria_mesh.Compute()
+if not tria_mesh.Compute(): raise Exception("Error when computing Mesh")
index aa0cb45bf16ed4380f819b1359a51c4b408908d1..351dc795c5ed3d7fdf4fe9d2cf5d5f681561bd4f 100644 (file)
@@ -31,6 +31,6 @@ algo3D.MaxElementVolume(200.)
 # compute the mesh
 ret = tetra.Compute()
 if ret == 0:
-    print("problem when computing the mesh")
-else:
-    print("Computation succeeded")
+    raise Exception("problem when computing the mesh")
+
+print("Computation succeeded")
index 7295778f0b239d62f078d677f18fec99d814268c..3cc6860bc9f832c517ec7cb390f6909ef0c14cbf 100644 (file)
@@ -33,4 +33,4 @@ algo2D = tria.Triangle()
 algo2D.LengthFromEdges()
 
 # compute the mesh
-tria.Compute()
+if not tria.Compute(): raise Exception("Error when computing Mesh")
index 43d77f1c28829563b67ebd81b1c6a3c5aecf02de..d59d4430fbc6b048deedc8b1961b47c451156c31 100644 (file)
@@ -39,7 +39,7 @@ algo_local.Arithmetic1D(1, 4)
 algo_local.Propagation()
 
 # compute the mesh which contains prisms
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
 
 # create another mesh on the box
 mesh = smesh_builder.Mesh(box, "Propagation of distribution of nodes")
@@ -60,4 +60,4 @@ algo_local.Arithmetic1D(1, 4)
 algo_local.PropagationOfDistribution()
 
 # compute the mesh which contains hexahedra only
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 9646d17079a346d33d78bc6cbfadc50e0bc84b47..cb02c912ef628884e02edea54818583b97fc5f0e 100644 (file)
@@ -29,7 +29,7 @@ algo3D = hexa.Hexahedron()
 algo1D.Arithmetic1D(1, 4)
 
 # compute the mesh
-hexa.Compute()
+if not hexa.Compute(): raise Exception("Error when computing Mesh")
 
 # 2. Create a tetrahedral mesh on the box
 tetra = smesh_builder.Mesh(box, "Box : tetrahedrical mesh")
@@ -48,4 +48,4 @@ algo1D.Arithmetic1D(1, 4)
 algo2D.LengthFromEdges()
 
 # compute the mesh
-tetra.Compute()
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
index 0a1b3d85c8b230a7c3cedaf2495b7bbc8e7f75d7..92e0f1163f11b8349436987ec771288f83d79362 100644 (file)
@@ -47,7 +47,7 @@ src_mesh.Segment().NumberOfSegments(9,10)
 src_mesh.Quadrangle()
 src_mesh.Hexahedron()
 src_mesh.Triangle(f1) # triangular sub-mesh
-src_mesh.Compute()
+if not src_mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Mesh the box using projection algorithms
 
@@ -75,7 +75,7 @@ proj2D.SourceFace( f2 )
 # 3D hypotheses to project prisms from the source to the target mesh
 proj3D = tgt_mesh.Projection3D()
 proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 )
-tgt_mesh.Compute()
+if not tgt_mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Move the source mesh to visually compare the two meshes
 src_mesh.TranslateObject( src_mesh, smesh_builder.MakeDirStruct( 210, 0, 0 ), Copy=False)
index 86796723fbf8175feef5a889ee9fc03a8fd27d34..0fb36d3c65ecbf7733732f4a27cc35940738284f 100644 (file)
@@ -29,9 +29,9 @@ geom_builder.addToStudyInFather( box, Face_2, 'Face_2' )
 src_mesh = smesh_builder.Mesh(Face_1, "Source mesh")
 src_mesh.Segment().NumberOfSegments(15)
 src_mesh.Triangle()
-src_mesh.Compute()
+if not src_mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Mesh the target mesh using the algorithm Projection1D2D
 tgt_mesh = smesh_builder.Mesh(Face_2, "Target mesh")
 tgt_mesh.Projection1D2D().SourceFace(Face_1,src_mesh)
-tgt_mesh.Compute()
+if not tgt_mesh.Compute(): raise Exception("Error when computing Mesh")
index d7f9ff5b6af07b66472c127906d7e0521d04fb0e..d391b5f2141b1b6b221321607494342a24178271 100644 (file)
@@ -37,4 +37,4 @@ Mesh_1.AddHypothesis(Fixed_points_1D_1)
 Regular_1D = Mesh_1.Segment()
 Quadrangle_2D = Mesh_1.Quadrangle()
 # Compute mesh
-Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
index f1b359e5064aedc31e893b23cb9958fce92f8b18..0ef0433d81652319befe3fb10d979419e69b4cac 100644 (file)
@@ -24,7 +24,7 @@ radial_Quad_algo = mesh.Quadrangle(algo=smeshBuilder.RADIAL_QUAD)
 # The Radial Quadrange algorithm can work without any hypothesis
 # In this case it uses "Default Nb of Segments" preferences parameter to discretize edges
 # So by default there will be 15 segments in both radial and circular directions
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # The Radial Quadrange uses global or local 1d hypotheses if it does
 # not have its own hypotheses.
@@ -32,9 +32,9 @@ mesh.Compute()
 # So that there will be 5 radial layers and 10 circular segments
 global_Nb_Segments = mesh.Segment().NumberOfSegments(5)
 local_Nb_Segments  = mesh.Segment(circle).NumberOfSegments(10)
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Define own parameters of Radial Quadrange algorithm
 # The number of radial layers will be 4
 radial_Quad_algo.NumberOfLayers( 4 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index accc5879b012b2c72bd5b22baad20a490eca17ec..bc7ce0b993f590df54d637fef9fff2772e79c95d 100644 (file)
@@ -28,4 +28,4 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
 Quadrangle_2D = Mesh_1.Quadrangle().TriangleVertex( triaVertex )
 
 # Compute the mesh
-Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
index d1c7118444361880a49fd052f334af371502e66c..06ec83c1992984452ca792ab324567e49057c2ed 100644 (file)
@@ -36,8 +36,8 @@ Regular_1D_1 = Mesh_1.Segment(geom=Edge_2)
 Nb_Segments_2 = Regular_1D_1.NumberOfSegments(10)
 
 # Compute mesh (with Quadrangle Preference type)
-isDone = Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
 
 # Change type to Reduced and compute again
 Quadrangle_Parameters_1.SetQuadType( smeshBuilder.QUAD_REDUCED )
-isDone = Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
index 850bc4865e5175c48f98143c8923dc5e89e8d437..c3fb9ec5b2d7316cff21a31b6e343845b27ce67b 100644 (file)
@@ -33,7 +33,7 @@ geom_builder.addToStudyInFather( boxes[1], midFace1, "middle Face")
 srcMesh = smesh_builder.Mesh(boxes[0], "source mesh") # box coloser to CS origin
 nSeg1 = srcMesh.Segment().NumberOfSegments(4)
 srcMesh.Quadrangle()
-srcMesh.Compute()
+if not srcMesh.Compute(): raise Exception("Error when computing Mesh")
 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", SMESH.FACE )
 
 # Import faces from midFace0 to the target mesh
@@ -43,8 +43,8 @@ importAlgo = tgtMesh.UseExisting2DElements(midFace1)
 import2hyp = importAlgo.SourceFaces( [srcFaceGroup] )
 tgtMesh.Segment().NumberOfSegments(3)
 tgtMesh.Quadrangle()
-tgtMesh.Compute()
+if not tgtMesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Import the whole source mesh with groups
 import2hyp.SetCopySourceMesh(True,True)
-tgtMesh.Compute()
+if not tgtMesh.Compute(): raise Exception("Error when computing Mesh")
index 917ddd4877cb49c5819ffb9504756925e5ba83b6..9861b2ac4c138b3102054e7d2807b13b9be3b859 100644 (file)
@@ -43,7 +43,7 @@ layersHyp = algo3D.ViscousLayers(thickness,numberOfLayers,stretchFactor,
                                  ignoreFaces,           # optional
                                  groupName = groupName) # optional
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # retrieve boundary prisms created by mesh.Compute()
 boundaryGroup = mesh.GetGroupByName( layersHyp.GetGroupName() )[0]
@@ -65,7 +65,7 @@ mesh.Segment().NumberOfSegments( 5 )
 vlHyp = mesh.Triangle().ViscousLayers2D( 2, 3, 1.5,
                                          edgeIds, isEdgesToIgnore=True, # optional
                                          groupName=groupName)           # optional
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # retrieve boundary elements created by mesh.Compute()
 quadrangles = mesh.GetGroupByName( vlHyp.GetGroupName() )[0]
@@ -74,4 +74,4 @@ print( "Nb boundary quadrangles", quadrangles.Size() )
 # viscous layers will be created on 3 edges, as we pass isEdgesToIgnore=False
 vlHyp.SetEdges( edgeIds, False )
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index f2f024ffda55778a87ee31a36b88b1ae1580b743..5fca17b5b006826897e551606187b90ebd621122 100644 (file)
@@ -28,4 +28,4 @@ mesh.Hexahedron()
 # define refinement near vertices
 algo1d.LengthNearVertex( 0.2 )
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index d78f685bae2683aa41873e9cf7aef1fac2a070e1..30bf3d9e904651fa9397bb13f619fefc7d11444b 100644 (file)
@@ -15,7 +15,7 @@ face = geom_builder.MakeFaceHW(100, 100, 1, theName="quadrangle")
 mesh = smesh_builder.Mesh(face)
 mesh.Segment().NumberOfSegments(10)
 mesh.Triangle().MaxElementArea(25)
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # get all free borders
 filter = smesh_builder.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders)
index 8f27a7c186ddab3e7d0ef42e5cf717af7ec3ac75..741bfe18880d8e51fc86ac1a2c039dc51e4800d3 100644 (file)
@@ -16,7 +16,7 @@ geom_builder.addToStudy( face, "quadrangle" )
 mesh = smesh_builder.Mesh(face)
 mesh.Segment().NumberOfSegments(10)
 mesh.Triangle().MaxElementArea(25)
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # get all faces with free edges
 filter = smesh_builder.GetFilter(SMESH.FACE, SMESH.FT_FreeEdges)
index 9b9f5523ea93820fc9218b29180977d28897b59f..01b2fa468fb93c0409cddda3668d053551988e42 100644 (file)
@@ -16,7 +16,7 @@ mesh = smesh_builder.Mesh( box, "Box" )
 mesh.Segment().NumberOfSegments(10)
 mesh.Quadrangle()
 mesh.Hexahedron()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 # copy all elements with translation and Merge nodes
 mesh.TranslateObject( mesh, smesh_builder.MakeDirStruct( 10,0,0), Copy=True )
 mesh.MergeNodes( mesh.FindCoincidentNodes(1e-7) )
index 43a5af86650831d1413707156e8168dbf8663705..9d6c27c75120163a16c6411f069a2e6e2b6d8aa6 100644 (file)
@@ -16,7 +16,7 @@ mesh = smesh_builder.Mesh( box, "Box" )
 mesh.Segment().NumberOfSegments(10)
 mesh.Quadrangle()
 mesh.Hexahedron()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 # copy all elements with translation
 mesh.TranslateObject( mesh, [10,0,0], Copy=True )
 # create  a filter to find nodes equal within tolerance of 1e-5
index f5c0e7d3b5ec240560c036988561cb5147cd7f21..22369a4183d8e9f54dab9bc66083165c74a66a94 100644 (file)
@@ -16,7 +16,7 @@ mesh = smesh_builder.Mesh( box, "Box" )
 mesh.Segment().NumberOfSegments(10)
 mesh.Quadrangle()
 mesh.Hexahedron()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 # copy all elements with translation and merge nodes
 mesh.TranslateObject( mesh, [10,0,0], Copy=True )
 mesh.MergeNodes( mesh.FindCoincidentNodes( 1e-5 ))
index b66a8d0b76a1beb734db8079414f94d86d0a9d4d..587138ea01a3fe37129bb7ba958f62cb78a7cdb6 100644 (file)
@@ -34,7 +34,7 @@ v000 = geom_builder.MakeVertex( 100,100,0, theName='v000' ) # can use box sub-ve
 v001 = geom_builder.GetVertexNearPoint( box1, geom_builder.MakeVertex(100,100,100), theName='v001')
 ijkAlgo.Renumber([ smeshBuilder.BlockCS( box1, v000, v001 ) ])
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Create filters with FT_ConnectedElements criterion by pointing a domain in different ways:
 
index b632fce21976213b14b654a7b9a6076037f11404..f816da018919fd4471ea02b8732ad8397c2ffc4d 100644 (file)
@@ -44,7 +44,7 @@ Mesh_1 = smesh_builder.Mesh(Partition_1)
 Mesh_1.Segment().NumberOfSegments(15)
 Mesh_1.Triangle().LengthFromEdges()
 Mesh_1.Tetrahedron()
-Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
 
 # relevant groups of volumes and faces
 
index e3ddd4e221977276fdce699d9bb825e8d940f46c..fff4b4041e9b44f07ffa0dda1fb027588af7293a 100644 (file)
@@ -33,7 +33,7 @@ quadra.Quadrangle()
 algo1D.NumberOfSegments(7) 
 
 # compute the mesh
-quadra.Compute()
+if not quadra.Compute(): raise Exception("Error when computing Mesh")
 
 # create SMESH group on the face with name "SMESHGroup1"
 aSmeshGroup1 = quadra.GroupOnGeom(face, "SMESHGroup1")
index 2de59d734938674bd718ae84f8d5f8d904e463f6..2c592aebd1f4f7e335af14b4f6629498aa706957 100644 (file)
@@ -16,7 +16,7 @@ box = geom_builder.MakeBoxDXDYDZ(10,10,10)
 mesh = smesh_builder.Mesh(box,"Quad mesh")
 hyp1D = mesh.Segment().StartEndLength( 1, 4 )
 mesh.Quadrangle()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group on filter selecting faces of medium size
 critaria = [ \
@@ -30,7 +30,7 @@ print("Group on filter contains %s elements" % filtGroup.Size())
 # group on filter is updated if the mesh is modified
 hyp1D.SetStartLength( 2.5 )
 hyp1D.SetEndLength( 2.5 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("After mesh change, group on filter contains %s elements" % filtGroup.Size())
 
 # set a new filter defining the group
index a0c9991a8a4f314dbe21632c0bc798c97faeeb24..9e1053db2079888c78acb7c2699dabcf9f2632da 100644 (file)
@@ -27,8 +27,8 @@ mesh2 = smesh_builder.Mesh(box2, 'box2')
 mesh2.Segment().NumberOfSegments(5)
 mesh2.Triangle().MaxElementArea(20)
 
-mesh1.Compute()
-mesh2.Compute()
+if not mesh1.Compute(): raise Exception("Error when computing Mesh")
+if not mesh2.Compute(): raise Exception("Error when computing Mesh")
 
 # compute min distance from grp1 to the origin (not available yet)
 smesh_builder.MinDistance(mesh1)
index 33bffbaeaffef23e7b1c550fa6df119ee007b74a..e4d8338c67112589fd7d2b47ed883e3f95c385dd 100644 (file)
@@ -27,8 +27,8 @@ mesh2 = smesh_builder.Mesh(box2, 'box2')
 mesh2.Segment().NumberOfSegments(5)
 mesh2.Triangle().MaxElementArea(20)
 
-mesh1.Compute()
-mesh2.Compute()
+if not mesh1.Compute(): raise Exception("Error when computing Mesh")
+if not mesh2.Compute(): raise Exception("Error when computing Mesh")
 
 # compute bounding box for mesh1
 mesh1.BoundingBox()
index 44d2f6e7167cfaea84ea6c862ae810f22727d80a..77a59ee60561d5b89e5272f3abce06d0b62e7c02 100644 (file)
@@ -19,7 +19,7 @@ submesh_1d = mesh.Segment().NumberOfSegments(5)
 submesh_2d = mesh.Quadrangle()
 submesh_3d = mesh.Hexahedron()
 submesh_2d_face = mesh.Triangle(face)
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group
 
index 902ce7184424a4b54e32e367bd6e5468b1facf70..37a372e6f32db8bb74d1424d18579e985c67acf0 100644 (file)
@@ -83,4 +83,4 @@ mesh.Quadrangle(sub_face4)
 
 # finally compute whole mesh
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 69bd3f0e1e67d814397dee642fddd3c18f6bca66..0041b612c69a3e6fade050df120cefec072e2e67 100644 (file)
@@ -73,7 +73,7 @@ algo3d = tetra.Tetrahedron()
 algo3d.MaxElementVolume(100) 
 
 # Compute the mesh
-tetra.Compute() 
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
 
 # Create a mesh group of all triangles generated on geom faces present in faces_group
 group = tetra.Group(faces_group)
index 268ec12353f285f12e7e97d3ed7e69e4b5b8ea0c..4555823c838fa8982636b1c49c675eaec5e4ff55 100644 (file)
@@ -16,7 +16,7 @@ mesh = smesh_builder.Mesh(box, 'box')
 mesh.Segment().NumberOfSegments(10)
 mesh.Triangle().MaxElementArea(5)
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 print("After Compute(): %s nodes, %s faces" % ( mesh.NbNodes(), mesh.NbFaces()))
 
 # remove nodes #246 and #255
index cd058178a4ea6dc2787a35d06837a42a773ee79c..5b570e3968578d36deb7eca16e4d79ab5ea92253 100644 (file)
@@ -14,7 +14,7 @@ box = geom_builder.MakeBoxDXDYDZ(200, 200, 200)
 mesh = smesh_builder.Mesh( box )
 mesh.Segment().AutomaticLength(0.1)
 mesh.Quadrangle()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # find node at (0,0,0) which is located on a geom vertex
 node000 = None
index 673569516d9c61f25c43d4e95503679057166edd..acfb7570dd2fc2765db2d7d628826cf3f844a18d 100644 (file)
@@ -46,7 +46,7 @@ def Mesh1D(shape1d, nbSeg, name):
   algo = mesh1d_tool.Segment()
   hyp  = algo.NumberOfSegments(nbSeg)
   isDone = mesh1d_tool.Compute()
-  if not isDone: print('Mesh ', name, ': computation failed')
+  if not isDone: raise Exception('Mesh %s: computation failed' % name)
   return mesh1d_tool
 
 # Create a mesh with six nodes, seven edges and two quadrangle faces
index 39250d3a301324fbc9f2eac0e91e64b5afa1a356..b01e6be154710e395370c887c80766ac230b914a 100644 (file)
@@ -28,7 +28,7 @@ algo1D.NumberOfSegments(3)
 Mesh_1.Quadrangle()
 
 isDone = Mesh_1.Compute()
-if not isDone: print('Mesh Mesh_1 : computation failed')
+if not isDone: raise Exception('Mesh Mesh_1 : computation failed')
 
 # build a triangle mesh on Face_2
 Mesh_2 = smesh_builder.Mesh(Face_2)
@@ -39,7 +39,7 @@ algo2D = Mesh_2.Triangle()
 algo2D.MaxElementArea(240)
 
 isDone = Mesh_2.Compute()
-if not isDone: print('Mesh Mesh_2 : computation failed')
+if not isDone: raise Exception('Mesh Mesh_2 : computation failed')
 
 # create a 2d pattern
 pattern = smesh_builder.GetPattern()
@@ -60,7 +60,7 @@ Mesh_3.Segment().NumberOfSegments(1)
 Mesh_3.Quadrangle()
 Mesh_3.Hexahedron()
 isDone = Mesh_3.Compute()
-if not isDone: print('Mesh Mesh_3 : computation failed')
+if not isDone: raise Exception('Mesh Mesh_3 : computation failed')
 
 # create a 3d pattern (hexahedrons)
 pattern_hexa = smesh_builder.GetPattern()
@@ -103,7 +103,7 @@ Mesh_4.Segment().NumberOfSegments(1)
 Mesh_4.Quadrangle()
 Mesh_4.Hexahedron()
 isDone = Mesh_4.Compute()
-if not isDone: print('Mesh Mesh_4 : computation failed')
+if not isDone: raise Exception('Mesh Mesh_4 : computation failed')
 
 # create another 3d pattern (pyramids)
 pattern_pyra = smesh_builder.GetPattern()
index b837d6a9c5336fe7bf2987a517c5499efc8cef9b..1a8ea2a237d9ba9095d2f9b27027fa58cc90e4d3 100644 (file)
@@ -23,7 +23,7 @@ Mesh.Tetrahedron()
 
 # compute mesh
 
-Mesh.Compute()
+if not Mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # convert to quadratic
 # theForce3d = 1; this results in the medium node lying at the
index 8d90ad382788a53f36f0c1c09f0b8460d1138cec..9e65604ee0ab7c47c10255e35b5690a5dfa4dc07 100644 (file)
@@ -37,7 +37,7 @@ algo3D = tetra.Tetrahedron()
 algo3D.MaxElementVolume("MaxElementVolume")
 
 # compute the mesh
-ret = tetra.Compute()
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
 
 # translate the mesh
 point = SMESH.PointStruct("Offset", 0., 0.)
index 20ab781e8a69a859f29deb51b6d6b979d85c3c08..481fdad0115b37af64c4037c6634d499f6526908 100644 (file)
@@ -72,4 +72,4 @@ mesh.Segment(bigQuad).LocalLength( 3 )
 mesh.Triangle(bigQuad)
 
 # compute the mesh
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 450827bd4decb61072a9da9705e28e1a7fc868ad..669cfd8adcd3b01efd8f2dca22eb6635865ca633 100644 (file)
@@ -29,4 +29,4 @@ algo1d.NumberOfSegments( circNbSeg ) # division of circle edges
 algo2d = mesh.Quadrangle( smeshBuilder.QUAD_MA_PROJ )
 algo2d.StartEndLength( circleLen2 / circNbSeg, circleLen1 / circNbSeg ) # radial division
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 42c04a3151c1765e9686765f68f5b11d945b1a0b..e9c4074b037da86f0eba03705fefba4912901862 100644 (file)
@@ -20,7 +20,7 @@ mesh = smesh_builder.Mesh( Fuse, "Deflection_2D")
 algo = mesh.Segment()
 algo.LocalLength(35)
 algo = mesh.Triangle()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # get min and max deflection
 minMax = mesh.GetMinMax( SMESH.FT_Deflection2D )
index dda1aca12e45985e8dc47482474b89b4e4e415b6..76b8be68ce7654c496f9b89c43e8b77de9c64c4e 100644 (file)
@@ -23,7 +23,7 @@ algo = mesh.Segment()
 algo.NumberOfSegments(5)
 algo = mesh.Triangle()
 algo.MaxElementArea(20.)
-mesh.Compute() 
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # criterion : free borders
 aFilter = smesh_builder.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders)
index 3b48bf305f5ca142fdce9e3e3d0e0288cb338d70..e4c6c5213f53f2228120b43f41abdd4a357d1eca 100644 (file)
@@ -23,7 +23,7 @@ algo = mesh.Segment()
 algo.NumberOfSegments(5)
 algo = mesh.Triangle()
 algo.MaxElementArea(20.)
-mesh.Compute() 
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Criterion : Borders at multi-connection
 nb_conn = 2
index 9958d71153cef0c0d9f016d4f4aed0c434e957b8..cfe71c97b380ecfc7f83e8f6d6de29169e064ff0 100644 (file)
@@ -23,7 +23,7 @@ algo = mesh.Segment()
 algo.NumberOfSegments(5)
 algo = mesh.Triangle()
 algo.MaxElementArea(20.)
-mesh.Compute() 
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Criterion : Length > 3.
 length_margin = 3.
index 4559cb8971cf0395bcd51e434b258d11023b2e00..008ee2fbc9ca57197102638c2c5b6dc445bd10c1 100644 (file)
@@ -18,7 +18,7 @@ idbox = geom_builder.addToStudy(box, "box")
 mesh = smesh_builder.Mesh(box, "Mesh_free_nodes")
 mesh.Segment().NumberOfSegments(10)
 mesh.Triangle().MaxElementArea(150.)
-mesh.Compute() 
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Remove some elements to obtain free nodes
 # Criterion : AREA < 80.
index 7ecbc5ba3ea0971689515969da846dcbfef84336..22d6a9b100d267b638820c24d1dc6b3eb7dbfc2c 100644 (file)
@@ -42,7 +42,7 @@ Mesh_1 = smesh_builder.Mesh(Partition_1)
 Mesh_1.Segment().MaxSize(34.641)
 Mesh_1.Triangle()
 Mesh_1.Tetrahedron()
-Mesh_1.Compute()
+if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group of free faces
 aFilter = smesh_builder.GetFilter(SMESH.FACE, SMESH.FT_FreeFaces )
index ce88f377359309fd0f4bd1b4dbba1ec68699e601..5b1b695fbfeeca3fd4f83d457d9e4ffd3529b9ee 100644 (file)
@@ -16,7 +16,7 @@ geom_builder.addToStudy( box, "box" )
 mesh = smesh_builder.Mesh(box)
 mesh.Segment().NumberOfSegments(3)
 mesh.Quadrangle()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # remove 2 faces
 allFaces = mesh.GetElementsByType(SMESH.FACE)
index 1b08179f1cc25cd9fbb825d8839790242b37c60b..731b3b01fa4ad91d509eca4922f4dda929e3218b 100644 (file)
@@ -23,7 +23,7 @@ algo = mesh.Segment()
 algo.NumberOfSegments(5)
 algo = mesh.Triangle()
 algo.MaxElementArea(20.)
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Criterion : Length 2D > 5.7
 length_margin = 5.7
index a76fa3543c7c9d229b5d0687b31bd2abe6c0aae0..1e875a8ca4b2297a34f23b9aca11e172ee3e29f7 100644 (file)
@@ -23,7 +23,7 @@ algo = mesh.Segment()
 algo.NumberOfSegments(5)
 algo = mesh.Triangle()
 algo.MaxElementArea(20.)
-mesh.Compute() 
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Criterion : MULTI-CONNECTION 2D = 3
 nb_conn = 3
index a2623d8462c66d6daf68185261ab51766bdac6c3..a84ecc829301e631e14dc7aaaadc6c3484251653 100644 (file)
@@ -33,4 +33,4 @@ mesh.Projection1D2D( faces[1] ).SourceFace( faces[0] ) # projection faces[0] ->
 prism_algo.NumberOfSegments( 4, 5. )
 
 # compute the mesh
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index 90d544e364d69aa563faf8fa2c0545ef2ae7e643..a8e51ed2437effabad910fda86ccdbd9a0e418b7 100644 (file)
@@ -24,7 +24,7 @@ mesh = smesh_builder.Mesh( shape )
 mesh.Segment().NumberOfSegments(1)
 mesh.Quadrangle()
 mesh.Triangle( ff[1] )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # make group of quadrangles and extrude them into a hexahedron
 quadGroup = mesh.Group( ff[0], "quads")
index 0e250eee0269375cc9455af138478bbfb2b05eca..9f3672b636fcefa257037cdf53b70e730887259d 100644 (file)
@@ -40,7 +40,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_1)
 smeshhomard.SetRemoveLogOnSuccess(False)
 smeshhomard.SetVerboseLevel(3)
-smeshhomard.Compute()
+if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
 
 if osp.isfile(output_med_1):
   os.remove(output_med_1)
@@ -79,7 +79,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_2)
 smeshhomard.SetRemoveLogOnSuccess(True)
 smeshhomard.SetVerboseLevel(0)
-smeshhomard.Compute()
+if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
 
 if osp.isfile(output_med_2):
   print("Test Uniform refinement Case 2: Error: output med file has not been removed")
index 96139e01b9d2b34b59e4cf2e016088cf225086df..b0e12e3709ae7c840e9bcdfac862ebbf22edd905 100644 (file)
@@ -42,7 +42,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_1)
 smeshhomard.SetRemoveLogOnSuccess(False)
 smeshhomard.SetVerboseLevel(3)
-smeshhomard.Compute()
+if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
 
 if osp.isfile(output_med_1):
   os.remove(output_med_1)
@@ -85,7 +85,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_2)
 smeshhomard.SetRemoveLogOnSuccess(True)
 smeshhomard.SetVerboseLevel(0)
-smeshhomard.Compute()
+if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
 
 if osp.isfile(output_med_2):
   print("Test Uniform refinement Case 2: Error: output med file has not been removed")
index 07c8bb86abc465ef83e18469334cfb8536632659..750040b2b5dada03660428a4100f9161ad5a50d1 100644 (file)
@@ -18,7 +18,7 @@ Regular_1D = Mesh1.Segment()
 Nb_Segments_1 = Regular_1D.NumberOfSegments(3)
 Nb_Segments_1.SetDistrType( 0 )
 Quadrangle_2D = Mesh1.Quadrangle()
-isDone = Mesh1.Compute()
+if not Mesh1.Compute(): raise Exception("Error when computing Mesh")
 
 #Perform scale operation for the whole mesh and creation of a new mesh
 newMesh = Mesh1.ScaleMakeMesh(Mesh1,SMESH.PointStruct(100,100,200),[0.5,0.3,0.7],True,"ScaledMesh")
index 2600cb7347fa476bc36113324da7419e07616912..72fd27d4037fd8de971c6665206f5bcadcec8ccc 100644 (file)
@@ -40,7 +40,7 @@ algo1D.NumberOfSegments(6)
 algo2D = trias.Triangle()
 algo2D.LengthFromEdges()
 
-trias.Compute()
+if not trias.Compute(): raise Exception("Error when computing Mesh")
 
 # create a group of all triangles currently present in the mesh
 faceTriGroup = trias.Group( face1, "face triangles" )
@@ -49,7 +49,7 @@ faceTriGroup = trias.Group( face1, "face triangles" )
 circlemesh = smesh_builder.Mesh(circle, "Path mesh")
 algo = circlemesh.Segment()
 algo.NumberOfSegments(10)
-circlemesh.Compute()
+if not circlemesh.Compute(): raise Exception("Error when computing Mesh")
 
 # extrusion of the mesh
 trias.ExtrusionAlongPath([], circlemesh, circle, 1, MakeGroups=True )
index db7a6cb7cb79986ce018b7b58a996f9d64fafa62..e54dec1a37060b999ebf9bc05313a3a54d32ae1e 100644 (file)
@@ -35,7 +35,7 @@ algo_local = mesh.Segment(edge1)
 algo_local.Arithmetic1D(1, 4)
 algo_local.Propagation()
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # sew border to side
 # FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,
index 3de67b9dff5b82d977fc2149f91ef309a6c79775..50249a7e1eaf2c448b8781e43cd1ae6483adaf16 100644 (file)
@@ -35,7 +35,7 @@ algo_local = mesh.Segment(edge1)
 algo_local.Arithmetic1D(1, 4)
 algo_local.Propagation()
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # sew conform free borders
 # FirstNodeID1, SecondNodeID1, LastNodeID1, FirstNodeID2, SecondNodeID2
index 19ab5ed9514d4aad61552156cfbc9cd5671c2a13..7941b29f9257fc8a2f9279c597544689f8740aaa 100644 (file)
@@ -24,7 +24,7 @@ mesh = smesh_builder.Mesh(shape, "Two faces : quadrangle mesh")
 mesh.Segment().Arithmetic1D( 0.1, 0.4 )
 mesh.Segment(q1).NumberOfSegments( 5 )
 mesh.Quadrangle()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # sew free borders
 
index 36c2f5c22064a1180c2141f6d68d10be29764f58..317a61bb1c0b3be2c3292b5f678807cf20664c72 100644 (file)
@@ -30,7 +30,7 @@ algo_local = mesh.Segment(EdgesList[8])
 algo_local.NumberOfSegments(4)
 algo_local.Propagation()
 
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # sew side elements
 
index 5fddd3015dccbef4b624317c5ee4b662be72559b..a08d21f52b74e4df2f6c017a4ea3cb0040e26eca 100644 (file)
@@ -21,7 +21,7 @@ mesh.Quadrangle()
 mesh.Hexahedron()
 
 # Compute mesh
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Duplicate nodes only
 
index d8fade8950aa354ae54069144367c9d7ab54a57d..8ee0260b7358c8394aec39176c533a69f4a10f43 100644 (file)
@@ -25,7 +25,7 @@ mesh = smesh_builder.Mesh( shape, "test_Reorient2D")
 mesh.AutomaticHexahedralization(0.5)
 localAlgo = mesh.Segment(faces[0])
 localAlgo.NumberOfSegments( 11 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 group = mesh.Group( faces[1] )
 
 vec = geom_builder.MakeVectorDXDYDZ( 1, 1, 1 )
index 4cdb9f26ae5eeee550003934352ea3af962e6966..ef13199b69b9ada0156e22af8f2da6845c1308a7 100644 (file)
@@ -101,7 +101,7 @@ geom_builder.addToStudy( f2, "f2" )
 # compute 1D mesh
 mesh = smesh_builder.Mesh( box )
 mesh.Segment().NumberOfSegments( 5 )
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # compute 2D mesh
 mesh.Quadrangle()
@@ -109,8 +109,8 @@ mesh.UseExistingFaces(f1) # UseExistingFaces() allows using my2DMeshing();
 mesh.UseExistingFaces(f2) # assign UseExistingFaces() BEFORE calling my2DMeshing()!
 my2DMeshing(f1, mesh)
 my2DMeshing(f2, mesh)
-assert mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # compute 3D mesh
 mesh.Prism()
-assert mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
index e75f036a3159e29967eadf9d73828ebf560b2e23..ded69ba88d7ccaa8d8a261538764fa4e10b6132c 100644 (file)
@@ -32,11 +32,11 @@ Regular_1D_1_1 = tetra.Segment(geom=Face_1)
 Nb_Segments_1 = Regular_1D_1_1.NumberOfSegments(5)
 Nb_Segments_1.SetDistrType( 0 )
 Quadrangle_2D = tetra.Quadrangle(geom=Face_1)
-isDone = tetra.Compute()
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
 submesh = Regular_1D_1_1.GetSubMesh()
 
 # compute the mesh
-tetra.Compute()
+if not tetra.Compute(): raise Exception("Error when computing Mesh")
 
 # Creation of group
 group = tetra.CreateEmptyGroup( SMESH.FACE, 'Group' )
index a2f2ed17a4298b9ddc9d14d742dd264950f50b2d..ddaba327bdeb77910595b05fdf05aec4fdfcb4f5 100644 (file)
@@ -16,7 +16,7 @@ box = geom_builder.MakeBoxDXDYDZ(100,100,100)
 # Create a mesh
 mesh = smesh_builder.Mesh(box,"Mesh")
 mesh.AutomaticHexahedralization()
-mesh.Compute()
+if not mesh.Compute(): raise Exception("Error when computing Mesh")
 
 # Create a point
 x,y,z = 0, 0, 1
index 859b5c25cbe8786843e2894445cec2e47a89a78e..8d2edd7292f30d2b721ee479e907b22d5b18c939 100644 (file)
@@ -203,6 +203,8 @@ def TEST_createBoxMesh():
     Hexa_3D = smesh.CreateHypothesis('Hexa_3D')
     status = boxmesh.AddHypothesis(Hexa_3D)
     isDone = boxmesh.Compute()
+    if not isDone:
+      raise Exception("Error when computing Mesh")
 
     smesh.SetName(boxmesh.GetMesh(), 'boxmesh')
     if salome.sg.hasDesktop():
index 48ad9342f33c64735ef6ef203f9d7b10221f8d19..9c486e840ab03187df2ba091d9651ab880125dcb 100644 (file)
@@ -100,8 +100,11 @@ smesh.SetName(hypArea200, "Max. Element Area")
 
 print("---------------------Compute the mesh")
 
-ret = mesh.Compute()
-print(ret)
+isDone = mesh.Compute()
+print(isDone)
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
 
 salome.sg.updateObjBrowser()
 
index 0e29c92321364976ef1714b63b3d644174e323c1..19566aa47f8ff61c9af536f248a2c858bb525d3c 100644 (file)
@@ -76,8 +76,13 @@ hypNbSeg2 = algoReg2.NumberOfSegments(34)
 smesh.SetName(hypNbSeg2, "NumberOfSegments 2")
 
 # compute meshes
-mesh1.Compute()
-mesh2.Compute()
+isDone = mesh1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
+isDone = mesh2.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 
 # ---- udate object browser
index 8879bac61a8dbe25a41f2c53f07fe91b59734bcb..306da9a567156a2cb967b14eadfc9dca661c4abe 100644 (file)
@@ -86,8 +86,13 @@ smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2))
 
 
 # compute meshes
-mesh1.Compute()
-mesh2.Compute()
+isDone = mesh1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
+isDone = mesh2.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # ---- update object browser
 salome.sg.updateObjBrowser()
index f26a923fc4e88cfd0b40e166de44c938c39a24b5..761036aa403a1f22fd3b84a88dba43acc3b76a63 100644 (file)
@@ -29,7 +29,8 @@ def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theEl
         aName = str(theSubShape)
         geompy.addToStudyInFather(theShape,theSubShape,aName)
 
-    theMeshGen.Compute(theMesh,theShape)
+    if not theMeshGen.Compute(theMesh,theShape):
+        raise Exception("Error when computing Mesh")
 
     aFilterMgr = theMeshGen.CreateFilterManager()
     aFilter = aFilterMgr.CreateFilter()
@@ -48,7 +49,9 @@ def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType):
         aName = str(theSubShape)
         geompy.addToStudyInFather(theShape,theSubShape,aName)
 
-    theMesh.Compute()
+    if not theMesh.Compute():
+        raise Exception("Error when computing Mesh")
+
     aFilter = smesh.GetFilter(theElemType, SMESH.FT_BelongToGeom, theSubShape)
     return aFilter.GetElementsId(theMesh.GetMesh())
     
index 2592404bd880df459c117d7c07613102094bb933..b700769f85f7544edd8d0b4163a656960426f9ec 100644 (file)
@@ -73,7 +73,9 @@ algo1D_1=Mesh_inf.Segment()
 algo1D_1.NumberOfSegments(10)
 algo2D_1=Mesh_inf.Quadrangle()
 algo3D_1=Mesh_inf.Hexahedron()
-Mesh_inf.Compute()
+isDone = Mesh_inf.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # create a group on the top face
 Gsup1=Mesh_inf.Group(Fsup1, "Sup")
@@ -86,7 +88,9 @@ algo1D_2=Mesh_sup.Segment()
 algo1D_2.NumberOfSegments(5)
 algo2D_2=Mesh_sup.Quadrangle()
 algo3D_2=Mesh_sup.Hexahedron()
-Mesh_sup.Compute()
+isDone = Mesh_sup.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # create a group on the top face
 Gsup2=Mesh_sup.Group(Fsup2, "Sup")
index e4d3e281691a1a339c867d3a23a9474c4d8e8c1f..dbddea1e47bfae98950a833180f9ee8540226024 100644 (file)
@@ -28,7 +28,9 @@ from SMESH_test1 import *
 
 # Compute the mesh created in SMESH_test1
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Create geometry groups on plane:
 aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
index 7dfb236a7903fc99e66b1aaf70354b7abe9f8e9b..d980821bb54229e6dcf16c2e51a54a14594cb299 100644 (file)
@@ -34,7 +34,9 @@ from SMESH_test1 import *
 
 # Compute the mesh created in SMESH_test1
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Create geometry groups on plane:
 aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
@@ -70,7 +72,10 @@ print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
 print(" ")
 
 print("Re-compute mesh, contents of aGroupOnShell changes again:")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
 print("aGroupOnShell size =", aGroupOnShell.Size())
 print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
 
index 8af4bfa6a44b45a9c148e5f18412598ecc941e6a..06ff151317daeaa2db852daa1550ffb0f73ce8e6 100644 (file)
@@ -39,7 +39,9 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
 #Example
 from SMESH_test1 import *
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # First way
 BuildGroupLyingOn(mesh.GetMesh(), SMESH.FACE, "Group of faces lying on edge #1", edge )
index 884d7e12e760e836739beb8e58d3d19b908aa9f5..0d56b7b42c646e837c7a806f5b5f8f4d1670bd52 100644 (file)
@@ -147,7 +147,9 @@ smesh.SetName(hVolume, "MaxElementVolume_"+str(theMaxElementVolume))
 
 
 print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 print("Information about the Nut:")
 print("Number of nodes       : ", mesh.NbNodes())
index 81c0db42de8807f39bc5c1aa79f9b9c3ccc4ae08..c1921fc1cc8dba6d5260573582c8ca745290901e 100644 (file)
@@ -169,19 +169,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
 
 print("-------------------------- compute the mesh of alveole ")
 ret = mesh.Compute()
-
-if ret != 0:
-    log=mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the Mesh_mechanic:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of triangles   : ", mesh.NbTriangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
-    print("problem when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the Mesh_mechanic:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of triangles   : ", mesh.NbTriangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index b61ecc2c60749a8e8a9f39b6a152bdba3d1224ae..42cad67393db64bfc0c87904a26da23d5ef76aea 100644 (file)
@@ -116,6 +116,8 @@ algo = my_hexa.Segment()
 algo.NumberOfSegments(NbSeg)
 my_hexa.Quadrangle()
 my_hexa.Hexahedron()
-my_hexa.Compute()
+isDone = my_hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 salome.sg.updateObjBrowser()
index a681a7503a130071dad4bc32ac28278ac8dccc15..8b988656635601420ccdf4aea3567d057cbda30d 100644 (file)
@@ -68,6 +68,8 @@ alg3D.SetName("algo3D")
 
 # compute mesh
 
-box_mesh.Compute()
+isDone = box_mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 sg.updateObjBrowser()
index 1a1ac3a7adf5836a955196966fe806201a93b042..d39cd101438ad99f3e5ca2d4db2ff526478f99a0 100644 (file)
@@ -124,18 +124,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
 print("-------------------------- compute shell")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the MeshBox2:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of triangles   : ", mesh.NbTriangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
-    print("probleme when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the MeshBox2:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of triangles   : ", mesh.NbTriangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index 696adefc7cebdaf8bc2d6b0e3f574ac8fe084ab1..bc665aaf817d1c0ed56a37ecf865dfe85e93c214 100644 (file)
@@ -134,18 +134,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
 print("-------------------------- compute shell")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the MeshBox3:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of triangles   : ", mesh.NbTriangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
-    print("probleme when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the MeshBox3:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of triangles   : ", mesh.NbTriangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index 6174766aa76b81b1011f1dce13f232ab2ef83368..2eab3d2271bcf581142c4a25528727f07d215f02 100644 (file)
@@ -93,18 +93,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
 print("-------------------------- compute the mesh of the box")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the MeshBox:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of triangles   : ", mesh.NbTriangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
-    print("probleme when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the MeshBox:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of triangles   : ", mesh.NbTriangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index e24cafbde4a13e564ac6713e6067785a06a2fe0a..d701478ffadedc36d78aeaf4a14f827600ec129c 100644 (file)
@@ -73,6 +73,8 @@ top_1 = Mesh_1.GroupOnGeom(top,'top',SMESH.FACE)
 middle_1 = Mesh_1.GroupOnGeom(middle,'middle',SMESH.FACE)
 bottom_1 = Mesh_1.GroupOnGeom(bottom,'bottom',SMESH.FACE)
 isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 [ top_1, middle_1, bottom_1 ] = Mesh_1.GetGroups()
 
index 28bc26a4fa8fb60196c79bb95bfa637700d0b91d..fce3c252afe0b981debab0c0e77aaa45cdea1d4e 100644 (file)
@@ -83,6 +83,8 @@ algo3d = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_3D)
 algo3d.MaxElementVolume(0.0002)
 
 isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Create groups
 d_geom_groups = {}
index a05a5bf9d715ce7fd464ccdb9dd338f57593d006..3973405a493130edd4dcd28c5526e8b295986a61 100644 (file)
@@ -180,21 +180,20 @@ salome.sg.updateObjBrowser()
 
 print("-------------------------- compute the mesh of the volume")
 
-ret=mesh.Compute()
-
+ret = mesh.Compute()
 print(ret)
-if ret != 0:
-##    log=mesh.GetLog(0) # no erase trace
-##    for linelog in log:
-##        print linelog
-    print("Information about the MeshBox :")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of triangles   : ", mesh.NbTriangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
-    print("problem when Computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+##log=mesh.GetLog(0) # no erase trace
+##for linelog in log:
+##    print linelog
+print("Information about the MeshBox :")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of triangles   : ", mesh.NbTriangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index 70736bff851d329943d8617683b44c897c24511a..e0ebe778cc9a1841c38b7a7094ed5e2fefed8e94 100644 (file)
@@ -85,18 +85,18 @@ hexa3D.SetName("Hexa_3D")
 print("-------------------------- compute compshell")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the MeshcompShel:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of quadrangles : ", mesh.NbQuadrangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of hexahedrons : ", mesh.NbHexas())
-else:
-    print("problem when Computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the MeshcompShel:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of quadrangles : ", mesh.NbQuadrangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of hexahedrons : ", mesh.NbHexas())
 
 salome.sg.updateObjBrowser()
index 0da15f6db56eea46374ea0c03cb369829a929a2b..ed3f3f4ad324dbfaf382a49354e8c1fc20f9c9af 100644 (file)
@@ -64,16 +64,15 @@ netgen.SetFineness( smeshBuilder.Fine )
 print("-------------------------- compute mesh")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    print("Information about the MeshcompShel:")
-    print("Number of nodes        : ", mesh.GetMesh().NbNodes())
-    print("Number of edges        : ", mesh.GetMesh().NbEdges())
-    print("Number of faces        : ", mesh.GetMesh().NbFaces())
-    print("Number of triangles    : ", mesh.GetMesh().NbTriangles())
-    print("Number of volumes      : ", mesh.GetMesh().NbVolumes())
-    print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
-    
-else:
-    print("problem when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+print("Information about the MeshcompShel:")
+print("Number of nodes        : ", mesh.GetMesh().NbNodes())
+print("Number of edges        : ", mesh.GetMesh().NbEdges())
+print("Number of faces        : ", mesh.GetMesh().NbFaces())
+print("Number of triangles    : ", mesh.GetMesh().NbTriangles())
+print("Number of volumes      : ", mesh.GetMesh().NbVolumes())
+print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
 
 salome.sg.updateObjBrowser()
index 15d2f7755bf87a8b5f4016e94679cbaf67985451..21187f67fa17dacff642425deba8459b7cc84921 100644 (file)
@@ -96,19 +96,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
 print("-------------------------- compute compshell")
 ret = mesh.Compute(mesh)
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the MeshcompShel:")
-    print("Number of nodes        : ", mesh.NbNodes())
-    print("Number of edges        : ", mesh.NbEdges())
-    print("Number of faces        : ", mesh.NbFaces())
-    print("Number of triangles    : ", mesh.NbTriangles())
-    print("Number of volumes      : ", mesh.NbVolumes())
-    print("Number of tetrahedrons : ", mesh.NbTetras())
-    
-else:
-    print("problem when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the MeshcompShel:")
+print("Number of nodes        : ", mesh.NbNodes())
+print("Number of edges        : ", mesh.NbEdges())
+print("Number of faces        : ", mesh.NbFaces())
+print("Number of triangles    : ", mesh.NbTriangles())
+print("Number of volumes      : ", mesh.NbVolumes())
+print("Number of tetrahedrons : ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index e0762fc75b5bad2cc8e8f264983cf46117e9d6e0..8ccafed36bee0df0fab8d77a0f7fab4a703abd26 100644 (file)
@@ -94,17 +94,17 @@ smesh.SetName(hypLengthFromEdge,"LengthFromEdge")
 print("-------------------------- compute the skin flight")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    log = mesh.GetLog(0) # no erase trace
-    # for linelog in log:
-    #     print(linelog)
-    print("Information about the Mesh_mechanic_tetra:")
-    print("Number of nodes      : ", mesh.NbNodes())
-    print("Number of edges      : ", mesh.NbEdges())
-    print("Number of faces      : ", mesh.NbFaces())
-    print("Number of triangles  : ", mesh.NbTriangles())
-    print("Number of volumes    : ", mesh.NbVolumes())
-else:
-    print("probleme when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+#     print(linelog)
+print("Information about the Mesh_mechanic_tetra:")
+print("Number of nodes      : ", mesh.NbNodes())
+print("Number of edges      : ", mesh.NbEdges())
+print("Number of faces      : ", mesh.NbFaces())
+print("Number of triangles  : ", mesh.NbTriangles())
+print("Number of volumes    : ", mesh.NbVolumes())
 
 salome.sg.updateObjBrowser()
index 90e2f1226258b345e208623dcdc732d433d079f4..bee8167c260be54c8975248beec55ae88da51e7e 100644 (file)
@@ -59,8 +59,9 @@ algoMef = mesh.Triangle()
 hypArea = algoMef.MaxElementArea(20)
 
 
-mesh.Compute()
-
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Criterion : Free edges. Create group.
 
index d3141cdd38010eff3c27b8990f4a333966d03b69..929242d3af5a5fffc50839575c6144ab058e28da 100644 (file)
@@ -87,15 +87,15 @@ for edges in edgeGroups: # loop on groups of logically parallel edges
 # ---- compute mesh
 print("-------------------------- compute mesh")
 ok = mesh.Compute()
-if ok:
-    print("Information about the Mesh:")
-    print("Number of nodes       : ", mesh.NbNodes())
-    print("Number of edges       : ", mesh.NbEdges())
-    print("Number of faces       : ", mesh.NbFaces())
-    print("Number of quadrangles : ", mesh.NbQuadrangles())
-    print("Number of volumes     : ", mesh.NbVolumes())
-    print("Number of hexahedrons : ", mesh.NbHexas())
-else:
-    print("problem when Computing the mesh")
+if not ok:
+    raise Exception("Error when computing Mesh")
+
+print("Information about the Mesh:")
+print("Number of nodes       : ", mesh.NbNodes())
+print("Number of edges       : ", mesh.NbEdges())
+print("Number of faces       : ", mesh.NbFaces())
+print("Number of quadrangles : ", mesh.NbQuadrangles())
+print("Number of volumes     : ", mesh.NbVolumes())
+print("Number of hexahedrons : ", mesh.NbHexas())
 
 salome.sg.updateObjBrowser()
index ec7be0498f9459b0bd270039cad2a981417904fc..584a6c6912f6066a4303ff3748a5de7c98477378 100644 (file)
@@ -177,7 +177,9 @@ smesh.SetName(algo.GetSubMesh(), "SubMeshFace4")
 
 print("-------------------------- compute the mesh of the mechanic piece")
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 print("Information about the Mesh_mechanic:")
 print("Number of nodes       : ", mesh.NbNodes())
index d1c4abedc55abb133b6db55c2d3dfa7027ff1f40..a82694b61480405bbefbfdee5c60f4548124a25e 100644 (file)
@@ -181,7 +181,9 @@ submesh4 = algo.GetSubMesh()
 
 print("-------------------------- compute the mesh of the mechanic piece")
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 print("Information about the Mesh_mechanic:")
 print("Number of nodes       : ", mesh.NbNodes())
index 918fa118a2b6e2bfa1b0158c822d72eb6f860c46..7a0365a303492e15b0f64f7927e1716615d20f72 100644 (file)
@@ -122,17 +122,16 @@ netgen.SetQuadAllowed( 1 )
 print("-------------------------- compute mesh")
 ret = mesh.Compute()
 print(ret)
-if ret != 0:
-    print("Information about the MeshcompShel:")
-    print("Number of nodes        : ", mesh.NbNodes())
-    print("Number of edges        : ", mesh.NbEdges())
-    print("Number of faces        : ", mesh.NbFaces())
-    print("Number of triangles    : ", mesh.NbTriangles())
-    print("Number of quadrangles  : ", mesh.NbQuadrangles())
-    print("Number of volumes      : ", mesh.NbVolumes())
-    print("Number of tetrahedrons : ", mesh.NbTetras())
-    
-else:
-    print("problem when computing the mesh")
+if not ret:
+    raise Exception("Error when computing Mesh")
+
+print("Information about the MeshcompShel:")
+print("Number of nodes        : ", mesh.NbNodes())
+print("Number of edges        : ", mesh.NbEdges())
+print("Number of faces        : ", mesh.NbFaces())
+print("Number of triangles    : ", mesh.NbTriangles())
+print("Number of quadrangles  : ", mesh.NbQuadrangles())
+print("Number of volumes      : ", mesh.NbVolumes())
+print("Number of tetrahedrons : ", mesh.NbTetras())
 
 salome.sg.updateObjBrowser()
index d7b88ddfd2835cff39ec8a236f27efd668f651d5..902cb7139a7b1d499d87c9124decc20e02dba391 100644 (file)
@@ -147,7 +147,9 @@ smesh.SetName(hypVolume, "maxElementVolume_" + str(maxElementVolume))
 
 
 print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 print("Information about the Mesh_mechanic_tetra:")
 print("Number of nodes       : ", mesh.NbNodes())
index bf71253cce52f2a682f95429a07ad1a2126c8021..059663e3c3fa1f491e8d5f851ac6538aaf038aaf 100644 (file)
@@ -94,6 +94,9 @@ face = salome.IDToObject(idf)
 
 ret = mesh.Compute(face)
 print(ret)
+if not ret:
+    raise Exception("Error when computing Mesh")
+
 log = [] #mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after
 for a in log:
     print("-------")
index eda63d90f6c30dbe2dd0a266017f1a896f13edc2..a5cd78a61a689cd75154ccfa800018b78f97d03f 100644 (file)
@@ -109,7 +109,9 @@ print(hypArea2.GetId())
 print(hypArea2.GetMaxElementArea())
 smesh.SetName(hypArea2, "MaxElementArea_500")
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 salome.sg.updateObjBrowser()
 
index 1bc3d99b68f99d43a0559d3dd720884f969c8824..55fde9e8e07864b3fe2c0385bea6a821a57499fd 100644 (file)
@@ -31,6 +31,9 @@ from SMESH_test1 import *
 print("-------------------------- compute box")
 ret = mesh.Compute()
 print(ret)
+if not ret:
+    raise Exception("Error when computing Mesh")
+
 log = mesh.GetLog(0); # no erase trace
 # for linelog in log:
 #     print(linelog)
index c97b20ddbeb0fcfc89aa64f005c3d8a9b633cba0..b0396714257a0137415dc496c11cf60af9439c35 100644 (file)
@@ -66,7 +66,9 @@ algo4.MaxElementArea(100)
 submesh = algo4.GetSubMesh()
 smesh.SetName(submesh, "SubMeshFace")
 
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 faces = submesh.GetElementsByType(SMESH.FACE)
 if len(faces) > 1:
index 9626ff9ebeaf1e65970140dfb59864cd2cf93985..c9084f8aacd2079c109df4627c8707c0aebb2c4d 100644 (file)
@@ -44,7 +44,8 @@ smesh.SetEnablePublish( True ) # Set to False to avoid publish in study if not n
 Mesh_1 = smesh.Mesh(Box_1)
 NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
 isDone = Mesh_1.Compute()
-
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 ## Set names of Mesh objects
 smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
index 54594a19448632239395f27a33a4a813f212de79..16a7a679594e109f63182c224746429083bc4205 100644 (file)
@@ -64,7 +64,8 @@ NETGEN_3D_Parameters_1.SetFuseEdges( 1 )
 NETGEN_3D_Parameters_1.SetQuadAllowed( 0 )
 NETGEN_3D_Parameters_1.SetCheckChartBoundary( 152 )
 isDone = Mesh_1.Compute()
-
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 ## Set names of Mesh objects
 smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
index f900b96c2f26e1f1a0277fc77edd2cc67d8656a0..8b2727d94df92de9416bdf7313ab292a8a030602 100644 (file)
@@ -76,6 +76,8 @@ class SMESHExportOfFieldsInMemory(unittest.TestCase):
     Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
     Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
     isDone = Mesh_1.Compute()
+    if not isDone:
+      raise Exception("Error when computing Mesh")
     smesh.SetName(Mesh_1, 'Mesh_1')
 
     #### Mesh_1.ExportMED( r'Mesh_with_one_field_on_cells.med', 0, 41, 1, Mesh_1.GetMesh(), 1, [ Field_1_1 ], '',-1 )
@@ -165,6 +167,8 @@ class SMESHExportOfFieldsInMemory(unittest.TestCase):
     Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
     Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
     isDone = Mesh_1.Compute()
+    if not isDone:
+      raise Exception("Error when computing Mesh")
     smesh.SetName(Mesh_1, 'Mesh_1')
 
     # 23th of june 2021 : Bug both in ExportMED and in ExportMEDCoupling
index 7a28ea7b28b11efd7e95403d6a8addf8b4bc9bf1..ae85b6147c3fb50f29ca5dda989ab238c1939379 100644 (file)
@@ -174,6 +174,8 @@ def createMesh(algo):
   algo_1d_sub.Propagation()
 
   isDone = Mesh_1.Compute()
+  if not isDone:
+    raise Exception("Error when computing Mesh")
 
   nb_nodes = Mesh_1.NbNodes()
   # Create 2 cracks by two calls of DoubleNodeElemGroups
index 44fe5a9d5cd116e43bdfc01fc06edd7dbc1ea818..033be24e2c5f61f8c63187b16631766fbf762a94 100644 (file)
@@ -318,7 +318,9 @@ algo.Propagation()
 # Compute the mesh
 # ----------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 9344c246214bf26d6f2de8a789d371cc980f916c..dc9becc086669f9f9c417f2071782d3fa8d62200 100644 (file)
@@ -120,7 +120,9 @@ hexa.Hexahedron()
 # Compute the mesh
 # ----------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 109644f7a349086b9819187d6214d499e294e79d..eb89f55749abfb3e22c21fac58ee613f51285bd5 100644 (file)
@@ -107,7 +107,9 @@ hexa.Hexahedron()
 # Compute the mesh
 # ----------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 9c6a0219b159348a1db66fb67d8939550dab3f54..145b952ae1b3397a6b19dd5ee916996e35b8dba8 100644 (file)
@@ -112,7 +112,9 @@ localMesh(box_tetra2, 0)
 # Mesh calculus
 # -------------
 
-mixed.Compute()
+isDone = mixed.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 8b577eb93267b247b117a7ecc6f14ba2b2fdf954..3a740f29f01e66ce214399c15052aae21d8d748d 100644 (file)
@@ -147,7 +147,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 3bc2de2bd8c7494ca1a1ecf3f91a4622bde8a7c8..0450b65b8034e5a607f24bd00c2d87c0a6fb6eda 100644 (file)
@@ -164,7 +164,9 @@ algo4.Propagation()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 53da036ac85fa044c93ed1c1c7fb15d09333ba06..0620281131727f7defc81afe3edda3084529d6b9 100644 (file)
@@ -104,7 +104,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index f9582e2278a7555474ce644f5fea5ffff2636e4f..81bb03a7ef0c32eaabf56d7e5aaf99e1f9656203 100644 (file)
@@ -137,7 +137,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 1754c13d6457aa4cfcda55e7e2dc08cc4a7e7e6b..f79919cbeede1125387df77518e54a011d74d4eb 100644 (file)
@@ -140,7 +140,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index a242628943012ff8016abbab25d100f842f82a9a..6b258074ceb718f225b9766e81511d0fab7f3f5b 100644 (file)
@@ -102,7 +102,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 15775a8f1a1f177538a6b52f52a3bd16776300bb..4de0dfea472e78bead74d49316da20b688debcf1 100644 (file)
@@ -123,7 +123,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 3d4b67b66ca2b08a0712b369ac82adb77153252e..fb940d59bfe3fd2ed9fc0b5528452f2cbad4314d 100644 (file)
@@ -143,7 +143,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 t3= time.time()
 
index 19361cea2c0c746364a03eaff4517cdc27d6e7d0..81efeea9dad3b6143544fc3544f6610f3d2aa474 100644 (file)
@@ -256,7 +256,9 @@ local(cyl_x+d, cyl_y+d, box_dz, 10)
 # Compute the mesh
 # ----------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index da5b52d1208cf7b7abf6f316d1c517bb33ac66b0..dd52befcf6693dc710950c6fd023a8001dba2c83 100644 (file)
@@ -141,7 +141,9 @@ while m_i<m_n:
 # Calculer le maillage
 # --------------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 12953cfb281400ed7e9674db117d2740fb62f6de..6444b5debc4eeed3f6ac3485c91ff88d41aeeda4 100644 (file)
@@ -200,7 +200,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 341712dc1c3aa384e73e377c06be06fb0fbe9bd4..230fd30faf939f86c22f35f4770f8f780b926e4f 100644 (file)
@@ -144,7 +144,9 @@ local(gx+g_dx, gy-g_dy, gz     , 21)
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index b45076fb4ef162a6203fd690ffd1a4560110ceed..5409e5a25276b182089c40fe328bb44876d01e5b 100644 (file)
@@ -103,7 +103,10 @@ hexa.Hexahedron()
 # Calcul du maillage
 # ------------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
 # Update object browser
 # ---------------------
 
index dc84ea8816dc6b4c94f1930d313e846e307fc10b..26837bfab0c4fd5adaf6be39f2a702d10c96ee39 100644 (file)
@@ -140,7 +140,9 @@ hexa.Hexahedron()
 # Calcul du maillage
 # ------------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Update object browser
 # ---------------------
index 91bb1155aed582756474f66ef20785f036f390b3..a393fab76449e6666a0fe6d6bfd91facaf74e5c6 100644 (file)
@@ -180,7 +180,9 @@ hexa.Hexahedron()
 # Mesh calculus
 # -------------
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Le groupe de mailles
 # --------------------
index a0e42bed01adc7b16fa99f9984d1f17c59b8bea8..8541d2ee6b220198ab728519faf61064d993ba6c 100644 (file)
@@ -126,7 +126,9 @@ algo3d.MaxElementVolume(100)
 # Compute the mesh
 # ----------------
 
-tetra.Compute()
+isDone = tetra.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # Create a groupe of faces
 # ------------------------
index 2946be21f918b4b226aa10e8da70de32d2187dab..bd45eb3362c8b6ebb768b8a23ab7b291ea1e68ee 100644 (file)
@@ -125,7 +125,9 @@ discretize(        +radius,       0, height/2,  20)
 hexa.Quadrangle()
 hexa.Hexahedron()
 
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 hexa.Group(group_a)
 hexa.Group(group_b)
index 6624489980a982c5acf9c964ce09477fd7da21ef..d6148a15a9341b1199efb5529c9c9ec1d47594ef 100644 (file)
@@ -170,7 +170,9 @@ refine(MyMesh, P2, P3, 12, 14, "Haut"  )
 algo2D = MyMesh.Triangle()
 algo2D.MaxElementArea(0.07)
 
-MyMesh.Compute()
+isDone = MyMesh.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 MyMesh.ExportMED(path+"110_triangles.med", 0)
 
index db186bca3381ab90c51cbed4862fc908622d1311..7667ed34395b69a4b3bf73aae16fc1dc74f7ac32 100644 (file)
@@ -42,6 +42,8 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
 Nb_Segments_1.SetDistrType( 0 )
 Quadrangle_2D = Mesh_1.Quadrangle()
 isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # groups creation
 
index 658458855b63c8ff77933edbe76d027e7dd38566..f8723b3e1c7faeb22cdb9e4d34ee32830dae02d4 100644 (file)
@@ -81,6 +81,8 @@ algo3d.SetKeepFiles(False)
 # --------------
 
 status = m.Compute()
+if not status:
+    raise Exception("Error when computing Mesh")
 
 # Test if ok
 # ----------
index 9556189608adda72e9d7633aa47471223faf487c..8a92f546489675cc18f3234adad824e275c29bb2 100644 (file)
@@ -42,6 +42,8 @@ Nb_Segments_1.SetDistrType( 0 )
 Quadrangle_2D = Mesh_1.Quadrangle()
 Hexa_3D = Mesh_1.Hexahedron()
 isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 ### CreateDimGroup()
 
index e73b71fb73be58bd5c0d8f58524254d87aab9d3b..a7fb6a7e7dcf9f6c6ed55ee3146da0414154c036 100644 (file)
@@ -18,7 +18,9 @@ smesh = smeshBuilder.New()
 Mesh_1 = smesh.Mesh( Box_1 )
 Mesh_1.Segment().NumberOfSegments(15)
 Mesh_1.Triangle()
-Mesh_1.Compute()
+isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
 
 # define arguments for MakePolyLine
 
index fb50008a9c958f83b87525ca186e9d1665a73dc6..51d043abc8027f6dd93fec4888d4840d188bf707 100644 (file)
@@ -33,6 +33,9 @@ Regular_1D = Mesh_1.Segment()
 Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
 Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
 isDone = Mesh_1.Compute()
+if not isDone:
+    raise Exception("Error when computing Mesh")
+
 aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
 isDone = Mesh_1.QuadToTriObject( Mesh_1,  )
 Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 1 )
index 76ec09d8ba5d38abc0a455469a466357a42e8942..4f0ffbd6569260fc37369f0752c7f64e0963065c 100644 (file)
@@ -70,8 +70,10 @@ def test_netgen3d():
     mesh_2d = smesh.Mesh(groupe_1, 'Maillage_1')
     mesh_2d.AddHypothesis(groupe_1, netgen_2d_parameters_1)
     mesh_2d.Triangle(algo=smeshBuilder.NETGEN_1D2D)
-    is_done = mesh_2d.Compute()
-    assert is_done
+    isDone = mesh_2d.Compute()
+    if not isDone:
+        raise Exception("Error when computing Mesh")
+
     smesh.SetName(mesh_2d, 'Maillage_1')
 
     with tempfile.TemporaryDirectory() as tmp_dir:
index f26bfd718759063c3b49e08ce3e04ef01bcff588..e48141e80c936489026446705da203a0549b08c7 100644 (file)
@@ -105,7 +105,6 @@ PolygonPerFace_2D = Mesh_1.Polygon()
 PolyhedronPerSolid_3D = Mesh_1.Polyhedron()
 
 ok = Mesh_1.Compute()
-
 if not ok:
   raise Exception("Error when computing Mesh")