Ajout d'un test de non régression pour blocFissure

Merge branch 'gni/evolution'
This commit is contained in:
Gérald NICOLAS 2021-04-19 11:47:39 +02:00
commit 21b39b9997
52 changed files with 386 additions and 323 deletions

View File

@ -0,0 +1,48 @@
#!/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)

View File

@ -46,6 +46,7 @@ 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
) )
SET(GOOD_TESTS SET(GOOD_TESTS

View File

@ -45,7 +45,7 @@ class cubeAngle(fissureGenerique):
logging.info(texte) logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -88,8 +88,8 @@ class cubeAngle(fissureGenerique):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte) logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 10) areteFaceFissure = 10)

View File

@ -44,8 +44,8 @@ class cubeAngle2(cubeAngle):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 32, nbsegCercle = 32,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -24,6 +24,7 @@ import os
from blocFissure import gmu from blocFissure import gmu
dicoParams = dict(nomCas = "cubeCoin", dicoParams = dict(nomCas = "cubeCoin",
nomProbleme = "cubeCoin",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Coin.brep"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Coin.brep"),
edgeFiss = [3], edgeFiss = [3],

View File

@ -24,6 +24,7 @@ import os
from blocFissure import gmu from blocFissure import gmu
dicoParams = dict(nomCas = "cubeMilieu", dicoParams = dict(nomCas = "cubeMilieu",
nomProbleme = "cubeMilieu",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Milieu.brep"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Milieu.brep"),
edgeFiss = [3], edgeFiss = [3],

View File

@ -24,6 +24,7 @@ import os
from blocFissure import gmu from blocFissure import gmu
dicoParams = dict(nomCas = "cubeTransverse", dicoParams = dict(nomCas = "cubeTransverse",
nomProbleme = "cubeTransverse",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Transverse.brep"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Transverse.brep"),
edgeFiss = [6], edgeFiss = [6],

View File

@ -48,7 +48,7 @@ class cylindre(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -85,8 +85,8 @@ class cylindre(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 20) areteFaceFissure = 20)

View File

@ -24,6 +24,7 @@ import os
from blocFissure import gmu from blocFissure import gmu
dicoParams = dict(nomCas = 'disque', dicoParams = dict(nomCas = 'disque',
nomProbleme = "disque",
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],

View File

@ -51,7 +51,7 @@ class ellipse_1(fissureGenerique):
logging.info(texte) logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -96,8 +96,8 @@ class ellipse_1(fissureGenerique):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte) logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 1000) areteFaceFissure = 1000)

View File

@ -45,7 +45,7 @@ class eprouvetteCourbe(fissureGenerique):
logging.info(texte) logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -90,8 +90,8 @@ class eprouvetteCourbe(fissureGenerique):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte) logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 15) areteFaceFissure = 15)

View File

@ -49,7 +49,7 @@ class eprouvetteDroite(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -89,8 +89,8 @@ class eprouvetteDroite(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 15) areteFaceFissure = 15)

View File

@ -19,27 +19,31 @@
# #
"""Lancement des cas-tests de blocFissure""" """Lancement des cas-tests de blocFissure"""
import traceback
import logging import logging
import os
import tempfile
import traceback
from blocFissure.gmu import initLog from blocFissure.gmu import initLog
from blocFissure.gmu.casStandard import casStandard from blocFissure.gmu.casStandard import casStandard
# ----------------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------------
#initLog.setDebug() LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
#initLog.setVerbose() #initLog.setDebug(LOGFILE) # debug = 10
#initLog.setRelease() #initLog.setVerbose(LOGFILE) # info = 20
#initLog.setPerfTests() #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 ... # ---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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] # OK 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 # 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 = False
RUNALL = True RUNALL = True
if RUNALL: 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] 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 # 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: else:
TORUNPB = list() TORUNPB = list()
for IAUX in TORUNOK: for IAUX in TORUNOK:
@ -238,6 +242,7 @@ def calcul_cas (n_cas, cas, d_aux, ligne):
nom = cas.nomProbleme nom = cas.nomProbleme
texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom) texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
logging.critical(ligne+texte_a) logging.critical(ligne+texte_a)
try: try:
ok_maillage = cas.executeProbleme() ok_maillage = cas.executeProbleme()
except: except:
@ -246,13 +251,14 @@ def calcul_cas (n_cas, cas, d_aux, ligne):
if not ok_maillage: if not ok_maillage:
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom) texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
print(ligne) print(ligne)
return ok_maillage, texte return ok_maillage, texte
#============================================================= #=============================================================
def calcul_tout (l_problemes, d_aux): def calcul_tout (l_problemes, d_aux):
"""Calcul de tous les cas""" """Calcul de tous les cas"""
ligne = "---------------------------------------------------------------------" ligne = "---------------------------------------------------------------------"
texte = "" texte = "\n"
nb_cas_ok = 0 nb_cas_ok = 0
nb_cas_nook = 0 nb_cas_nook = 0
for n_cas, cas in enumerate(l_problemes): for n_cas, cas in enumerate(l_problemes):
@ -274,6 +280,7 @@ def calcul_tout (l_problemes, d_aux):
else: else:
texte += "Les {} tests se sont bien passés.\n".format(nb_cas) texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
print (texte+ligne) print (texte+ligne)
logging.critical(ligne+texte)
return return
#============================================================= #=============================================================

View File

@ -48,7 +48,7 @@ class faceGauche(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -87,8 +87,8 @@ class faceGauche(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 1000) areteFaceFissure = 1000)

View File

@ -46,7 +46,7 @@ class faceGauche_2(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -85,8 +85,8 @@ class faceGauche_2(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 1000) areteFaceFissure = 1000)

View File

@ -97,8 +97,8 @@ class fissureCoude_1(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 6, nbsegCercle = 6,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -99,8 +99,8 @@ class fissureCoude_10(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 3, nbsegRad = 3,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 2.5) areteFaceFissure = 2.5)

View File

