Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/smesh
authorrnv <rnv@opencascade.com>
Wed, 26 May 2021 13:32:53 +0000 (16:32 +0300)
committerrnv <rnv@opencascade.com>
Wed, 26 May 2021 13:32:53 +0000 (16:32 +0300)
105 files changed:
CMakeLists.txt
doc/salome/examples/basic_geom_smesh_without_session.py
doc/salome/examples/blocFissure_01_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_02_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_03_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_04_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_05_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_06_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_07_without_session.py [new file with mode: 0755]
doc/salome/examples/blocFissure_without_session.py [deleted file]
doc/salome/examples/tests.set
idl/SMESH_Mesh.idl
src/DriverMED/CMakeLists.txt
src/DriverMED/DriverMED_Family.cxx
src/DriverMED/DriverMED_Family.h
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.h
src/MEDWrapper/CMakeLists.txt
src/MEDWrapper/MED_Factory.cxx
src/MEDWrapper/MED_Factory.hxx
src/MEDWrapper/MED_TFile.hxx [new file with mode: 0644]
src/MEDWrapper/MED_Wrapper.cxx
src/MEDWrapper/MED_Wrapper.hxx
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESHClient/CMakeLists.txt
src/SMESHGUI/CMakeLists.txt
src/SMESHGUI/SMESH_msg_fr.ts
src/SMESH_I/CMakeLists.txt
src/SMESH_I/SMESH_Component_Generator.cxx
src/SMESH_I/SMESH_Gen_No_Session_i.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Gen_i.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx
src/SMESH_SWIG/smeshBuilder.py
src/StdMeshers/CMakeLists.txt
src/StdMeshersGUI/CMakeLists.txt
src/StdMeshers_I/CMakeLists.txt
src/Tools/blocFissure/CasTests/CMakeLists.txt
src/Tools/blocFissure/CasTests/blocFissureTest.py [new file with mode: 0644]
src/Tools/blocFissure/CasTests/cubeAngle2.py [deleted file]
src/Tools/blocFissure/CasTests/cubeAngle_2.py [new file with mode: 0644]
src/Tools/blocFissure/CasTests/cylindre_2.py
src/Tools/blocFissure/CasTests/disquePerce.py
src/Tools/blocFissure/CasTests/ellipse_1.py
src/Tools/blocFissure/CasTests/ellipse_2.py
src/Tools/blocFissure/CasTests/execution_Cas.py [deleted file]
src/Tools/blocFissure/doc/conf.py.in
src/Tools/blocFissure/doc/images/01_CubeAngle_2.png [deleted file]
src/Tools/blocFissure/doc/images/01_CubeAngle_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/02_CubeAngle2.png [deleted file]
src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png [deleted file]
src/Tools/blocFissure/doc/images/02_CubeAngle_2.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/02_CubeAngle_2_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/03_cylindre_2.png [deleted file]
src/Tools/blocFissure/doc/images/03_cylindre_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/04_cylindre2.png [deleted file]
src/Tools/blocFissure/doc/images/04_cylindre2_2.png [deleted file]
src/Tools/blocFissure/doc/images/04_cylindre_2.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/04_cylindre_2_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/05_disque_2.png [deleted file]
src/Tools/blocFissure/doc/images/05_disque_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/06_ellipse1.png [deleted file]
src/Tools/blocFissure/doc/images/06_ellipse1_2.png [deleted file]
src/Tools/blocFissure/doc/images/06_ellipse_1.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/06_ellipse_1_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/07_ellipse2.png [deleted file]
src/Tools/blocFissure/doc/images/07_ellipse2_2.png [deleted file]
src/Tools/blocFissure/doc/images/07_ellipse_2.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/07_ellipse_2_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png [deleted file]
src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png [deleted file]
src/Tools/blocFissure/doc/images/09_eprouvetteDroite_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png [deleted file]
src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png [deleted file]
src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/12_faceGauche2.png [deleted file]
src/Tools/blocFissure/doc/images/12_faceGauche2_2.png [deleted file]
src/Tools/blocFissure/doc/images/12_faceGauche_2.png [new file with mode: 0644]
src/Tools/blocFissure/doc/images/12_faceGauche_2_a.png [new file with mode: 0644]
src/Tools/blocFissure/doc/scripts.rst
src/Tools/blocFissure/doc/testcases.rst
src/Tools/blocFissure/gmu/construitFissureGenerale.py
src/Tools/blocFissure/gmu/construitFissureGenerale_b.py
src/Tools/blocFissure/gmu/fissureGenerique.py
src/Tools/blocFissure/gmu/identifieEdgesPeau.py
src/Tools/blocFissure/gmu/identifieEdgesPeau_a.py
src/Tools/blocFissure/gmu/identifieEdgesPeau_b.py
src/Tools/blocFissure/gmu/identifieEdgesPeau_c.py
src/Tools/blocFissure/gmu/identifieElementsGeometriquesPeau.py
src/Tools/blocFissure/gmu/mailleFacesFissure.py
src/Tools/blocFissure/gmu/mailleFacesPeau.py
src/Tools/blocFissure/materielCasTests/CMakeLists.txt
src/Tools/blocFissure/materielCasTests/cubeAngle.py
src/Tools/blocFissure/materielCasTests/disquePerce.py [new file with mode: 0644]
src/Tools/blocFissure/materielCasTests/disque_perce.py [deleted file]
src/Tools/blocFissure/materielCasTests/ellipse.py
src/Tools/blocFissure/materielCasTests/ellipse_probleme.py
src/Tools/blocFissure/materielCasTests/fissureGauche2.py [deleted file]
src/Tools/blocFissure/materielCasTests/fissureGauche_2.py [new file with mode: 0644]
src/Tools/blocFissure/materielCasTests/genereMateriel.py
src/Tools/padder/meshjob/impl/CMakeLists.txt

index b322f2b40a6b65a1655099941dfc96e39133a5e0..68f91de510b77107886c7ab6d347c460f391ac3e 100644 (file)
@@ -27,7 +27,7 @@ INCLUDE(CMakeDependentOption)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 6)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index d10a23ceee2f9f0c49060fbc80c8a3354058ee78..9626ff9ebeaf1e65970140dfb59864cd2cf93985 100644 (file)
@@ -50,4 +50,13 @@ isDone = Mesh_1.Compute()
 smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
 smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
 
