Salome HOME
Fix Compute for Homard assert_compute 2/head
authorFrederic Pons <frederic.pons@opencascade.com>
Wed, 5 Apr 2023 16:11:36 +0000 (18:11 +0200)
committerFrederic Pons <frederic.pons@opencascade.com>
Wed, 5 Apr 2023 16:11:36 +0000 (18:11 +0200)
doc/examples/test_homard_adapt.py
doc/examples/test_uniform_refinement.py
test/ex30_tepal.py [deleted file]
test/tests.set

index 9f3672b636fcefa257037cdf53b70e730887259d..0c1d88fe7f1791381a8f6bff854e76f59b794d8c 100644 (file)
@@ -40,7 +40,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_1)
 smeshhomard.SetRemoveLogOnSuccess(False)
 smeshhomard.SetVerboseLevel(3)
-if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
+if smeshhomard.Compute() != 0: 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)
-if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
+if smeshhomard.Compute() != 0: 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 b0e12e3709ae7c840e9bcdfac862ebbf22edd905..1b362b0e88c9fcb19b134e2ff8a381a90f9bb201 100644 (file)
@@ -42,7 +42,7 @@ smeshhomard.SetLogInFile(True)
 smeshhomard.SetLogFile(log_file_1)
 smeshhomard.SetRemoveLogOnSuccess(False)
 smeshhomard.SetVerboseLevel(3)
-if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
+if smeshhomard.Compute() != 0: 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)
-if not smeshhomard.Compute(): raise Exception("Error when computing Mesh")
+if smeshhomard.Compute() != 0: 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")
diff --git a/test/ex30_tepal.py b/test/ex30_tepal.py
deleted file mode 100644 (file)
index f8723b3..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# ====================================================================
-#
-import os
-
-import salome
-salome.salome_init()
-import GEOM
-from salome.geom import geomBuilder
-geompy = geomBuilder.New()
-
-import SMESH, SALOMEDS
-from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New()
-
-# Parameters
-# ----------
-
-results = "/tmp/ZZ"
-
-radius =  50
-height = 200
-
-# Build a cylinder
-# ----------------
-
-base = geompy.MakeVertex(0, 0, 0)
-direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
-
-cylinder = geompy.MakeCylinder(base, direction, radius, height)
-
-geompy.addToStudy(cylinder, "Cylinder")
-
-# Define a mesh on a geometry
-# ---------------------------
-
-smesh.UpdateStudy()
-
-m = smesh.Mesh(cylinder)
-
-# 2D mesh with BLSURF
-# -------------------
-
-algo2d = m.Triangle(smeshBuilder.BLSURF)
-
-algo2d.SetPhysicalMesh(1)
-algo2d.SetPhySize(5)
-
-algo2d.SetGeometricMesh(0)
-
-# 3D mesh with tepal
-# ------------------
-
-algo3d = m.Tetrahedron(smeshBuilder.GHS3DPRL)
-
-algo3d.SetMEDName(results)
-algo3d.SetNbPart(4)
-algo3d.SetBackground(False)
-algo3d.SetKeepFiles(False)
-
-# Launch meshers
-# --------------
-
-status = m.Compute()
-if not status:
-    raise Exception("Error when computing Mesh")
-
-# Test if ok
-# ----------
-
-if os.access(results+".xml", os.F_OK):
-    print("Ok: tepal")
-else:
-    print("KO: tepal")
-
-# Update object browser
-# ---------------------
-
-salome.sg.updateObjBrowser()
index 9eecbe094d7c21e4ffdb9b93910708c2843b4a36..a3f3b0a0088bbadf711cf6dff683b7c26fc85963 100644 (file)
@@ -67,7 +67,6 @@ SET(BAD_TESTS
   )
 IF(NOT WIN32)
   LIST(APPEND BAD_TESTS
-    ex30_tepal.py
     test_smeshplugin_mg_tetra_parallele.py
   )
 ENDIF(NOT WIN32)