Merge branch 'gni/evolution' into V9_7_BR
45
doc/salome/examples/blocFissure_01_without_session.py
Executable file
@ -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)
|
||||||
|
|
49
doc/salome/examples/blocFissure_02_without_session.py
Executable file
@ -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)
|
||||||
|
|
45
doc/salome/examples/blocFissure_03_without_session.py
Executable file
@ -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)
|
||||||
|
|
43
doc/salome/examples/blocFissure_04_without_session.py
Executable file
@ -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)
|
||||||
|
|
43
doc/salome/examples/blocFissure_05_without_session.py
Executable file
@ -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)
|
||||||
|
|
43
doc/salome/examples/blocFissure_06_without_session.py
Executable file
@ -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)
|
||||||
|
|
46
doc/salome/examples/blocFissure_07_without_session.py
Executable file
@ -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)
|
||||||
|
|
@ -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)
|
|
@ -46,7 +46,13 @@ SET(BAD_TESTS
|
|||||||
test_smeshplugin_mg_tetra_parallele.py
|
test_smeshplugin_mg_tetra_parallele.py
|
||||||
test_smeshplugins.py
|
test_smeshplugins.py
|
||||||
MGAdaptTests_without_session.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
|
SET(GOOD_TESTS
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
# scripts / static
|
# scripts / static
|
||||||
SET(plugin_SCRIPTS
|
SET(plugin_SCRIPTS
|
||||||
__init__.py
|
__init__.py
|
||||||
cubeAngle2.py
|
blocFissureTest.py
|
||||||
|
cubeAngle_2.py
|
||||||
cubeAngle.py
|
cubeAngle.py
|
||||||
cubeCoin.py
|
cubeCoin.py
|
||||||
cubeMilieu.py
|
cubeMilieu.py
|
||||||
@ -35,7 +36,6 @@ SET(plugin_SCRIPTS
|
|||||||
eprouvetteCourbe.py
|
eprouvetteCourbe.py
|
||||||
eprouvetteDroite_2.py
|
eprouvetteDroite_2.py
|
||||||
eprouvetteDroite.py
|
eprouvetteDroite.py
|
||||||
execution_Cas.py
|
|
||||||
faceGauche_2.py
|
faceGauche_2.py
|
||||||
faceGauche.py
|
faceGauche.py
|
||||||
fissureCoude_10.py
|
fissureCoude_10.py
|
||||||
|
522
src/Tools/blocFissure/CasTests/blocFissureTest.py
Normal file
@ -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
|
@ -23,13 +23,13 @@ import os
|
|||||||
|
|
||||||
from .cubeAngle import cubeAngle
|
from .cubeAngle import cubeAngle
|
||||||
|
|
||||||
class cubeAngle2(cubeAngle):
|
class cubeAngle_2(cubeAngle):
|
||||||
"""problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan
|
"""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
|
detection d'un probleme de tolerance sur les edges de jonction pipe et face fissure externe
|
||||||
"""
|
"""
|
||||||
|
|
||||||
nomProbleme = "cubeAngle2"
|
nomProbleme = "cubeAngle_2"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
def setParamShapeFissure(self):
|
def setParamShapeFissure(self):
|
@ -33,7 +33,7 @@ from .cylindre import cylindre
|
|||||||
class cylindre_2(cylindre):
|
class cylindre_2(cylindre):
|
||||||
"""problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
|
"""problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
|
||||||
|
|
||||||
nomProbleme = "cylindre2"
|
nomProbleme = "cylindre_2"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
|
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
import os
|
import os
|
||||||
from blocFissure import gmu
|
from blocFissure import gmu
|
||||||
|
|
||||||
dicoParams = dict(nomCas = 'disque',
|
dicoParams = dict(nomCas = 'disquePerce',
|
||||||
nomProbleme = "disque",
|
nomProbleme = "disquePerce",
|
||||||
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"),
|
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"),
|
||||||
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"),
|
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"),
|
||||||
edgeFiss = [3],
|
edgeFiss = [3],
|
||||||
|
@ -34,7 +34,7 @@ from blocFissure.gmu.putName import putName
|
|||||||
class ellipse_1(fissureGenerique):
|
class ellipse_1(fissureGenerique):
|
||||||
"""problème de fissure non plane, débouchante non normale"""
|
"""problème de fissure non plane, débouchante non normale"""
|
||||||
|
|
||||||
nomProbleme = "ellipse1"
|
nomProbleme = "ellipse_1"
|
||||||
shapeFissureParams = dict()
|
shapeFissureParams = dict()
|
||||||
maillageFissureParams = dict()
|
maillageFissureParams = dict()
|
||||||
referencesMaillageFissure = dict()
|
referencesMaillageFissure = dict()
|
||||||
@ -78,7 +78,7 @@ class ellipse_1(fissureGenerique):
|
|||||||
|
|
||||||
lgInfluence = shapeFissureParams['lgInfluence']
|
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"])
|
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionIDs(fondFiss, [3])
|
geompy.UnionIDs(fondFiss, [3])
|
||||||
geompy.addToStudy( shellFiss, 'shellFiss' )
|
geompy.addToStudy( shellFiss, 'shellFiss' )
|
||||||
|
@ -32,7 +32,7 @@ from .ellipse_1 import ellipse_1
|
|||||||
class ellipse_2(ellipse_1):
|
class ellipse_2(ellipse_1):
|
||||||
"""problème de fissure non plane, débouchante non normale"""
|
"""problème de fissure non plane, débouchante non normale"""
|
||||||
|
|
||||||
nomProbleme = "ellipse2"
|
nomProbleme = "ellipse_2"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
|
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
|
||||||
@ -43,7 +43,7 @@ class ellipse_2(ellipse_1):
|
|||||||
|
|
||||||
lgInfluence = shapeFissureParams['lgInfluence']
|
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"])
|
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionIDs(fondFiss, [3])
|
geompy.UnionIDs(fondFiss, [3])
|
||||||
geompy.addToStudy( shellFiss, 'shellFiss' )
|
geompy.addToStudy( shellFiss, 'shellFiss' )
|
||||||
|
@ -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
|
|
@ -43,7 +43,7 @@ master_doc = 'index'
|
|||||||
|
|
||||||
# General substitutions.
|
# General substitutions.
|
||||||
project = 'Plug-in blocFissure'
|
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
|
# The default replacements for |version| and |release|, also used in various
|
||||||
# other places throughout the built documents.
|
# other places throughout the built documents.
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
@ -51,21 +51,21 @@ Geometrical parameters of the tore are illustrated :
|
|||||||
:align: center
|
:align: center
|
||||||
:alt: Geometrical parameters of the tore
|
:alt: Geometrical parameters of the tore
|
||||||
|
|
||||||
Different levels of verbose are available. Use one of this 4 optional functions to set verbose type:
|
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:
|
||||||
|
|
||||||
- / **setDebug()**
|
- / **setDebug(LOGFILE)**
|
||||||
|
|
||||||
- / **setVerbose()**
|
- / **setVerbose(LOGFILE)**
|
||||||
|
|
||||||
- / **setRelease()**
|
- / **setRelease(LOGFILE)**
|
||||||
|
|
||||||
- / **setUnitTests()**
|
- / **setUnitTests(LOGFILE)**
|
||||||
|
|
||||||
**example to run in salome session**::
|
**example to run in salome session**::
|
||||||
|
|
||||||
from blocFissure import gmu
|
from blocFissure import gmu
|
||||||
from blocFissure.gmu import initLog
|
from blocFissure.gmu import initLog
|
||||||
initLog.setDebug()
|
initLog.setDebug("/tmp/blocFissure.log")
|
||||||
|
|
||||||
from blocFissure.casStandard import casStandard
|
from blocFissure.casStandard import casStandard
|
||||||
|
|
||||||
@ -83,6 +83,8 @@ Different levels of verbose are available. Use one of this 4 optional functions
|
|||||||
|
|
||||||
execInstance = casStandard(dicoParams)
|
execInstance = casStandard(dicoParams)
|
||||||
|
|
||||||
|
newmesh = execInstance.maillageFissure
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,96 +4,102 @@
|
|||||||
Test cases
|
Test cases
|
||||||
#######################
|
#######################
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
.. _genericTC:
|
.. _genericTC:
|
||||||
|
|
||||||
Generic cases
|
Generic cases
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
All 13 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.
|
All 16 cases are shown Table 2. Two views show the whole cracked structure and a zoom onto the crack with its tore.
|
||||||
|
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| CubeAngle |
|
| CubeAngle |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/01_CubeAngle.png | .. image:: images/01_CubeAngle_2.png |
|
|.. image:: images/01_CubeAngle.png | .. image:: images/01_CubeAngle_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| CubeAngle2 |
|
| CubeAngle_2 |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/02_CubeAngle2.png | .. image:: images/02_CubeAngle2_2.png |
|
|.. image:: images/02_CubeAngle_2.png | .. image:: images/02_CubeAngle_2_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|
| cubeCoin |
|
||||||
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|
| cubeMilieu |
|
||||||
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|
| cubeTransverse |
|
||||||
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| cylindre |
|
| cylindre |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/03_cylindre.png | .. image:: images/03_cylindre_2.png |
|
|.. image:: images/03_cylindre.png | .. image:: images/03_cylindre_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| cylindre2 |
|
| cylindre_2 |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/04_cylindre2.png | .. image:: images/04_cylindre2_2.png |
|
|.. image:: images/04_cylindre_2.png | .. image:: images/04_cylindre_2_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| disque |
|
| disquePerce |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/05_disque.png | .. image:: images/05_disque_2.png |
|
|.. image:: images/05_disque.png | .. image:: images/05_disque_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| ellipse1 |
|
| ellipse_1 |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/06_ellipse1.png | .. image:: images/06_ellipse1_2.png |
|
|.. image:: images/06_ellipse_1.png | .. image:: images/06_ellipse_1_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| ellipse2 (tilted crack) |
|
| ellipse_2 (tilted crack) |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/07_ellipse2.png | .. image:: images/07_ellipse2_2.png |
|
|.. image:: images/07_ellipse_2.png | .. image:: images/07_ellipse_2_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| eprouvetteCourbe |
|
| eprouvetteCourbe |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/08_eprouvetteCourbe.png | .. image:: images/08_eprouvetteCourbe_2.png |
|
|.. image:: images/08_eprouvetteCourbe.png | .. image:: images/08_eprouvetteCourbe_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| eprouvetteDroite |
|
| eprouvetteDroite |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/09_eprouvetteDroite.png | .. image:: images/09_eprouvetteDroite_2.png |
|
|.. image:: images/09_eprouvetteDroite.png | .. image:: images/09_eprouvetteDroite_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| eprouvetteDroite2 |
|
| eprouvetteDroite_2 |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/10_eprouvetteDroite2.png | .. image:: images/10_eprouvetteDroite2_2.png |
|
|.. image:: images/10_eprouvetteDroite_2.png | .. image:: images/10_eprouvetteDroite_2_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| faceGauche |
|
| faceGauche |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/11_faceGauche.png | .. image:: images/11_faceGauche_2.png |
|
|.. image:: images/11_faceGauche.png | .. image:: images/11_faceGauche_2.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| faceGauche2 |
|
| faceGauche_2 |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/12_faceGauche2.png | .. image:: images/12_faceGauche2_2.png |
|
|.. image:: images/12_faceGauche_2.png | .. image:: images/12_faceGauche_2_a.png |
|
||||||
| :height: 300 | :height: 300 |
|
| :height: 300 | :height: 300 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| vis (Crack is in the radius filet between the screw head and the screw shank) |
|
| vis (Crack is in the radius filet between the screw head and the screw shank) |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|.. image:: images/13_vis_1.png | .. image:: images/13_vis_1_2.png |
|
|.. image:: images/13_vis_1.png | .. image:: images/13_vis_1_2.png |
|
||||||
| :width: 400 | :width: 400 |
|
| :width: 400 | :width: 400 |
|
||||||
| :align: center | :align: center |
|
| :align: center | :align: center |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
| tube |
|
| tube |
|
||||||
+-------------------------------------------+----------------------------------------------+
|
+--------------------------------------------+-----------------------------------------------+
|
||||||
|
|
||||||
.. _pipeTC:
|
.. _pipeTC:
|
||||||
|
|
||||||
@ -123,16 +129,14 @@ coude_0 can be computed using this file for the data:
|
|||||||
|
|
||||||
« Bloc Fissure » is very efficient for the case of bended pipes. The generation of the geometry and the crack insertion takes only around 15s.
|
« Bloc Fissure » is very efficient for the case of bended pipes. The generation of the geometry and the crack insertion takes only around 15s.
|
||||||
|
|
||||||
Running test cases
|
Data for the test cases
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
All the files for these test cases are stored in the directory of the installation of SALOME:
|
All the files for these test cases are stored in the directory of the installation of SALOME:
|
||||||
|
|
||||||
``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``
|
``Salome-VXXXX_package-YY/modules/SMESH_VXXXX/lib/python3.6/site-packages/salome/blocFissure``
|
||||||
|
|
||||||
The test cases can be runned either through the python window of the SALOME GUI or with a python script.
|
The set of the med, xao and brep files can be created by the following importation:
|
||||||
|
|
||||||
0) **Generate med and breps files.**::
|
|
||||||
|
|
||||||
from blocFissure.materielCasTests import genereMateriel
|
from blocFissure.materielCasTests import genereMateriel
|
||||||
|
|
||||||
@ -142,48 +146,36 @@ Once the files are generated, they are saved into the directory of the installat
|
|||||||
|
|
||||||
There is no need to generate them again.
|
There is no need to generate them again.
|
||||||
|
|
||||||
1) **To execute all test cases**::
|
To check the installation of salome, the test cases can be computed by the salome test process::
|
||||||
|
|
||||||
from blocFissure.CasTests import execution_Cas
|
salome -test blocFissure
|
||||||
|
|
||||||
2) **To execute only selected test cases**:
|
Running test cases
|
||||||
|
=====================================
|
||||||
|
|
||||||
modify the file ``CasTests/execution_Cas.py`` and change::
|
The test cases can be runned by the following instructions::
|
||||||
|
|
||||||
runall = False. #old : True
|
from blocFissure.CasTests.blocFissureTest import blocFissureTest
|
||||||
|
BLOCFISSURE_TEST = blocFissureTest(list_of_cases)
|
||||||
|
MESSAGE_ERREUR = BLOCFISSURE_TEST.lancement()
|
||||||
|
sys.stdout.write(MESSAGE_ERREUR)
|
||||||
|
del BLOCFISSURE_TEST
|
||||||
|
|
||||||
And change from 0 to 1 of the index of the test you want to launch::
|
If ``list_of_cases`` is an empty list, all the cases are computed.
|
||||||
|
|
||||||
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]
|
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.
|
||||||
|
|
||||||
then launch the test cases::
|
|
||||||
|
|
||||||
from blocFissure.CasTests import execution_Cas
|
|
||||||
|
|
||||||
The index of each test is the position of the test in the following table, from 0 for cubeAngle, 1 for cubeAngle2,
|
|
||||||
2 for cubeCoin... from top to bottom, then from left to right.
|
|
||||||
|
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cubeAngle | cylindre_2 | eprouvetteDroite_2 | fissureCoude_3 | fissureCoude_9 |
|
| cubeAngle | cylindre_2 | eprouvetteDroite_2 | fissureCoude_3 | fissureCoude_9 |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cubeAngle2 | disquePerce | faceGauche | fissureCoude_4 | fissure_Coude |
|
| cubeAngle_2 | disquePerce | faceGauche | fissureCoude_4 | fissure_Coude |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cubeCoin | ellipse_1 | faceGauche_2 | fissureCoude_5 | fissure_Coude_4 |
|
| cubeCoin | ellipse_1 | faceGauche_2 | fissureCoude_5 | fissure_Coude_4 |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cubeMilieu | ellipse_2 | fissureCoude_1 | fissureCoude_6 | vis_1 |
|
| cubeMilieu | ellipse_2 | fissureCoude_1 | fissureCoude_6 | vis_1 |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cubeTransverse | eprouvetteCourbe | fissureCoude_10 | fissureCoude_7 | tube |
|
| cubeTransverse | eprouvetteCourbe | fissureCoude_10 | fissureCoude_7 | |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
| cylindre | eprouvetteDroite | fissureCoude_2 | fissureCoude_8 | |
|
| cylindre | eprouvetteDroite | fissureCoude_2 | fissureCoude_8 | |
|
||||||
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
+--------------------+--------------------+--------------------+-----------------+-----------------+
|
||||||
|
|
||||||
3) **To execute only one test case**::
|
|
||||||
|
|
||||||
from blocFissure.CasTests.[TEST_CASE_NAME] import [TEST_CASE_NAME]
|
|
||||||
|
|
||||||
[TEST_CASE_NAME](0).executeProbleme()
|
|
||||||
|
|
||||||
[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.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,8 +132,8 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
|||||||
|
|
||||||
# --- inventaire des faces de peau coupées par la fissure
|
# --- inventaire des faces de peau coupées par la fissure
|
||||||
|
|
||||||
ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, \
|
ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
|
||||||
facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
||||||
edgeRadFacePipePeau, facesPipePeau = \
|
edgeRadFacePipePeau, facesPipePeau = \
|
||||||
construitFissureGenerale_b( partitionsPeauFissFond, \
|
construitFissureGenerale_b( partitionsPeauFissFond, \
|
||||||
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
||||||
@ -201,7 +201,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
|||||||
# --- maillage faces de peau
|
# --- maillage faces de peau
|
||||||
|
|
||||||
meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||||
facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
|
facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
|
||||||
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
|
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
|
||||||
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
|
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
|
||||||
mailleur, nro_cas)
|
mailleur, nro_cas)
|
||||||
|
@ -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]
|
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)
|
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]
|
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
|
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
|
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]
|
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']
|
edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
|
||||||
facesPeaux[ifil] = dataPPFF['facePeau']
|
facesPeaux[ifil] = dataPPFF['facePeau']
|
||||||
edCircPeau[ifil] = dataPPFF['edgesCircPeau']
|
edCircPeau[ifil] = dataPPFF['edgesCircPeau']
|
||||||
ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
|
|
||||||
gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
|
gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
|
||||||
gpedgeVifs[ifil] = dataPPFF['bordsVifs']
|
gpedgeVifs[ifil] = dataPPFF['bordsVifs']
|
||||||
edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
|
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)
|
geomPublish(initLog.debug, avc, name, nro_cas)
|
||||||
|
|
||||||
return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
|
return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
|
||||||
ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
||||||
edgeRadFacePipePeau, facesPipePeau
|
edgeRadFacePipePeau, facesPipePeau
|
||||||
|
@ -34,6 +34,7 @@ class fissureGenerique(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
nomProbleme = "fissureGenerique"
|
nomProbleme = "fissureGenerique"
|
||||||
|
maillageFissure = None
|
||||||
geomParams = dict()
|
geomParams = dict()
|
||||||
meshParams = dict()
|
meshParams = dict()
|
||||||
shapeFissureParams = dict()
|
shapeFissureParams = dict()
|
||||||
@ -132,10 +133,10 @@ class fissureGenerique(object):
|
|||||||
if step == 4:
|
if step == 4:
|
||||||
return
|
return
|
||||||
|
|
||||||
maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
|
self.maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
|
||||||
shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
|
shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
|
||||||
elementsDefaut, step, mailleur)
|
elementsDefaut, step, mailleur)
|
||||||
|
|
||||||
self.setReferencesMaillageFissure()
|
self.setReferencesMaillageFissure()
|
||||||
ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
|
ok_maillage = getStatsMaillageFissure(self.maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
|
||||||
return ok_maillage
|
return ok_maillage
|
||||||
|
@ -57,6 +57,6 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
|
|||||||
# --- edges de la face de peau partagées avec la face de fissure
|
# --- edges de la face de peau partagées avec la face de fissure
|
||||||
edgesFissurePeau = identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau)
|
edgesFissurePeau = identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau)
|
||||||
|
|
||||||
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau,
|
return (endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, \
|
||||||
edgesCircPeau, verticesCircPeau, groupEdgesBordPeau,
|
edgesCircPeau, groupEdgesBordPeau, \
|
||||||
bordsVifs, edgesFissurePeau, aretesVivesCoupees)
|
bordsVifs, edgesFissurePeau, aretesVivesCoupees)
|
||||||
|
@ -32,6 +32,7 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
|
|||||||
nro_cas=None):
|
nro_cas=None):
|
||||||
"""Identification précise des edges et disques des faces de peau selon index extremité fissure"""
|
"""Identification précise des edges et disques des faces de peau selon index extremité fissure"""
|
||||||
logging.info('start')
|
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
|
for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
|
||||||
logging.debug("examen face debouchante circulaire")
|
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"])
|
sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[j_aux_0]], geompy.ShapeType["VERTEX"])
|
||||||
nameFace = "facePipePeau_{}".format(i_aux)
|
nameFace = "facePipePeau_{}".format(i_aux)
|
||||||
nameVert = "endEdgeFond_{}".format(i_aux)
|
nameVert = "endEdgeFond_{}".format(i_aux)
|
||||||
nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
|
|
||||||
facesPipePeau[i_aux] = face
|
facesPipePeau[i_aux] = face
|
||||||
endsEdgeFond[i_aux] = sharedVertices[0]
|
endsEdgeFond[i_aux] = sharedVertices[0]
|
||||||
geomPublish(initLog.debug, face, nameFace, nro_cas)
|
geomPublish(initLog.debug, face, nameFace, nro_cas)
|
||||||
@ -55,29 +55,30 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
|
|||||||
for edge in edgesFace:
|
for edge in edgesFace:
|
||||||
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
||||||
edgeRadFacePipePeau[i_aux] = edge
|
edgeRadFacePipePeau[i_aux] = edge
|
||||||
|
nameEdge = "edgeRadFacePipePeau_{}".format(i_aux)
|
||||||
geomPublish(initLog.debug, edge, nameEdge, nro_cas)
|
geomPublish(initLog.debug, edge, nameEdge, nro_cas)
|
||||||
break
|
break
|
||||||
|
|
||||||
# --- edges elliptiques de la face de peau et points de jonction de la face externe de fissure
|
# --- 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())
|
logging.info('Nombre de faces : len(facesPipePeau) = %d', len(facesPipePeau))
|
||||||
edgesCircPeau = [None for _ in range(len(facesPipePeau))]
|
edgesCircPeau = list()
|
||||||
verticesCircPeau = [None for _ in range(len(facesPipePeau))]
|
verticesCircPeau = list()
|
||||||
for i_aux,fcirc in enumerate(facesPipePeau):
|
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"])
|
edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
|
||||||
grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(grpEdgesCirc, edges)
|
geompy.UnionList(groupe, edges)
|
||||||
edgesCircPeau[i_aux] = grpEdgesCirc
|
geomPublishInFather(initLog.always, facePeau, groupe, "edgeCirc_{}".format(i_aux))
|
||||||
name = "edgeCirc_{}".format(i_aux)
|
edgesCircPeau.append(groupe)
|
||||||
geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name)
|
|
||||||
edgesListees = edgesListees + edges
|
edgesListees = edgesListees + edges
|
||||||
|
# Sommets
|
||||||
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
||||||
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
groupe = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
||||||
geompy.UnionList(grpVertCircPeau, vertices)
|
geompy.UnionList(groupe, vertices)
|
||||||
verticesCircPeau[i_aux] = grpVertCircPeau
|
geomPublishInFather(initLog.info, facePeau, groupe, "point(s)EdgeCirc_{}".format(i_aux))
|
||||||
name = "pointEdgeCirc_{}".format(i_aux)
|
verticesCircPeau.append(groupe)
|
||||||
geomPublishInFather(initLog.info, facePeau, grpVertCircPeau, name)
|
|
||||||
|
|
||||||
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
|
return edgesCircPeau, verticesCircPeau
|
||||||
|
@ -32,7 +32,9 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
|
|||||||
"""edges de bord de la face de peau"""
|
"""edges de bord de la face de peau"""
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
|
|
||||||
|
# Liste des arêtes de bord
|
||||||
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
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()
|
edgesBords = list()
|
||||||
for i_aux, edge in enumerate(edgesFilling):
|
for i_aux, edge in enumerate(edgesFilling):
|
||||||
edgepeau = geompy.GetInPlace(facePeau, edge)
|
edgepeau = geompy.GetInPlace(facePeau, edge)
|
||||||
@ -42,18 +44,19 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
|
|||||||
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
||||||
logging.debug(" EDGES multiples")
|
logging.debug(" EDGES multiples")
|
||||||
l_edges = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
|
l_edges = geompy.ExtractShapes(edgepeau, geompy.ShapeType["EDGE"], False)
|
||||||
edgesBords += l_edges
|
edgesBords.extend(l_edges)
|
||||||
edgesListees += l_edges
|
edgesListees.extend(l_edges)
|
||||||
else:
|
else:
|
||||||
logging.debug(" EDGE")
|
logging.debug(" EDGE")
|
||||||
edgesBords.append(edgepeau)
|
edgesBords.append(edgepeau)
|
||||||
edgesListees.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"])
|
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesBordPeau, edgesBords)
|
geompy.UnionList(groupEdgesBordPeau, edgesBords)
|
||||||
bordsVifs = None
|
bordsVifs = None
|
||||||
if aretesVivesC is not 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)
|
bordsVifs = geompy.GetInPlace(facePeau, aretesVivesC)
|
||||||
if bordsVifs is None:
|
if bordsVifs is None:
|
||||||
logging.debug("pas d'identification des bords vifs par GetInPlace: test par distance")
|
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 ):
|
if ( dist < 0.001 ):
|
||||||
edvifs.append(edge)
|
edvifs.append(edge)
|
||||||
break
|
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"])
|
bordsVifs = geompy.CreateGroup(facePeau,geompy.ShapeType["EDGE"])
|
||||||
for edge in edvifs:
|
for edge in edvifs:
|
||||||
geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge))
|
geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge))
|
||||||
|
@ -33,38 +33,39 @@ def identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircP
|
|||||||
logging.info('start')
|
logging.info('start')
|
||||||
logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
|
logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
|
||||||
logging.info('Nombre de sommets : len(verticesPipePeau) = %d', len(verticesPipePeau))
|
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)
|
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
|
||||||
logging.info('Nombre total d arêtes de la peau : len(edgesPeau) = %d', len(edgesPeau))
|
logging.info('Nombre total d arêtes de la peau : len(edgesPeau) = %d', len(edgesPeau))
|
||||||
|
|
||||||
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
|
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
|
||||||
|
|
||||||
edgesFissurePeau = list()
|
l_edge_cercle = list()
|
||||||
# --- au moins une extrémité du pipe sur cette face de peau
|
# --- au moins une extrémité du pipe sur cette face de peau : arêtes sui les prenent toutes
|
||||||
if verticesPipePeau:
|
if verticesPipePeau:
|
||||||
# En premier, les edges associés aux extrémités du pipe
|
i_aux = -1
|
||||||
edgesFissurePeau = [None for _ in range(len(verticesCircPeau))]
|
|
||||||
for edge in edges:
|
for edge in edges:
|
||||||
for i_aux, vertex in enumerate(verticesCircPeau):
|
for groupe in verticesCircPeau:
|
||||||
logging.info(".. distance %s", geompy.MinDistance(vertex, edge))
|
cercle = True
|
||||||
if ( ( geompy.MinDistance(vertex, edge) < 1.e-3 ) and ( edge not in edgesFissurePeau ) ):
|
for id_vertex in geompy.GetObjectIDs(groupe):
|
||||||
edgesFissurePeau[i_aux] = edge
|
vertex = geompy.GetSubShape(facePeau, [id_vertex])
|
||||||
name = "edgeFissurePeau_{}".format(i_aux)
|
distance = geompy.MinDistance(vertex, edge)
|
||||||
logging.info("... entrée de %s à la place %d", edge, i_aux)
|
logging.info(".. distance %s", distance)
|
||||||
geomPublishInFather(initLog.debug, facePeau, edge, name)
|
if ( distance > 1.e-3 ):
|
||||||
# Ensuite, on ajoute les edges manquantes
|
cercle = False
|
||||||
for edge in edges:
|
break
|
||||||
if edge not in edgesFissurePeau:
|
if cercle:
|
||||||
logging.info("... ajout")
|
logging.info("... entrée de %s dans l_edge_cercle", edge)
|
||||||
edgesFissurePeau.append(edge)
|
l_edge_cercle.append(edge)
|
||||||
|
i_aux += 1
|
||||||
|
name = "edgeFissurePeauCercle_{}".format(i_aux)
|
||||||
|
geomPublishInFather(initLog.info, facePeau, edge, name)
|
||||||
|
|
||||||
else:
|
# --- Les arêtes n'appartenant pas aux cercles
|
||||||
|
edgesFissurePeau = list()
|
||||||
for i_aux, edge in enumerate(edges):
|
for i_aux, edge in enumerate(edges):
|
||||||
|
if edge not in l_edge_cercle:
|
||||||
edgesFissurePeau.append(edge)
|
edgesFissurePeau.append(edge)
|
||||||
name = "edgeFissurePeau{}".format(i_aux)
|
name = "edgeFissurePeau_{}".format(i_aux)
|
||||||
geomPublishInFather(initLog.debug, facePeau, edge, name)
|
geomPublishInFather(initLog.debug, facePeau, edge, name)
|
||||||
|
|
||||||
logging.info('==> Nombre d arêtes : len(edgesFissurePeau) = %d', len(edgesFissurePeau))
|
logging.info('==> Nombre d arêtes : len(edgesFissurePeau) = %d', len(edgesFissurePeau))
|
||||||
|
@ -27,10 +27,9 @@ from .trouveEdgesFissPeau import trouveEdgesFissPeau
|
|||||||
from .identifieFacesPeau import identifieFacesPeau
|
from .identifieFacesPeau import identifieFacesPeau
|
||||||
from .identifieEdgesPeau import identifieEdgesPeau
|
from .identifieEdgesPeau import identifieEdgesPeau
|
||||||
|
|
||||||
def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, \
|
def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, \
|
||||||
edgesFondFiss, wireFondFiss, aretesVivesC, \
|
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
||||||
facesDefaut, centreFondFiss, rayonPipe, \
|
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
|
||||||
aretesVivesCoupees, \
|
|
||||||
nro_cas=None):
|
nro_cas=None):
|
||||||
"""Identification des éléments géométriques de la face de peau"""
|
"""Identification des éléments géométriques de la face de peau"""
|
||||||
logging.info('start')
|
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
|
# --- 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) = \
|
bordsVifs, edgesFissurePeau, aretesVivesCoupees) = \
|
||||||
identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
|
identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
|
||||||
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
|
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]
|
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)
|
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]
|
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
|
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
|
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]
|
edgesFissurePeau = edgesFissurePeau, # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
||||||
|
@ -60,7 +60,8 @@ def mailleFacesFissure(faceFissureExterne, \
|
|||||||
hypo2d.SetQuadAllowed( 0 )
|
hypo2d.SetQuadAllowed( 0 )
|
||||||
putName(hypo2d, "faceFiss", i_pref=nro_cas)
|
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)
|
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
|
||||||
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
|
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
|
||||||
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
|
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
|
||||||
|
@ -34,7 +34,7 @@ from . import initLog
|
|||||||
from .putName import putName
|
from .putName import putName
|
||||||
|
|
||||||
def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||||
facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
|
facesPeaux, edCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
|
||||||
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
|
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
|
||||||
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
|
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
|
||||||
mailleur="MeshGems", nro_cas=None):
|
mailleur="MeshGems", nro_cas=None):
|
||||||
@ -91,13 +91,13 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
|||||||
# --- edges de bord de la face de filling
|
# --- edges de bord de la face de filling
|
||||||
filling = facesDefaut[ifil]
|
filling = facesDefaut[ifil]
|
||||||
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
||||||
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
gpedgeBord[ifil] = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
||||||
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
geompy.UnionList(gpedgeBord[ifil], edgesFilling)
|
||||||
geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas)
|
geomPublishInFather(initLog.always, filling, gpedgeBord[ifil], "EdgesBords", nro_cas)
|
||||||
|
|
||||||
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
||||||
groupEdgesBordPeau.GetName(), bordsLibres.GetName())
|
gpedgeBord[ifil].GetName(), bordsLibres.GetName())
|
||||||
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
|
algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
|
||||||
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
||||||
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
||||||
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
|
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
|
||||||
@ -105,21 +105,20 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
logging.info("face de peau %d coupée par la fissure", ifil)
|
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]
|
# 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]
|
# gpedgeBord[ifil] : pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
||||||
groupEdgesBordPeau = 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
|
||||||
bordsVifs = 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]
|
||||||
edgesFissurePeau = 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'", \
|
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
||||||
groupEdgesBordPeau.GetName(), bordsLibres.GetName())
|
gpedgeBord[ifil].GetName(), bordsLibres.GetName())
|
||||||
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
|
algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeBord[ifil])
|
||||||
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
||||||
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
||||||
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), i_pref=nro_cas)
|
putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), i_pref=nro_cas)
|
||||||
|
|
||||||
objet = geompy.MakeCompound(edgesFissurePeau)
|
objet = geompy.MakeCompound(edFissPeau[ifil])
|
||||||
geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
|
geomPublishInFather(initLog.always, facePeau, objet, "edFissPeau_{}".format(ifil))
|
||||||
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
||||||
objet.GetName(), grpEdgesPeauFissureExterne.GetName())
|
objet.GetName(), grpEdgesPeauFissureExterne.GetName())
|
||||||
algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
|
algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
|
||||||
@ -127,15 +126,15 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
|||||||
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
|
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
|
||||||
putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), i_pref=nro_cas)
|
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'", \
|
logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
|
||||||
bordsVifs.GetName(), grpAretesVives.GetName())
|
gpedgeVifs[ifil].GetName(), grpAretesVives.GetName())
|
||||||
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
|
algo1d = meshFacePeau.UseExisting1DElements(geom=gpedgeVifs[ifil])
|
||||||
putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
|
putName(algo1d.GetSubMesh(), "gpedgeVifs", ifil, nro_cas)
|
||||||
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
|
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
|
||||||
putName(hypo1d, "SourceEdges_{}".format(grpAretesVives.GetName()), i_pref=nro_cas)
|
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)
|
texte = "i_aux = {}".format(i_aux)
|
||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
if edgeCirc is not None:
|
if edgeCirc is not None:
|
||||||
|
@ -25,13 +25,13 @@ SET(plugin_SCRIPTS
|
|||||||
cubeAngle.py
|
cubeAngle.py
|
||||||
cubeFin.py
|
cubeFin.py
|
||||||
decoupeCylindre.py
|
decoupeCylindre.py
|
||||||
disque_perce.py
|
disquePerce.py
|
||||||
ellipse_disque.py
|
ellipse_disque.py
|
||||||
ellipse_probleme.py
|
ellipse_probleme.py
|
||||||
ellipse.py
|
ellipse.py
|
||||||
eprouvetteCourbe.py
|
eprouvetteCourbe.py
|
||||||
eprouvetteDroite.py
|
eprouvetteDroite.py
|
||||||
fissureGauche2.py
|
fissureGauche_2.py
|
||||||
fissureGauche.py
|
fissureGauche.py
|
||||||
genereMateriel.py
|
genereMateriel.py
|
||||||
tube.py
|
tube.py
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#
|
#
|
||||||
"""Géométries et maillages de base nécessaires aux cas-tests :
|
"""Géométries et maillages de base nécessaires aux cas-tests :
|
||||||
. cubeAngle
|
. cubeAngle
|
||||||
. cubeAngle2
|
. cubeAngle_2
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
"""Géométrie et maillage de base nécessaire au cas-test :
|
"""Géométrie et maillage de base nécessaire au cas-test :
|
||||||
. disque_perce
|
. disquePerce
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
@ -54,8 +54,8 @@ Scale_1 = geompy.MakeScaleAlongAxes(Rotation_1, Vertex_1, 1, 1.5, 1)
|
|||||||
Vertex_3 = geompy.MakeVertex(420, -400, 300)
|
Vertex_3 = geompy.MakeVertex(420, -400, 300)
|
||||||
Vertex_4 = geompy.MakeVertex(500, 400, 500)
|
Vertex_4 = geompy.MakeVertex(500, 400, 500)
|
||||||
Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
|
Box_1 = geompy.MakeBoxTwoPnt(Vertex_4, Vertex_3)
|
||||||
ellipse1 = geompy.MakeCut(Scale_1, Box_1)
|
ellipse_1 = geompy.MakeCut(Scale_1, Box_1)
|
||||||
[fondFiss] = geompy.SubShapes(ellipse1, [4])
|
[fondFiss] = geompy.SubShapes(ellipse_1, [4])
|
||||||
geompy.addToStudy( O, 'O' )
|
geompy.addToStudy( O, 'O' )
|
||||||
geompy.addToStudy( OX, 'OX' )
|
geompy.addToStudy( OX, 'OX' )
|
||||||
geompy.addToStudy( OY, 'OY' )
|
geompy.addToStudy( OY, 'OY' )
|
||||||
@ -69,9 +69,9 @@ geompy.addToStudy( Scale_1, 'Scale_1' )
|
|||||||
geompy.addToStudy( Vertex_3, 'Vertex_3' )
|
geompy.addToStudy( Vertex_3, 'Vertex_3' )
|
||||||
geompy.addToStudy( Vertex_4, 'Vertex_4' )
|
geompy.addToStudy( Vertex_4, 'Vertex_4' )
|
||||||
geompy.addToStudy( Box_1, 'Box_1' )
|
geompy.addToStudy( Box_1, 'Box_1' )
|
||||||
geompy.addToStudy( ellipse1, 'ellipse1' )
|
geompy.addToStudy( ellipse_1, 'ellipse_1' )
|
||||||
geompy.addToStudyInFather( ellipse1, fondFiss, 'fondFiss' )
|
geompy.addToStudyInFather( ellipse_1, fondFiss, 'fondFiss' )
|
||||||
geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1.brep"))
|
geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1.brep"))
|
||||||
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
|
@ -54,7 +54,7 @@ Vertex_2 = geompy.MakeVertex(20, -100, -50)
|
|||||||
Vertex_4 = geompy.MakeVertex(100, 100, 50)
|
Vertex_4 = geompy.MakeVertex(100, 100, 50)
|
||||||
Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
|
Box_1 = geompy.MakeBoxTwoPnt(Vertex_2, Vertex_4)
|
||||||
Cut_1 = geompy.MakeCut(Rotation_1, Box_1)
|
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( Disk_1, 'Disk_1' )
|
||||||
geompy.addToStudy( O, 'O' )
|
geompy.addToStudy( O, 'O' )
|
||||||
geompy.addToStudy( OX, 'OX' )
|
geompy.addToStudy( OX, 'OX' )
|
||||||
@ -68,8 +68,8 @@ geompy.addToStudy( Vertex_2, 'Vertex_2' )
|
|||||||
geompy.addToStudy( Box_1, 'Box_1' )
|
geompy.addToStudy( Box_1, 'Box_1' )
|
||||||
geompy.addToStudy( Vertex_4, 'Vertex_4' )
|
geompy.addToStudy( Vertex_4, 'Vertex_4' )
|
||||||
geompy.addToStudy( Cut_1, 'Cut_1' )
|
geompy.addToStudy( Cut_1, 'Cut_1' )
|
||||||
geompy.addToStudy( ellipse1, 'ellipse1_pb' )
|
geompy.addToStudy( ellipse_1, 'ellipse_1_pb' )
|
||||||
geompy.ExportBREP(ellipse1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
|
geompy.ExportBREP(ellipse_1, os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_1_pb.brep"))
|
||||||
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
from blocFissure.materielCasTests import cubeAngle
|
from blocFissure.materielCasTests import cubeAngle
|
||||||
from blocFissure.materielCasTests import cubeFin
|
from blocFissure.materielCasTests import cubeFin
|
||||||
from blocFissure.materielCasTests import decoupeCylindre
|
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_disque
|
||||||
from blocFissure.materielCasTests import ellipse
|
from blocFissure.materielCasTests import ellipse
|
||||||
from blocFissure.materielCasTests import ellipse_probleme
|
from blocFissure.materielCasTests import ellipse_probleme
|
||||||
from blocFissure.materielCasTests import eprouvetteCourbe
|
from blocFissure.materielCasTests import eprouvetteCourbe
|
||||||
from blocFissure.materielCasTests import eprouvetteDroite
|
from blocFissure.materielCasTests import eprouvetteDroite
|
||||||
from blocFissure.materielCasTests import fissureGauche
|
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 vis
|
||||||
from blocFissure.materielCasTests import tube
|
from blocFissure.materielCasTests import tube
|
||||||
|