@ -97,8 +97,8 @@ class fissureCoude_2(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 6, nbsegCercle = 6,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -97,8 +97,8 @@ class fissureCoude_3(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 6, nbsegCercle = 6,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -97,8 +97,8 @@ class fissureCoude_4(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 6, nbsegCercle = 6,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -97,8 +97,8 @@ class fissureCoude_5(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -98,8 +98,8 @@ class fissureCoude_6(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 12, nbsegCercle = 12,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -99,8 +99,8 @@ class fissureCoude_7(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 12, nbsegCercle = 12,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -99,8 +99,8 @@ class fissureCoude_8(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 4, nbsegRad = 4,
nbsegCercle = 16, nbsegCercle = 16,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -97,8 +97,8 @@ class fissureCoude_9(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 6, nbsegRad = 6,
nbsegCercle = 20, nbsegCercle = 20,
areteFaceFissure = 2.5) areteFaceFissure = 2.5)

View File

@ -76,6 +76,7 @@ class fissure_Coude(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereGeometrieSaine(self, geomParams): def genereGeometrieSaine(self, geomParams):
"""a écrire"""
logging.info("genereGeometrieSaine %s", self.nomCas) logging.info("genereGeometrieSaine %s", self.nomCas)
angleCoude = geomParams['angleCoude'] angleCoude = geomParams['angleCoude']
@ -108,7 +109,6 @@ class fissure_Coude(fissureGenerique):
P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2) P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
geomPublish(initLog.always, P2, "P2", self.numeroCas ) geomPublish(initLog.always, P2, "P2", self.numeroCas )
# --- tube coude sain # --- tube coude sain
geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1) geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
@ -146,7 +146,7 @@ class fissure_Coude(fissureGenerique):
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10) pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
vec2 = geompy.MakeVector(P2, pp2) vec2 = geompy.MakeVector(P2, pp2)
#geomPublish(initLog.debug,vec2, 'vec2') #geomPublish(initLog.debug, vec2, 'vec2', self.numeroCas)
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON) facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(CLGV, facesIds) geompy.UnionIDs(CLGV, facesIds)
@ -160,7 +160,7 @@ class fissure_Coude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
interne = geompy.MakeFuse(extru1, revol1) interne = geompy.MakeFuse(extru1, revol1)
interne = geompy.MakeFuse(extru2, interne) interne = geompy.MakeFuse(extru2, interne)
geomPublish(initLog.debug,interne, 'interne') geomPublish(initLog.debug, interne, 'interne', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN) facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUINT, facesIds) geompy.UnionIDs(PEAUINT, facesIds)
@ -176,7 +176,7 @@ class fissure_Coude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1) externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe) externe = geompy.MakeFuse(extru2, externe)
geomPublish(initLog.debug,externe, 'externe') geomPublish(initLog.debug, externe, 'externe', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON) facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUEXT, facesIds) geompy.UnionIDs(PEAUEXT, facesIds)
@ -230,41 +230,34 @@ class fissure_Coude(fissureGenerique):
n_long_p2 = meshParams['n_long_p2'] n_long_p2 = meshParams['n_long_p2']
maillageSain = smesh.Mesh(geometrieSaine) maillageSain = smesh.Mesh(geometrieSaine)
putName(maillageSain, "maillageSain", i_pref=self.numeroCas)
algo3d = maillageSain.Hexahedron() algo3d = maillageSain.Hexahedron()
algo2d = maillageSain.Quadrangle() algo2d = maillageSain.Quadrangle()
putName(algo3d, "3d_maillageSain", i_pref=self.numeroCas)
putName(algo2d, "2d_maillageSain", i_pref=self.numeroCas)
algo1d_long_p1 = maillageSain.Segment(geom=long_p1) algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1) hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
putName(algo1d_long_p1, "algo1d_long_p1", i_pref=self.numeroCas) putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas)
putName(hypo1d_long_p1, "hypo1d_long_p1", i_pref=self.numeroCas)
algo1d_ep = maillageSain.Segment(geom=ep) algo1d_ep = maillageSain.Segment(geom=ep)
hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep) hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas) putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas)
putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas)
algo1d_long_coude = maillageSain.Segment(geom=long_coude) algo1d_long_coude = maillageSain.Segment(geom=long_coude)
hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude) hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
putName(algo1d_long_coude, "algo1d_long_coude", i_pref=self.numeroCas) putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas)
putName(hypo1d_long_coude, "hypo1d_long_coude", i_pref=self.numeroCas)
algo1d_circ_g = maillageSain.Segment(geom=circ_g) algo1d_circ_g = maillageSain.Segment(geom=circ_g)
hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g) hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
putName(algo1d_circ_g, "algo1d_circ_g", i_pref=self.numeroCas) putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas)
putName(hypo1d_circ_g, "hypo1d_circ_g", i_pref=self.numeroCas)
algo1d_circ_d = maillageSain.Segment(geom=circ_d) algo1d_circ_d = maillageSain.Segment(geom=circ_d)
hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d) hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
putName(algo1d_circ_d, "algo1d_circ_d", i_pref=self.numeroCas) putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas)
putName(hypo1d_circ_d, "hypo1d_circ_d", i_pref=self.numeroCas)
algo1d_long_p2 = maillageSain.Segment(geom=long_p2) algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2) hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
putName(algo1d_long_p2, "algo1d_long_p2", i_pref=self.numeroCas) putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas)
putName(hypo1d_long_p2, "hypo1d_long_p2", i_pref=self.numeroCas)
_ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
_ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
@ -275,14 +268,21 @@ class fissure_Coude(fissureGenerique):
_ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
_ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) _ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
_ = maillageSain.Compute() is_done = maillageSain.Compute()
text = "maillageSain.Compute"
if is_done:
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)
raise Exception(text)
return [maillageSain, True] # True : maillage hexa return [maillageSain, True] # True : maillage hexa
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamShapeFissure(self): def setParamShapeFissure(self):
""" """
paramètres de la fissure paramètres de la fissure pour le tuyau coude
profondeur : 0 < profondeur <= épaisseur profondeur : 0 < profondeur <= épaisseur
azimut : entre 0 et 360° azimut : entre 0 et 360°
alpha : 0 < alpha < angleCoude alpha : 0 < alpha < angleCoude
@ -487,8 +487,8 @@ class fissure_Coude(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegExt = 5, nbsegExt = 5,
nbsegGen = 25, nbsegGen = 25,
nbsegRad = 5, nbsegRad = 5,

View File

@ -76,7 +76,7 @@ class fissure_Coude_4(fissure_Coude):
""" """
self.shapeFissureParams = dict(nomRep = os.curdir, self.shapeFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomCas,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
profondeur = 10, profondeur = 10,
azimut = 90, azimut = 90,
alpha = 20, alpha = 20,

View File

@ -49,7 +49,7 @@ class tube(fissureGenerique):
logging.info(texte) logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -96,8 +96,8 @@ class tube(fissureGenerique):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte) logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 8, nbsegCercle = 8,
areteFaceFissure = 0.5) areteFaceFissure = 0.5)

View File

@ -51,7 +51,7 @@ class vis_1(fissureGenerique):
logging.info(texte) logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "visSain.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "visSain.med"))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas) putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -96,8 +96,8 @@ class vis_1(fissureGenerique):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte) logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = self.nomCas + "_fissure", nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 32, nbsegCercle = 32,
areteFaceFissure = 0.1) areteFaceFissure = 0.1)

View File

@ -56,10 +56,9 @@ def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \
meshFondFiss = smesh.Mesh(wireFondFiss) meshFondFiss = smesh.Mesh(wireFondFiss)
putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas) putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas)
algo1d = meshFondFiss.Segment() algo1d = meshFondFiss.Segment()
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas)
putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas) hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas) putName(hypo1d, "Adaptive_wireFondFiss", i_pref=nro_cas)
is_done = meshFondFiss.Compute() is_done = meshFondFiss.Compute()
text = "calculePointsAxiauxPipe meshFondFiss.Compute" text = "calculePointsAxiauxPipe meshFondFiss.Compute"

View File