-assert(Mesh_1.GetMesh().NbTetras()>=5)
+nbOfTetraExp = 5
+
+assert(Mesh_1.GetMesh().NbTetras()>=nbOfTetraExp)
+
+#Mesh_1.ExportMED("toto.med")
+
+import medcoupling as mc
+
+mv_mm = Mesh_1.ExportMEDCoupling()
+assert(mc.MEDCoupling1SGTUMesh(mv_mm[0]).getNumberOfCells()>=nbOfTetraExp)
diff --git a/doc/salome/examples/blocFissure_01_without_session.py b/doc/salome/examples/blocFissure_01_without_session.py
new file mode 100755 (executable)
index 0000000..fcdda32
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. cubeAngle
+. cubeFin
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["cubeAngle", "cubeAngle_2","cubeCoin", "cubeMilieu", "cubeTransverse"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_02_without_session.py b/doc/salome/examples/blocFissure_02_without_session.py
new file mode 100755 (executable)
index 0000000..72700e3
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. decoupeCylindre
+. disque_perce
+. fissureGauche
+. fissureGauche_2
++ ellipse, ellipse_disque, ellipse_probleme
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["cylindre", "cylindre_2", "disquePerce", "faceGauche","ellipse_1", "ellipse_2"])
+#BLOCFISSURE_TEST = blocFissureTest(["cylindre", "cylindre_2", "disquePerce", "faceGauche","ellipse_1", "ellipse_2", "faceGauche_2"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_03_without_session.py b/doc/salome/examples/blocFissure_03_without_session.py
new file mode 100755 (executable)
index 0000000..a6f730c
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. eprouvetteCourbe
+. eprouvetteDroite
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["eprouvetteCourbe", "eprouvetteDroite", "eprouvetteDroite_2"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_04_without_session.py b/doc/salome/examples/blocFissure_04_without_session.py
new file mode 100755 (executable)
index 0000000..e535f76
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissureCoude_1", "fissureCoude_2", "fissureCoude_3", "fissureCoude_4", "fissureCoude_5"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_05_without_session.py b/doc/salome/examples/blocFissure_05_without_session.py
new file mode 100755 (executable)
index 0000000..16e4bb3
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissureCoude_6", "fissureCoude_7", "fissureCoude_8", "fissureCoude_9", "fissureCoude_10"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_06_without_session.py b/doc/salome/examples/blocFissure_06_without_session.py
new file mode 100755 (executable)
index 0000000..185f5d7
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sans matériels (1/3)
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.03"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["fissure_Coude", "fissure_Coude_4"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_07_without_session.py b/doc/salome/examples/blocFissure_07_without_session.py
new file mode 100755 (executable)
index 0000000..87ff982
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""Tests de blocFissure ; en standalone
+
+Cas tests basés sur les matériels :
+. vis
+. tube
+
+Copyright 2021 EDF
+Gérald NICOLAS
++33.1.78.19.43.52
+"""
+
+__revision__ = "V02.04"
+
+import os
+import sys
+
+# Lancement des cas-tests
+import salome
+salome.standalone()
+salome.salome_init()
+
+from blocFissure.CasTests.blocFissureTest import blocFissureTest
+BLOCFISSURE_TEST = blocFissureTest(["vis_1"])
+#BLOCFISSURE_TEST = blocFissureTest(["vis_1", "tube"])
+MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
+#sys.stdout.write(MESSAGE_ERREUR)
+del BLOCFISSURE_TEST
+
+# Diagnostic
+if MESSAGE_ERREUR:
+  if ( "NOOK" in MESSAGE_ERREUR ):
+    LAUX = MESSAGE_ERREUR.split()
+    ERREUR = int(LAUX[LAUX.index("NOOK")+2])
+  else:
+    ERREUR = 0
+else:
+  MESSAGE_ERREUR = "Impossible de trouver le diagnostic de la procédure de tests."
+  ERREUR = -1
+
+if ERREUR:
+  sys.stderr.write(MESSAGE_ERREUR)
+  #raise Exception(MESSAGE_ERREUR)
+  assert(False)
+
diff --git a/doc/salome/examples/blocFissure_without_session.py b/doc/salome/examples/blocFissure_without_session.py
deleted file mode 100644 (file)
index 0be55d4..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-"""Tests de blocFissure ; en standalone
-
-Copyright 2021 EDF
-Gérald NICOLAS
-+33.1.78.19.43.52
-"""
-
-__revision__ = "V02.01"
-
-import os
-import tempfile
-import sys
-
-# Fichier de diagnostic
-LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
-if os.path.isfile(LOGFILE):
-  os.remove(LOGFILE)
-
-# Lancement des cas-tests
-import salome
-salome.standalone()
-salome.salome_init()
-
-from blocFissure.materielCasTests import genereMateriel
-
-from blocFissure.CasTests import execution_Cas
-
-# Diagnostic
-ERREUR = 0
-if os.path.isfile(LOGFILE):
-  with open(LOGFILE, 'r') as FICHIER:
-    LES_LIGNES = FICHIER.readlines()
-  for LIGNE in LES_LIGNES:
-    #print (LIGNE[:-1])
-    if ( "NOOK" in LIGNE ):
-      MESSAGE_ERREUR = LIGNE
-      ERREUR = int(LIGNE.split()[-1])
-      break
-else:
-  MESSAGE_ERREUR = "Impossible de trouver le fichier de diagnostic {}".format(LOGFILE)
-  ERREUR = -1
-
-if ERREUR:
-  sys.stderr.write(MESSAGE_ERREUR)
-  #raise Exception(MESSAGE_ERREUR)
-  assert(False)
index 99000efd5da74fcf70d5e214b0cdc72860330fee..e0293d38831b0d752ae6fc4023751f1aeca0c5ff 100644 (file)
@@ -46,7 +46,13 @@ SET(BAD_TESTS
   test_smeshplugin_mg_tetra_parallele.py
   test_smeshplugins.py
   MGAdaptTests_without_session.py
-  blocFissure_without_session.py
+  blocFissure_01_without_session.py
+  blocFissure_02_without_session.py
+  blocFissure_03_without_session.py
+  blocFissure_04_without_session.py
+  blocFissure_05_without_session.py
+  blocFissure_06_without_session.py
+  blocFissure_07_without_session.py
   )
 
 SET(GOOD_TESTS
index 2ff478b0a6b190c3a963ea10c192a06366740065..070732b256ef4964e578997e2beedae3de9aac2e 100644 (file)
@@ -663,6 +663,10 @@ module SMESH
                    in boolean     overwrite,
                    in boolean     autoDimension) raises (SALOME::SALOME_Exception);
 
+    long long ExportMEDCoupling(in boolean     auto_groups,
+      in boolean     autoDimension
+    ) raises (SALOME::SALOME_Exception);
+
     /*!
      * Export a [part of] Mesh into a MED file
      * @params
@@ -701,6 +705,13 @@ module SMESH
                           in string             geomAssocFields,
                           in double             ZTolerance) raises (SALOME::SALOME_Exception);
 
+    long long ExportPartToMEDCoupling( in SMESH_IDSource     meshPart,
+                          in boolean            auto_groups,
+                          in boolean            autoDimension,
+                          in GEOM::ListOfFields fields,
+                          in string             geomAssocFields,
+                          in double             ZTolerance) raises (SALOME::SALOME_Exception);
+
     /*!
      * Export Mesh to SAUV formatted file
      * Write a temporary med file and use med2sauv
index a1dcd1a49adc28bbb114be1fa6da8057c11fe042..2186564d45256601f4aebb2eddf98595b732cd2a 100644 (file)
@@ -20,6 +20,7 @@
 # --- options ---
 # additional include directories
 INCLUDE_DIRECTORIES(
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${MEDFILE_INCLUDE_DIRS}
   ${HDF5_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
index 2acd6a826050c797a5c0d11c4fe97272b7423bbd..f5b00968a0d58c314b0d8302c44722b74798b91e 100644 (file)
@@ -26,7 +26,6 @@
 //  Module : SMESH
 //
 #include "DriverMED_Family.h"
-#include "MED_Factory.hxx"
 
 #include <sstream>      
 
@@ -366,67 +365,6 @@ DriverMED_Family
   return aFamilies;
 }
 
-//=============================================================================
-/*!
- *  Create TFamilyInfo for this family
- */
-//=============================================================================
-MED::PFamilyInfo
-DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, 
-                                const MED::PMeshInfo& theMeshInfo) const
-{
-  ostringstream aStr;
-  aStr << "FAM_" << myId;
-  set<string>::const_iterator aGrIter = myGroupNames.begin();
-  for(; aGrIter != myGroupNames.end(); aGrIter++){
-    aStr << "_" << *aGrIter;
-  }
-  string aValue = aStr.str();
-  // PAL19785,0019867 - med forbids whitespace to be the last char in the name
-  int maxSize = MED::GetNOMLength();
-  int lastCharPos = min( maxSize, (int) aValue.size() ) - 1;
-  while ( isspace( aValue[ lastCharPos ] ))
-    aValue.resize( lastCharPos-- );
-
-  MED::PFamilyInfo anInfo;
-  if(myId == 0 || myGroupAttributVal == 0){
-    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
-                                      aValue,
-                                      myId,
-                                      myGroupNames);
-  }else{
-    MED::TStringVector anAttrDescs (1, "");  // 1 attribute with empty description,
-    MED::TIntVector anAttrIds (1, myId);        // Id=0,
-    MED::TIntVector anAttrVals (1, myGroupAttributVal);
-    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
-                                      aValue,
-                                      myId,
-                                      myGroupNames,
-                                      anAttrDescs,
-                                      anAttrIds,
-                                      anAttrVals);
-  }
-
-//  cout << endl;
-//  cout << "Groups: ";
-//  set<string>::iterator aGrIter = myGroupNames.begin();
-//  for (; aGrIter != myGroupNames.end(); aGrIter++)
-//  {
-//    cout << " " << *aGrIter;
-//  }
-//  cout << endl;
-//
-//  cout << "Elements: ";
-//  set<const SMDS_MeshElement *>::iterator anIter = myElements.begin();
-//  for (; anIter != myElements.end(); anIter++)
-//  {
-//    cout << " " << (*anIter)->GetID();
-//  }
-//  cout << endl;
-
-  return anInfo;
-}
-
 //=============================================================================
 /*!
  *  Initialize the tool by SMESHDS_GroupBase
index d102b87a9ffa791080f1876de566e1f7e87e2512..bdbf843013546ae7804e20ca10646eff994ebafc 100644 (file)
@@ -91,9 +91,10 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
                 const bool doAllInGroups);
 
   //! Create TFamilyInfo for this family
+  template<class LowLevelWriter>
   MED::PFamilyInfo 
-  GetFamilyInfo (const MED::PWrapper& theWrapper, 
-                 const MED::PMeshInfo& theMeshInfo) const;
+  GetFamilyInfo(const LowLevelWriter& theWrapper, 
+                const MED::PMeshInfo& theMeshInfo) const;
 
   //! Returns elements of this family
   const ElementsSet& GetElements () const;
@@ -154,4 +155,70 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
   ElemTypeSet         myTypes; // Issue 0020576
 };
 
+#include "MED_Factory.hxx"
+
+#include <set>
+#include <string>
+//=============================================================================
+/*!
+ *  Create TFamilyInfo for this family
+ */
+//=============================================================================
+template<class LowLevelWriter>
+MED::PFamilyInfo
+DriverMED_Family::GetFamilyInfo(const LowLevelWriter& theWrapper, 
+                                const MED::PMeshInfo& theMeshInfo) const
+{
+  std::ostringstream aStr;
+  aStr << "FAM_" << myId;
+  std::set<std::string>::const_iterator aGrIter = myGroupNames.begin();
+  for(; aGrIter != myGroupNames.end(); aGrIter++){
+    aStr << "_" << *aGrIter;
+  }
+  std::string aValue = aStr.str();
+  // PAL19785,0019867 - med forbids whitespace to be the last char in the name
+  int maxSize = MED::GetNOMLength();
+  int lastCharPos = std::min( maxSize, (int) aValue.size() ) - 1;
+  while ( isspace( aValue[ lastCharPos ] ))
+    aValue.resize( lastCharPos-- );
+
+  MED::PFamilyInfo anInfo;
+  if(myId == 0 || myGroupAttributVal == 0){
+    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+                                      aValue,
+                                      myId,
+                                      myGroupNames);
+  }else{
+    MED::TStringVector anAttrDescs (1, "");  // 1 attribute with empty description,
+    MED::TIntVector anAttrIds (1, myId);        // Id=0,
+    MED::TIntVector anAttrVals (1, myGroupAttributVal);
+    anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
+                                      aValue,
+                                      myId,
+                                      myGroupNames,
+                                      anAttrDescs,
+                                      anAttrIds,
+                                      anAttrVals);
+  }
+
+//  cout << endl;
+//  cout << "Groups: ";
+//  set<string>::iterator aGrIter = myGroupNames.begin();
+//  for (; aGrIter != myGroupNames.end(); aGrIter++)
+//  {
+//    cout << " " << *aGrIter;
+//  }
+//  cout << endl;
+//
+//  cout << "Elements: ";
+//  set<const SMDS_MeshElement *>::iterator anIter = myElements.begin();
+//  for (; anIter != myElements.end(); anIter++)
+//  {
+//    cout << " " << (*anIter)->GetID();
+//  }
+//  cout << endl;
+
+  return anInfo;
+}
+
 #endif
index b0d98d2c32c3263529502975c9c892518c4910fe..4581568136b65b1b39964c5c897a3ac7f484cfef 100644 (file)
@@ -35,6 +35,7 @@
 #include "SMDS_SetIterator.hxx"
 #include "SMESHDS_Mesh.hxx"
 #include "MED_Common.hxx"
+#include "MED_TFile.hxx"
 
 #include <med.h>
 
@@ -343,13 +344,43 @@ namespace
   }
 }
 
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
+{
+  MED::PWrapper myMed = CrWrapperW(myFile, myVersion);
+  return this->PerformInternal<MED::PWrapper>(myMed);
+}
+
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh_Mem::Perform()
+{
+  void *ptr(nullptr);
+  std::size_t sz(0);
+  Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
+  bool isClosed(false);
+  TMemFile *tfileInst = nullptr;
+  {// let braces to flush (call of MED::PWrapper myMed destructor)
+    tfileInst = new TMemFile(&isClosed);
+    MED::PWrapper myMed = CrWrapperW(myFile, -1, tfileInst);
+    status = this->PerformInternal<MED::PWrapper>(myMed);
+  }
+  if(tfileInst)
+  {
+    ptr = tfileInst->getData(); sz = tfileInst->getSize();
+  }
+  _data = MEDCoupling::DataArrayByte::New();
+  _data->useArray(reinterpret_cast<char *>(ptr),true,MEDCoupling::DeallocType::C_DEALLOC,sz,1);
+  if(!isClosed)
+    THROW_SALOME_EXCEPTION("DriverMED_W_SMESHDS_Mesh_Mem::Perform - MED memory file id is supposed to be closed !");
+  return status;
+}
+
 //================================================================================
 /*!
  * \brief Write my mesh
  */
 //================================================================================
 
-Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
+template<class LowLevelWriter>
+Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::PerformInternal(LowLevelWriter myMed)
 {
   Status aResult = DRS_OK;
   try {
@@ -471,7 +502,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
       }
     }
 
-    MED::PWrapper myMed = CrWrapperW(myFile, myVersion);
     PMeshInfo aMeshInfo = myMed->CrMeshInfo(aMeshDimension,aSpaceDimension,aMeshName);
     //MESSAGE("Add - aMeshName : "<<aMeshName<<"; "<<aMeshInfo->GetName());
     myMed->SetMeshInfo(aMeshInfo);
@@ -532,7 +562,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
     list<DriverMED_FamilyPtr>::iterator aFamsIter;
     for (aFamsIter = aFamilies.begin(); aFamsIter != aFamilies.end(); aFamsIter++)
     {
-      PFamilyInfo aFamilyInfo = (*aFamsIter)->GetFamilyInfo(myMed,aMeshInfo);
+      PFamilyInfo aFamilyInfo = (*aFamsIter)->GetFamilyInfo<LowLevelWriter>(myMed,aMeshInfo);
       myMed->SetFamilyInfo(aFamilyInfo);
     }
 
index 96196aa752ef36e3e9a38877120d1f92eee9a523..e9f9d172c2964c59fc8d6be7e373876af65a4979 100644 (file)
@@ -74,7 +74,10 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
 
   /*! add one mesh
    */
-  virtual Status Perform();
+  Status Perform() override;
+
+  template<class LowLevelWriter>
+  Driver_Mesh::Status PerformInternal(LowLevelWriter myMed);
 
  private:
 
@@ -94,4 +97,15 @@ class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
   double myZTolerance;
 };
 
+#include "MEDCouplingMemArray.hxx"
+
+class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh_Mem : public DriverMED_W_SMESHDS_Mesh
+{
+public:
+  Status Perform() override;
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() { return _data; }
+private:
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _data;
+};
+
 #endif
index 7c3478e240988d768e17e8496a58b88f0ca457b3..2e8a32fb61edc5b561ad49033fdff5385429ae0d 100644 (file)
@@ -24,6 +24,7 @@ INCLUDE_DIRECTORIES(
   ${HDF5_INCLUDE_DIRS}
   ${MEDFILE_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
+  ${MEDCOUPLING_INCLUDE_DIRS}
 )
 
 # additional preprocessor / compiler flags
@@ -37,6 +38,7 @@ SET(_link_LIBRARIES
   ${HDF5_LIBS}
   ${MEDFILE_C_LIBRARIES}
   ${KERNEL_SALOMELocalTrace}
+  ${MEDCoupling_medloader}
 )
 
 # --- headers ---
index e8c145f8ca66f7bdae91658de313f04e1b855498..7d03749e6fe53c9854ce4e04395cf0901813cf18 100644 (file)
@@ -183,10 +183,10 @@ namespace MED
     if (!CheckCompatibility(fileName)) {
       EXCEPTION(std::runtime_error, "Cannot open file '"<<fileName<<"'.");
     }
-    return new MED::TWrapper(fileName, false);
+    return new MED::TWrapper(fileName, false, nullptr);
   }
 
-  PWrapper CrWrapperW(const std::string& fileName, int theVersion)
+  PWrapper CrWrapperW(const std::string& fileName, int theVersion, TFileInternal *tfileInst)
   {
     bool isCreated = false;
     if (!CheckCompatibility(fileName, true))
@@ -204,6 +204,6 @@ namespace MED
       wantedMajor = theVersion/10;
       wantedMinor = theVersion%10;
     }
-    return new MED::TWrapper(fileName, true, wantedMajor, wantedMinor);
+    return new MED::TWrapper(fileName, true, tfileInst, wantedMajor, wantedMinor);
   }
 }
index 6a8c7345475d38a377cbf7d37a43818ad118b29b..0a2e4efce3e5a78fad9a513bf8be1e4214c525a9 100644 (file)
@@ -47,7 +47,7 @@ namespace MED
   PWrapper CrWrapperR( const std::string& );
 
   MEDWRAPPER_EXPORT
-  PWrapper CrWrapperW( const std::string&, int theVersion=-1 );
+  PWrapper CrWrapperW( const std::string&, int theVersion=-1 , TFileInternal *tfileInst=nullptr );
 }
 
 #endif // MED_Factory_HeaderFile
diff --git a/src/MEDWrapper/MED_TFile.hxx b/src/MEDWrapper/MED_TFile.hxx
new file mode 100644 (file)
index 0000000..10dc553
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D
+//
+// 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
+//
+
+#pragma once
+
+#include "MED_Wrapper.hxx"
+
+namespace MED
+{
+  class TFileInternal
+  {
+  public:
+    virtual ~TFileInternal() = default;
+    virtual void Open(EModeAcces theMode, TErr* theErr = nullptr) = 0;
+    virtual void Close() = 0;
+    virtual const TIdt& Id() const = 0;
+  };
+
+  class MEDIDTHoder : public TFileInternal
+  {
+  protected:
+    MEDIDTHoder(bool *isClosedStatus = nullptr):_isClosedStatus(isClosedStatus) { }
+    void UnRefFid()
+    {
+      if (--myCount == 0)
+      {
+        MEDfileClose(myFid);
+        myIsClosed = true;
+        if(_isClosedStatus)
+          *_isClosedStatus = true;
+      }
+    }
+  public:
+    const TIdt& Id() const override;
+    ~MEDIDTHoder() { this->UnRefFid(); }
+    void Close() override { this->UnRefFid(); }
+  protected:
+    TInt myCount = 0;
+    TIdt myFid = 0;
+    bool myIsClosed = false;
+    bool *_isClosedStatus = nullptr;
+  };
+
+  class TFileDecorator : public TFileInternal
+  {
+  public:
+    TFileDecorator(TFileInternal *effective):_effective(effective) { }
+    void Open(EModeAcces theMode, TErr* theErr = nullptr) override { if(_effective) _effective->Open(theMode,theErr); }
+    void Close() override { if(_effective) _effective->Close(); }
+    const TIdt& Id() const override { if(_effective) return _effective->Id(); EXCEPTION(std::runtime_error, "TFileDecorator - GetFid() : no effective TFile !"); }
+    ~TFileDecorator() { delete _effective; }
+  private:
+    TFileInternal *_effective = nullptr;
+  };
+
+  class TMemFile : public MEDIDTHoder
+  {
+  public:
+    TMemFile(bool* isClosedStatus = nullptr):MEDIDTHoder(isClosedStatus) { }
+    void Open(EModeAcces theMode, TErr* theErr = nullptr) override;
+    void *getData() const { return memfile.app_image_ptr; }
+    std::size_t getSize() const { return memfile.app_image_size; }
+  private:
+    med_memfile memfile = MED_MEMFILE_INIT;
+  };
+
+  class TFile : public MEDIDTHoder
+  {
+  public:
+    TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1);
+    void Open(EModeAcces theMode, TErr* theErr = nullptr) override;
+  protected:
+    std::string myFileName;
+    TInt myMajor;
+    TInt myMinor;
+  };
+}
index f4a7fc45831ef77928260a5112154d39d0a0a658..4d0f992714aa6140a2198f0178c0de2d824a0363 100644 (file)
@@ -23,7 +23,9 @@
 #include "MED_Wrapper.hxx"
 #include "MED_TStructures.hxx"
 #include "MED_Utilities.hxx"
+#include "MED_TFile.hxx"
 
+#include "MEDFileUtilities.hxx"
 #include <med.h>
 #include <med_err.h>
 #include <med_proto.h>
@@ -76,90 +78,75 @@ namespace MED
   }
 
   //---------------------------------------------------------------
-  class TFile
+  const TIdt& MEDIDTHoder::Id() const
   {
-    TFile();
-    TFile(const TFile&);
+    if (myFid < 0)
+      EXCEPTION(std::runtime_error, "TFile - GetFid() < 0");
+    return myFid;
+  }
 
-  public:
-    TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1):
-      myCount(0),
-      myFid(0),
-      myFileName(theFileName),
-      myMajor(theMajor),
-      myMinor(theMinor)
+  void TMemFile::Open(EModeAcces theMode, TErr* theErr)
+  {
+    if (this->myCount++ == 0)
     {
-      if ((myMajor < 0) || (myMajor > MED_MAJOR_NUM)) myMajor = MED_MAJOR_NUM;
-      if ((myMinor < 0) || (myMajor == MED_MAJOR_NUM && myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
+      std::string dftFileName = MEDCoupling::MEDFileWritableStandAlone::GenerateUniqueDftFileNameInMem();
+      memfile = MED_MEMFILE_INIT;
+      memfile.app_image_ptr=0;
+      memfile.app_image_size=0;
+      myFid = MEDmemFileOpen(dftFileName.c_str(),&memfile,MED_FALSE,MED_ACC_CREAT);
     }
+    if (theErr)
+      *theErr = TErr(myFid);
+    else if (myFid < 0)
+      EXCEPTION(std::runtime_error,"TMemFile - MEDmemFileOpen");
+  }
 
-    ~TFile()
-    {
-      Close();
-    }
+  TFile::TFile(const std::string& theFileName, TInt theMajor, TInt theMinor):
+    myFileName(theFileName),
+    myMajor(theMajor),
+    myMinor(theMinor)
+  {
+    if ((myMajor < 0) || (myMajor > MED_MAJOR_NUM)) myMajor = MED_MAJOR_NUM;
+    if ((myMinor < 0) || (myMajor == MED_MAJOR_NUM && myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
+  }
 
-    void
-    Open(EModeAcces theMode,
-         TErr* theErr = NULL)
-    {
-      if (myCount++ == 0) {
-        const char* aFileName = myFileName.c_str();
+  void TFile::Open(EModeAcces theMode, TErr* theErr)
+  {
+    if (myCount++ == 0) {
+      const char* aFileName = myFileName.c_str();
 #ifdef WIN32
-        if (med_access_mode(theMode) == MED_ACC_RDWR) {
-          // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
-          std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
+      if (med_access_mode(theMode) == MED_ACC_RDWR) {
+        // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
+        std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
 #ifdef UNICODE
-          const char* to_decode = aReadOlnyRmCmd.c_str();
-          int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
-          wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
-          MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
-          awReadOlnyRmCmd[size_needed] = '\0';
-          _wsystem(awReadOlnyRmCmd);
-          delete[] awReadOlnyRmCmd;
+        const char* to_decode = aReadOlnyRmCmd.c_str();
+        int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
+        wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
+        MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
+        awReadOlnyRmCmd[size_needed] = '\0';
+        _wsystem(awReadOlnyRmCmd);
+        delete[] awReadOlnyRmCmd;
 #else
-          system(aReadOlnyRmCmd.c_str());
-#endif
-        }
+        system(aReadOlnyRmCmd.c_str());
 #endif
-        myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
       }
-      if (theErr)
-        *theErr = TErr(myFid);
-      else if (myFid < 0)
-        EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< myMajor <<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
-    }
-
-    const TIdt&
-    Id() const
-    {
-      if (myFid < 0)
-        EXCEPTION(std::runtime_error, "TFile - GetFid() < 0");
-      return myFid;
-    }
-
-    void
-    Close()
-    {
-      if (--myCount == 0)
-        MEDfileClose(myFid);
+#endif
+      myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
     }
-
-  protected:
-    TInt myCount;
-    TIdt myFid;
-    std::string myFileName;
-    TInt myMajor;
-    TInt myMinor;
-  };
+    if (theErr)
+      *theErr = TErr(myFid);
+    else if (myFid < 0)
+      EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< myMajor <<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
+  }
 
   //---------------------------------------------------------------
   class TFileWrapper
   {
-    PFile myFile;
+    PFileInternal myFile;
     TInt myMinor;
 
   public:
-    TFileWrapper(const PFile& theFile,
+    TFileWrapper(const PFileInternal& theFile,
                  EModeAcces theMode,
                  TErr* theErr = NULL,
                  TInt theMinor=-1):
@@ -211,11 +198,15 @@ namespace MED
 
   //---------------------------------------------------------------
   TWrapper
-  ::TWrapper(const std::string& theFileName, bool write, TInt theMajor, TInt theMinor):
-    myFile(new TFile(theFileName, theMajor, theMinor)),
+  ::TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst, TInt theMajor, TInt theMinor):
     myMajor(theMajor),
     myMinor(theMinor)
   {
+    if(!tfileInst)
+      myFile.reset(new TFile(theFileName, theMajor, theMinor) );
+    else
+      myFile.reset(new TFileDecorator(tfileInst) );
+    
     TErr aRet;
     if ( write ) {
       myFile->Open(eLECTURE_ECRITURE, &aRet);
index bc73c9dd997921069e5101b42606248faf6e806c..ddd3a159b9209f2c98febc0f44980b64451aafca 100644 (file)
@@ -32,8 +32,8 @@
 namespace MED
 {
   //----------------------------------------------------------------------------
-  class TFile;
-  typedef boost::shared_ptr<TFile> PFile;
+  class TFileInternal;
+  typedef std::shared_ptr<TFileInternal> PFileInternal;
 
   typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
 
@@ -52,7 +52,7 @@ namespace MED
     TWrapper& operator=(const TWrapper&);
 
   public:
-    TWrapper(const std::string& theFileName, bool write, TInt theMajor=-1, TInt theVersion=-1);
+    TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst = nullptr, TInt theMajor=-1, TInt theVersion=-1);
 
     virtual
     ~TWrapper();
@@ -938,7 +938,7 @@ namespace MED
                     TErr* theErr = NULL);
 
   protected:
-    PFile myFile;
+    PFileInternal myFile;
     TInt myMajor;
     TInt myMinor;
   };
@@ -963,23 +963,23 @@ namespace MED
   //----------------------------------------------------------------------------
   //! Specialization of SharedPtr for TWrapper
   template<>
-  class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public boost::shared_ptr<TWrapper>
+  class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public std::shared_ptr<TWrapper>
   {
   public:
     SharedPtr() {}
 
     SharedPtr(TWrapper* p):
-      boost::shared_ptr<TWrapper>(p)
+      std::shared_ptr<TWrapper>(p)
     {}
 
     template<class Y>
     explicit SharedPtr(Y* p):
-      boost::shared_ptr<TWrapper>(p)
+      std::shared_ptr<TWrapper>(p)
     {}
 
     template<class Y>
     SharedPtr(const SharedPtr<Y>& r):
-      boost::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
+      std::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
     {}
 
     template<class Y>
@@ -1021,7 +1021,7 @@ namespace MED
     TWrapper*
     get() const // never throws
     {
-      return boost::shared_ptr<TWrapper>::get();
+      return std::shared_ptr<TWrapper>::get();
     }
   };
 }
index 315bf6544e97f85fdb4fc7f7b70fa1cfc1331340..d21330b4e83e5ca0544c0935cbbf91a5301a964c 100644 (file)
@@ -1392,48 +1392,17 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
   return false;
 }
 
-//================================================================================
-/*!
- * \brief Export the mesh to a med file
- *  \param [in] file - name of the MED file
- *  \param [in] theMeshName - name of this mesh
- *  \param [in] theAutoGroups - boolean parameter for creating/not creating
- *              the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
- *              the typical use is auto_groups=false.
- *  \param [in] theVersion - define the minor (xy, where version is x.y.z) of MED file format.
- *              If theVersion is equal to -1, the minor version is not changed (default).
- *  \param [in] meshPart - mesh data to export
- *  \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
- *              - 1D if all mesh nodes lie on OX coordinate axis, or
- *              - 2D if all mesh nodes lie on XOY coordinate plane, or
- *              - 3D in the rest cases.
- *              If \a theAutoDimension is \c false, the space dimension is always 3.
- *  \param [in] theAddODOnVertices - to create 0D elements on all vertices
- *  \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
- *  \param [in] ZTolerance - tolerance in Z direction. If Z coordinate of a node is close to zero
- *              within a given tolerance, the coordinate is set to zero.
- *              If \a ZTolerance is negative, the node coordinates are kept as is.
- *  \return int - mesh index in the file
- */
-//================================================================================
-
-void SMESH_Mesh::ExportMED(const char *        file,
+void SMESH_Mesh::ExportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
                            const char*         theMeshName,
                            bool                theAutoGroups,
-                           int                 theVersion,
                            const SMESHDS_Mesh* meshPart,
                            bool                theAutoDimension,
                            bool                theAddODOnVertices,
                            double              theZTolerance,
                            bool                theAllElemsToGroup)
 {
-  MESSAGE("MED_VERSION:"<< theVersion);
-
-  Driver_Mesh::Status status;
+  Driver_Mesh::Status status = Driver_Mesh::DRS_OK;
   SMESH_TRY;
-
-  DriverMED_W_SMESHDS_Mesh myWriter;
-  myWriter.SetFile         ( file , theVersion);
   myWriter.SetMesh         ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS   );
   myWriter.SetAutoDimension( theAutoDimension );
   myWriter.AddODOnVertices ( theAddODOnVertices );
@@ -1492,6 +1461,64 @@ void SMESH_Mesh::ExportMED(const char *        file,
     throw TooLargeForExport("MED");
 }
 
+/*!
+ * Same as SMESH_Mesh::ExportMED except for \a file and \a theVersion
+ */
+MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> SMESH_Mesh::ExportMEDCoupling(
+                           const char*         theMeshName,
+                           bool                theAutoGroups,
+                           const SMESHDS_Mesh* meshPart,
+                           bool                theAutoDimension,
+                           bool                theAddODOnVertices,
+                           double              theZTolerance,
+                           bool                theAllElemsToGroup)
+{
+  DriverMED_W_SMESHDS_Mesh_Mem myWriter;
+  this->ExportMEDCommmon(myWriter,theMeshName,theAutoGroups,meshPart,theAutoDimension,theAddODOnVertices,theZTolerance,theAllElemsToGroup);
+  return myWriter.getData();
+}
+
+//================================================================================
+/*!
+ * \brief Export the mesh to a med file
+ *  \param [in] file - name of the MED file
+ *  \param [in] theMeshName - name of this mesh
+ *  \param [in] theAutoGroups - boolean parameter for creating/not creating
+ *              the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ *              the typical use is auto_groups=false.
+ *  \param [in] theVersion - define the minor (xy, where version is x.y.z) of MED file format.
+ *              If theVersion is equal to -1, the minor version is not changed (default).
+ *  \param [in] meshPart - mesh data to export
+ *  \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
+ *              - 1D if all mesh nodes lie on OX coordinate axis, or
+ *              - 2D if all mesh nodes lie on XOY coordinate plane, or
+ *              - 3D in the rest cases.
+ *              If \a theAutoDimension is \c false, the space dimension is always 3.
+ *  \param [in] theAddODOnVertices - to create 0D elements on all vertices
+ *  \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413)
+ *  \param [in] ZTolerance - tolerance in Z direction. If Z coordinate of a node is close to zero
+ *              within a given tolerance, the coordinate is set to zero.
+ *              If \a ZTolerance is negative, the node coordinates are kept as is.
+ *  \return int - mesh index in the file
+ */
+//================================================================================
+
+void SMESH_Mesh::ExportMED(const char *        file,
+                           const char*         theMeshName,
+                           bool                theAutoGroups,
+                           int                 theVersion,
+                           const SMESHDS_Mesh* meshPart,
+                           bool                theAutoDimension,
+                           bool                theAddODOnVertices,
+                           double              theZTolerance,
+                           bool                theAllElemsToGroup)
+{
+  MESSAGE("MED_VERSION:"<< theVersion);
+  DriverMED_W_SMESHDS_Mesh myWriter;
+  myWriter.SetFile( file , theVersion );
+  this->ExportMEDCommmon(myWriter,theMeshName,theAutoGroups,meshPart,theAutoDimension,theAddODOnVertices,theZTolerance,theAllElemsToGroup);
+}
+
 //================================================================================
 /*!
  * \brief Export the mesh to a SAUV file
index ea3e18dc60bb943b25bc2d1e420e241ae9732f00..66023da8e540cfdcfeb2f0b50a02559045bd2096 100644 (file)
@@ -41,6 +41,8 @@
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 
+#include "MEDCouplingMemArray.hxx"
+
 #include <map>
 #include <list>
 #include <vector>
@@ -62,6 +64,8 @@ class SMESH_HypoFilter;
 class SMESH_subMesh;
 class TopoDS_Solid;
 
+class DriverMED_W_SMESHDS_Mesh;
+
 typedef std::list<int> TListOfInt;
 typedef std::list<TListOfInt> TListOfListOfInt;
 
@@ -261,6 +265,15 @@ class SMESH_EXPORT SMESH_Mesh
     TooLargeForExport(const char* format):runtime_error(format) {}
   };
 
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> ExportMEDCoupling(
+                 const char*         theMeshName = NULL,
+                 bool                theAutoGroups = true,
+                 const SMESHDS_Mesh* theMeshPart = 0,
+                 bool                theAutoDimension = false,
+                 bool                theAddODOnVertices = false,
+                 double              theZTolerance = -1.,
+                 bool                theAllElemsToGroup = false);
+
   void ExportMED(const char *        theFile,
                  const char*         theMeshName = NULL,
                  bool                theAutoGroups = true,
@@ -372,6 +385,16 @@ class SMESH_EXPORT SMESH_Mesh
   
 private:
 
+  void ExportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
+                           const char*         theMeshName,
+                           bool                theAutoGroups,
+                           const SMESHDS_Mesh* meshPart,
+                           bool                theAutoDimension,
+                           bool                theAddODOnVertices,
+                           double              theZTolerance,
+                           bool                theAllElemsToGroup);
+
+private:
   void fillAncestorsMap(const TopoDS_Shape& theShape);
   void getAncestorsSubMeshes(const TopoDS_Shape&            theSubShape,
                              std::vector< SMESH_subMesh* >& theSubMeshes) const;
index ec16456969e85f6c4d571818277c4cb2ffc722b1..ed7f14f4728a4d2f05f52bbc8078f3087d177a08 100644 (file)
@@ -26,6 +26,7 @@ INCLUDE_DIRECTORIES(
   ${Boost_INCLUDE_DIRS}
   ${OpenCASCADE_INCLUDE_DIR}
   ${OMNIORB_INCLUDE_DIR}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/Controls
   ${PROJECT_SOURCE_DIR}/src/Driver
   ${PROJECT_SOURCE_DIR}/src/DriverDAT
index e1696341bd0b7e75e7bdf31c9a3523837064c2a2..587ee89bd2f766ce4e4003e10a303cbed1f01ac9 100644 (file)
@@ -34,6 +34,7 @@ INCLUDE_DIRECTORIES(
   ${Boost_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${HDF5_INCLUDE_DIRS}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/OBJECT
   ${PROJECT_SOURCE_DIR}/src/SMESHFiltersSelection
   ${PROJECT_SOURCE_DIR}/src/SMDS
index b69f4650ab6a44b36979beaa6673c6d185ba452e..992eab2df6cddfeae1a168d5d2a0a573a0f239bb 100644 (file)
@@ -4795,7 +4795,7 @@ Il ne peut pas être supprimé.</translation>
     </message>
     <message>
         <source>Generate mesh from CAD model or import mesh</source>
-        <translation type="unfinished">Generate mesh from CAD model or import mesh</translation>
+        <translation type="unfinished">Créer un maillage à partir d'un modèle CAO ou par importation</translation>
     </message>
 </context>
 <context>
@@ -5151,7 +5151,7 @@ Ouvrez une fenêtre VTK et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_SELECTION_INCREMENT</source>
-        <translation type="unfinished">Elements width increment</translation>
+        <translation type="unfinished">Incrément de largeur d'éléments</translation>
     </message>
     <message>
         <source>PREF_OBJECT_COLOR</source>
@@ -5247,59 +5247,59 @@ Ouvrez une fenêtre VTK et essayez de nouveau</translation>
     </message>
     <message>
         <source>INFO_WELCOME_TO_SMESH</source>
-        <translation type="unfinished">Welcome to Mesh</translation>
+        <translation type="unfinished">Bienvenue dans le module Mesh</translation>
     </message>
     <message>
         <source>INFO_GRP_CREATE_MESH</source>
-        <translation type="unfinished">Create mesh</translation>
+        <translation type="unfinished">Créer un maillage</translation>
     </message>
     <message>
         <source>INFO_DEFINE_ALGOS</source>
-        <translation type="unfinished">Choose algorithms</translation>
+        <translation type="unfinished">Choisir les algorithmes</translation>
     </message>
     <message>
         <source>INFO_DEFINE_HYPOS</source>
-        <translation type="unfinished">Define hypotheses</translation>
+        <translation type="unfinished">Définir des hypothèses</translation>
     </message>
     <message>
         <source>INFO_COMPUTE</source>
-        <translation type="unfinished">Compute</translation>
+        <translation type="unfinished">Calculer</translation>
     </message>
     <message>
         <source>INFO_REFINE</source>
-        <translation type="unfinished">Add refinements</translation>
+        <translation type="unfinished">Ajouter des raffinements</translation>
     </message>
     <message>
         <source>INFO_REFINE_LOCAL_SIZE</source>
-        <translation type="unfinished">via local sizes with some hypotheses</translation>
+        <translation type="unfinished">via des tailles locales dans certaines hypothèses</translation>
     </message>
     <message>
         <source>INFO_REFINE_SUBMESH</source>
-        <translation type="unfinished">via sub-meshes</translation>
+        <translation type="unfinished">via des sous-maillages</translation>
     </message>
     <message>
         <source>INFO_GRP_IMPORT_MESH</source>
-        <translation type="unfinished">Import mesh</translation>
+        <translation type="unfinished">Importer un maillage</translation>
     </message>
     <message>
         <source>INFO_AVAILABLE_FORMATS</source>
-        <translation type="unfinished">Available formats</translation>
+        <translation type="unfinished">Formats disponibles</translation>
     </message>
     <message>
         <source>INFO_GRP_CHECK_MESH</source>
-        <translation type="unfinished"> Check mesh quality</translation>
+        <translation type="unfinished">Contrôler la qualité du maillage</translation>
     </message>
     <message>
         <source>INFO_DISPLAY</source>
-        <translation type="unfinished">Display mesh</translation>
+        <translation type="unfinished">Afficher le maillage</translation>
     </message>
     <message>
         <source>INFO_QUALITY_INFO</source>
-        <translation type="unfinished">Display some quality criteria</translation>
+        <translation type="unfinished">Afficher des critères de qualité</translation>
     </message>
     <message>
         <source>INFO_QUALITY_AREA</source>
-        <translation type="unfinished">area</translation>
+        <translation type="unfinished">surface</translation>
     </message>
     <message>
         <source>INFO_QUALITY_VOLUME</source>
@@ -5307,11 +5307,11 @@ Ouvrez une fenêtre VTK et essayez de nouveau</translation>
     </message>
     <message>
         <source>INFO_QUALITY_ASPECT_RATION</source>
-        <translation type="unfinished">aspect ration</translation>
+        <translation type="unfinished">Facteur de forme</translation>
     </message>
     <message>
         <source>INFO_CLIPPING</source>
-        <translation type="unfinished">Add clipping planes</translation>
+        <translation type="unfinished">Insérer un plan de coupe</translation>
     </message>
 </context>
 <context>
index dc500e2c776d91e03373c67cd1742ffc18800094..e04e4a60403bc0c091f041eb1919bd091e61ed1e 100644 (file)
@@ -28,6 +28,7 @@ INCLUDE_DIRECTORIES(
   ${KERNEL_INCLUDE_DIRS}
   ${GUI_INCLUDE_DIRS}
   ${GEOM_INCLUDE_DIRS}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/Controls
   ${PROJECT_SOURCE_DIR}/src/SMDS
   ${PROJECT_SOURCE_DIR}/src/SMESHDS
index a1819c5e1be469223061c286349c96e472d74352..aafbd35cce8648ad2b662acc9608e7113950bda0 100644 (file)
@@ -23,6 +23,8 @@
 #include "SALOME_Container_i.hxx"
 #include "SALOME_KernelServices.hxx"
 
+#include "SALOME_Fake_NamingService.hxx"
+
 #include <cstring>
 
 static Engines::EngineComponent_var _unique_compo;
@@ -46,6 +48,8 @@ Engines::EngineComponent_var RetrieveSMESHInstance()
     //
     pman->activate();
     //
+    SMESH_Gen_i::SetNS(new SALOME_Fake_NamingService);
+    //
     SMESH_Gen_No_Session_i *servant = new SMESH_Gen_No_Session_i(orb, poa, conId, "SMESH_inst_2", "SMESH");
     PortableServer::ObjectId *zeId = servant->getId();
     CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
index db261e7d419f675da56607298d50e581b41830a0..cbcc33eb3260f3bc514f2a29671c8b7ea2743f8e 100644 (file)
@@ -29,7 +29,6 @@ SMESH_Gen_No_Session_i::SMESH_Gen_No_Session_i( CORBA::ORB_ptr orb,
                                                 const char*               instanceName,
                                                 const char*               interfaceName):SMESH_Gen_i(orb,poa,contId,instanceName,interfaceName,false)
 {
-  myNS = new SALOME_Fake_NamingService;
 }
 
 GEOM::GEOM_Gen_var SMESH_Gen_No_Session_i::GetGeomEngine( bool isShaper )
index 107a1ef4f81a425c3fc2a7ac6877e5500ba580f1..93c981ec317b108464d66716735b16411d9de801 100644 (file)
@@ -237,6 +237,14 @@ CORBA::Object_var SMESH_Gen_i::SObjectToObject( SALOMEDS::SObject_ptr theSObject
   return anObj;
 }
 
+// Set Naming Service object
+void SMESH_Gen_i::SetNS(SALOME_NamingService_Abstract *ns)
+{
+  if(myNS)
+    delete myNS;
+  myNS = ns;
+}
+
 //=============================================================================
 /*!
  *  GetNS [ static ]
@@ -247,7 +255,7 @@ CORBA::Object_var SMESH_Gen_i::SObjectToObject( SALOMEDS::SObject_ptr theSObject
 
 SALOME_NamingService_Abstract* SMESH_Gen_i::GetNS()
 {
-  if ( myNS == NULL ) {
+  if ( !myNS ) {
     myNS = SINGLETON_<SALOME_NamingService>::Instance();
     ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting());
     myNS->init_orb( GetORB() );
index 1d1ed678b70b5ae39193578dbe23ce22a8a637e4..648b1d2f5966c2339de3322bc8ad592ef80e3c46 100644 (file)
@@ -104,6 +104,8 @@ public:
   static CORBA::ORB_var GetORB() { return myOrb;}
   // Get SMESH module's POA object
   static PortableServer::POA_var GetPOA() { return myPoa;}
+  // Set Naming Service object
+  static void SetNS(SALOME_NamingService_Abstract *ns);
   // Get Naming Service object
   static SALOME_NamingService_Abstract* GetNS();
   // Get SALOME_LifeCycleCORBA object
index b2551f73933e5839fe24874b95f3f20e688613de..2fc681ef523f0e0e9d29c4fbe88f5d1c78b79b53 100644 (file)
@@ -3684,6 +3684,25 @@ void SMESH_Mesh_i::PrepareForWriting (const char* file, bool overwrite)
   }
 }
 
+/*!
+  Return a MeshName
+ */
+std::string SMESH_Mesh_i::generateMeshName()
+{
+  string aMeshName = "Mesh";
+  SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant();
+  if ( !aStudy->_is_nil() )
+  {
+    SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject(  _this() );
+    if ( !aMeshSO->_is_nil() )
+    {
+      CORBA::String_var name = aMeshSO->GetName();
+      aMeshName = name;
+    }
+  }
+  return aMeshName;
+}
+
 //================================================================================
 /*!
  * \brief Prepare a file for export and pass names of mesh groups from study to mesh DS
@@ -3698,13 +3717,11 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char*    file,
 {
   // Perform Export
   PrepareForWriting(file, overwrite);
-  string aMeshName = "Mesh";
+  string aMeshName(this->generateMeshName());
   SALOMEDS::Study_var aStudy = SMESH_Gen_i::GetSMESHGen()->getStudyServant();
   if ( !aStudy->_is_nil() ) {
     SALOMEDS::SObject_wrap aMeshSO = _gen_i->ObjectToSObject(  _this() );
     if ( !aMeshSO->_is_nil() ) {
-      CORBA::String_var name = aMeshSO->GetName();
-      aMeshName = name;
       // asv : 27.10.04 : fix of 6903: check for StudyLocked before adding attributes
       if ( !aStudy->GetProperties()->IsLocked() )
       {
@@ -3763,6 +3780,23 @@ void SMESH_Mesh_i::ExportMED(const char*    file,
   SMESH_CATCH( SMESH::throwCorbaException );
 }
 
+CORBA::LongLong SMESH_Mesh_i::ExportMEDCoupling(CORBA::Boolean auto_groups, CORBA::Boolean autoDimension)
+{
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> data;
+  SMESH_TRY;
+  // TODO : Fix me ! 2 next lines are required
+  //if( !this->_gen_i->IsEmbeddedMode() )
+  //  SMESH::throwCorbaException("SMESH_Mesh_i::ExportMEDCoupling : only for embedded mode !");
+  if ( _preMeshInfo )
+    _preMeshInfo->FullLoadFromFile();
+
+  string aMeshName = this->generateMeshName();
+  data = _impl->ExportMEDCoupling( aMeshName.c_str(), auto_groups, 0, autoDimension );
+  SMESH_CATCH( SMESH::throwCorbaException );
+  MEDCoupling::DataArrayByte *ret(data.retn());
+  return reinterpret_cast<CORBA::LongLong>(ret);
+}
+
 //================================================================================
 /*!
  * \brief Export a mesh to a SAUV file
@@ -3862,23 +3896,47 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii)
   SMESH_CATCH( SMESH::throwCorbaException );
 }
 
-//================================================================================
-/*!
- * \brief Export a part of mesh to a med file
- */
-//================================================================================
+class MEDFileSpeCls
+{
+public:
+  MEDFileSpeCls(const char *file, CORBA::Boolean overwrite, CORBA::Long version):_file(file),_overwrite(overwrite),_version(version) { }
+  std::string prepareMeshNameAndGroups(SMESH_Mesh_i& self) { return self.prepareMeshNameAndGroups(_file.c_str(),_overwrite); }
+  void exportTo(SMESH_Mesh *mesh, const std::string& aMeshName, CORBA::Boolean auto_groups,
+                SMESH_MeshPartDS* partDS,
+                CORBA::Boolean autoDimension, bool have0dField,
+                CORBA::Double ZTolerance)
+  {
+    mesh->ExportMED( _file.c_str(), aMeshName.c_str(), auto_groups, _version,
+                    partDS, autoDimension,have0dField,ZTolerance);
 
-void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
-                                   const char*               file,
-                                   CORBA::Boolean            auto_groups,
-                                   CORBA::Long               version,
-                                   CORBA::Boolean            overwrite,
-                                   CORBA::Boolean            autoDimension,
-                                   const GEOM::ListOfFields& fields,
-                                   const char*               geomAssocFields,
-                                   CORBA::Double             ZTolerance)
+  }
+
+  void exportField(SMESH_Mesh_i& self, const std::string& aMeshName, bool have0dField, SMESHDS_Mesh *meshDS, const GEOM::ListOfFields& fields, const char*geomAssocFields)
+  {
+    DriverMED_W_Field fieldWriter;
+    fieldWriter.SetFile( _file.c_str() );
+    fieldWriter.SetMeshName( aMeshName );
+    fieldWriter.AddODOnVertices( have0dField );
+    self.exportMEDFields( fieldWriter, meshDS, fields, geomAssocFields );
+  }
+
+  void prepareForWriting(SMESH_Mesh_i& self) { self.PrepareForWriting(_file.c_str(), _overwrite); }
+private:
+  std::string _file;
+  CORBA::Boolean _overwrite;
+  CORBA::Long  _version;
+};
+
+
+template<class SPECLS>
+void SMESH_Mesh_i::ExportPartToMEDCommon(SPECLS& speCls,
+      SMESH::SMESH_IDSource_ptr meshPart,
+      CORBA::Boolean            auto_groups,
+      CORBA::Boolean            autoDimension,
+      const GEOM::ListOfFields& fields,
+      const char*               geomAssocFields,
+      CORBA::Double             ZTolerance)
 {
-  MESSAGE("MED version: "<< version);
   SMESH_TRY;
   if ( _preMeshInfo )
     _preMeshInfo->FullLoadFromFile();
@@ -3924,10 +3982,8 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
   if ( CORBA::is_nil( meshPart ) ||
        SMESH::DownCast< SMESH_Mesh_i* >( meshPart ))
   {
-    aMeshName = prepareMeshNameAndGroups(file, overwrite);
-    _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version,
-                      0, autoDimension, /*addODOnVertices=*/have0dField,
-                      ZTolerance);
+    aMeshName = speCls.prepareMeshNameAndGroups(*this);
+    speCls.exportTo(_impl, aMeshName, auto_groups, nullptr, autoDimension, have0dField, ZTolerance);
     meshDS = _impl->GetMeshDS();
   }
   else
@@ -3935,7 +3991,7 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
     if ( _preMeshInfo )
       _preMeshInfo->FullLoadFromFile();
 
-    PrepareForWriting(file, overwrite);
+    speCls.prepareForWriting(*this);
 
     SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( meshPart );
     if ( !SO->_is_nil() ) {
@@ -3944,8 +4000,7 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
     }
 
     SMESH_MeshPartDS* partDS = new SMESH_MeshPartDS( meshPart );
-    _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version,
-                      partDS, autoDimension, /*addODOnVertices=*/have0dField, ZTolerance);
+    speCls.exportTo(_impl, aMeshName, auto_groups, partDS, autoDimension, have0dField, ZTolerance);
     meshDS = tmpDSDeleter._obj = partDS;
   }
 
@@ -3953,15 +4008,32 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
 
   if ( _impl->HasShapeToMesh() )
   {
-    DriverMED_W_Field fieldWriter;
-    fieldWriter.SetFile( file );
-    fieldWriter.SetMeshName( aMeshName );
-    fieldWriter.AddODOnVertices( have0dField );
-
-    exportMEDFields( fieldWriter, meshDS, fields, geomAssocFields );
+    speCls.exportField(*this,aMeshName,have0dField,meshDS,fields,geomAssocFields);
   }
+  SMESH_CATCH( SMESH::throwCorbaException );
+}
+
+//================================================================================
+/*!
+ * \brief Export a part of mesh to a med file
+ */
+//================================================================================
 
+void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
+                                   const char*               file,
+                                   CORBA::Boolean            auto_groups,
+                                   CORBA::Long               version,
+                                   CORBA::Boolean            overwrite,
+                                   CORBA::Boolean            autoDimension,
+                                   const GEOM::ListOfFields& fields,
+                                   const char*               geomAssocFields,
+                                   CORBA::Double             ZTolerance)
+{
+  MESSAGE("MED version: "<< version);
+  MEDFileSpeCls spe(file,overwrite,version);
+  this->ExportPartToMEDCommon<MEDFileSpeCls>(spe,meshPart,auto_groups,autoDimension,fields,geomAssocFields,ZTolerance);
   // dump
+  SMESH_TRY;
   GEOM::ListOfGBO_var goList = new GEOM::ListOfGBO;
   goList->length( fields.length() );
   for ( size_t i = 0; i < fields.length(); ++i )
@@ -3980,10 +4052,45 @@ void SMESH_Mesh_i::ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
                 << ( geomAssocFields ? geomAssocFields : "" ) << "',"
                 << TVar( ZTolerance )
                 << " )";
-
   SMESH_CATCH( SMESH::throwCorbaException );
 }
 
+class MEDFileMemSpeCls
+{
+public:
+  std::string prepareMeshNameAndGroups(SMESH_Mesh_i& self) { return self.generateMeshName(); }
+  void exportTo(SMESH_Mesh *mesh, const std::string& aMeshName, CORBA::Boolean auto_groups,
+                SMESH_MeshPartDS* partDS,
+                CORBA::Boolean autoDimension, bool have0dField,
+                CORBA::Double ZTolerance)
+  {
+    _res = mesh->ExportMEDCoupling(aMeshName.c_str(),auto_groups,partDS,autoDimension,have0dField,ZTolerance);
+  }
+  void prepareForWriting(SMESH_Mesh_i& self) { /* nothing here */ }
+  void exportField(SMESH_Mesh_i& self, const std::string& aMeshName, bool have0dField, SMESHDS_Mesh *meshDS, const GEOM::ListOfFields& fields, const char*geomAssocFields)
+  {
+    THROW_IK_EXCEPTION("exportField Not implemented yet for full memory !");
+  }
+public:
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> getData() { return _res; }
+private:
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> _res;
+};
+
+CORBA::LongLong SMESH_Mesh_i::ExportPartToMEDCoupling(SMESH::SMESH_IDSource_ptr meshPart,
+                                  CORBA::Boolean            auto_groups,
+                                  CORBA::Boolean            autoDimension,
+                                  const GEOM::ListOfFields& fields,
+                                  const char*               geomAssocFields,
+                                  CORBA::Double             ZTolerance)
+{
+  MEDFileMemSpeCls spe;
+  this->ExportPartToMEDCommon<MEDFileMemSpeCls>(spe,meshPart,auto_groups,autoDimension,fields,geomAssocFields,ZTolerance);
+  MEDCoupling::MCAuto<MEDCoupling::DataArrayByte> res( spe.getData() );
+  MEDCoupling::DataArrayByte *ret(res.retn());
+  return reinterpret_cast<CORBA::LongLong>(ret);
+}
+
 //================================================================================
 /*!
  * Write GEOM fields to MED file
index b274e33f66a3457068d53811dfd921541ec20c36..f17c076de64f7c1ad73949e6d14164a333f67396 100644 (file)
@@ -212,6 +212,10 @@ public:
                   CORBA::Boolean     overwrite,
                   CORBA::Boolean     autoDimension = true);
 
+  CORBA::LongLong ExportMEDCoupling(CORBA::Boolean     auto_groups,
+  CORBA::Boolean     autoDimension = true
+  );
+
   void ExportSAUV( const char* file, CORBA::Boolean auto_groups );
 
   void ExportDAT( const char* file );
@@ -225,6 +229,16 @@ public:
                  const char*               file,
                  CORBA::Boolean            withRequiredGroups);
 
+    
+  template<class SPECLS>
+  void ExportPartToMEDCommon(SPECLS& speCls,
+      SMESH::SMESH_IDSource_ptr meshPart,
+      CORBA::Boolean            auto_groups,
+      CORBA::Boolean            autoDim,
+      const GEOM::ListOfFields& fields,
+      const char*               geomAssocFields,
+      CORBA::Double             ZTolerance);
+
   void ExportPartToMED(SMESH::SMESH_IDSource_ptr meshPart,
                        const char*               file,
                        CORBA::Boolean            auto_groups,
@@ -234,6 +248,14 @@ public:
                        const GEOM::ListOfFields& fields,
                        const char*               geomAssocFields,
                        CORBA::Double             ZTolerance);
+
+  CORBA::LongLong ExportPartToMEDCoupling(SMESH::SMESH_IDSource_ptr meshPart,
+                       CORBA::Boolean            auto_groups,
+                       CORBA::Boolean            autoDim,
+                       const GEOM::ListOfFields& fields,
+                       const char*               geomAssocFields,
+                       CORBA::Double             ZTolerance);
+
   void ExportPartToDAT(SMESH::SMESH_IDSource_ptr meshPart,
                        const char*               file);
   void ExportPartToUNV(SMESH::SMESH_IDSource_ptr meshPart,
@@ -626,14 +648,9 @@ public:
   std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
   std::map<int, ::SMESH_subMesh*> _mapSubMesh;   //NRI
 
-private:
+public:
+  std::string generateMeshName( );
   std::string prepareMeshNameAndGroups( const char* file, CORBA::Boolean overwrite );
-
-  /*!
-   * Check and correct names of mesh groups
-   */
-  void checkGroupNames();
-
   /*
    * Write GEOM fields to MED file
    */
@@ -641,6 +658,12 @@ private:
                         SMESHDS_Mesh*             meshDS,
                         const GEOM::ListOfFields& fields,
                         const char*               geomAssocFields);
+private:
+  /*!
+   * Check and correct names of mesh groups
+   */
+  void checkGroupNames();
+
   /*!
    * Convert submesh ids into submesh interfaces
    */
index 2c7211828d54774216d8c8a6fbdb613a0d35b386..e65c357496e416352100235f2348a609d87c4144 100644 (file)
@@ -2299,6 +2299,69 @@ class Mesh(metaclass = MeshMeta):
             self.mesh.RemoveHypothesis( self.geom, hyp )
             pass
         pass
+
+    def ExportMEDCoupling(self, *args, **kwargs):
+        """
+        Export the mesh in a memory representation.
+
+        Parameters:
+        auto_groups (boolean): parameter for creating/not creating
+                the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+                the typical use is auto_groups=False.
+        overwrite (boolean): parameter for overwriting/not overwriting the file
+        meshPart: a part of mesh (:class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`) to export instead of the mesh
+        autoDimension: if *True* (default), a space dimension of a MED mesh can be either
+
+                - 1D if all mesh nodes lie on OX coordinate axis, or
+                - 2D if all mesh nodes lie on XOY coordinate plane, or
+                - 3D in the rest cases.
+
+                If *autoDimension* is *False*, the space dimension is always 3.
+        fields: list of GEOM fields defined on the shape to mesh.
+        geomAssocFields: each character of this string means a need to export a 
+                corresponding field; correspondence between fields and characters 
+                is following:
+
+                - 'v' stands for "_vertices_" field;
+                - 'e' stands for "_edges_" field;
+                - 'f' stands for "_faces_" field;
+                - 's' stands for "_solids_" field.
+
+        zTolerance (float): tolerance in Z direction. If Z coordinate of a node is 
+                        close to zero within a given tolerance, the coordinate is set to zero.
+                        If *ZTolerance* is negative (default), the node coordinates are kept as is.
+        """
+        auto_groups     = args[0] if len(args) > 0 else False
+        meshPart        = args[1] if len(args) > 1 else None
+        autoDimension   = args[2] if len(args) > 2 else True
+        fields          = args[3] if len(args) > 3 else []
+        geomAssocFields = args[4] if len(args) > 4 else ''
+        z_tolerance     = args[5] if len(args) > 5 else -1.
+        # process keywords arguments
+        auto_groups     = kwargs.get("auto_groups", auto_groups)
+        meshPart        = kwargs.get("meshPart", meshPart)
+        autoDimension   = kwargs.get("autoDimension", autoDimension)
+        fields          = kwargs.get("fields", fields)
+        geomAssocFields = kwargs.get("geomAssocFields", geomAssocFields)
+        z_tolerance     = kwargs.get("zTolerance", z_tolerance)
+
+        # invoke engine's function
+        if meshPart or fields or geomAssocFields or z_tolerance > 0:
+            unRegister = genObjUnRegister()
+            if isinstance( meshPart, list ):
+                meshPart = self.GetIDSource( meshPart, SMESH.ALL )
+                unRegister.set( meshPart )
+
+            z_tolerance,Parameters,hasVars = ParseParameters(z_tolerance)
+            self.mesh.SetParameters(Parameters)
+
+            return self.mesh.ExportPartToMEDCoupling(meshPart, auto_groups, autoDimension, fields, geomAssocFields, z_tolerance)
+        else:
+            intPtr = self.mesh.ExportMEDCoupling(auto_groups, autoDimension)
+            import medcoupling
+            dab = medcoupling.FromPyIntPtrToDataArrayByte(intPtr)
+            return medcoupling.MEDFileMesh.New(dab)
+
     def ExportMED(self, *args, **kwargs):
         """
         Export the mesh in a file in MED format
index 0a69940c1474d982c49f0d6e0da50f035327d83c..ec44a6aafd4b1cb0171062b2218172ff4237a635 100644 (file)
@@ -29,6 +29,7 @@ INCLUDE_DIRECTORIES(
   ${Boost_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
   ${GEOM_INCLUDE_DIRS}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/SMESHUtils
   ${PROJECT_SOURCE_DIR}/src/SMESH
   ${PROJECT_SOURCE_DIR}/src/SMESHDS
index 1b28ee703e03301e99c26d870fde632dced47ee6..15150fd2e19e5a1099ffc2e694de2d8d911656e9 100644 (file)
@@ -32,6 +32,7 @@ INCLUDE_DIRECTORIES(
   ${Boost_INCLUDE_DIRS}
   ${QWT_INCLUDE_DIR}
   ${OMNIORB_INCLUDE_DIR}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/SMESH
   ${PROJECT_SOURCE_DIR}/src/SMESHUtils
   ${PROJECT_SOURCE_DIR}/src/SMESH_I
index 27734abf9ebde5e107db569398c46c53746dd37f..c6262c72df6d945e0e83aa5be50fe3041fc901cf 100644 (file)
@@ -27,6 +27,7 @@ INCLUDE_DIRECTORIES(
   ${MEDFILE_INCLUDE_DIRS}
   ${Boost_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/SMESHImpl
   ${PROJECT_SOURCE_DIR}/src/SMESH
   ${PROJECT_SOURCE_DIR}/src/SMESHUtils
index 768955a58685f28b19f3e61d5009991a760e1d76..2aec25d1e0529e1b7592291c2a2d967c020ebe0c 100644 (file)
@@ -22,7 +22,8 @@
 # scripts / static
 SET(plugin_SCRIPTS
   __init__.py
-  cubeAngle2.py
+  blocFissureTest.py
+  cubeAngle_2.py
   cubeAngle.py
   cubeCoin.py
   cubeMilieu.py
@@ -35,7 +36,6 @@ SET(plugin_SCRIPTS
   eprouvetteCourbe.py
   eprouvetteDroite_2.py
   eprouvetteDroite.py
-  execution_Cas.py
   faceGauche_2.py
   faceGauche.py
   fissureCoude_10.py
diff --git a/src/Tools/blocFissure/CasTests/blocFissureTest.py b/src/Tools/blocFissure/CasTests/blocFissureTest.py
new file mode 100644 (file)
index 0000000..6beab0a
--- /dev/null
@@ -0,0 +1,522 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021  EDF R&D
+#
+# 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
+#
+__revision__ = "V03.02"
+
+"""Lancement des cas-tests de blocFissure
+
+Temps par type de matériel :
+. cubeAngle : 24s ["cubeAngle", "cubeAngle_2"])
+. cubeFin : 42s ["cubeCoin", "cubeMilieu", "cubeTransverse"]
+. decoupeCylindre : 8s ["cylindre", "cylindre_2"]
+. disquePerce (+ ellipse_disque) : 9s ["disquePerce"]
+. fissureGauche : 26s ["faceGauche"]
+. fissureGauche_2 (+ ellipse + ellipse_probleme): 22s ["ellipse_1", "ellipse_2", "faceGauche_2"]
+. eprouvetteCourbe : 22s ["eprouvetteCourbe"]
+. eprouvetteDroite : 31s ["eprouvetteDroite", "eprouvetteDroite_2"]
+. vis : 9s ["vis"]
+. tube : ["tube"]
+. sans matériel : 66s ["fissureCoude_1", "fissureCoude_2", "fissureCoude_3", "fissureCoude_4", "fissureCoude_5"]
+. sans matériel : 69s ["fissureCoude_6", "fissureCoude_7", "fissureCoude_8", "fissureCoude_9", "fissureCoude_10"]
+. sans matériel : 28s ["fissure_Coude", "fissure_Coude_4"]
+"""
+
+import logging
+import os
+import sys
+import tempfile
+import traceback
+
+from blocFissure.gmu import initLog
+from blocFissure.gmu.casStandard import casStandard
+
+# -----------------------------------------------------------------------------------------------
+LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
+#initLog.setDebug(LOGFILE)     # debug = 10
+#initLog.setVerbose(LOGFILE)   # info = 20
+#initLog.setRelease(LOGFILE)   # warning = 30
+#initLog.setPerfTests(LOGFILE) # critical = 50
+#initLog.setAlways(LOGFILE)    # critical = 50
+
+# Les cas qui marchent ...
+TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] # OK 19/04/2021
+#           0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
+TORUNPB = list()
+for IAUX in TORUNOK:
+  TORUNPB.append((IAUX+1)%2)
+print ("TORUN = {} # OK".format(TORUNOK))
+print ("TORUN = {} # PB".format(TORUNPB))
+
+# Numéro de référence associé à chaque problème défini par le nom de son fichier dans le répertoire CasTests
+NREF_PB = dict()
+NREF_PB["cubeAngle"] = 0
+NREF_PB["cubeAngle_2"] = 1
+NREF_PB["cubeCoin"] = 2
+NREF_PB["cubeMilieu"] = 3
+NREF_PB["cubeTransverse"] = 4
+NREF_PB["cylindre"] = 5
+NREF_PB["cylindre_2"] = 6
+NREF_PB["disquePerce"] = 7
+NREF_PB["ellipse_1"] = 8
+NREF_PB["ellipse_2"] = 9
+NREF_PB["eprouvetteCourbe"] = 10
+NREF_PB["eprouvetteDroite"] = 11
+NREF_PB["eprouvetteDroite_2"] = 12
+NREF_PB["faceGauche"] = 13
+NREF_PB["faceGauche_2"] = 14
+NREF_PB["fissureCoude_1"] = 15
+NREF_PB["fissureCoude_2"] = 16
+NREF_PB["fissureCoude_3"] = 17
+NREF_PB["fissureCoude_4"] = 18
+NREF_PB["fissureCoude_5"] = 19
+NREF_PB["fissureCoude_6"] = 20
+NREF_PB["fissureCoude_7"] = 21
+NREF_PB["fissureCoude_8"] = 22
+NREF_PB["fissureCoude_9"] = 23
+NREF_PB["fissureCoude_10"] = 24
+NREF_PB["fissure_Coude"] = 25
+NREF_PB["fissure_Coude_4"] = 26
+NREF_PB["vis_1"] = 27
+NREF_PB["tube"] = 28
+
+#=========================  Début de la classe ===================================
+
+class blocFissureTest (object):
+
+  """Test de blocFissure
+
+Options facultatives
+********************
+Le(s) numéro/nom du/des tests à passer. Si aucun n'est donné, tous les cas sont passés.
+  """
+
+# A. La base
+
+  message_info = ""
+  _verbose = 0
+  _verbose_max = 0
+  affiche_aide_globale = 0
+
+# B. Les variables
+
+  l_cas = None
+  l_problemes = None
+  d_nom_probleme = None
+  l_materiels = None
+
+#=========================== Début de la méthode =================================
+
+  def __init__ ( self, liste_option ):
+
+    """Le constructeur de la classe blocFissureTest"""
+
+    self.l_cas = list()
+    erreur = False
+
+    for option in liste_option :
+
+      #print (option, type(option))
+      if isinstance(option, str):
+        saux = option.upper()
+      else:
+        saux = option
+      #print (saux)
+      # Options générales de pilotage
+      if saux in ( "-H", "-HELP" ):
+        self.affiche_aide_globale = 1
+      elif saux == "-V" :
+        self._verbose = 1
+      elif saux == "-VMAX" :
+        self._verbose = 1
+        self._verbose_max = 1
+
+      else :
+      # Options du traitement
+        if isinstance(option, int):
+          self.l_cas.append(option)
+        elif ( option in NREF_PB ):
+          self.l_cas.append(NREF_PB[option])
+        else:
+          print ("Option inconnue : {}".format(option))
+          erreur = True
+
+# Si aucun cas n'est donné, on prend tous ceux par défaut
+    if not self.l_cas:
+      for i_aux, valeur in enumerate(TORUNOK):
+        if valeur:
+          self.l_cas.append(i_aux)
+
+    if erreur:
+      self.l_cas = list()
+
+    if self._verbose_max:
+      print ("Liste des cas : {}".format(self.l_cas))
+
+    if self._verbose_max:
+      initLog.setVerbose(LOGFILE)   # info = 20
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def __del__(self):
+    """A la suppression de l'instance de classe"""
+    if self._verbose_max:
+      print ("Suppression de l'instance de la classe.")
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def caract_l_problemes (self):
+    """Caractérisation des problèmes"""
+    self.d_nom_probleme = dict()
+    self.l_problemes = list()
+    self.l_materiels = list()
+
+    n_cas = 0
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.cubeAngle import cubeAngle
+      self.l_problemes.append(cubeAngle(n_cas))
+      self.l_materiels.append("cubeAngle")
+
+    n_cas = 1
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.cubeAngle_2 import cubeAngle_2
+      self.l_problemes.append(cubeAngle_2(n_cas))
+      self.l_materiels.append("cubeAngle")
+
+    n_cas = 2
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests import cubeCoin
+      self.l_problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, n_cas))
+      self.d_nom_probleme[n_cas] = "cubeCoin"
+      self.l_materiels.append("cubeFin")
+
+    n_cas = 3
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests import cubeMilieu
+      self.l_problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, n_cas))
+      self.d_nom_probleme[n_cas] = "cubeMilieu"
+      self.l_materiels.append("cubeFin")
+
+    n_cas = 4
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests import cubeTransverse
+      self.l_problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, n_cas))
+      self.d_nom_probleme[n_cas] = "cubeTransverse"
+      self.l_materiels.append("cubeFin")
+
+    n_cas = 5
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.cylindre import cylindre
+      self.l_problemes.append(cylindre(n_cas))
+      self.l_materiels.append("decoupeCylindre")
+
+    n_cas = 6
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.cylindre_2 import cylindre_2
+      self.l_problemes.append(cylindre_2(n_cas))
+      self.l_materiels.append("decoupeCylindre")
+
+    n_cas = 7
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests import disquePerce
+      self.l_problemes.append(casStandard(disquePerce.dicoParams, disquePerce.referencesMaillageFissure, n_cas))
+      self.d_nom_probleme[n_cas] = "disquePerce"
+      self.l_materiels.append("disquePerce")
+      self.l_materiels.append("ellipse_disque")
+
+    n_cas = 8
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.ellipse_1 import ellipse_1
+      self.l_problemes.append(ellipse_1(n_cas))
+      self.l_materiels.append("ellipse")
+      self.l_materiels.append("fissureGauche_2")
+
+    n_cas = 9
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.ellipse_2 import ellipse_2
+      self.l_problemes.append(ellipse_2(n_cas))
+      self.l_materiels.append("ellipse_probleme")
+      self.l_materiels.append("fissureGauche_2")
+
+    n_cas = 10
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.eprouvetteCourbe import eprouvetteCourbe
+      self.l_problemes.append(eprouvetteCourbe(n_cas))
+      self.l_materiels.append("eprouvetteCourbe")
+
+    n_cas = 11
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.eprouvetteDroite import eprouvetteDroite
+      self.l_problemes.append(eprouvetteDroite(n_cas))
+      self.l_materiels.append("eprouvetteDroite")
+
+    n_cas = 12
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.eprouvetteDroite_2 import eprouvetteDroite_2
+      self.l_problemes.append(eprouvetteDroite_2(n_cas))
+      self.l_materiels.append("eprouvetteDroite")
+
+    n_cas = 13
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.faceGauche import faceGauche
+      self.l_problemes.append(faceGauche(n_cas))
+      self.l_materiels.append("fissureGauche")
+
+    n_cas = 14
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.faceGauche_2 import faceGauche_2
+      self.l_problemes.append(faceGauche_2(n_cas))
+      self.l_materiels.append("fissureGauche_2")
+
+    n_cas = 15
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_1 import fissureCoude_1
+      self.l_problemes.append(fissureCoude_1(n_cas))
+
+    n_cas = 16
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_2 import fissureCoude_2
+      self.l_problemes.append(fissureCoude_2(n_cas))
+
+    n_cas = 17
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_3 import fissureCoude_3
+      self.l_problemes.append(fissureCoude_3(n_cas))
+
+    n_cas = 18
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_4 import fissureCoude_4
+      self.l_problemes.append(fissureCoude_4(n_cas))
+
+    n_cas = 19
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_5 import fissureCoude_5
+      self.l_problemes.append(fissureCoude_5(n_cas))
+
+    n_cas = 20
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_6 import fissureCoude_6
+      self.l_problemes.append(fissureCoude_6(n_cas))
+
+    n_cas = 21
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_7 import fissureCoude_7
+      self.l_problemes.append(fissureCoude_7(n_cas))
+
+    n_cas = 22
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_8 import fissureCoude_8
+      self.l_problemes.append(fissureCoude_8(n_cas))
+
+    n_cas = 23
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_9 import fissureCoude_9
+      self.l_problemes.append(fissureCoude_9(n_cas))
+
+    n_cas = 24
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissureCoude_10 import fissureCoude_10
+      self.l_problemes.append(fissureCoude_10(n_cas))
+
+    n_cas = 25
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissure_Coude import fissure_Coude
+      self.l_problemes.append(fissure_Coude(n_cas))
+
+    n_cas = 26
+    if n_cas in self.l_cas:
+      from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
+      self.l_problemes.append(fissure_Coude_4(n_cas))
+
+    n_cas = 27
+    if n_cas in self.l_cas:
+      # genereMateriel : vis
+      from blocFissure.CasTests.vis_1 import vis_1
+      self.l_problemes.append(vis_1(n_cas))
+      self.l_materiels.append("vis")
+
+    n_cas = 28
+    if n_cas in self.l_cas:
+      # genereMateriel : tube
+      from blocFissure.CasTests.tube import tube
+      self.l_problemes.append(tube(n_cas))
+      self.l_materiels.append("tube")
+      #"Mesh_13" has not been computed:
+      #-  "algo2d_facePeau_0" failed on "FACE_12 to mesh". Error: Algorithm failed. NgException at Surface meshing: Problem in Surface mesh generation
+      #-  "algo1d_cercle1_0" failed on EDGE #20. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+      #-  "algo1d_cercle1_0" failed on EDGE #17. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+      #-  "algo1d_cercle1_0" failed on EDGE #15. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+      #-  "algo1d_cercle1_0" failed on EDGE #12. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
+
+    return
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def cree_materiels (self):
+    """Création des matériels"""
+
+    if "cubeAngle" in self.l_materiels:
+      from blocFissure.materielCasTests import cubeAngle
+
+    if "cubeFin" in self.l_materiels:
+      from blocFissure.materielCasTests import cubeFin
+
+    if "decoupeCylindre" in self.l_materiels:
+      from blocFissure.materielCasTests import decoupeCylindre
+
+    if "disquePerce" in self.l_materiels:
+      from blocFissure.materielCasTests import disquePerce
+
+    if "ellipse_disque" in self.l_materiels:
+      from blocFissure.materielCasTests import ellipse_disque
+
+    if "ellipse_probleme" in self.l_materiels:
+      from blocFissure.materielCasTests import ellipse_probleme
+
+    if "ellipse" in self.l_materiels:
+      from blocFissure.materielCasTests import ellipse
+
+    if "fissureGauche" in self.l_materiels:
+      from blocFissure.materielCasTests import fissureGauche
+
+    if "fissureGauche_2" in self.l_materiels:
+      from blocFissure.materielCasTests import fissureGauche_2
+
+    if "eprouvetteCourbe" in self.l_materiels:
+      from blocFissure.materielCasTests import eprouvetteCourbe
+
+    if "eprouvetteDroite" in self.l_materiels:
+      from blocFissure.materielCasTests import eprouvetteDroite
+
+    if "vis" in self.l_materiels:
+      from blocFissure.materielCasTests import vis
+
+    if "tube" in self.l_materiels:
+      from blocFissure.materielCasTests import tube
+
+    return
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def calcul_cas (self, n_cas, cas, ligne):
+    """Calcul d'un cas"""
+    texte = ""
+    if n_cas in self.d_nom_probleme:
+      nom = self.d_nom_probleme[n_cas]
+    else:
+      nom = cas.nomProbleme
+    texte_a = "\n=== Exécution du cas n° {}, '{}'".format(NREF_PB[nom],nom)
+    logging.critical(ligne+texte_a)
+
+    try:
+      ok_maillage = cas.executeProbleme()
+    except:
+      traceback.print_exc()
+      ok_maillage = False
+    if not ok_maillage:
+      texte = "Problème avec le cas n° {}, '{}'\n".format(NREF_PB[nom],nom)
+    print(ligne)
+
+    return ok_maillage, texte
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def calcul_tout (self):
+    """Calcul de tous les cas"""
+
+    ligne = "---------------------------------------------------------------------"
+    texte = "\n"
+    nb_cas_ok = 0
+    nb_cas_nook = 0
+    for n_cas, cas in enumerate(self.l_problemes):
+      #print ("Cas n° {}, '{}'".format(n_cas,cas.nomProbleme))
+      ok_maillage, texte_a = self.calcul_cas (n_cas, cas, ligne)
+      texte += texte_a
+      if ok_maillage:
+        nb_cas_ok += 1
+      else:
+        nb_cas_nook += 1
+      print(ligne)
+
+    nb_cas = nb_cas_nook + nb_cas_ok
+    if ( nb_cas > 1):
+      if nb_cas_nook:
+        texte += ". Nombre de cas_tests OK   : {}\n".format(nb_cas_ok)
+        texte += ". Nombre de cas_tests NOOK : {}\n".format(nb_cas_nook)
+      else:
+        texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
+    print (texte+ligne)
+    logging.critical(ligne+texte)
+
+    return texte
+
+#===========================  Fin de la méthode ==================================
+
+#=========================== Début de la méthode =================================
+
+  def lancement (self):
+    """Lancement général"""
+
+    # Tri des problèmes
+    self.caract_l_problemes ()
+
+    # Création des matériels
+    self.cree_materiels ()
+
+    # Calcul des fissures
+    texte = self.calcul_tout ()
+
+    return texte
+
+#===========================  Fin de la méthode ==================================
+
+#==========================  Fin de la classe ====================================
+
+#==================================================================================
+# Lancement
+#==================================================================================
+
+if __name__ == "__main__" :
+
+# 1. Options
+
+  L_OPTIONS = sys.argv[1:]
+  L_OPTIONS.append("-v")
+
+# 2. Lancement de la classe
+
+  #print ("L_OPTIONS :", L_OPTIONS)
+  BLOCFISSURE_TEST = blocFissureTest(L_OPTIONS)
+
+  if BLOCFISSURE_TEST.affiche_aide_globale:
+    sys.stdout.write(BLOCFISSURE_TEST.__doc__+"\n")
+  else:
+    TEXTE = BLOCFISSURE_TEST.lancement()
+    sys.stdout.write(TEXTE)
+
+  del BLOCFISSURE_TEST
diff --git a/src/Tools/blocFissure/CasTests/cubeAngle2.py b/src/Tools/blocFissure/CasTests/cubeAngle2.py
deleted file mode 100644 (file)
index f2ede5d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021  EDF R&D
-#
-# 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
-#
-"""problème de fissure plane coupant 2 faces (angle)"""
-
-import os
-
-from .cubeAngle import cubeAngle
-
-class cubeAngle2(cubeAngle):
-  """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
-
-  detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
-  """
-
-  nomProbleme = "cubeAngle2"
-
-  # ---------------------------------------------------------------------------
-  def setParamShapeFissure(self):
-    """paramètres de la fissure pour méthode construitFissureGenerale
-
-    lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
-    rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
-    """
-    self.shapeFissureParams = dict(lgInfluence = 20,
-                                   rayonPipe   = 5)
-
-  # ---------------------------------------------------------------------------
-  def setParamMaillageFissure(self):
-    self.maillageFissureParams = dict(nomRep           = os.curdir,
-                                      nomFicSain       = self.nomProbleme,
-                                      nomFicFissure    = self.nomProbleme + "_fissure",
-                                      nbsegRad         = 5,
-                                      nbsegCercle      = 32,
-                                      areteFaceFissure = 5)
-
-  # ---------------------------------------------------------------------------
-  def setReferencesMaillageFissure(self):
-    self.referencesMaillageFissure = dict( \
-                                          Entity_Quad_Quadrangle = 2350, \
-                                          Entity_Quad_Hexa = 5315, \
-                                          Entity_Node = 38196, \
-                                          Entity_Quad_Edge = 345, \
-                                          Entity_Quad_Triangle = 1214, \
-                                          Entity_Quad_Tetra = 7772, \
-                                          Entity_Quad_Pyramid = 620, \
-                                          Entity_Quad_Penta = 512 \
-                                         )
diff --git a/src/Tools/blocFissure/CasTests/cubeAngle_2.py b/src/Tools/blocFissure/CasTests/cubeAngle_2.py
new file mode 100644 (file)
index 0000000..24f2d01
--- /dev/null
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021  EDF R&D
+#
+# 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
+#
+"""problème de fissure plane coupant 2 faces (angle)"""
+
+import os
+
+from .cubeAngle import cubeAngle
+
+class cubeAngle_2(cubeAngle):
+  """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
+
+  detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
+  """
+
+  nomProbleme = "cubeAngle_2"
+
+  # ---------------------------------------------------------------------------
+  def setParamShapeFissure(self):
+    """paramètres de la fissure pour méthode construitFissureGenerale
+
+    lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
+    rayonPipe   : le rayon du pile maillé en hexa autour du fond de fissure
+    """
+    self.shapeFissureParams = dict(lgInfluence = 20,
+                                   rayonPipe   = 5)
+
+  # ---------------------------------------------------------------------------
+  def setParamMaillageFissure(self):
+    self.maillageFissureParams = dict(nomRep           = os.curdir,
+                                      nomFicSain       = self.nomProbleme,
+                                      nomFicFissure    = self.nomProbleme + "_fissure",
+                                      nbsegRad         = 5,
+                                      nbsegCercle      = 32,
+                                      areteFaceFissure = 5)
+
+  # ---------------------------------------------------------------------------
+  def setReferencesMaillageFissure(self):
+    self.referencesMaillageFissure = dict( \
+                                          Entity_Quad_Quadrangle = 2350, \
+                                          Entity_Quad_Hexa = 5315, \
+                                          Entity_Node = 38196, \
+                                          Entity_Quad_Edge = 345, \
+                                          Entity_Quad_Triangle = 1214, \
+                                          Entity_Quad_Tetra = 7772, \
+                                          Entity_Quad_Pyramid = 620, \
+                                          Entity_Quad_Penta = 512 \
+                                         )
index 05e6f22bc17097700a540937fd4c3c2a3111501d..4d0a93d4f4f623f2534734564ed1be982b36fa55 100644 (file)
@@ -33,7 +33,7 @@ from .cylindre import cylindre
 class cylindre_2(cylindre):
   """problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
 
-  nomProbleme = "cylindre2"
+  nomProbleme = "cylindre_2"
 
   # ---------------------------------------------------------------------------
   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
index 558afb038bbaad7815826e43d14a2d044f8a2c6e..8412b52d11fd1083bb5a5e136d4460de7b10ccb7 100644 (file)
@@ -23,8 +23,8 @@
 import os
 from blocFissure import gmu
 
-dicoParams = dict(nomCas            = 'disque',
-                  nomProbleme       = "disque",
+dicoParams = dict(nomCas            = 'disquePerce',
+                  nomProbleme       = "disquePerce",
                   maillageSain      = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"),
                   CAOFaceFissure    = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"),
                   edgeFiss          = [3],
index 764e75c4849e1d5886922e939a96c67424d494b0..d29eddc25d95ef141a4f9bb3ae54b3e9ff53aba7 100644 (file)
@@ -34,7 +34,7 @@ from blocFissure.gmu.putName import putName
 class ellipse_1(fissureGenerique):
   """problème de fissure non plane, débouchante non normale"""
 
-  nomProbleme = "ellipse1"
+  nomProbleme = "ellipse_1"
   shapeFissureParams = dict()
   maillageFissureParams = dict()
   referencesMaillageFissure = dict()
@@ -78,7 +78,7 @@ class ellipse_1(fissureGenerique):
 
     lgInfluence = shapeFissureParams['lgInfluence']
 
-    shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1.brep"))
+    shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1.brep"))
     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
     geompy.UnionIDs(fondFiss, [3])
     geompy.addToStudy( shellFiss, 'shellFiss' )
index b1dd294903acc19189fd27eb9f55f84894b9c2c5..aaf78dc8aa40746ce54d7ea1f9f573594faf9447 100644 (file)
@@ -32,7 +32,7 @@ from .ellipse_1 import ellipse_1
 class ellipse_2(ellipse_1):
   """problème de fissure non plane, débouchante non normale"""
 
-  nomProbleme = "ellipse2"
+  nomProbleme = "ellipse_2"
 
   # ---------------------------------------------------------------------------
   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
@@ -43,7 +43,7 @@ class ellipse_2(ellipse_1):
 
     lgInfluence = shapeFissureParams['lgInfluence']
 
-    shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
+    shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1_pb.brep"))
     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
     geompy.UnionIDs(fondFiss, [3])
     geompy.addToStudy( shellFiss, 'shellFiss' )
diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py
deleted file mode 100644 (file)
index 2213dbc..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021  EDF R&D
-#
-# 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
-#
-"""Lancement des cas-tests de blocFissure"""
-
-import logging
-import os
-import tempfile
-import traceback
-
-from blocFissure.gmu import initLog
-from blocFissure.gmu.casStandard import casStandard
-
-# -----------------------------------------------------------------------------------------------
-LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
-#initLog.setDebug(LOGFILE)     # debug = 10
-#initLog.setVerbose(LOGFILE)   # info = 20
-#initLog.setRelease(LOGFILE)   # warning = 30
-#initLog.setPerfTests(LOGFILE) # critical = 50
-#initLog.setAlways(LOGFILE)    # critical = 50
-
-# ---tous les cas en séquence, ou les cas sélectionnés ...
-TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] # OK 19/04/2021
-#           0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
-#RUNALL = False
-RUNALL = True
-if RUNALL:
-  TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
-#           0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
-  TORUN = TORUNOK
-else:
-  TORUNPB = list()
-  for IAUX in TORUNOK:
-    TORUNPB.append((IAUX+1)%2)
-  print ("TORUN = {} # OK".format(TORUNOK))
-  print ("TORUN = {} # PB".format(TORUNPB))
-#                                                                                                    genereMateriel
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # aucun
-  TORUN = [ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cubeAngle
-  TORUN = [ 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cubeFin
-  TORUN = [ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # decoupeCylindre
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # disque_perce + ellipse_disque
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # ellipse + fissureGauche2
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # ellipse_probleme + fissureGauche2
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteCourbe
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteDroite
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0] # vis
-  TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] # tube
-#           0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
-  TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] #  OK
-# -----------------------------------------------------------------------------------------------
-
-def caract_l_problemes ():
-  """Caractérisation des problèmes"""
-  d_aux = dict()
-  l_problemes = list()
-
-  n_cas = 0
-  # genereMateriel : cubeAngle
-  from blocFissure.CasTests.cubeAngle import cubeAngle
-  l_problemes.append(cubeAngle(n_cas))
-
-  n_cas = 1
-  # genereMateriel : cubeAngle
-  from blocFissure.CasTests.cubeAngle2 import cubeAngle2
-  l_problemes.append(cubeAngle2(n_cas))
-
-  n_cas = 2
-  # genereMateriel : cubeFin
-  from blocFissure.CasTests import cubeCoin
-  l_problemes.append(casStandard(cubeCoin.dicoParams, cubeCoin.referencesMaillageFissure, n_cas))
-  d_aux[n_cas] = "cubeCoin"
-
-  n_cas = 3
-  # genereMateriel : cubeFin
-  from blocFissure.CasTests import cubeMilieu
-  l_problemes.append(casStandard(cubeMilieu.dicoParams, cubeMilieu.referencesMaillageFissure, n_cas))
-  d_aux[n_cas] = "cubeMilieu"
-
-  n_cas = 4
-  # genereMateriel : cubeFin
-  from blocFissure.CasTests import cubeTransverse
-  l_problemes.append(casStandard(cubeTransverse.dicoParams, cubeTransverse.referencesMaillageFissure, n_cas))
-  d_aux[n_cas] = "cubeTransverse"
-
-  n_cas = 5
-  # genereMateriel : decoupeCylindre
-  from blocFissure.CasTests.cylindre import cylindre
-  l_problemes.append(cylindre(n_cas))
-
-  n_cas = 6
-  # genereMateriel : decoupeCylindre
-  from blocFissure.CasTests.cylindre_2 import cylindre_2
-  l_problemes.append(cylindre_2(n_cas))
-
-  n_cas = 7
-  # genereMateriel : disque_perce
-  # genereMateriel : ellipse_disque
-  from blocFissure.CasTests import disquePerce
-  l_problemes.append(casStandard(disquePerce.dicoParams, disquePerce.referencesMaillageFissure, n_cas))
-  d_aux[n_cas] = "disquePerce"
-
-  n_cas = 8
-  # genereMateriel: ellipse
-  # genereMateriel : fissureGauche2
-  from blocFissure.CasTests.ellipse_1 import ellipse_1
-  l_problemes.append(ellipse_1(n_cas))
-
-  n_cas = 9
-  # genereMateriel: ellipse_probleme
-  # genereMateriel : fissureGauche2
-  from blocFissure.CasTests.ellipse_2 import ellipse_2
-  l_problemes.append(ellipse_2(n_cas))
-
-  n_cas = 10
-  # genereMateriel : eprouvetteCourbe
-  from blocFissure.CasTests.eprouvetteCourbe import eprouvetteCourbe
-  l_problemes.append(eprouvetteCourbe(n_cas))
-
-  n_cas = 11
-  # genereMateriel : eprouvetteDroite
-  from blocFissure.CasTests.eprouvetteDroite import eprouvetteDroite
-  l_problemes.append(eprouvetteDroite(n_cas))
-
-  n_cas = 12
-  # genereMateriel : eprouvetteDroite
-  from blocFissure.CasTests.eprouvetteDroite_2 import eprouvetteDroite_2
-  l_problemes.append(eprouvetteDroite_2(n_cas))
-
-  n_cas = 13
-  # genereMateriel : fissureGauche
-  from blocFissure.CasTests.faceGauche import faceGauche
-  l_problemes.append(faceGauche(n_cas))
-
-  n_cas = 14
-  # genereMateriel : fissureGauche2
-  from blocFissure.CasTests.faceGauche_2 import faceGauche_2
-  l_problemes.append(faceGauche_2(n_cas))
-
-  n_cas = 15
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_1 import fissureCoude_1
-  l_problemes.append(fissureCoude_1(n_cas))
-
-  n_cas = 16
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_2 import fissureCoude_2
-  l_problemes.append(fissureCoude_2(n_cas))
-
-  n_cas = 17
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_3 import fissureCoude_3
-  l_problemes.append(fissureCoude_3(n_cas))
-
-  n_cas = 18
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_4 import fissureCoude_4
-  l_problemes.append(fissureCoude_4(n_cas))
-
-  n_cas = 19
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_5 import fissureCoude_5
-  l_problemes.append(fissureCoude_5(n_cas))
-
-  n_cas = 20
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_6 import fissureCoude_6
-  l_problemes.append(fissureCoude_6(n_cas))
-
-  n_cas = 21
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_7 import fissureCoude_7
-  l_problemes.append(fissureCoude_7(n_cas))
-
-  n_cas = 22
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_8 import fissureCoude_8
-  l_problemes.append(fissureCoude_8(n_cas))
-
-  n_cas = 23
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_9 import fissureCoude_9
-  l_problemes.append(fissureCoude_9(n_cas))
-
-  n_cas = 24
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissureCoude_10 import fissureCoude_10
-  l_problemes.append(fissureCoude_10(n_cas))
-
-  n_cas = 25
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissure_Coude import fissure_Coude
-  l_problemes.append(fissure_Coude(n_cas))
-
-  n_cas = 26
-  # genereMateriel : aucun
-  from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
-  l_problemes.append(fissure_Coude_4(n_cas))
-
-  n_cas = 27
-  # genereMateriel : vis
-  from blocFissure.CasTests.vis_1 import vis_1
-  l_problemes.append(vis_1(n_cas))
-
-  n_cas = 28
-  # genereMateriel : tube
-  from blocFissure.CasTests.tube import tube
-  l_problemes.append(tube(n_cas))
-  #"Mesh_13" has not been computed:
-  #-  "algo2d_facePeau_0" failed on "FACE_12 to mesh". Error: Algorithm failed. NgException at Surface meshing: Problem in Surface mesh generation
-  #-  "algo1d_cercle1_0" failed on EDGE #20. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
-  #-  "algo1d_cercle1_0" failed on EDGE #17. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
-  #-  "algo1d_cercle1_0" failed on EDGE #15. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
-  #-  "algo1d_cercle1_0" failed on EDGE #12. Error: Algorithm failed. Source elements don't cover totally the geometrical edge
-
-  return l_problemes, d_aux
-#=============================================================
-def calcul_cas (n_cas, cas, d_aux, ligne):
-  """Calcul d'un cas"""
-  texte = ""
-  if n_cas in d_aux:
-    nom = d_aux[n_cas]
-  else:
-    nom = cas.nomProbleme
-  texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
-  logging.critical(ligne+texte_a)
-
-  try:
-    ok_maillage = cas.executeProbleme()
-  except:
-    traceback.print_exc()
-    ok_maillage = False
-  if not ok_maillage:
-    texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
-  print(ligne)
-
-  return ok_maillage, texte
-#=============================================================
-def calcul_tout (l_problemes, d_aux):
-  """Calcul de tous les cas"""
-
-  ligne = "---------------------------------------------------------------------"
-  texte = "\n"
-  nb_cas_ok = 0
-  nb_cas_nook = 0
-  for n_cas, cas in enumerate(l_problemes):
-    #print ("Cas n° {}, '{}'".format(n_cas,cas.nomProbleme))
-    if TORUN[n_cas]:
-      ok_maillage, texte_a = calcul_cas (n_cas, cas, d_aux, ligne)
-      texte += texte_a
-      if ok_maillage:
-        nb_cas_ok += 1
-      else:
-        nb_cas_nook += 1
-      print(ligne)
-
-  nb_cas = nb_cas_nook + nb_cas_ok
-  if ( nb_cas > 1):
-    if nb_cas_nook:
-      texte += ". Nombre de cas_tests OK   : {}\n".format(nb_cas_ok)
-      texte += ". Nombre de cas_tests NOOK : {}\n".format(nb_cas_nook)
-    else:
-      texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
-  print (texte+ligne)
-  logging.critical(ligne+texte)
-
-  return
-#=============================================================
-#=============================================================
-
-while True:
-
-  L_PROBLEMES, D_AUX = caract_l_problemes()
-
-  if ( len(L_PROBLEMES) != len(TORUN) ):
-    TEXTE  = "\nNombre de problèmes définis  : {}\n".format(len(L_PROBLEMES))
-    TEXTE += "Longueur de la liste 'TORUN' : {}\n".format(len(TORUN))
-    TEXTE += "\t==> Incohérence de programmation à corriger dans {}".format(__name__)
-    print (TEXTE)
-    break
-
-  calcul_tout (L_PROBLEMES, D_AUX)
-
-  break
index 5d530fb5c26be1742c1df3fcb2c6273aa273e4b3..b72f48cc03246e39871f6ef47428ad635e44d65a 100644 (file)
@@ -43,7 +43,7 @@ master_doc = 'index'
 
 # General substitutions.
 project = 'Plug-in blocFissure'
-copyright = '2010-2021 EDF R&D'
+copyright = '2010-2021 EDF'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
diff --git a/src/Tools/blocFissure/doc/images/01_CubeAngle_2.png b/src/Tools/blocFissure/doc/images/01_CubeAngle_2.png
deleted file mode 100644 (file)
index aa4b00c..0000000
Binary files a/src/Tools/blocFissure/doc/images/01_CubeAngle_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/01_CubeAngle_a.png b/src/Tools/blocFissure/doc/images/01_CubeAngle_a.png
new file mode 100644 (file)
index 0000000..aa4b00c
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/01_CubeAngle_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/02_CubeAngle2.png b/src/Tools/blocFissure/doc/images/02_CubeAngle2.png
deleted file mode 100644 (file)
index 3a01748..0000000
Binary files a/src/Tools/blocFissure/doc/images/02_CubeAngle2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png b/src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png
deleted file mode 100644 (file)
index d590720..0000000
Binary files a/src/Tools/blocFissure/doc/images/02_CubeAngle2_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/02_CubeAngle_2.png b/src/Tools/blocFissure/doc/images/02_CubeAngle_2.png
new file mode 100644 (file)
index 0000000..3a01748
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/02_CubeAngle_2.png differ
diff --git a/src/Tools/blocFissure/doc/images/02_CubeAngle_2_a.png b/src/Tools/blocFissure/doc/images/02_CubeAngle_2_a.png
new file mode 100644 (file)
index 0000000..d590720
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/02_CubeAngle_2_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/03_cylindre_2.png b/src/Tools/blocFissure/doc/images/03_cylindre_2.png
deleted file mode 100644 (file)
index 106d201..0000000
Binary files a/src/Tools/blocFissure/doc/images/03_cylindre_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/03_cylindre_a.png b/src/Tools/blocFissure/doc/images/03_cylindre_a.png
new file mode 100644 (file)
index 0000000..106d201
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/03_cylindre_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/04_cylindre2.png b/src/Tools/blocFissure/doc/images/04_cylindre2.png
deleted file mode 100644 (file)
index 8f06c17..0000000
Binary files a/src/Tools/blocFissure/doc/images/04_cylindre2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/04_cylindre2_2.png b/src/Tools/blocFissure/doc/images/04_cylindre2_2.png
deleted file mode 100644 (file)
index a065a41..0000000
Binary files a/src/Tools/blocFissure/doc/images/04_cylindre2_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/04_cylindre_2.png b/src/Tools/blocFissure/doc/images/04_cylindre_2.png
new file mode 100644 (file)
index 0000000..8f06c17
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/04_cylindre_2.png differ
diff --git a/src/Tools/blocFissure/doc/images/04_cylindre_2_a.png b/src/Tools/blocFissure/doc/images/04_cylindre_2_a.png
new file mode 100644 (file)
index 0000000..a065a41
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/04_cylindre_2_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/05_disque_2.png b/src/Tools/blocFissure/doc/images/05_disque_2.png
deleted file mode 100644 (file)
index deda214..0000000
Binary files a/src/Tools/blocFissure/doc/images/05_disque_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/05_disque_a.png b/src/Tools/blocFissure/doc/images/05_disque_a.png
new file mode 100644 (file)
index 0000000..deda214
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/05_disque_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/06_ellipse1.png b/src/Tools/blocFissure/doc/images/06_ellipse1.png
deleted file mode 100644 (file)
index 9ad5911..0000000
Binary files a/src/Tools/blocFissure/doc/images/06_ellipse1.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/06_ellipse1_2.png b/src/Tools/blocFissure/doc/images/06_ellipse1_2.png
deleted file mode 100644 (file)
index 349ff36..0000000
Binary files a/src/Tools/blocFissure/doc/images/06_ellipse1_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/06_ellipse_1.png b/src/Tools/blocFissure/doc/images/06_ellipse_1.png
new file mode 100644 (file)
index 0000000..9ad5911
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/06_ellipse_1.png differ
diff --git a/src/Tools/blocFissure/doc/images/06_ellipse_1_a.png b/src/Tools/blocFissure/doc/images/06_ellipse_1_a.png
new file mode 100644 (file)
index 0000000..349ff36
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/06_ellipse_1_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/07_ellipse2.png b/src/Tools/blocFissure/doc/images/07_ellipse2.png
deleted file mode 100644 (file)
index 354b93d..0000000
Binary files a/src/Tools/blocFissure/doc/images/07_ellipse2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/07_ellipse2_2.png b/src/Tools/blocFissure/doc/images/07_ellipse2_2.png
deleted file mode 100644 (file)
index 0f306a7..0000000
Binary files a/src/Tools/blocFissure/doc/images/07_ellipse2_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/07_ellipse_2.png b/src/Tools/blocFissure/doc/images/07_ellipse_2.png
new file mode 100644 (file)
index 0000000..354b93d
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/07_ellipse_2.png differ
diff --git a/src/Tools/blocFissure/doc/images/07_ellipse_2_a.png b/src/Tools/blocFissure/doc/images/07_ellipse_2_a.png
new file mode 100644 (file)
index 0000000..0f306a7
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/07_ellipse_2_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png b/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png
deleted file mode 100644 (file)
index 53e826f..0000000
Binary files a/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_a.png b/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_a.png
new file mode 100644 (file)
index 0000000..53e826f
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/08_eprouvetteCourbe_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png b/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png
deleted file mode 100644 (file)
index 9c5c222..0000000
Binary files a/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_a.png b/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_a.png
new file mode 100644 (file)
index 0000000..9c5c222
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/09_eprouvetteDroite_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png
deleted file mode 100644 (file)
index 3801db3..0000000
Binary files a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png
deleted file mode 100644 (file)
index 562865e..0000000
Binary files a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite2_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2.png b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2.png
new file mode 100644 (file)
index 0000000..3801db3
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2.png differ
diff --git a/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2_a.png b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2_a.png
new file mode 100644 (file)
index 0000000..562865e
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/10_eprouvetteDroite_2_a.png differ
diff --git a/src/Tools/blocFissure/doc/images/12_faceGauche2.png b/src/Tools/blocFissure/doc/images/12_faceGauche2.png
deleted file mode 100644 (file)
index ff0163a..0000000
Binary files a/src/Tools/blocFissure/doc/images/12_faceGauche2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/12_faceGauche2_2.png b/src/Tools/blocFissure/doc/images/12_faceGauche2_2.png
deleted file mode 100644 (file)
index 2e4cbe5..0000000
Binary files a/src/Tools/blocFissure/doc/images/12_faceGauche2_2.png and /dev/null differ
diff --git a/src/Tools/blocFissure/doc/images/12_faceGauche_2.png b/src/Tools/blocFissure/doc/images/12_faceGauche_2.png
new file mode 100644 (file)
index 0000000..ff0163a
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/12_faceGauche_2.png differ
diff --git a/src/Tools/blocFissure/doc/images/12_faceGauche_2_a.png b/src/Tools/blocFissure/doc/images/12_faceGauche_2_a.png
new file mode 100644 (file)
index 0000000..2e4cbe5
Binary files /dev/null and b/src/Tools/blocFissure/doc/images/12_faceGauche_2_a.png differ
index 078da259697a2abff64b7a3a8b9c87e875ae79c3..d8804c1c3ccc87cff14423b1489245c9ebccb1fe 100644 (file)
@@ -51,21 +51,21 @@ Geometrical parameters of the tore are illustrated :
    :align: center\r
    :alt: Geometrical parameters of the tore\r
 \r
-Different levels of verbose are available. Use one of this 4 optional functions to set verbose type:\r
+Different levels of verbose are available. The prints are located in the file ''LOGFILE''. Use one of this 4 optional functions to set verbose type:\r
 \r
-- / **setDebug()**\r
+- / **setDebug(LOGFILE)**\r
 \r
-- / **setVerbose()**\r
+- / **setVerbose(LOGFILE)**\r
 \r
-- / **setRelease()**\r
+- / **setRelease(LOGFILE)**\r
 \r
-- / **setUnitTests()**\r
+- / **setUnitTests(LOGFILE)**\r
 \r
 **example to run in salome session**::\r
 \r
   from blocFissure import gmu\r
   from blocFissure.gmu import initLog\r
-  initLog.setDebug()\r
+  initLog.setDebug("/tmp/blocFissure.log")\r
 \r
   from blocFissure.casStandard import casStandard\r
 \r
@@ -83,6 +83,8 @@ Different levels of verbose are available. Use one of this 4 optional functions
 \r
   execInstance = casStandard(dicoParams)\r
 \r
+  newmesh = execInstance.maillageFissure\r
+\r
 \r
 \r
 \r
index 8119c4e6e1da1f32861c81839f97b5d12627c1af..57dc0948166477c0dc05cf4e1bf42b11392a1638 100644 (file)
 Test cases\r
 #######################\r
 \r
-A base of 30 test cases guarantees the correct functioning of « Bloc Fissure ». 12 cases are dedicated to :ref:`cracked bended pipes <pipeTC>` and the others 13 are for other :ref:`generic geometries <genericTC>`. They are shown here in order to illustrate cases on which « Bloc Fissure » works.\r
+A base of 28 test cases guarantees the correct functioning of « Bloc Fissure ». 12 cases are dedicated to :ref:`cracked bended pipes <pipeTC>` and the others 16 are for other :ref:`generic geometries <genericTC>`. They are shown here in order to illustrate cases on which « Bloc Fissure » works.\r
 \r
 .. _genericTC:\r
 \r
 Generic cases\r
 ===============================\r
 \r
-All 13 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.\r
-\r
-+-------------------------------------------+----------------------------------------------+\r
-| CubeAngle                                                                                |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/01_CubeAngle.png         | .. image:: images/01_CubeAngle_2.png         |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| CubeAngle2                                                                               |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/02_CubeAngle2.png        | .. image:: images/02_CubeAngle2_2.png        |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| cylindre                                                                                 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/03_cylindre.png          | .. image:: images/03_cylindre_2.png          |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| cylindre2                                                                                |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/04_cylindre2.png         | .. image:: images/04_cylindre2_2.png         |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| disque                                                                                   |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/05_disque.png            | .. image:: images/05_disque_2.png            |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| ellipse1                                                                                 |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/06_ellipse1.png          | .. image:: images/06_ellipse1_2.png          |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| ellipse2 (tilted crack)                                                                  |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/07_ellipse2.png          | .. image:: images/07_ellipse2_2.png          |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteCourbe                                                                         |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/08_eprouvetteCourbe.png  | .. image:: images/08_eprouvetteCourbe_2.png  |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteDroite                                                                         |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/09_eprouvetteDroite.png  | .. image:: images/09_eprouvetteDroite_2.png  |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| eprouvetteDroite2                                                                        |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/10_eprouvetteDroite2.png | .. image:: images/10_eprouvetteDroite2_2.png |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| faceGauche                                                                               |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/11_faceGauche.png        | .. image:: images/11_faceGauche_2.png        |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| faceGauche2                                                                              |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/12_faceGauche2.png       | .. image:: images/12_faceGauche2_2.png       |\r
-|   :height: 300                            |    :height: 300                              |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| vis (Crack is in the radius filet between the screw head and the screw shank)            |\r
-+-------------------------------------------+----------------------------------------------+\r
-|.. image:: images/13_vis_1.png             | .. image:: images/13_vis_1_2.png             |\r
-|   :width: 400                             |    :width: 400                               |\r
-|   :align: center                          |    :align: center                            |\r
-+-------------------------------------------+----------------------------------------------+\r
-| tube                                                                                     |\r
-+-------------------------------------------+----------------------------------------------+\r
+All 16 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.\r
+\r
++--------------------------------------------+-----------------------------------------------+\r
+| CubeAngle                                                                                  |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/01_CubeAngle.png          | .. image:: images/01_CubeAngle_a.png          |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| CubeAngle_2                                                                                |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/02_CubeAngle_2.png        | .. image:: images/02_CubeAngle_2_a.png        |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeCoin                                                                                   |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeMilieu                                                                                 |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cubeTransverse                                                                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cylindre                                                                                   |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/03_cylindre.png           | .. image:: images/03_cylindre_a.png           |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| cylindre_2                                                                                 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/04_cylindre_2.png         | .. image:: images/04_cylindre_2_a.png         |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| disquePerce                                                                                |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/05_disque.png             | .. image:: images/05_disque_a.png             |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| ellipse_1                                                                                  |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/06_ellipse_1.png          | .. image:: images/06_ellipse_1_a.png          |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| ellipse_2 (tilted crack)                                                                   |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/07_ellipse_2.png          | .. image:: images/07_ellipse_2_a.png          |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteCourbe                                                                           |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/08_eprouvetteCourbe.png   | .. image:: images/08_eprouvetteCourbe_a.png   |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteDroite                                                                           |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/09_eprouvetteDroite.png   | .. image:: images/09_eprouvetteDroite_a.png   |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| eprouvetteDroite_2                                                                         |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/10_eprouvetteDroite_2.png | .. image:: images/10_eprouvetteDroite_2_a.png |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| faceGauche                                                                                 |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/11_faceGauche.png         | .. image:: images/11_faceGauche_2.png         |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| faceGauche_2                                                                               |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/12_faceGauche_2.png       | .. image:: images/12_faceGauche_2_a.png       |\r
+|   :height: 300                             |    :height: 300                               |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| vis (Crack is in the radius filet between the screw head and the screw shank)              |\r
++--------------------------------------------+-----------------------------------------------+\r
+|.. image:: images/13_vis_1.png              | .. image:: images/13_vis_1_2.png              |\r
+|   :width: 400                             |    :width: 400                                 |\r
+|   :align: center                           |    :align: center                             |\r
++--------------------------------------------+-----------------------------------------------+\r
+| tube                                                                                       |\r
++--------------------------------------------+-----------------------------------------------+\r
 \r
 .. _pipeTC:\r
 \r
@@ -123,16 +129,14 @@ coude_0 can be computed using this file for the data:
 \r
 « Bloc Fissure » is very efficient for the case of bended pipes. The generation of the geometry and the crack insertion takes only around 15s.\r
 \r
-Running test cases\r
+Data for the test cases\r
 =====================================\r
 \r
 All the files for these test cases are stored in the directory of the installation of SALOME:\r
 \r
 ``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``\r
 \r
-The test cases can be runned either through the python window of the SALOME GUI or with a python script.\r
-\r
-0) **Generate med and breps files.**::\r
+The set of the med, xao and brep files can be created by the following importation:\r
 \r
     from blocFissure.materielCasTests import genereMateriel\r
 \r
@@ -142,48 +146,36 @@ Once the files are generated, they are saved into the directory of the installat
 \r
 There is no need to generate them again.\r
 \r
-1) **To execute all test cases**::\r
-\r
-    from blocFissure.CasTests import execution_Cas\r
-\r
-2) **To execute only selected test cases**:\r
+To check the installation of salome, the test cases can be computed by the salome test process::\r
 \r
-modify the file ``CasTests/execution_Cas.py`` and change::\r
+    salome -test blocFissure\r
 \r
-    runall = False. #old : True\r
-\r
-And change from 0 to 1 of the index of the test you want to launch::\r
+Running test cases\r
+=====================================\r
 \r
-    torun = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\r
+The test cases can be runned by the following instructions::\r
 \r
-then launch the test cases::\r
+    from blocFissure.CasTests.blocFissureTest import blocFissureTest\r
+    BLOCFISSURE_TEST = blocFissureTest(list_of_cases)\r
+    MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()\r
+    sys.stdout.write(MESSAGE_ERREUR)\r
+    del BLOCFISSURE_TEST\r
 \r
-    from blocFissure.CasTests import execution_Cas\r
+If ``list_of_cases`` is an empty list, all the cases are computed.\r
 \r
-The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle2,\r
-2 for cubeCoin... from top to bottom, then from left to right.\r
+If not, ``list_of_cases`` is made of the list of the numbers and/or the name of the requested case. The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle_2, 2 for cubeCoin... from top to bottom, then from left to right.\r
 \r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
 | cubeAngle          | cylindre_2         | eprouvetteDroite_2 | fissureCoude_3  | fissureCoude_9  |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
-| cubeAngle        | disquePerce        | faceGauche         | fissureCoude_4  | fissure_Coude   |\r
+| cubeAngle_2        | disquePerce        | faceGauche         | fissureCoude_4  | fissure_Coude   |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
 | cubeCoin           | ellipse_1          | faceGauche_2       | fissureCoude_5  | fissure_Coude_4 |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
 | cubeMilieu         | ellipse_2          | fissureCoude_1     | fissureCoude_6  | vis_1           |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
-| cubeTransverse     | eprouvetteCourbe   | fissureCoude_10    | fissureCoude_7  | tube            |\r
+| cubeTransverse     | eprouvetteCourbe   | fissureCoude_10    | fissureCoude_7  |                 |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
 | cylindre           | eprouvetteDroite   | fissureCoude_2     | fissureCoude_8  |                 |\r
 +--------------------+--------------------+--------------------+-----------------+-----------------+\r
 \r
-3) **To execute only one test case**::\r
-\r
-    from blocFissure.CasTests.[TEST_CASE_NAME] import [TEST_CASE_NAME]\r
-\r
-    [TEST_CASE_NAME](0).executeProbleme()\r
-\r
-[TEST_CASE_NAME] is the name of the test case in the previous list. Note that the test cases fissureCoude_4 and fissure_Coude_4 are very similar.\r
-\r
-\r
-\r
index a2aa580c469f0a96d99055c81ba768d2c06db3ec..90e0f60f7484659b7b4bc5ee6e18721cd54d6f00 100644 (file)
@@ -132,8 +132,8 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
 
   # --- inventaire des faces de peau coupées par la fissure
 
-  ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, \
-    facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
+  ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
+    gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
     edgeRadFacePipePeau, facesPipePeau = \
     construitFissureGenerale_b( partitionsPeauFissFond, \
                                 edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
@@ -201,7 +201,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
   # --- maillage faces de peau
 
   meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
-                                    facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
+                                    facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
                                     bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
                                     edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
                                     mailleur, nro_cas)
index bf2c5d4fdec95580b9b9069a167275ee66880825..b96ce6386360376ba1ecacd69aa8a4fe5faf90cb 100644 (file)
@@ -50,7 +50,6 @@ pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
   edFisExtPi = [ list() for _ in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
   facesPeaux = [None for _ in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
   edCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
-  ptCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
   gpedgeBord = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
   gpedgeVifs = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
   edFissPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
@@ -70,7 +69,6 @@ pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
       edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
       facesPeaux[ifil] = dataPPFF['facePeau']
       edCircPeau[ifil] = dataPPFF['edgesCircPeau']
-      ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
       gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
       gpedgeVifs[ifil] = dataPPFF['bordsVifs']
       edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
@@ -87,5 +85,5 @@ pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
     geomPublish(initLog.debug, avc, name, nro_cas)
 
   return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
-         ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
+         gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
          edgeRadFacePipePeau, facesPipePeau
index f053e93bfeba254e9dd66f8ba41192f3750e7105..0092b64621258a0db1856583ae23f8b7c25d6401 100644 (file)
@@ -34,6 +34,7 @@ class fissureGenerique(object):
   """
 
   nomProbleme = "fissureGenerique"
+  maillageFissure = None
   geomParams = dict()
   meshParams = dict()
   shapeFissureParams = dict()
@@ -132,10 +133,10 @@ class fissureGenerique(object):
     if step == 4:
       return
 
-    maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
-                                                 shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
-                                                 elementsDefaut, step, mailleur)
+    self.maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
+                                                      shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
+                                                      elementsDefaut, step, mailleur)
 
     self.setReferencesMaillageFissure()
-    ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
+    ok_maillage = getStatsMaillageFissure(self.maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
     return ok_maillage
index c4cbe095cebdb760b4ebe8d6170a758314a0f612..f782d8d7c6a39acfe9619bb556dcac415e1abb10 100644 (file)
@@ -57,6 +57,6 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
   # ---  edges de la face de peau partagées avec la face de fissure
   edgesFissurePeau = identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau)
 
-  return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
-          edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
+  return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, \
+          edgesCircPeau, groupEdgesBordPeau, \
           bordsVifs, edgesFissurePeau, aretesVivesCoupees)
index b13a9ec492ddf42a771a2454fbce054ab1e4b20c..869b178949204115865779d1675211824072d8b0 100644 (file)
@@ -32,6 +32,7 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
                         nro_cas=None):
   """Identification précise des edges et disques des faces de peau selon index extremité fissure"""
   logging.info('start')
+  logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
 
   for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
     logging.debug("examen face debouchante circulaire")
@@ -46,7 +47,6 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
         sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[j_aux_0]], geompy.ShapeType["VERTEX"])
         nameFace = "facePipePeau_{}".format(i_aux)
         nameVert = "endEdgeFond_{}".format(i_aux)
-        nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
         facesPipePeau[i_aux] = face
         endsEdgeFond[i_aux] = sharedVertices[0]
         geomPublish(initLog.debug, face, nameFace, nro_cas)
@@ -55,29 +55,30 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
         for edge in edgesFace:
           if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
             edgeRadFacePipePeau[i_aux] = edge
+            nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
             geomPublish(initLog.debug, edge, nameEdge, nro_cas)
             break
 
   # --- edges elliptiques de la face de peau et points de jonction de la face externe de fissure
-  logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
-  edgesCircPeau = [None for _ in range(len(facesPipePeau))]
-  verticesCircPeau = [None for _ in range(len(facesPipePeau))]
+  logging.info('Nombre de faces : len(facesPipePeau) = %d', len(facesPipePeau))
+  edgesCircPeau = list()
+  verticesCircPeau = list()
   for i_aux,fcirc in enumerate(facesPipePeau):
-    logging.info(". Partage avec la face '%s'", fcirc.GetName())
+    # Arêtes
     edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
-    grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
-    geompy.UnionList(grpEdgesCirc, edges)
-    edgesCircPeau[i_aux] = grpEdgesCirc
-    name = "edgeCirc_{}".format(i_aux)
-    geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name)
+    groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
+    geompy.UnionList(groupe, edges)
+    geomPublishInFather(initLog.always, facePeau, groupe, "edgeCirc_{}".format(i_aux))
+    edgesCircPeau.append(groupe)
     edgesListees = edgesListees + edges
+    # Sommets
     vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
-    grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
-    geompy.UnionList(grpVertCircPeau, vertices)
-    verticesCircPeau[i_aux] = grpVertCircPeau
-    name = "pointEdgeCirc_{}".format(i_aux)
-    geomPublishInFather(initLog.info, facePeau, grpVertCircPeau, name)
+    groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
+    geompy.UnionList(groupe, vertices)
+    geomPublishInFather(initLog.info, facePeau, groupe, "point(s)EdgeCirc_{}".format(i_aux))
+    verticesCircPeau.append(groupe)
 
-  logging.info('==> Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
+  logging.info("==> Nombre de groupes d'arêtes   : len(edgesCircPeau)    = %d", len(edgesCircPeau))
+  logging.info("==> Nombre de groupes de sommets : len(verticesCircPeau) = %d", len(verticesCircPeau))
 
   return edgesCircPeau, verticesCircPeau
index 3044d61dedb0b1fcbe48222283f15967c73465c6..bdde0322ba8b8dfcacbbf58536489466e4229433 100644 (file)
@@ -32,7 +32,9 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
   """edges de bord de la face de peau"""
   logging.info('start')
 
+  # Liste des arêtes de bord
   edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
+  logging.info('Détermination des arêtes de bord à partir des %d arêtes de fillingFaceExterne', len(edgesFilling))
   edgesBords = list()
   for i_aux, edge in enumerate(edgesFilling):
     edgepeau = geompy.GetInPlace(facePeau, edge)
@@ -42,18 +44,19 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
     if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
       logging.debug("  EDGES multiples")
       l_edges = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
-      edgesBords += l_edges
-      edgesListees += l_edges
+      edgesBords.extend(l_edges)
+      edgesListees.extend(l_edges)
     else:
       logging.debug("  EDGE")
       edgesBords.append(edgepeau)
       edgesListees.append(edgepeau)
+  logging.info('==> Nombre d arêtes de bord : len(edgesBords) = %d', len(edgesBords))
 
   groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
   geompy.UnionList(groupEdgesBordPeau, edgesBords)
   bordsVifs = None
   if aretesVivesC is not None:
-    logging.debug("identification des bords vifs par GetInPlace")
+    logging.info("identification des bords vifs par GetInPlace")
     bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
     if bordsVifs is None:
       logging.debug("pas d'identification des bords vifs par GetInPlace: test par distance")
@@ -69,7 +72,8 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
           if ( dist < 0.001 ):
             edvifs.append(edge)
             break
-      if len(edvifs) >0:
+      if edvifs:
+        logging.info('==> Nombre d arêtes de bord vif : len(edvifs) = %d', len(edvifs))
         bordsVifs = geompy.CreateGroup(facePeau,geompy.ShapeType["EDGE"])
         for edge in edvifs:
           geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge))
index afe027f1fb0b5c85da687baee92cd7ee95d41e42..233e3c9a86cfe7fc92ee375ed72f04d4f5e88112 100644 (file)
@@ -33,38 +33,39 @@ def identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircP
   logging.info('start')
   logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
   logging.info('Nombre de sommets : len(verticesPipePeau) = %d', len(verticesPipePeau))
-  #logging.info('verticesPipePeau = %s', verticesPipePeau)
-  logging.info('Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
-  #logging.info('verticesCircPeau = %s', verticesCircPeau)
 
   edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
   logging.info('Nombre total d arêtes de la peau : len(edgesPeau) = %d', len(edgesPeau))
 
   edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
 
-  edgesFissurePeau = list()
-# --- au moins une extrémité du pipe sur cette face de peau
+  l_edge_cercle = list()
+# --- au moins une extrémité du pipe sur cette face de peau : arêtes sui les prenent toutes
   if verticesPipePeau:
-    # En premier, les edges associés aux extrémités du pipe
-    edgesFissurePeau = [None for _ in range(len(verticesCircPeau))]
-    for edge in edges:
-      for i_aux, vertex in enumerate(verticesCircPeau):
-        logging.info(".. distance %s", geompy.MinDistance(vertex, edge))
-        if ( ( geompy.MinDistance(vertex, edge) < 1.e-3 ) and ( edge not in edgesFissurePeau ) ):
-          edgesFissurePeau[i_aux] = edge
-          name = "edgeFissurePeau_{}".format(i_aux)
-          logging.info("... entrée de %s à la place %d", edge, i_aux)
-          geomPublishInFather(initLog.debug, facePeau, edge, name)
-    # Ensuite, on ajoute les edges manquantes
+    i_aux = -1
     for edge in edges:
-      if edge not in edgesFissurePeau:
-        logging.info("... ajout")
-        edgesFissurePeau.append(edge)
+      for groupe in verticesCircPeau:
+        cercle = True
+        for id_vertex in geompy.GetObjectIDs(groupe):
+          vertex = geompy.GetSubShape(facePeau, [id_vertex])
+          distance = geompy.MinDistance(vertex, edge)
+          logging.info(".. distance %s", distance)
+          if ( distance > 1.e-3 ):
+            cercle = False
+            break
+        if cercle:
+          logging.info("... entrée de %s dans l_edge_cercle", edge)
+          l_edge_cercle.append(edge)
+          i_aux += 1
+          name = "edgeFissurePeauCercle_{}".format(i_aux)
+          geomPublishInFather(initLog.info, facePeau, edge, name)
 
-  else:
-    for i_aux, edge in enumerate(edges):
+# --- Les arêtes n'appartenant pas aux cercles
+  edgesFissurePeau = list()
+  for i_aux, edge in enumerate(edges):
+    if edge not in l_edge_cercle:
       edgesFissurePeau.append(edge)
-      name = "edgeFissurePeau{}".format(i_aux)
+      name = "edgeFissurePeau_{}".format(i_aux)
       geomPublishInFather(initLog.debug, facePeau, edge, name)
 
   logging.info('==> Nombre d arêtes : len(edgesFissurePeau) = %d', len(edgesFissurePeau))
index e585993b7a67f0c9e607ebfcada1efc55846ae30..3e32edb8c943ee7b1308929c5ab97d13c4558667 100644 (file)
@@ -27,10 +27,9 @@ from .trouveEdgesFissPeau import trouveEdgesFissPeau
 from .identifieFacesPeau import identifieFacesPeau
 from .identifieEdgesPeau import identifieEdgesPeau
 
-def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, \
-                                      edgesFondFiss, wireFondFiss, aretesVivesC, \
-                                      facesDefaut, centreFondFiss, rayonPipe, \
-                                      aretesVivesCoupees, \
+def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, \
+                                      edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
+                                      facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
                                       nro_cas=None):
   """Identification des éléments géométriques de la face de peau"""
   logging.info('start')
@@ -69,7 +68,8 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss
 
   # --- identification précise des edges et disques des faces de peau selon index extremité fissure
 
-  (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, \
+  (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, \
+  edgesCircPeau, groupEdgesBordPeau, \
   bordsVifs, edgesFissurePeau, aretesVivesCoupees) = \
                                               identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
                                                                 edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
@@ -83,7 +83,6 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss
                   edgesFissExtPipe    = edgesFissExtPipe,    # pour chaque face [edge commun au pipe des faces de fissure externes]
                   facePeau            = facePeau,            # pour chaque face : la face de peau finale a mailler (percee des faces débouchantes)
                   edgesCircPeau       = edgesCircPeau,       # pour chaque face de peau : [groupe subshapes edges circulaires aux débouchés du pipe]
-                  verticesCircPeau    = verticesCircPeau,    # pour chaque face de peau : [groupe subshapes points sur edges circulaires aux débouchés du pipe]
                   groupEdgesBordPeau  = groupEdgesBordPeau,  # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
                   bordsVifs           = bordsVifs,           # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
                   edgesFissurePeau    = edgesFissurePeau,    # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
index 546525af9e7987dc1dce048d7396fe9c6389c28e..4563862357a3eb939580a7b76a9a0489d0d18439 100644 (file)
@@ -60,7 +60,8 @@ def mailleFacesFissure(faceFissureExterne, \
     hypo2d.SetQuadAllowed( 0 )
   putName(hypo2d, "faceFiss", i_pref=nro_cas)
 
-  logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName())
+  logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
+                edgesPipeFissureExterneC.GetName(), edgeFaceFissGroup.GetName())
   algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
   putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
   hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
index 9e56f5815dfb0825375342b33cc02b8ed1abf641..f53859b711a8bc7ccfb026579b515d1ab4ff5a4a 100644 (file)
@@ -34,7 +34,7 @@ from . import initLog
 from .putName import putName
 
 def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
-                    facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
+                    facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
                     bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
                     edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
                     mailleur="MeshGems", nro_cas=None):
@@ -91,13 +91,13 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
       # --- edges de bord de la face de filling
       filling = facesDefaut[ifil]
       edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
-      groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
-      geompy.UnionList(groupEdgesBordPeau, edgesFilling)
-      geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas)
+      gpedgeBord[ifil] = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
+      geompy.UnionList(gpedgeBord[ifil], edgesFilling)
+      geomPublishInFather(initLog.always, filling, gpedgeBord[ifil], "EdgesBords", nro_cas)
 
       logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
-                    groupEdgesBordPeau.GetName(), bordsLibres.GetName())
-      algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+                    gpedgeBord[ifil].GetName(), bordsLibres.GetName())
+      algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
       putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
       hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
       putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
@@ -105,21 +105,20 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
     else:
 
       logging.info("face de peau %d coupée par la fissure", ifil)
-      edgesCircPeau      = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
-      _                  = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
-      groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
-      bordsVifs          = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
-      edgesFissurePeau   = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
+      # edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
+      # gpedgeBord[ifil] : pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
+      # gpedgeVifs[ifil] : pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
+      # edFissPeau[ifil] : pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
 
       logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
-                    groupEdgesBordPeau.GetName(), bordsLibres.GetName())
-      algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
+                    gpedgeBord[ifil].GetName(), bordsLibres.GetName())
+      algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
       putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
       hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
       putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), i_pref=nro_cas)
 
-      objet = geompy.MakeCompound(edgesFissurePeau)
-      geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
+      objet = geompy.MakeCompound(edFissPeau[ifil])
+      geomPublishInFather(initLog.always, facePeau, objet, "edFissPeau_{}".format(ifil))
       logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
                     objet.GetName(), grpEdgesPeauFissureExterne.GetName())
       algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
@@ -127,15 +126,15 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
       hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
       putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), i_pref=nro_cas)
 
-      if bordsVifs is not None:
+      if gpedgeVifs[ifil] is not None:
         logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
-                      bordsVifs.GetName(), grpAretesVives.GetName())
-        algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
-        putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
+                      gpedgeVifs[ifil].GetName(), grpAretesVives.GetName())
+        algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeVifs[ifil])
+        putName(algo1d.GetSubMesh(), "gpedgeVifs", ifil, nro_cas)
         hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
         putName(hypo1d, "SourceEdges_{}".format(grpAretesVives.GetName()), i_pref=nro_cas)
 
-      for i_aux, edgeCirc in enumerate(edgesCircPeau):
+      for i_aux, edgeCirc in enumerate(edCircPeau[ifil]):
         texte = "i_aux = {}".format(i_aux)
         logging.info(texte)
         if edgeCirc is not None:
index 51701fde303b632e33e800ad21a269418f8ce058..af61ca4b1d6f6c4d6d32da674d75bbb8ec05d409 100644 (file)
@@ -25,13 +25,13 @@ SET(plugin_SCRIPTS
   cubeAngle.py
   cubeFin.py
   decoupeCylindre.py
-  disque_perce.py
+  disquePerce.py
   ellipse_disque.py
   ellipse_probleme.py
   ellipse.py
   eprouvetteCourbe.py
   eprouvetteDroite.py
-  fissureGauche2.py
+  fissureGauche_2.py
   fissureGauche.py
   genereMateriel.py
   tube.py
index b3ed2808b02c68327785ff36125b708b6773b643..fe9332e1e9345f3fd73be6b7d7e324a953d70636 100644 (file)
@@ -19,7 +19,7 @@
 #
 """Géométries et maillages de base nécessaires aux cas-tests :
 . cubeAngle
-. cubeAngle2
+. cubeAngle_2
 """
 
 import os
diff --git a/src/Tools/blocFissure/materielCasTests/disquePerce.py b/src/Tools/blocFissure/materielCasTests/disquePerce.py
new file mode 100644 (file)
index 0000000..c56b9ec
--- /dev/null
@@ -0,0 +1,105 @@
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2014-2021  EDF R&D
+#
+# 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
+#
+"""Géométrie et maillage de base nécessaire au cas-test :
+. disquePerce
+"""
+
+import os
+
+import logging
+
+import salome
+from salome.smesh import smeshBuilder
+from salome.StdMeshers import StdMeshersBuilder
+import GEOM
+import SMESH
+import SALOMEDS
+
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy
+from blocFissure.gmu.geomsmesh import geomPublish
+from blocFissure.gmu.geomsmesh import geomPublishInFather
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.putName import putName
+from blocFissure.gmu import initLog
+
+###
+### GEOM component
+###
+
+O, OX, OY, OZ = triedreBase()
+
+Cylinder_1 = geompy.MakeCylinderRH(100, 300)
+Cylinder_2 = geompy.MakeCylinderRH(600, 200)
+Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
+Face_1 = geompy.MakeFaceHW(500, 1500, 3)
+Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
+geompy.addToStudy( Disque, 'Disque' )
+geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
+geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
+geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
+geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
+
+geomPublish(initLog.debug, Cylinder_1, 'Cylinder_1' )
+geomPublish(initLog.debug, Cylinder_2, 'Cylinder_2' )
+geomPublish(initLog.debug, Cut_1, 'Cut_1' )
+geomPublish(initLog.debug, Face_1, 'Face_1' )
+
+###
+### SMESH component
+###
+
+smesh = smeshBuilder.New()
+Disque_1 = smesh.Mesh(Disque)
+putName(Disque_1.GetMesh(), 'Disque')
+
+Regular_1D = Disque_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
+Nb_Segments_1.SetDistrType( 0 )
+Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
+Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
+Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
+Nb_Segments_2.SetDistrType( 0 )
+Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
+status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
+Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+
+## set object names
+#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='Disque')
+putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='Disque')
+
+is_done = Disque_1.Compute()
+text = "Disque_1.Compute"
+if is_done:
+  logging.info(text+" OK")
+else:
+  text = "Erreur au calcul du maillage.\n" + text
+  logging.info(text)
+  raise Exception(text)
+
+Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser()
diff --git a/src/Tools/blocFissure/materielCasTests/disque_perce.py b/src/Tools/blocFissure/materielCasTests/disque_perce.py
deleted file mode 100644 (file)
index 0bc931a..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014-2021  EDF R&D
-#
-# 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
-#
-"""Géométrie et maillage de base nécessaire au cas-test :
-. disque_perce
-"""
-
-import os
-
-import logging
-
-import salome
-from salome.smesh import smeshBuilder
-from salome.StdMeshers import StdMeshersBuilder
-import GEOM
-import SMESH
-import SALOMEDS
-
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy
-from blocFissure.gmu.geomsmesh import geomPublish
-from blocFissure.gmu.geomsmesh import geomPublishInFather
-
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.putName import putName
-from blocFissure.gmu import initLog
-
-###
-### GEOM component
-###
-
-O, OX, OY, OZ = triedreBase()
-
-Cylinder_1 = geompy.MakeCylinderRH(100, 300)
-Cylinder_2 = geompy.MakeCylinderRH(600, 200)
-Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
-Face_1 = geompy.MakeFaceHW(500, 1500, 3)
-Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
-[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
-geompy.addToStudy( Disque, 'Disque' )
-geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
-geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
-geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
-geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
-
-geomPublish(initLog.debug, Cylinder_1, 'Cylinder_1' )
-geomPublish(initLog.debug, Cylinder_2, 'Cylinder_2' )
-geomPublish(initLog.debug, Cut_1, 'Cut_1' )
-geomPublish(initLog.debug, Face_1, 'Face_1' )
-
-###
-### SMESH component
-###
-
-smesh = smeshBuilder.New()
-Disque_1 = smesh.Mesh(Disque)
-putName(Disque_1.GetMesh(), 'Disque')
-
-Regular_1D = Disque_1.Segment()
-Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
-Nb_Segments_1.SetDistrType( 0 )
-Hexa_3D = Disque_1.Hexahedron(algo=smeshBuilder.Hexa)
-Regular_1D_1 = Disque_1.Segment(geom=Compound_3)
-Nb_Segments_2 = Regular_1D_1.NumberOfSegments(20)
-Nb_Segments_2.SetDistrType( 0 )
-Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
-status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
-Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
-
-## set object names
-#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
-#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
-putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='Disque')
-putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='Disque')
-
-is_done = Disque_1.Compute()
-text = "Disque_1.Compute"
-if is_done:
-  logging.info(text+" OK")
-else:
-  text = "Erreur au calcul du maillage.\n" + text
-  logging.info(text)
-  raise Exception(text)
-
-Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
-
-if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser()
index d2e5925779a671e9cd9f276458f2be1fc623afdc..dd327275812f9a3d9716a8708f8cb522856b4682 100644 (file)
@@ -54,8 +54,8 @@ Scale_1 = geompy.MakeScaleAlongAxes(Rotation_1, Vertex_1, 1, 1.5, 1)
 Vertex_3 = geompy.MakeVertex(420, -400, 300)
 Vertex_4 = geompy.MakeVertex(500, 400, 500)
 Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
-ellipse1 = geompy.MakeCut(Scale_1, Box_1)
-[fondFiss] = geompy.SubShapes(ellipse1, [4])
+ellipse_1 = geompy.MakeCut(Scale_1, Box_1)
+[fondFiss] = geompy.SubShapes(ellipse_1, [4])
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
 geompy.addToStudy( OY, 'OY' )
@@ -69,9 +69,9 @@ geompy.addToStudy( Scale_1, 'Scale_1' )
 geompy.addToStudy( Vertex_3, 'Vertex_3' )
 geompy.addToStudy( Vertex_4, 'Vertex_4' )
 geompy.addToStudy( Box_1, 'Box_1' )
-geompy.addToStudy( ellipse1, 'ellipse1' )
-geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
-geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1.brep"))
+geompy.addToStudy( ellipse_1, 'ellipse_1' )
+geompy.addToStudyInFather( ellipse_1, fondFiss, 'fondFiss' )
+geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1.brep"))
 
 
 if salome.sg.hasDesktop():
index 1d271c5999401a0b834d9da426c9f68a18d772f0..096f805aaea51be912b7bd1d88bd50afa716c383 100644 (file)
@@ -54,7 +54,7 @@ Vertex_2 = geompy.MakeVertex(20, -100, -50)
 Vertex_4 = geompy.MakeVertex(100, 100, 50)
 Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
 Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
-ellipse1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
+ellipse_1 = geompy.MakeTranslation(Cut_1, 400, 0, 400)
 geompy.addToStudy( Disk_1, 'Disk_1' )
 geompy.addToStudy( O, 'O' )
 geompy.addToStudy( OX, 'OX' )
@@ -68,8 +68,8 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' )
 geompy.addToStudy( Box_1, 'Box_1' )
 geompy.addToStudy( Vertex_4, 'Vertex_4' )
 geompy.addToStudy( Cut_1, 'Cut_1' )
-geompy.addToStudy( ellipse1, 'ellipse1_pb' )
-geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
+geompy.addToStudy( ellipse_1, 'ellipse_1_pb' )
+geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1_pb.brep"))
 
 
 if salome.sg.hasDesktop():
diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py
deleted file mode 100644 (file)
index 2ea914c..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (C) 2014-2021  EDF R&D
-#
-# 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
-#
-"""Géométrie et maillage de base nécessaire au cas-test :
-. faceGauche_2
-"""
-
-import os
-import math
-
-import logging
-
-import salome
-from salome.smesh import smeshBuilder
-from salome.StdMeshers import StdMeshersBuilder
-import GEOM
-import SMESH
-import SALOMEDS
-
-from blocFissure import gmu
-from blocFissure.gmu.geomsmesh import geompy
-from blocFissure.gmu.geomsmesh import geomPublish
-from blocFissure.gmu.geomsmesh import geomPublishInFather
-
-from blocFissure.gmu.triedreBase import triedreBase
-from blocFissure.gmu.putName import putName
-from blocFissure.gmu import initLog
-
-###
-### GEOM component
-###
-
-O, OX, OY, OZ = triedreBase()
-
-Circle_1 = geompy.MakeCircle(O, OX, 500.)
-Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
-Vertex_1 = geompy.MakeVertex(500., 0., 0.)
-Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
-Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
-Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
-
-FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
-geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
-geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep"))
-
-Vertex_2 = geompy.MakeVertex(0, -500, 0)
-Vertex_3 = geompy.MakeVertex(400, 500, 800)
-objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
-geompy.addToStudy( objetSain, 'objetSain' )
-
-Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, math.pi)
-Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-geompy.addToStudy( Partition_2, 'Partition_2' )
-[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
-geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
-Plane_1 = geompy.MakePlaneLCS(None, 2000., 3)
-
-FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
-
-geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
-
-geomPublish(initLog.debug, Circle_1, 'Circle_1' )
-geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
-geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
-geomPublish(initLog.debug, Circle_3, 'Circle_3' )
-geomPublish(initLog.debug, Extrusion_2, 'Extrusion_2' )
-geomPublish(initLog.debug, Partition_1, 'Partition_1' )
-geomPublishInFather(initLog.debug, Partition_1, Face_1, 'Face_1' )
-geomPublishInFather(initLog.debug, Partition_1, Face_2, 'Face_2' )
-geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
-geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
-geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
-geomPublish(initLog.debug, Plane_1, 'Plane_1' )
-
-###
-### SMESH component
-###
-smesh = smeshBuilder.New()
-Mesh_1 = smesh.Mesh(objetSain)
-putName(Mesh_1.GetMesh(), 'Mesh_1')
-
-Regular_1D = Mesh_1.Segment()
-Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[  ])
-Nb_Segments_1.SetDistrType( 0 )
-Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
-Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
-
-## set object names
-#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
-#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
-#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
-putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='fissuregauche2')
-
-is_done = Mesh_1.Compute()
-text = "Mesh_1.Compute"
-if is_done:
-  logging.info(text+" OK")
-else:
-  text = "Erreur au calcul du maillage.\n" + text
-  logging.info(text)
-  raise Exception(text)
-
-Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
-
-if salome.sg.hasDesktop():
-  salome.sg.updateObjBrowser()
diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche_2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche_2.py
new file mode 100644 (file)
index 0000000..2ea914c
--- /dev/null
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014-2021  EDF R&D
+#
+# 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
+#
+"""Géométrie et maillage de base nécessaire au cas-test :
+. faceGauche_2
+"""
+
+import os
+import math
+
+import logging
+
+import salome
+from salome.smesh import smeshBuilder
+from salome.StdMeshers import StdMeshersBuilder
+import GEOM
+import SMESH
+import SALOMEDS
+
+from blocFissure import gmu
+from blocFissure.gmu.geomsmesh import geompy
+from blocFissure.gmu.geomsmesh import geomPublish
+from blocFissure.gmu.geomsmesh import geomPublishInFather
+
+from blocFissure.gmu.triedreBase import triedreBase
+from blocFissure.gmu.putName import putName
+from blocFissure.gmu import initLog
+
+###
+### GEOM component
+###
+
+O, OX, OY, OZ = triedreBase()
+
+Circle_1 = geompy.MakeCircle(O, OX, 500.)
+Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
+Vertex_1 = geompy.MakeVertex(500., 0., 0.)
+Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
+Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
+Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
+
+FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
+geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
+geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep"))
+
+Vertex_2 = geompy.MakeVertex(0, -500, 0)
+Vertex_3 = geompy.MakeVertex(400, 500, 800)
+objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
+geompy.addToStudy( objetSain, 'objetSain' )
+
+Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, math.pi)
+Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.addToStudy( Partition_2, 'Partition_2' )
+[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
+geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
+Plane_1 = geompy.MakePlaneLCS(None, 2000., 3)
+
+FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
+
+geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
+
+geomPublish(initLog.debug, Circle_1, 'Circle_1' )
+geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
+geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
+geomPublish(initLog.debug, Circle_3, 'Circle_3' )
+geomPublish(initLog.debug, Extrusion_2, 'Extrusion_2' )
+geomPublish(initLog.debug, Partition_1, 'Partition_1' )
+geomPublishInFather(initLog.debug, Partition_1, Face_1, 'Face_1' )
+geomPublishInFather(initLog.debug, Partition_1, Face_2, 'Face_2' )
+geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
+geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
+geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
+geomPublish(initLog.debug, Plane_1, 'Plane_1' )
+
+###
+### SMESH component
+###
+smesh = smeshBuilder.New()
+Mesh_1 = smesh.Mesh(objetSain)
+putName(Mesh_1.GetMesh(), 'Mesh_1')
+
+Regular_1D = Mesh_1.Segment()
+Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[  ])
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
+Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
+
+## set object names
+#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
+#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
+#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
+putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='fissuregauche2')
+
+is_done = Mesh_1.Compute()
+text = "Mesh_1.Compute"
+if is_done:
+  logging.info(text+" OK")
+else:
+  text = "Erreur au calcul du maillage.\n" + text
+  logging.info(text)
+  raise Exception(text)
+
+Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
+
+if salome.sg.hasDesktop():
+  salome.sg.updateObjBrowser()
index f597b9eb9e4ca9a3d6adf2ceb9fa0b73c19596f8..7ef23abb6906035fc4ac833b30eaa781a8ae3070 100644 (file)
 from blocFissure.materielCasTests import cubeAngle
 from blocFissure.materielCasTests import cubeFin
 from blocFissure.materielCasTests import decoupeCylindre
-from blocFissure.materielCasTests import disque_perce
+from blocFissure.materielCasTests import disquePerce
 from blocFissure.materielCasTests import ellipse_disque
 from blocFissure.materielCasTests import ellipse
 from blocFissure.materielCasTests import ellipse_probleme
 from blocFissure.materielCasTests import eprouvetteCourbe
 from blocFissure.materielCasTests import eprouvetteDroite
 from blocFissure.materielCasTests import fissureGauche
-from blocFissure.materielCasTests import fissureGauche2
+from blocFissure.materielCasTests import fissureGauche_2
 from blocFissure.materielCasTests import vis
 from blocFissure.materielCasTests import tube
index cd76a642f4e67db371d47d1ae23cadd7b8bd2d37..dedd03cb5a31734c8f422e254e1801ad81b86e4f 100644 (file)
@@ -26,6 +26,7 @@ INCLUDE_DIRECTORIES(
   ${Boost_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${LIBXML2_INCLUDE_DIR}
+  ${MEDCOUPLING_INCLUDE_DIRS}
   ${PROJECT_SOURCE_DIR}/src/SMESH
   ${PROJECT_SOURCE_DIR}/src/SMESH_I
   ${PROJECT_SOURCE_DIR}/src/SMESHDS