@ -50,36 +50,44 @@ class casStandard(fissureGenerique):
referencesMaillageFissure = None referencesMaillageFissure = None
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def __init__ (self, dicoParams, references = None, numeroCas = 0): def __init__ (self, dicoParams, references = None, numeroCas = None):
initEtude() initEtude()
self.references = references self.references = references
self.dicoParams = dicoParams self.dicoParams = dicoParams
self.numeroCas = numeroCas
if 'nomProbleme' in self.dicoParams:
self.nomProbleme = self.dicoParams['nomProbleme']
if 'nomCas' in self.dicoParams: if 'nomCas' in self.dicoParams:
self.nomCas = self.dicoParams['nomCas'] self.nomCas = self.dicoParams['nomCas']
elif 'nomres' in self.dicoParams: elif 'nomres' in self.dicoParams:
self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0] self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0]
elif ( self.numeroCas is not None ):
self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
else: else:
self.nomCas = 'casStandard' self.nomCas = 'casStandard'
if 'reptrav' in self.dicoParams: if 'reptrav' in self.dicoParams:
self.reptrav = self.dicoParams['reptrav'] self.reptrav = self.dicoParams['reptrav']
else: else:
self.reptrav = os.curdir self.reptrav = os.curdir
self.numeroCas = numeroCas
if self.numeroCas != 0:
self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
else:
self.nomProbleme = self.nomCas
if 'lenSegPipe' in self.dicoParams: if 'lenSegPipe' in self.dicoParams:
self.lenSegPipe = self.dicoParams['lenSegPipe'] self.lenSegPipe = self.dicoParams['lenSegPipe']
else: else:
self.lenSegPipe =self.dicoParams['rayonPipe'] self.lenSegPipe = self.dicoParams['rayonPipe']
if 'step' in self.dicoParams: if 'step' in self.dicoParams:
step = self.dicoParams['step'] step = self.dicoParams['step']
else: else:
step = -1 # exécuter toutes les étapes step = -1 # exécuter toutes les étapes
if 'aretesVives' not in self.dicoParams: if 'aretesVives' not in self.dicoParams:
self.dicoParams['aretesVives'] = 0 self.dicoParams['aretesVives'] = 0
if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
# valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
if ( self.numeroCas is None ):
self.executeProbleme(step) self.executeProbleme(step)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -87,7 +95,7 @@ class casStandard(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain']) ([objetSain], _) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain'])
putName(objetSain.GetMesh(), 'objetSain', i_pref=self.numeroCas) putName(objetSain.GetMesh(), objetSain.GetName(), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -154,8 +162,8 @@ class casStandard(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = self.reptrav, self.maillageFissureParams = dict(nomRep = self.reptrav,
nomFicSain = self.nomCas +'_sain', nomFicSain = self.nomCas,
nomFicFissure = self.nomCas, nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = self.dicoParams['nbSegRad'], nbsegRad = self.dicoParams['nbSegRad'],
nbsegCercle = self.dicoParams['nbSegCercle'], nbsegCercle = self.dicoParams['nbSegCercle'],
areteFaceFissure = self.dicoParams['areteFaceFissure'], areteFaceFissure = self.dicoParams['areteFaceFissure'],

View File

@ -75,7 +75,6 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetStandardOutputLog( 0 )
hypo3d.SetRemoveLogOnSuccess( 1 ) hypo3d.SetRemoveLogOnSuccess( 1 )
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas) putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute() is_done = meshBoiteDefaut.Compute()
text = "meshBoiteDefaut.Compute" text = "meshBoiteDefaut.Compute"
@ -94,9 +93,11 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
_, normfiss = shapeSurFissure(facesPortFissure) _, normfiss = shapeSurFissure(facesPortFissure)
maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \ maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \
None, None, 'COMPLET', normfiss) None, None, 'COMPLET', normfiss)
putName(maillageComplet, nomFicFissure)
logging.info("conversion quadratique") logging.info("conversion quadratique")
maillageComplet.ConvertToQuadratic( 1 ) maillageComplet.ConvertToQuadratic( 1 )
logging.info("groupes") logging.info("groupes")
groups = maillageComplet.GetGroups() groups = maillageComplet.GetGroups()
grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS'] grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
@ -116,7 +117,6 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
logging.info("export maillage fini") logging.info("export maillage fini")
fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure)) fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure))
maillageComplet.ExportMED(fichierMaillageFissure) maillageComplet.ExportMED(fichierMaillageFissure)
putName(maillageComplet, nomFicFissure)
logging.info("fichier maillage fissure %s", fichierMaillageFissure) logging.info("fichier maillage fissure %s", fichierMaillageFissure)
return maillageComplet return maillageComplet

View File

@ -34,12 +34,14 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
for n_edges, edges in enumerate(listEdges): for n_edges, edges in enumerate(listEdges):
idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau) # idf = indice de face débouchante (facesPipePeau) ; idf vaut 0 ou 1
idf = idFacesDebouchantes[n_edges]
logging.info("idf: %d", idf) logging.info("idf: %d", idf)
if idf >= 0: if ( idf >= 0 ):
gptdsk = list() gptdsk = list()
if idf > 0: # idf vaut 0 ou 1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) if ( idf > 0 ):
idf = -1
centre = ptEdgeFond[idFillingFromBout[n_edges]][idf] centre = ptEdgeFond[idFillingFromBout[n_edges]][idf]
name = "centre_{}".format(idf) name = "centre_{}".format(idf)
geomPublish(initLog.debug, centre, name) geomPublish(initLog.debug, centre, name)
@ -50,7 +52,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
edgesCirc = list() edgesCirc = list()
for grpEdgesCirc in grpsEdgesCirc: for grpEdgesCirc in grpsEdgesCirc:
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False) edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
logging.info("edgesCirc: %s", edgesCirc) logging.debug("edgesCirc: %s", edgesCirc)
for i_aux, edge in enumerate(edges): for i_aux, edge in enumerate(edges):
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True) extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)

View File

@ -19,10 +19,10 @@
# #
"""Fissure dans un coude""" """Fissure dans un coude"""
import os
import logging import logging
import os
import math import math
import GEOM import GEOM
import SMESH import SMESH
@ -259,50 +259,34 @@ class fissureCoude(fissureGenerique):
n_long_p2 = meshParams['n_long_p2'] n_long_p2 = meshParams['n_long_p2']
maillageSain = smesh.Mesh(geometrieSaine) maillageSain = smesh.Mesh(geometrieSaine)
putName(maillageSain, "maillageSain", i_pref=self.numeroCas)
algo3d = maillageSain.Hexahedron() algo3d = maillageSain.Hexahedron()
algo2d = maillageSain.Quadrangle() algo2d = maillageSain.Quadrangle()
putName(algo3d, "{}_3d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
putName(algo2d, "{}_2d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
algo1d_long_p1 = maillageSain.Segment(geom=long_p1) algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1) hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
putName(algo1d_long_p1, "algo1d_long_p1", i_pref=self.numeroCas) putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas)
putName(hypo1d_long_p1, "hypo1d_long_p1", i_pref=self.numeroCas)
algo1d_ep = maillageSain.Segment(geom=ep) algo1d_ep = maillageSain.Segment(geom=ep)
hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep) hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas) putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas)
putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas)
algo1d_long_coude = maillageSain.Segment(geom=long_coude) algo1d_long_coude = maillageSain.Segment(geom=long_coude)
hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude) hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
putName(algo1d_long_coude, "algo1d_long_coude", i_pref=self.numeroCas) putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas)
putName(hypo1d_long_coude, "hypo1d_long_coude", i_pref=self.numeroCas)
algo1d_circ_g = maillageSain.Segment(geom=circ_g) algo1d_circ_g = maillageSain.Segment(geom=circ_g)
hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g) hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
putName(algo1d_circ_g, "algo1d_circ_g", i_pref=self.numeroCas) putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas)
putName(hypo1d_circ_g, "hypo1d_circ_g", i_pref=self.numeroCas)
algo1d_circ_d = maillageSain.Segment(geom=circ_d) algo1d_circ_d = maillageSain.Segment(geom=circ_d)
hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d) hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
putName(algo1d_circ_d, "algo1d_circ_d", i_pref=self.numeroCas) putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas)
putName(hypo1d_circ_d, "hypo1d_circ_d", i_pref=self.numeroCas)
algo1d_long_p2 = maillageSain.Segment(geom=long_p2) algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2) hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
putName(algo1d_long_p2, "algo1d_long_p2", i_pref=self.numeroCas) putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas)
putName(hypo1d_long_p2, "hypo1d_long_p2", i_pref=self.numeroCas)
is_done = maillageSain.Compute()
text = "maillageSain.Compute"
if is_done:
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)
raise Exception(text)
_ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
_ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
@ -313,6 +297,15 @@ class fissureCoude(fissureGenerique):
_ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
_ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) _ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
is_done = maillageSain.Compute()
text = "maillageSain.Compute"
if is_done:
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)
raise Exception(text)
return [maillageSain, True] # True : maillage hexa return [maillageSain, True] # True : maillage hexa
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -367,7 +360,7 @@ class fissureCoude(fissureGenerique):
azimut = -azimut # axe inverse / ASCOUF azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1) axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
geomPublish(initLog.debug, axe,"axe", self.numeroCas) geomPublish(initLog.debug, axe, "axe", self.numeroCas)
if not lgInfluence: if not lgInfluence:
lgInfluence = profondeur lgInfluence = profondeur
@ -662,8 +655,8 @@ class fissureCoude(fissureGenerique):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomProbleme,
nomFicFissure = 'fissure_' + self.nomCas, nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5, nbsegRad = 5,
nbsegCercle = 6, nbsegCercle = 6,
areteFaceFissure = 5) areteFaceFissure = 5)

View File

@ -49,7 +49,7 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible
maillagesCoupes = list() maillagesCoupes = list()
# On crée une liste contenant le maillage de chaque face. # On crée une liste contenant le maillage de chaque face.
listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners) listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners, nro_cas)
i_aux = 0 i_aux = 0
while i_aux < len(listOfNewMeshes): while i_aux < len(listOfNewMeshes):
@ -89,6 +89,7 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible
listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes] listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes]
newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False) newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False)
putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas)
facesEnTrop = list() facesEnTrop = list()
criteres = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGenSurface, SMESH.FT_Undefined, face) for face in facesNonCoupees] criteres = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGenSurface, SMESH.FT_Undefined, face) for face in facesNonCoupees]
@ -100,6 +101,4 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible
newZoneDefaut_skin = maillageSain.GetMesh().CutListOfGroups([zoneDefaut_skin], facesEnTrop, 'newZoneDefaut_skin') newZoneDefaut_skin = maillageSain.GetMesh().CutListOfGroups([zoneDefaut_skin], facesEnTrop, 'newZoneDefaut_skin')
putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas)
return newZoneDefaut_skin, newMaillageInterne return newZoneDefaut_skin, newMaillageInterne

View File

@ -75,9 +75,11 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \
hypo2d.SetOptimize( 1 ) hypo2d.SetOptimize( 1 )
hypo2d.SetFineness( 2 ) hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( minSize ) hypo2d.SetMinSize( minSize )
hypo2d.SetChordalErrorEnabled (True)
hypo2d.SetChordalError( maxSize*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 ) hypo2d.SetQuadAllowed( 0 )
putName(algo2d, "{}_2d_zoneFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "zoneFiss", i_pref=nro_cas)
putName(hypo2d, "hypo1d_zoneFiss", i_pref=nro_cas)
is_done = meshFissure.Compute() is_done = meshFissure.Compute()
text = "meshFissure.Compute" text = "meshFissure.Compute"

View File

@ -30,13 +30,15 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
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('Nombre de sommets : len(verticesPipePeau) = %d', len(verticesPipePeau))
facesPipePeau = [None for _ in range(len(edgesFissExtPipe))] facesPipePeau = [None for _ in range(len(edgesFissExtPipe))]
endsEdgeFond = [None for _ in range(len(edgesFissExtPipe))] endsEdgeFond = [None for _ in range(len(edgesFissExtPipe))]
edgeRadFacePipePeau = [None for _ in range(len(edgesFissExtPipe))] edgeRadFacePipePeau = [None for _ in range(len(edgesFissExtPipe))]
edgesListees = list() edgesListees = list()
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau # --- au moins une extrémité du pipe sur cette face de peau
if verticesPipePeau:
edgesCircPeau, verticesCircPeau = identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \ edgesCircPeau, verticesCircPeau = identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \
endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \ endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \
@ -53,7 +55,6 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
nro_cas) nro_cas)
# --- 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,

View File

@ -44,9 +44,9 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
j_aux_0 = j_aux j_aux_0 = j_aux
break break
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) 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)
@ -58,23 +58,26 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
geomPublish(initLog.debug, edge, nameEdge, nro_cas) geomPublish(initLog.debug, edge, nameEdge, nro_cas)
break break
# --- edges circulaires 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.debug("facesPipePeau: %s", facesPipePeau) logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
edgesCircPeau = [None for _ in range(len(facesPipePeau))] edgesCircPeau = [None for _ in range(len(facesPipePeau))]
verticesCircPeau = [None for _ in range(len(facesPipePeau))] verticesCircPeau = [None for _ in range(len(facesPipePeau))]
for i_aux,fcirc in enumerate(facesPipePeau): for i_aux,fcirc in enumerate(facesPipePeau):
logging.info(". Partage avec la face '%s'", fcirc.GetName())
edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"]) edges = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["EDGE"])
grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"]) grpEdgesCirc = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(grpEdgesCirc, edges) geompy.UnionList(grpEdgesCirc, edges)
edgesCircPeau[i_aux] = grpEdgesCirc edgesCircPeau[i_aux] = grpEdgesCirc
name = "edgeCirc{}".format(i_aux) name = "edgeCirc_{}".format(i_aux)
geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name) geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name)
edgesListees = edgesListees + edges edgesListees = edgesListees + edges
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"]) vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"]) grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
geompy.UnionList(grpVertCircPeau, vertices) geompy.UnionList(grpVertCircPeau, vertices)
verticesCircPeau[i_aux] = grpVertCircPeau verticesCircPeau[i_aux] = grpVertCircPeau
name = "pointEdgeCirc{}".format(i_aux) name = "pointEdgeCirc_{}".format(i_aux)
geomPublishInFather(initLog.debug, facePeau, grpVertCircPeau, name) geomPublishInFather(initLog.info, facePeau, grpVertCircPeau, name)
logging.info('==> Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
return edgesCircPeau, verticesCircPeau return edgesCircPeau, verticesCircPeau

View File

@ -36,7 +36,7 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
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)
name = "edgepeau{}".format(i_aux) name = "edgepeau_{}".format(i_aux)
geomPublishInFather(initLog.debug, facePeau,edgepeau, name) geomPublishInFather(initLog.debug, facePeau,edgepeau, name)
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau)) logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1: if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:

View File

@ -31,21 +31,34 @@ from .substractSubShapes import substractSubShapes
def identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau): def identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircPeau):
"""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"""
logging.info('start') logging.info('start')
logging.info("Traitement des arêtes de '%s'", facePeau.GetName())
logging.info('Nombre de sommets : len(verticesPipePeau) = %d', len(verticesPipePeau))
#logging.info('verticesPipePeau = %s', verticesPipePeau)
logging.info('Nombre de sommets : len(verticesCircPeau) = %d', len(verticesCircPeau))
#logging.info('verticesCircPeau = %s', verticesCircPeau)
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False) edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
edges = substractSubShapes(facePeau, edgesPeau, edgesListees) logging.info('Nombre total d arêtes de la peau : len(edgesPeau) = %d', len(edgesPeau))
edgesFissurePeau = list()
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
edgesFissurePeau = [None for _ in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier
edgesFissurePeau = list()
# --- au moins une extrémité du pipe sur cette face de peau
if verticesPipePeau:
# En premier, les edges associés aux extrémités du pipe
edgesFissurePeau = [None for _ in range(len(verticesCircPeau))]
for edge in edges: for edge in edges:
for i_aux, grpVert in enumerate(verticesCircPeau): for i_aux, vertex in enumerate(verticesCircPeau):
if (geompy.MinDistance(grpVert, edge) < 1.e-3) and (edge not in edgesFissurePeau): logging.info(".. distance %s", geompy.MinDistance(vertex, edge))
if ( ( geompy.MinDistance(vertex, edge) < 1.e-3 ) and ( edge not in edgesFissurePeau ) ):
edgesFissurePeau[i_aux] = edge edgesFissurePeau[i_aux] = edge
name = "edgeFissurePeau{}".format(i_aux) name = "edgeFissurePeau_{}".format(i_aux)
logging.info("... entrée de %s à la place %d", edge, i_aux)
geomPublishInFather(initLog.debug, facePeau, edge, name) geomPublishInFather(initLog.debug, facePeau, edge, name)
for edge in edges: # on ajoute après les edges manquantes # Ensuite, on ajoute les edges manquantes
for edge in edges:
if edge not in edgesFissurePeau: if edge not in edgesFissurePeau:
logging.info("... ajout")
edgesFissurePeau.append(edge) edgesFissurePeau.append(edge)
else: else:
@ -54,4 +67,6 @@ def identifieEdgesPeau_c(verticesPipePeau, facePeau, edgesListees, verticesCircP
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))
return edgesFissurePeau return edgesFissurePeau

View File

@ -30,13 +30,13 @@ error = 40
critical = 50 critical = 50
always = 100 always = 100
filelog = os.path.join(tempfile.gettempdir(),"blocFissure.log") LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
loglevel = warning LOG_LEVEL = warning
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', \ logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', \
level=logging.WARNING, \ level=logging.WARNING, \
filename=filelog, filemode='w') filename=LOGFILE, filemode='w')
ch = None ch = None
fh = None fh = None
@ -64,49 +64,58 @@ def setLogger(logfile, level, formatter):
def setDebug(logfile=None): def setDebug(logfile=None):
"""setDebug""" """setDebug"""
global loglevel global LOG_LEVEL
loglevel = debug LOG_LEVEL = debug
level = logging.DEBUG level = logging.DEBUG
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s') formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter) setLogger(logfile, level, formatter)
logging.info('start Debug %s', loglevel) logging.info('start Debug %s', LOG_LEVEL)
def setVerbose(logfile=None): def setVerbose(logfile=None):
"""setVerbose""" """setVerbose"""
global loglevel global LOG_LEVEL
loglevel = info LOG_LEVEL = info
level = logging.INFO level = logging.INFO
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s') formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter) setLogger(logfile, level, formatter)
logging.info('start Verbose %s', loglevel) logging.info('start Verbose %s', LOG_LEVEL)
def setRelease(logfile=None): def setRelease(logfile=None):
"""setRelease""" """setRelease"""
global loglevel global LOG_LEVEL
loglevel = warning LOG_LEVEL = warning
level = logging.WARNING level = logging.WARNING
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s') formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter) setLogger(logfile, level, formatter)
logging.warning('start Release %s', loglevel) logging.warning('start Release %s', LOG_LEVEL)
def setUnitTests(logfile=None): def setUnitTests(logfile=None):
"""setUnitTests""" """setUnitTests"""
global loglevel global LOG_LEVEL
loglevel = critical LOG_LEVEL = critical
level = logging.CRITICAL level = logging.CRITICAL
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s') formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter) setLogger(logfile, level, formatter)
logging.critical('start UnitTests %s', loglevel) logging.critical('start UnitTests %s', LOG_LEVEL)
def setPerfTests(logfile=None): def setPerfTests(logfile=None):
"""setPerfTests""" """setPerfTests"""
global loglevel global LOG_LEVEL
loglevel = critical LOG_LEVEL = critical
level = logging.CRITICAL level = logging.CRITICAL
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s') formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter) setLogger(logfile, level, formatter)
logging.info('start PerfTests %s', loglevel) logging.info('start PerfTests %s', LOG_LEVEL)
def setAlways(logfile=None):
"""setAlways"""
global LOG_LEVEL
LOG_LEVEL = always
level = logging.CRITICAL
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
setLogger(logfile, level, formatter)
logging.info('start Always %s', LOG_LEVEL)
def getLogLevel(): def getLogLevel():
"""getLogLevel""" """getLogLevel"""
return loglevel return LOG_LEVEL

View File

@ -45,32 +45,26 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl
putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas) putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas)
algo3d = meshFondFiss.Prism() algo3d = meshFondFiss.Prism()
putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas)
putName(algo3d, "Prism", i_pref=nro_cas)
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE) algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
putName(algo2d, "QUADRANGLE", i_pref=nro_cas)
for i_aux, face in enumerate(disques): for i_aux, face in enumerate(disques):
#print (i_aux) #print (i_aux)
# la commande suivante entraîne addToStudy() failed # la commande suivante entraîne addToStudy() failed
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face) algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face)
putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas) putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas)
putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas)
for i_aux, edge in enumerate(rayons): for i_aux, edge in enumerate(rayons):
algo1d = meshFondFiss.Segment(geom=edge) algo1d = meshFondFiss.Segment(geom=edge)
hypo1d = algo1d.NumberOfSegments(4)
putName(algo1d.GetSubMesh(), "rayon", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "rayon", i_aux, nro_cas)
putName(algo1d, "algo1d_rayon", i_aux, nro_cas) hypo1d = algo1d.NumberOfSegments(4)
putName(hypo1d, "hypo1d_rayon", i_aux, nro_cas) putName(hypo1d, "rayon={}".format(4), i_aux, nro_cas)
for i_aux, edge in enumerate(demiCercles): for i_aux, edge in enumerate(demiCercles):
algo1d = meshFondFiss.Segment(geom=edge) algo1d = meshFondFiss.Segment(geom=edge)
hypo1d = algo1d.NumberOfSegments(6)
putName(algo1d.GetSubMesh(), "demiCercle", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "demiCercle", i_aux, nro_cas)
putName(algo1d, "algo1d_demiCercle", i_aux, nro_cas) hypo1d = algo1d.NumberOfSegments(6)
putName(hypo1d, "hypo1d_demiCercle", i_aux, nro_cas) putName(hypo1d, "demiCercle={}".format(6), i_aux, nro_cas)
generSorted, minlg, maxlg = sortEdges(generatrices) generSorted, minlg, maxlg = sortEdges(generatrices)
nbSegGenLong = int(math.sqrt(3.0)*maxlg/(profondeur - rayonPipe)) # on veut 2 triangles equilateraux dans la largeur de la face nbSegGenLong = int(math.sqrt(3.0)*maxlg/(profondeur - rayonPipe)) # on veut 2 triangles equilateraux dans la largeur de la face
@ -78,13 +72,13 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl
logging.info("min %s, max %s, nombre de segments %s, nombre de generatrices %s", minlg, maxlg, nbSegGenLong, len(generSorted)) logging.info("min %s, max %s, nombre de segments %s, nombre de generatrices %s", minlg, maxlg, nbSegGenLong, len(generSorted))
for i_aux, edge in enumerate(generSorted): for i_aux, edge in enumerate(generSorted):
algo1d = meshFondFiss.Segment(geom=edge) algo1d = meshFondFiss.Segment(geom=edge)
if i_aux < 6:
hypo1d = algo1d.NumberOfSegments(nbSegGenBout)
else:
hypo1d = algo1d.NumberOfSegments(nbSegGenLong)
putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas)
putName(algo1d, "algo1d_generatrice", i_aux, nro_cas) if i_aux < 6:
putName(hypo1d, "hypo1d_generatrice", i_aux, nro_cas) nbSeg = nbSegGenBout
else:
nbSeg = nbSegGenLong
hypo1d = algo1d.NumberOfSegments(nbSeg)
putName(hypo1d, "generatrice={}".format(nbSeg), i_aux, nro_cas)
disks = list() disks = list()
for i_aux, face in enumerate(disques[:4]): for i_aux, face in enumerate(disques[:4]):

View File

@ -55,10 +55,12 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr
hypo2d.SetOptimize( 1 ) hypo2d.SetOptimize( 1 )
hypo2d.SetFineness( 2 ) hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( 2 ) hypo2d.SetMinSize( 2 )
hypo2d.SetChordalErrorEnabled (True)
hypo2d.SetChordalError( 250. )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 ) hypo2d.SetQuadAllowed( 0 )
putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas) putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas)
putName(algo2d, "{}_2d_facePeau".format(mailleur), i_pref=nro_cas) putName(hypo2d, "facePeau", i_pref=nro_cas)
putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas)
# #
lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0] lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0]
frac = profondeur/lenEdgePeauFiss frac = profondeur/lenEdgePeauFiss
@ -72,21 +74,18 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr
hypo1d.SetConversionMode( 1 ) hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] ) hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] )
putName(algo1d.GetSubMesh(), "edgePeauFiss", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "edgePeauFiss", i_pref=nro_cas)
putName(algo1d, "algo1d_edgePeauFiss", i_pref=nro_cas) putName(hypo1d, "edgePeauFiss", i_pref=nro_cas)
putName(hypo1d, "hypo1d_edgePeauFiss", i_pref=nro_cas)
# #
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas) putName(hypo1d, "bordsLibres", i_pref=nro_cas)
putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas)
# #
for i_aux in range(2): for i_aux in range(2):
algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i_aux]) algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i_aux])
hypo1d = algo1d.SourceEdges([ groups_demiCercles[i_aux] ],0,0) hypo1d = algo1d.SourceEdges([ groups_demiCercles[i_aux] ],0,0)
putName(algo1d.GetSubMesh(), "DemiCercles", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "DemiCercles", i_aux, nro_cas)
putName(algo1d, "algo1d_groupDemiCercles", i_aux, nro_cas) putName(hypo1d, "groupDemiCercles", i_aux, nro_cas)
putName(hypo1d, "hypo1d_groupDemiCercles", i_aux, nro_cas)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE) _ = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE) _ = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)

View File

@ -55,22 +55,22 @@ def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_gen
hypo2d.SetOptimize( 1 ) hypo2d.SetOptimize( 1 )
hypo2d.SetFineness( 2 ) hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( 2 ) hypo2d.SetMinSize( 2 )
hypo2d.SetChordalErrorEnabled (True)
hypo2d.SetChordalError( mesh_size*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 ) hypo2d.SetQuadAllowed( 0 )
putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas) putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas)
putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) putName(hypo2d, "faceFiss", i_pref=nro_cas)
putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
# #
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss) algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss)
hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0) hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) putName(hypo1d, "edgeFissPeau", i_pref=nro_cas)
putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
# #
algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe) algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe)
hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0) hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) putName(hypo1d, "edgeFissPeau", i_pref=nro_cas)
putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
_ = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE) _ = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)

View File

@ -65,7 +65,6 @@ def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFac
hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetStandardOutputLog( 0 )
hypo3d.SetRemoveLogOnSuccess( 1 ) hypo3d.SetRemoveLogOnSuccess( 1 )
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas) putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas) putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute() is_done = meshBoiteDefaut.Compute()

View File

@ -17,16 +17,19 @@
# #
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""Cette fonction permet de scanner la liste de noeuds qui composent le maillage passé en paramètre """Fonctions générrales sur les maillages
Created on Mon Jun 23 14:49:36 2014 Created on Mon Jun 23 14:49:36 2014
@author: I48174 (Olivier HOAREAU) @author: I48174 (Olivier HOAREAU)
""" """
import logging import logging
import SMESH import SMESH
from .geomsmesh import smesh from .geomsmesh import smesh
from .putName import putName
def lookForCorner(maillageAScanner): def lookForCorner(maillageAScanner):
""" Cette fonction permet de scanner la liste de noeuds qui composent le """ Cette fonction permet de scanner la liste de noeuds qui composent le
@ -188,7 +191,8 @@ def createLinesFromMesh(maillageSupport):
return nodelines return nodelines
def createNewMeshesFromCorner(maillageSupport, listOfCorners): def createNewMeshesFromCorner(maillageSupport, listOfCorners, \
nro_cas=None):
""" Cette fonction permet de générer un nouveau maillage plus facile à """ Cette fonction permet de générer un nouveau maillage plus facile à
utiliser. On démarre d'un coin et on récupère les trois éléments utiliser. On démarre d'un coin et on récupère les trois éléments
@ -200,21 +204,26 @@ def createNewMeshesFromCorner(maillageSupport, listOfCorners):
tmp = list() tmp = list()
listOfNewMeshes = list() listOfNewMeshes = list()
n_msh = -1
for corner in listOfCorners: for corner in listOfCorners:
elems = maillageSupport.GetNodeInverseElements(corner) elems = maillageSupport.GetNodeInverseElements(corner)
for i_aux, elem in enumerate(elems): for elem in elems:
# --- Filtre selon le critère 'coplanar' --- # # --- Filtre selon le critère 'coplanar' --- #
critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \
SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30)
filtre = smesh.GetFilterFromCriteria([critere]) filtre = smesh.GetFilterFromCriteria([critere])
grp = maillageSupport.GroupOnFilter(SMESH.FACE, 'grp', filtre) n_msh += 1
nom = "coin_{}".format(n_msh)
grp = maillageSupport.GroupOnFilter(SMESH.FACE, nom, filtre)
# On copie le maillage en fonction du filtre # On copie le maillage en fonction du filtre
msh = smesh.CopyMesh(grp, 'new_{0}'.format(i_aux+1), False, True) msh = smesh.CopyMesh(grp, nom, False, True)
putName(msh, nom, i_pref=nro_cas)
# On stocke l'ensemble des noeuds du maillage dans tmp # On stocke l'ensemble des noeuds du maillage dans tmp
# On ajoute le maillage à la liste des nouveaux maillages # On ajoute le maillage à la liste des nouveaux maillages
# seulement s'il n'y est pas déjà # seulement s'il n'y est pas déjà
tmp.append(msh.GetNodesId()) tmp.append(msh.GetNodesId())
if ( tmp.count(msh.GetNodesId()) <= 1 ): if ( tmp.count(msh.GetNodesId()) <= 1 ):
putName(msh, "Face", len(listOfNewMeshes), nro_cas)
listOfNewMeshes.append(msh) listOfNewMeshes.append(msh)
return listOfNewMeshes return listOfNewMeshes

View File

@ -60,10 +60,9 @@ def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives,
geomPublish(initLog.always, aretesVivesC, "aretesVives", nro_cas) geomPublish(initLog.always, aretesVivesC, "aretesVives", nro_cas)
meshAretesVives = smesh.Mesh(aretesVivesC) meshAretesVives = smesh.Mesh(aretesVivesC)
algo1d = meshAretesVives.Segment() algo1d = meshAretesVives.Segment()
hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)
putName(algo1d.GetSubMesh(), "aretesVives", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "aretesVives", i_pref=nro_cas)
putName(algo1d, "algo1d_aretesVives", i_pref=nro_cas) hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)
putName(hypo1d, "hypo1d_aretesVives", i_pref=nro_cas) putName(hypo1d, "aretesVives={}".format(lgAretesVives), i_pref=nro_cas)
is_done = meshAretesVives.Compute() is_done = meshAretesVives.Compute()
text = "meshAretesVives.Compute" text = "meshAretesVives.Compute"

View File

@ -37,7 +37,7 @@ def mailleFacesFissure(faceFissureExterne, \
logging.info("Maillage avec %s pour le cas n°%s", mailleur, nro_cas) logging.info("Maillage avec %s pour le cas n°%s", mailleur, nro_cas)
meshFaceFiss = smesh.Mesh(faceFissureExterne) meshFaceFiss = smesh.Mesh(faceFissureExterne)
logging.info("Maillage avec %s", mailleur) putName(meshFaceFiss.GetMesh(), "faceFiss", i_pref=nro_cas)
if ( mailleur == "MeshGems"): if ( mailleur == "MeshGems"):
algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.MG_CADSurf) algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.MG_CADSurf)
hypo2d = algo2d.Parameters() hypo2d = algo2d.Parameters()
@ -54,22 +54,21 @@ def mailleFacesFissure(faceFissureExterne, \
hypo2d.SetOptimize( 1 ) hypo2d.SetOptimize( 1 )
hypo2d.SetFineness( 2 ) hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
hypo2d.SetChordalErrorEnabled (True)
hypo2d.SetChordalError( areteFaceFissure*0.25 ) hypo2d.SetChordalError( areteFaceFissure*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 ) hypo2d.SetQuadAllowed( 0 )
putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas) putName(hypo2d, "faceFiss", i_pref=nro_cas)
putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas)
putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName()) logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName())
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas) putName(hypo1d, "SourceEdges_edgeFissPeau", i_pref=nro_cas)
grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
is_done = meshFaceFiss.Compute() is_done = meshFaceFiss.Compute()
text = "meshFaceFiss.Compute" text = "meshFaceFiss.Compute"

View File

@ -79,10 +79,11 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
hypo2d.SetOptimize( 1 ) hypo2d.SetOptimize( 1 )
hypo2d.SetFineness( 2 ) hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
hypo2d.SetChordalErrorEnabled (True)
hypo2d.SetChordalError( dmoyen*0.25 ) hypo2d.SetChordalError( dmoyen*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 ) hypo2d.SetQuadAllowed( 0 )
putName(algo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas) putName(hypo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas)
putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas)
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
@ -94,12 +95,12 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
geompy.UnionList(groupEdgesBordPeau, edgesFilling) geompy.UnionList(groupEdgesBordPeau, edgesFilling)
geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas) geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas)
logging.info("UseExisting1DElements depuis '%s'", groupEdgesBordPeau.GetName()) logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
groupEdgesBordPeau.GetName(), bordsLibres.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
else: else:
@ -110,44 +111,44 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
bordsVifs = 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
edgesFissurePeau = 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 depuis groupEdgesBordPeau = '%s'", groupEdgesBordPeau.GetName()) logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
groupEdgesBordPeau.GetName(), bordsLibres.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), i_pref=nro_cas)
objet = geompy.MakeCompound(edgesFissurePeau) objet = geompy.MakeCompound(edgesFissurePeau)
geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau") geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
logging.info("UseExisting1DElements depuis objet = '%s'", objet.GetName()) logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
objet.GetName(), grpEdgesPeauFissureExterne.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=objet) algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
putName(algo1d.GetSubMesh(), objet.GetName(), i_pref=nro_cas)
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas) putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), i_pref=nro_cas)
putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas)
putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas)
if bordsVifs is not None: if bordsVifs is not None:
logging.info("UseExisting1DElements depuis bordsVifs = '%s'", bordsVifs.GetName()) logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
bordsVifs.GetName(), grpAretesVives.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas) putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas) hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
putName(hypo1d, "hypo1d_bordsVifs", ifil, 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(edgesCircPeau):
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:
logging.info("UseExisting1DElements depuis edgeCirc = '%s'", edgeCirc.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ?
if boutFromIfil[ifil] is None: if boutFromIfil[ifil] is None:
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0) groupe = edgesCircPipeGroup[i_aux]
else: else:
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) groupe = edgesCircPipeGroup[boutFromIfil[ifil]]
name = "cercle{}".format(i_aux) logging.info("UseExisting1DElements sur la géométrie '%s' avec les mailles de '%s'", \
putName(algo1d.GetSubMesh(), name, ifil, nro_cas) edgeCirc.GetName(), groupe.GetName())
putName(algo1d, "algo1d_" + name, ifil, nro_cas) algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ?
putName(hypo1d, "hypo1d_" + name, ifil, nro_cas) putName(algo1d.GetSubMesh(), groupe.GetName(), i_pref=nro_cas)
hypo1d = algo1d.SourceEdges([ groupe ],0,0)
putName(hypo1d, "SourceEdges_{}".format(groupe.GetName()), i_pref=nro_cas)
is_done = meshFacePeau.Compute() is_done = meshFacePeau.Compute()
text = "meshFacePeau {} .Compute".format(ifil) text = "meshFacePeau {} .Compute".format(ifil)

View File

@ -58,76 +58,66 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
for i_aux, sharedFaces_i in enumerate(sharedFaces): for i_aux, sharedFaces_i in enumerate(sharedFaces):
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN, geom=sharedFaces_i) algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN, geom=sharedFaces_i)
putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas)
hypo2d = algo2d.Parameters(which=smesh.SIMPLE) hypo2d = algo2d.Parameters(which=smesh.SIMPLE)
hypo2d.SetLocalLength(lensegEllipsoide) hypo2d.SetLocalLength(lensegEllipsoide)
hypo2d.LengthFromEdges() hypo2d.LengthFromEdges()
hypo2d.SetAllowQuadrangles(0) hypo2d.SetAllowQuadrangles(0)
putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas) putName(hypo2d, "sharedFaces", i_aux, nro_cas)
putName(algo2d, "{}_2d_sharedFaces".format(mailleur), i_aux, nro_cas)
putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas)
for i_aux, sharedEdges_i in enumerate(sharedEdges): for i_aux, sharedEdges_i in enumerate(sharedEdges):
algo1d = bloc1.Segment(geom=sharedEdges_i) algo1d = bloc1.Segment(geom=sharedEdges_i)
hypo1d = algo1d.LocalLength(lensegEllipsoide)
putName(algo1d.GetSubMesh(), "sharedEdges", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "sharedEdges", i_aux, nro_cas)
putName(algo1d, "algo1d_sharedEdges", i_aux, nro_cas) hypo1d = algo1d.LocalLength(lensegEllipsoide)
putName(hypo1d, "hypo1d_sharedEdges", i_aux, nro_cas) putName(hypo1d, "sharedEdges={}".format(lensegEllipsoide), i_aux, nro_cas)
declareAlgoEllipsoideFirst = False declareAlgoEllipsoideFirst = False
if declareAlgoEllipsoideFirst: if declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) hypo3d = algo3d.MaxElementVolume(1000.0)
putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) putName(hypo3d, "ellipsoide", i_pref=nro_cas)
algo3d = bloc1.Prism(geom=tore) algo3d = bloc1.Prism(geom=tore)
putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas)
algo2d = bloc1.Quadrangle(geom=tore) algo2d = bloc1.Quadrangle(geom=tore)
algo1d = bloc1.Segment(geom=tore) algo1d = bloc1.Segment(geom=tore)
hypo1d = algo1d.NumberOfSegments(nbsegGen) hypo1d = algo1d.NumberOfSegments(nbsegGen)
putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas) putName(hypo1d, "tore={}".format(nbsegGen), i_pref=nro_cas)
putName(algo3d, "{}_3d_tore".format(mailleur), i_pref=nro_cas)
putName(algo2d, "{}_2d_tore".format(mailleur), i_pref=nro_cas)
putName(algo1d, "algo1d_tore", i_pref=nro_cas)
putName(hypo1d, "hypo1d_tore", i_pref=nro_cas)
for i_aux, faces_i in enumerate(faces): for i_aux, faces_i in enumerate(faces):
algo2d = bloc1.Quadrangle(geom=faces_i) algo2d = bloc1.Quadrangle(geom=faces_i)
putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas)
hypo2d = smesh.CreateHypothesis('QuadrangleParams') hypo2d = smesh.CreateHypothesis('QuadrangleParams')
hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i_aux]) ) hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i_aux]) )
hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD ) hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD )
_ = bloc1.AddHypothesis(hypo2d,faces_i) _ = bloc1.AddHypothesis(hypo2d,faces_i)
putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas) putName(hypo2d, "faces", i_aux, nro_cas)
putName(algo2d, "{}_2d_faces".format(mailleur), i_aux, nro_cas)
putName(hypo2d, "hypo2d_faces", i_aux, nro_cas)
for i_aux, edges_i in enumerate(edges): for i_aux, edges_i in enumerate(edges):
algo1d = bloc1.Segment(geom=edges_i) algo1d = bloc1.Segment(geom=edges_i)
putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas)
if reverses[i_aux] > 0: if reverses[i_aux] > 0:
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges_i) ]) hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges_i) ])
else: else:
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ]) hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ])
putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas) putName(hypo1d, "edges", i_aux, nro_cas)
putName(algo1d, "algo1d_edges", i_aux, nro_cas)
putName(hypo1d, "hypo1d_edges", i_aux, nro_cas)
for i_aux, circles_i in enumerate(circles): for i_aux, circles_i in enumerate(circles):
algo1d = bloc1.Segment(geom=circles_i) algo1d = bloc1.Segment(geom=circles_i)
hypo1d = algo1d.NumberOfSegments(nbsegCercle)
putName(algo1d.GetSubMesh(), "circles", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "circles", i_aux, nro_cas)
putName(algo1d, "algo1d_circles", i_aux, nro_cas) hypo1d = algo1d.NumberOfSegments(nbsegCercle)
putName(hypo1d, "hypo1d_circles", i_aux, nro_cas) putName(hypo1d, "circles={}".format(nbsegCercle), i_aux, nro_cas)
if len(edgeext) == 1: if len(edgeext) == 1:
densite = int(round(nbsegFis/2)) densite = int(round(nbsegFis/2))
algo1d = bloc1.Segment(geom=edgeext[0]) algo1d = bloc1.Segment(geom=edgeext[0])
putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas)
hypo1d = algo1d.NumberOfSegments(nbsegFis) hypo1d = algo1d.NumberOfSegments(nbsegFis)
hypo1d.SetDistrType( 2 ) hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 ) hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] ) hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] )
putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas) putName(hypo1d, "edgeext", i_pref=nro_cas)
putName(algo1d, "algo1d_edgeext", i_pref=nro_cas)
putName(hypo1d, "hypo1d_edgeext", i_pref=nro_cas)
else: else:
longTotal = 0 longTotal = 0
longEdgeExts = list() longEdgeExts = list()
@ -139,21 +129,19 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
nbLocal = int(round(nbsegFis*longEdgeExts[i_aux]/longTotal)) nbLocal = int(round(nbsegFis*longEdgeExts[i_aux]/longTotal))
densite = int(round(nbLocal/2)) densite = int(round(nbLocal/2))
algo1d = bloc1.Segment(geom=edgeext_i) algo1d = bloc1.Segment(geom=edgeext_i)
putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas)
hypo1d = algo1d.NumberOfSegments(nbLocal) hypo1d = algo1d.NumberOfSegments(nbLocal)
hypo1d.SetDistrType( 2 ) hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 ) hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] ) hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] )
if reverext[i_aux]: if reverext[i_aux]:
hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext_i) ]) hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext_i) ])
putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas) putName(hypo1d, "edgeext", i_aux, nro_cas)
putName(algo1d, "algo1d_edgeext", i_aux, nro_cas)
putName(hypo1d, "hypo1d_edgeext", i_aux, nro_cas)
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore) algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore)
hypo2d = algo2d.LengthFromEdges()
putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas) putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas)
putName(algo2d, "{}_2d_facefissoutore".format(mailleur), i_pref=nro_cas) hypo2d = algo2d.LengthFromEdges()
putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas) putName(hypo2d, "facefissoutore", i_pref=nro_cas)
maxElemArea = 0.5*dmoyen*dmoyen maxElemArea = 0.5*dmoyen*dmoyen
@ -161,37 +149,31 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
for i_aux, facesExternes_i in enumerate(facesExternes): for i_aux, facesExternes_i in enumerate(facesExternes):
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facesExternes_i) algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facesExternes_i)
putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas)
hypo2d = algo2d.MaxElementArea(maxElemArea) hypo2d = algo2d.MaxElementArea(maxElemArea)
putName(hypo2d, "facesExternes={}".format(maxElemArea), i_aux, nro_cas)
if edgesBords is None: if edgesBords is None:
algo1d = bloc1.Segment(geom=facesExternes_i) algo1d = bloc1.Segment(geom=facesExternes_i)
hypo1d = algo1d.NumberOfSegments(1) hypo1d = algo1d.NumberOfSegments(1)
putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas) putName(hypo1d, "facesExternes", i_aux, nro_cas)
putName(algo2d, "{}2d_facesExternes".format(mailleur), i_aux, nro_cas)
putName(hypo2d, "hypo2d_facesExternes", i_aux, nro_cas)
if edgesBords is None:
putName(algo1d, "algo1d_facesExternes", i_aux, nro_cas)
putName(hypo1d, "hypo1d_facesExternes", i_aux, nro_cas)
for i_aux, aretesInternes_i in enumerate(aretesInternes): for i_aux, aretesInternes_i in enumerate(aretesInternes):
algo1d = bloc1.Segment(geom=aretesInternes_i) algo1d = bloc1.Segment(geom=aretesInternes_i)
hypo1d = algo1d.NumberOfSegments(nbsegExt)
putName(algo1d.GetSubMesh(), "aretesInternes", i_aux, nro_cas) putName(algo1d.GetSubMesh(), "aretesInternes", i_aux, nro_cas)
putName(algo1d, "algo1d_aretesInternes", i_aux, nro_cas) hypo1d = algo1d.NumberOfSegments(nbsegExt)
putName(hypo1d, "hypo1d_aretesInternes", i_aux, nro_cas) putName(hypo1d, "aretesInternes={}".format(nbsegExt), i_aux, nro_cas)
if edgesBords is not None: if edgesBords is not None:
algo1d = bloc1.UseExisting1DElements(geom=edgesBords) algo1d = bloc1.UseExisting1DElements(geom=edgesBords)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas) putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas) putName(hypo1d, "bordsLibres", i_pref=nro_cas)
if not declareAlgoEllipsoideFirst: if not declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) hypo3d = algo3d.MaxElementVolume(1000.0)
putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) putName(hypo3d, "ellipsoide", i_pref=nro_cas)
_ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE) _ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE)
_ = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE) _ = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE)
@ -230,10 +212,9 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
blocMesh = smesh.Concatenate(meshesBloc, 1, 1, 1e-05,False) blocMesh = smesh.Concatenate(meshesBloc, 1, 1, 1e-05,False)
algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN) algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN)
hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas) putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas)
putName(algo3d, "{}_3d_bloc".format(mailleur), i_pref=nro_cas) hypo3d = algo3d.MaxElementVolume(1000.0)
putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas) putName(hypo3d, "bloc", i_pref=nro_cas)
is_done = blocMesh.Compute() is_done = blocMesh.Compute()
text = "blocMesh.Compute" text = "blocMesh.Compute"

View File

@ -46,31 +46,20 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones, \
#for grp in groups: #for grp in groups:
#print ("\t{}".format(grp.GetName())) #print ("\t{}".format(grp.GetName()))
zoneDefaut = None zoneDefaut = None
for grp in groups:
logging.debug("groupe %s",grp.GetName())
if grp.GetName() == nomZones + "_vol":
zoneDefaut = grp
break
#print ("zoneDefaut = {}".format(zoneDefaut))
zoneDefaut_skin = None zoneDefaut_skin = None
for grp in groups:
if grp.GetName() == nomZones + "_skin":
zoneDefaut_skin = grp
break
#print ("zoneDefaut_skin = {}".format(zoneDefaut_skin))
zoneDefaut_internalFaces = None zoneDefaut_internalFaces = None
for grp in groups:
if grp.GetName() == nomZones + "_internalFaces":
zoneDefaut_internalFaces = grp
break
#print ("zoneDefaut_internalFaces = {}".format(zoneDefaut_internalFaces))
zoneDefaut_internalEdges = None zoneDefaut_internalEdges = None
for grp in groups: for grp in groups:
if grp.GetName() == nomZones + "_internalEdges": nom = grp.GetName()
logging.debug("groupe %s",nom)
if ( nom == nomZones + "_vol" ):
zoneDefaut = grp
elif ( nom == nomZones + "_skin" ):
zoneDefaut_skin = grp
elif ( nom == nomZones + "_internalFaces" ):
zoneDefaut_internalFaces = grp
elif ( nom == nomZones + "_internalEdges" ):
zoneDefaut_internalEdges = grp zoneDefaut_internalEdges = grp
break
#print ("zoneDefaut_internalEdges = {}".format(zoneDefaut_internalEdges))
# --- Le groupe ZoneDefaut ne doit contenir que des Hexaèdres" # --- Le groupe ZoneDefaut ne doit contenir que des Hexaèdres"
info = maillageSain.GetMeshInfo(zoneDefaut) info = maillageSain.GetMeshInfo(zoneDefaut)
@ -106,6 +95,8 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones, \
logging.debug(texte) logging.debug(texte)
if listOfCorner: if listOfCorner:
logging.info("présence de coins à la surface externe de la zone à reconstruire") logging.info("présence de coins à la surface externe de la zone à reconstruire")
zoneDefaut_skin, internalBoundary = fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner) zoneDefaut_skin, internalBoundary = \
fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner, \
nro_cas)
return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges

View File

@ -97,8 +97,8 @@ class fissureCoude_ihm(fissureCoude):
areteFaceFissure = taille cible de l'arête des triangles en face de fissure. areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
""" """
self.maillageFissureParams = dict(nomRep = os.curdir, \ self.maillageFissureParams = dict(nomRep = os.curdir, \
nomFicSain = self.nomCas, \ nomFicSain = self.nomProbleme, \
nomFicFissure = 'fissure_' + self.nomCas, \ nomFicFissure = self.nomProbleme + '_fissure', \
nbsegRad = self.dico['nbCouronnes'], \ nbsegRad = self.dico['nbCouronnes'], \
nbsegCercle = self.dico['nbSecteurs'], \ nbsegCercle = self.dico['nbSecteurs'], \
areteFaceFissure = self.dico['aretesFaceFissure']) areteFaceFissure = self.dico['aretesFaceFissure'])