From ea7070c2c8dcfc1f89298412277412fdd8632a83 Mon Sep 17 00:00:00 2001 From: GERALD NICOLAS Date: Fri, 16 Apr 2021 16:45:34 +0200 Subject: [PATCH] Unification des noms des maillages --- src/Tools/blocFissure/CasTests/cubeAngle.py | 6 +- src/Tools/blocFissure/CasTests/cubeAngle2.py | 4 +- src/Tools/blocFissure/CasTests/cubeCoin.py | 1 + src/Tools/blocFissure/CasTests/cubeMilieu.py | 1 + .../blocFissure/CasTests/cubeTransverse.py | 1 + src/Tools/blocFissure/CasTests/cylindre.py | 6 +- src/Tools/blocFissure/CasTests/disquePerce.py | 1 + src/Tools/blocFissure/CasTests/ellipse_1.py | 6 +- .../blocFissure/CasTests/eprouvetteCourbe.py | 6 +- .../blocFissure/CasTests/eprouvetteDroite.py | 6 +- .../blocFissure/CasTests/execution_Cas.py | 3 +- src/Tools/blocFissure/CasTests/faceGauche.py | 6 +- .../blocFissure/CasTests/faceGauche_2.py | 6 +- .../blocFissure/CasTests/fissureCoude_1.py | 4 +- .../blocFissure/CasTests/fissureCoude_10.py | 4 +- .../blocFissure/CasTests/fissureCoude_2.py | 4 +- .../blocFissure/CasTests/fissureCoude_3.py | 4 +- .../blocFissure/CasTests/fissureCoude_4.py | 4 +- .../blocFissure/CasTests/fissureCoude_5.py | 4 +- .../blocFissure/CasTests/fissureCoude_6.py | 4 +- .../blocFissure/CasTests/fissureCoude_7.py | 4 +- .../blocFissure/CasTests/fissureCoude_8.py | 4 +- .../blocFissure/CasTests/fissureCoude_9.py | 4 +- .../blocFissure/CasTests/fissure_Coude.py | 44 +++++----- .../blocFissure/CasTests/fissure_Coude_4.py | 2 +- src/Tools/blocFissure/CasTests/tube.py | 6 +- src/Tools/blocFissure/CasTests/vis_1.py | 6 +- .../gmu/calculePointsAxiauxPipe_a.py | 5 +- src/Tools/blocFissure/gmu/casStandard.py | 30 ++++--- .../gmu/construitFissureGenerale_c.py | 4 +- src/Tools/blocFissure/gmu/fissureCoude.py | 49 +++++------ .../gmu/fusionMaillageAttributionDefaut.py | 5 +- .../gmu/genereMeshCalculZoneDefaut.py | 3 +- .../blocFissure/gmu/insereFissureLongue_c.py | 24 +++--- .../blocFissure/gmu/insereFissureLongue_d.py | 12 +-- .../blocFissure/gmu/insereFissureLongue_e.py | 9 +-- .../blocFissure/gmu/insereFissureLongue_f.py | 1 - .../blocFissure/gmu/listOfExtraFunctions.py | 19 +++-- .../blocFissure/gmu/mailleAretesEtJonction.py | 5 +- .../blocFissure/gmu/mailleFacesFissure.py | 6 +- src/Tools/blocFissure/gmu/mailleFacesPeau.py | 30 +++---- src/Tools/blocFissure/gmu/meshBlocPart.py | 81 +++++++------------ src/Tools/blocFissure/gmu/peauInterne.py | 33 +++----- src/Tools/blocFissure/ihm/fissureCoude_ihm.py | 4 +- 44 files changed, 216 insertions(+), 255 deletions(-) diff --git a/src/Tools/blocFissure/CasTests/cubeAngle.py b/src/Tools/blocFissure/CasTests/cubeAngle.py index ef04109da..1a34beb3d 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle.py @@ -45,7 +45,7 @@ class cubeAngle(fissureGenerique): logging.info(texte) ([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 @@ -88,8 +88,8 @@ class cubeAngle(fissureGenerique): texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 10) diff --git a/src/Tools/blocFissure/CasTests/cubeAngle2.py b/src/Tools/blocFissure/CasTests/cubeAngle2.py index aa35b6225..f2ede5d65 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle2.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle2.py @@ -44,8 +44,8 @@ class cubeAngle2(cubeAngle): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 32, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/cubeCoin.py b/src/Tools/blocFissure/CasTests/cubeCoin.py index e6221be87..f068a96ef 100644 --- a/src/Tools/blocFissure/CasTests/cubeCoin.py +++ b/src/Tools/blocFissure/CasTests/cubeCoin.py @@ -24,6 +24,7 @@ import os from blocFissure import gmu dicoParams = dict(nomCas = "cubeCoin", + nomProbleme = "cubeCoin", maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Coin.brep"), edgeFiss = [3], diff --git a/src/Tools/blocFissure/CasTests/cubeMilieu.py b/src/Tools/blocFissure/CasTests/cubeMilieu.py index 96d069e35..3366b210f 100644 --- a/src/Tools/blocFissure/CasTests/cubeMilieu.py +++ b/src/Tools/blocFissure/CasTests/cubeMilieu.py @@ -24,6 +24,7 @@ import os from blocFissure import gmu dicoParams = dict(nomCas = "cubeMilieu", + nomProbleme = "cubeMilieu", maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Milieu.brep"), edgeFiss = [3], diff --git a/src/Tools/blocFissure/CasTests/cubeTransverse.py b/src/Tools/blocFissure/CasTests/cubeTransverse.py index bc05c37a4..161805e81 100644 --- a/src/Tools/blocFissure/CasTests/cubeTransverse.py +++ b/src/Tools/blocFissure/CasTests/cubeTransverse.py @@ -24,6 +24,7 @@ import os from blocFissure import gmu dicoParams = dict(nomCas = "cubeTransverse", + nomProbleme = "cubeTransverse", maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Transverse.brep"), edgeFiss = [6], diff --git a/src/Tools/blocFissure/CasTests/cylindre.py b/src/Tools/blocFissure/CasTests/cylindre.py index 6aacd332f..8960188d7 100644 --- a/src/Tools/blocFissure/CasTests/cylindre.py +++ b/src/Tools/blocFissure/CasTests/cylindre.py @@ -48,7 +48,7 @@ class cylindre(fissureGenerique): logging.info("genereMaillageSain %s", self.nomCas) ([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 @@ -85,8 +85,8 @@ class cylindre(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 20) diff --git a/src/Tools/blocFissure/CasTests/disquePerce.py b/src/Tools/blocFissure/CasTests/disquePerce.py index 368cdc555..558afb038 100644 --- a/src/Tools/blocFissure/CasTests/disquePerce.py +++ b/src/Tools/blocFissure/CasTests/disquePerce.py @@ -24,6 +24,7 @@ import os from blocFissure import gmu dicoParams = dict(nomCas = 'disque', + nomProbleme = "disque", maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"), CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"), edgeFiss = [3], diff --git a/src/Tools/blocFissure/CasTests/ellipse_1.py b/src/Tools/blocFissure/CasTests/ellipse_1.py index fce709094..764e75c48 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_1.py +++ b/src/Tools/blocFissure/CasTests/ellipse_1.py @@ -51,7 +51,7 @@ class ellipse_1(fissureGenerique): logging.info(texte) ([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 @@ -96,8 +96,8 @@ class ellipse_1(fissureGenerique): texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 1000) diff --git a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py index f587b8cb3..d214d6c0e 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py @@ -45,7 +45,7 @@ class eprouvetteCourbe(fissureGenerique): logging.info(texte) ([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 @@ -90,8 +90,8 @@ class eprouvetteCourbe(fissureGenerique): texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 15) diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py index 7484c1da1..b990ba7f0 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py @@ -49,7 +49,7 @@ class eprouvetteDroite(fissureGenerique): logging.info("genereMaillageSain %s", self.nomCas) ([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 @@ -89,8 +89,8 @@ class eprouvetteDroite(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 15) diff --git a/src/Tools/blocFissure/CasTests/execution_Cas.py b/src/Tools/blocFissure/CasTests/execution_Cas.py index 983899999..d5a5d41ce 100644 --- a/src/Tools/blocFissure/CasTests/execution_Cas.py +++ b/src/Tools/blocFissure/CasTests/execution_Cas.py @@ -257,7 +257,7 @@ def calcul_tout (l_problemes, d_aux): """Calcul de tous les cas""" ligne = "---------------------------------------------------------------------" - texte = "" + texte = "\n" nb_cas_ok = 0 nb_cas_nook = 0 for n_cas, cas in enumerate(l_problemes): @@ -279,6 +279,7 @@ def calcul_tout (l_problemes, d_aux): else: texte += "Les {} tests se sont bien passés.\n".format(nb_cas) print (texte+ligne) + logging.critical(ligne+texte) return #============================================================= diff --git a/src/Tools/blocFissure/CasTests/faceGauche.py b/src/Tools/blocFissure/CasTests/faceGauche.py index a63053ae7..b04c9a551 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche.py +++ b/src/Tools/blocFissure/CasTests/faceGauche.py @@ -48,7 +48,7 @@ class faceGauche(fissureGenerique): logging.info("genereMaillageSain %s", self.nomCas) ([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 @@ -87,8 +87,8 @@ class faceGauche(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 1000) diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index abe51ca03..9c0f33d03 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -46,7 +46,7 @@ class faceGauche_2(fissureGenerique): logging.info("genereMaillageSain %s", self.nomCas) ([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 @@ -85,8 +85,8 @@ class faceGauche_2(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 1000) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_1.py b/src/Tools/blocFissure/CasTests/fissureCoude_1.py index f26031baf..225f7a88b 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_1.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_1.py @@ -97,8 +97,8 @@ class fissureCoude_1(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 6, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_10.py b/src/Tools/blocFissure/CasTests/fissureCoude_10.py index b135dfcb7..e9a83799d 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_10.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_10.py @@ -99,8 +99,8 @@ class fissureCoude_10(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 3, nbsegCercle = 8, areteFaceFissure = 2.5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_2.py b/src/Tools/blocFissure/CasTests/fissureCoude_2.py index 1282b122b..8b981329b 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_2.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_2.py @@ -97,8 +97,8 @@ class fissureCoude_2(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 6, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_3.py b/src/Tools/blocFissure/CasTests/fissureCoude_3.py index 9adc4f5b4..b9f5b44b1 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_3.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_3.py @@ -97,8 +97,8 @@ class fissureCoude_3(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 6, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_4.py b/src/Tools/blocFissure/CasTests/fissureCoude_4.py index b897d5d2a..57496ebf9 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_4.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_4.py @@ -97,8 +97,8 @@ class fissureCoude_4(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 6, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_5.py b/src/Tools/blocFissure/CasTests/fissureCoude_5.py index e5865ce7e..5874a54dd 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_5.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_5.py @@ -97,8 +97,8 @@ class fissureCoude_5(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_6.py b/src/Tools/blocFissure/CasTests/fissureCoude_6.py index 4cdba6d83..394e29aee 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_6.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_6.py @@ -98,8 +98,8 @@ class fissureCoude_6(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 12, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_7.py b/src/Tools/blocFissure/CasTests/fissureCoude_7.py index 86bfbfb01..f9e261752 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_7.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_7.py @@ -99,8 +99,8 @@ class fissureCoude_7(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 12, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_8.py b/src/Tools/blocFissure/CasTests/fissureCoude_8.py index 7ca8505d8..490762022 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_8.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_8.py @@ -99,8 +99,8 @@ class fissureCoude_8(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 4, nbsegCercle = 16, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_9.py b/src/Tools/blocFissure/CasTests/fissureCoude_9.py index c20ce91ed..79485fcbf 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_9.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_9.py @@ -97,8 +97,8 @@ class fissureCoude_9(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 6, nbsegCercle = 20, areteFaceFissure = 2.5) diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index 75f584c0c..71dadf336 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -76,6 +76,7 @@ class fissure_Coude(fissureGenerique): # --------------------------------------------------------------------------- def genereGeometrieSaine(self, geomParams): + """a écrire""" logging.info("genereGeometrieSaine %s", self.nomCas) angleCoude = geomParams['angleCoude'] @@ -108,7 +109,6 @@ class fissure_Coude(fissureGenerique): P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2) geomPublish(initLog.always, P2, "P2", self.numeroCas ) - # --- tube coude sain 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) 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) CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(CLGV, facesIds) @@ -160,7 +160,7 @@ class fissure_Coude(fissureGenerique): extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) interne = geompy.MakeFuse(extru1, revol1) 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) PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(PEAUINT, facesIds) @@ -176,7 +176,7 @@ class fissure_Coude(fissureGenerique): extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2) externe = geompy.MakeFuse(extru1, revol1) 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) PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"]) geompy.UnionIDs(PEAUEXT, facesIds) @@ -230,41 +230,34 @@ class fissure_Coude(fissureGenerique): n_long_p2 = meshParams['n_long_p2'] maillageSain = smesh.Mesh(geometrieSaine) + putName(maillageSain, "maillageSain", i_pref=self.numeroCas) algo3d = maillageSain.Hexahedron() 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) 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, "hypo1d_long_p1", i_pref=self.numeroCas) + putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas) algo1d_ep = maillageSain.Segment(geom=ep) hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep) - putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas) - putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas) + putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas) algo1d_long_coude = maillageSain.Segment(geom=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, "hypo1d_long_coude", i_pref=self.numeroCas) + putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas) algo1d_circ_g = maillageSain.Segment(geom=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, "hypo1d_circ_g", i_pref=self.numeroCas) + putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas) algo1d_circ_d = maillageSain.Segment(geom=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, "hypo1d_circ_d", i_pref=self.numeroCas) + putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas) algo1d_long_p2 = maillageSain.Segment(geom=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, "hypo1d_long_p2", i_pref=self.numeroCas) + putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas) _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) @@ -275,14 +268,21 @@ class fissure_Coude(fissureGenerique): _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) _ = 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 # --------------------------------------------------------------------------- def setParamShapeFissure(self): """ - paramètres de la fissure + paramètres de la fissure pour le tuyau coude profondeur : 0 < profondeur <= épaisseur azimut : entre 0 et 360° alpha : 0 < alpha < angleCoude @@ -487,8 +487,8 @@ class fissure_Coude(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegExt = 5, nbsegGen = 25, nbsegRad = 5, diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude_4.py b/src/Tools/blocFissure/CasTests/fissure_Coude_4.py index c697198bb..89817efe3 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude_4.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude_4.py @@ -76,7 +76,7 @@ class fissure_Coude_4(fissure_Coude): """ self.shapeFissureParams = dict(nomRep = os.curdir, nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicFissure = self.nomProbleme + "_fissure", profondeur = 10, azimut = 90, alpha = 20, diff --git a/src/Tools/blocFissure/CasTests/tube.py b/src/Tools/blocFissure/CasTests/tube.py index c1b22f369..3b2e724d1 100644 --- a/src/Tools/blocFissure/CasTests/tube.py +++ b/src/Tools/blocFissure/CasTests/tube.py @@ -49,7 +49,7 @@ class tube(fissureGenerique): logging.info(texte) ([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 @@ -96,8 +96,8 @@ class tube(fissureGenerique): texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 8, areteFaceFissure = 0.5) diff --git a/src/Tools/blocFissure/CasTests/vis_1.py b/src/Tools/blocFissure/CasTests/vis_1.py index 6de374e88..58c59e2e3 100644 --- a/src/Tools/blocFissure/CasTests/vis_1.py +++ b/src/Tools/blocFissure/CasTests/vis_1.py @@ -51,7 +51,7 @@ class vis_1(fissureGenerique): logging.info(texte) ([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 @@ -96,8 +96,8 @@ class vis_1(fissureGenerique): texte = "setParamMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = self.nomCas + "_fissure", + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 32, areteFaceFissure = 0.1) diff --git a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py index a0e07a1ef..35b32a973 100644 --- a/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py +++ b/src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py @@ -56,10 +56,9 @@ def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \ meshFondFiss = smesh.Mesh(wireFondFiss) putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas) 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, "algo1d_wireFondFiss", i_pref=nro_cas) - putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas) + hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure + putName(hypo1d, "Adaptive_wireFondFiss", i_pref=nro_cas) is_done = meshFondFiss.Compute() text = "calculePointsAxiauxPipe meshFondFiss.Compute" diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index 0243a84e9..bc2ab6d71 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -50,36 +50,44 @@ class casStandard(fissureGenerique): referencesMaillageFissure = None # --------------------------------------------------------------------------- - def __init__ (self, dicoParams, references = None, numeroCas = 0): + def __init__ (self, dicoParams, references = None, numeroCas = None): initEtude() self.references = references self.dicoParams = dicoParams + self.numeroCas = numeroCas + + if 'nomProbleme' in self.dicoParams: + self.nomProbleme = self.dicoParams['nomProbleme'] + if 'nomCas' in self.dicoParams: self.nomCas = self.dicoParams['nomCas'] elif 'nomres' in self.dicoParams: 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: self.nomCas = 'casStandard' + if 'reptrav' in self.dicoParams: self.reptrav = self.dicoParams['reptrav'] else: 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: self.lenSegPipe = self.dicoParams['lenSegPipe'] else: - self.lenSegPipe =self.dicoParams['rayonPipe'] + self.lenSegPipe = self.dicoParams['rayonPipe'] + if 'step' in self.dicoParams: step = self.dicoParams['step'] else: step = -1 # exécuter toutes les étapes + if 'aretesVives' not in self.dicoParams: 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) # --------------------------------------------------------------------------- @@ -87,7 +95,7 @@ class casStandard(fissureGenerique): logging.info("genereMaillageSain %s", self.nomCas) ([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 @@ -154,8 +162,8 @@ class casStandard(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): self.maillageFissureParams = dict(nomRep = self.reptrav, - nomFicSain = self.nomCas +'_sain', - nomFicFissure = self.nomCas, + nomFicSain = self.nomCas, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = self.dicoParams['nbSegRad'], nbsegCercle = self.dicoParams['nbSegCercle'], areteFaceFissure = self.dicoParams['areteFaceFissure'], diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py index e46ddf28d..af3fa001d 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale_c.py @@ -75,7 +75,6 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \ hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas) - putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas) is_done = meshBoiteDefaut.Compute() text = "meshBoiteDefaut.Compute" @@ -94,9 +93,11 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \ _, normfiss = shapeSurFissure(facesPortFissure) maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \ None, None, 'COMPLET', normfiss) + putName(maillageComplet, nomFicFissure) logging.info("conversion quadratique") maillageComplet.ConvertToQuadratic( 1 ) + logging.info("groupes") groups = maillageComplet.GetGroups() grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS'] @@ -116,7 +117,6 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \ logging.info("export maillage fini") fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure)) maillageComplet.ExportMED(fichierMaillageFissure) - putName(maillageComplet, nomFicFissure) logging.info("fichier maillage fissure %s", fichierMaillageFissure) return maillageComplet diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index e5b22727d..929f60c7f 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -19,10 +19,10 @@ # """Fissure dans un coude""" -import os - import logging +import os import math + import GEOM import SMESH @@ -259,50 +259,34 @@ class fissureCoude(fissureGenerique): n_long_p2 = meshParams['n_long_p2'] maillageSain = smesh.Mesh(geometrieSaine) + putName(maillageSain, "maillageSain", i_pref=self.numeroCas) algo3d = maillageSain.Hexahedron() 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) 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, "hypo1d_long_p1", i_pref=self.numeroCas) + putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas) algo1d_ep = maillageSain.Segment(geom=ep) hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep) - putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas) - putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas) + putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas) algo1d_long_coude = maillageSain.Segment(geom=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, "hypo1d_long_coude", i_pref=self.numeroCas) + putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas) algo1d_circ_g = maillageSain.Segment(geom=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, "hypo1d_circ_g", i_pref=self.numeroCas) + putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas) algo1d_circ_d = maillageSain.Segment(geom=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, "hypo1d_circ_d", i_pref=self.numeroCas) + putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas) algo1d_long_p2 = maillageSain.Segment(geom=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, "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) + putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas) _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) @@ -313,6 +297,15 @@ class fissureCoude(fissureGenerique): _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) _ = 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 # --------------------------------------------------------------------------- @@ -367,7 +360,7 @@ class fissureCoude(fissureGenerique): azimut = -azimut # axe inverse / ASCOUF 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: lgInfluence = profondeur @@ -662,8 +655,8 @@ class fissureCoude(fissureGenerique): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, - nomFicSain = self.nomCas, - nomFicFissure = 'fissure_' + self.nomCas, + nomFicSain = self.nomProbleme, + nomFicFissure = self.nomProbleme + "_fissure", nbsegRad = 5, nbsegCercle = 6, areteFaceFissure = 5) diff --git a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py index 22827d280..76147ee31 100644 --- a/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py +++ b/src/Tools/blocFissure/gmu/fusionMaillageAttributionDefaut.py @@ -49,7 +49,7 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible maillagesCoupes = list() # On crée une liste contenant le maillage de chaque face. - listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners) + listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners, nro_cas) i_aux = 0 while i_aux < len(listOfNewMeshes): @@ -89,6 +89,7 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes] newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False) + putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas) facesEnTrop = list() 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') - putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas) - return newZoneDefaut_skin, newMaillageInterne diff --git a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py index 3ab7cf814..d211b38e7 100644 --- a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py +++ b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py @@ -79,8 +79,7 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \ hypo2d.SetChordalError( maxSize*0.25 ) hypo2d.SetUseSurfaceCurvature (True) hypo2d.SetQuadAllowed( 0 ) - putName(algo2d, "{}_2d_zoneFiss".format(mailleur), i_pref=nro_cas) - putName(hypo2d, "hypo1d_zoneFiss", i_pref=nro_cas) + putName(hypo2d, "zoneFiss", i_pref=nro_cas) is_done = meshFissure.Compute() text = "meshFissure.Compute" diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index c8b8578d4..49d94acf5 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -45,32 +45,26 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas) algo3d = meshFondFiss.Prism() - putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas) - putName(algo3d, "Prism", i_pref=nro_cas) algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE) - putName(algo2d, "QUADRANGLE", i_pref=nro_cas) for i_aux, face in enumerate(disques): #print (i_aux) # la commande suivante entraîne addToStudy() failed algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face) putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas) - putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas) for i_aux, edge in enumerate(rayons): algo1d = meshFondFiss.Segment(geom=edge) - hypo1d = algo1d.NumberOfSegments(4) putName(algo1d.GetSubMesh(), "rayon", i_aux, nro_cas) - putName(algo1d, "algo1d_rayon", i_aux, nro_cas) - putName(hypo1d, "hypo1d_rayon", i_aux, nro_cas) + hypo1d = algo1d.NumberOfSegments(4) + putName(hypo1d, "rayon={}".format(4), i_aux, nro_cas) for i_aux, edge in enumerate(demiCercles): algo1d = meshFondFiss.Segment(geom=edge) - hypo1d = algo1d.NumberOfSegments(6) putName(algo1d.GetSubMesh(), "demiCercle", i_aux, nro_cas) - putName(algo1d, "algo1d_demiCercle", i_aux, nro_cas) - putName(hypo1d, "hypo1d_demiCercle", i_aux, nro_cas) + hypo1d = algo1d.NumberOfSegments(6) + putName(hypo1d, "demiCercle={}".format(6), i_aux, nro_cas) 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 @@ -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)) for i_aux, edge in enumerate(generSorted): algo1d = meshFondFiss.Segment(geom=edge) + putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas) if i_aux < 6: - hypo1d = algo1d.NumberOfSegments(nbSegGenBout) + nbSeg = nbSegGenBout else: - hypo1d = algo1d.NumberOfSegments(nbSegGenLong) - putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas) - putName(algo1d, "algo1d_generatrice", i_aux, nro_cas) - putName(hypo1d, "hypo1d_generatrice", i_aux, nro_cas) + nbSeg = nbSegGenLong + hypo1d = algo1d.NumberOfSegments(nbSeg) + putName(hypo1d, "generatrice={}".format(nbSeg), i_aux, nro_cas) disks = list() for i_aux, face in enumerate(disques[:4]): diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py index cff54376a..0a68df106 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py @@ -60,8 +60,7 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr hypo2d.SetUseSurfaceCurvature (True) hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas) - putName(algo2d, "{}_2d_facePeau".format(mailleur), i_pref=nro_cas) - putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas) + putName(hypo2d, "facePeau", i_pref=nro_cas) # lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0] frac = profondeur/lenEdgePeauFiss @@ -75,21 +74,18 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr hypo1d.SetConversionMode( 1 ) hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] ) putName(algo1d.GetSubMesh(), "edgePeauFiss", i_pref=nro_cas) - putName(algo1d, "algo1d_edgePeauFiss", i_pref=nro_cas) - putName(hypo1d, "hypo1d_edgePeauFiss", i_pref=nro_cas) + putName(hypo1d, "edgePeauFiss", i_pref=nro_cas) # algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas) - putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas) + putName(hypo1d, "bordsLibres", i_pref=nro_cas) # for i_aux in range(2): algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i_aux]) hypo1d = algo1d.SourceEdges([ groups_demiCercles[i_aux] ],0,0) putName(algo1d.GetSubMesh(), "DemiCercles", i_aux, nro_cas) - putName(algo1d, "algo1d_groupDemiCercles", i_aux, nro_cas) - putName(hypo1d, "hypo1d_groupDemiCercles", i_aux, nro_cas) + putName(hypo1d, "groupDemiCercles", i_aux, nro_cas) _ = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE) _ = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py index 6cfd268ff..6fa5fe8ca 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_e.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_e.py @@ -60,20 +60,17 @@ def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_gen hypo2d.SetUseSurfaceCurvature (True) hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas) - putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) - putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas) + putName(hypo2d, "faceFiss", i_pref=nro_cas) # algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss) hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) - putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) - putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas) + putName(hypo1d, "edgeFissPeau", i_pref=nro_cas) # algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe) hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) - putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas) - putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas) + putName(hypo1d, "edgeFissPeau", i_pref=nro_cas) _ = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py index 034d5b0ec..cc57705cb 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_f.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_f.py @@ -65,7 +65,6 @@ def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFac hypo3d.SetStandardOutputLog( 0 ) hypo3d.SetRemoveLogOnSuccess( 1 ) 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) is_done = meshBoiteDefaut.Compute() diff --git a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py index 70a0fdbf1..a862f796e 100644 --- a/src/Tools/blocFissure/gmu/listOfExtraFunctions.py +++ b/src/Tools/blocFissure/gmu/listOfExtraFunctions.py @@ -17,16 +17,19 @@ # # 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 @author: I48174 (Olivier HOAREAU) """ import logging + import SMESH from .geomsmesh import smesh +from .putName import putName + def lookForCorner(maillageAScanner): """ Cette fonction permet de scanner la liste de noeuds qui composent le @@ -188,7 +191,8 @@ def createLinesFromMesh(maillageSupport): 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 à 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() listOfNewMeshes = list() + n_msh = -1 for corner in listOfCorners: elems = maillageSupport.GetNodeInverseElements(corner) - for i_aux, elem in enumerate(elems): + for elem in elems: # --- Filtre selon le critère 'coplanar' --- # critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \ SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30) 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 - 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 ajoute le maillage à la liste des nouveaux maillages # seulement s'il n'y est pas déjà tmp.append(msh.GetNodesId()) if ( tmp.count(msh.GetNodesId()) <= 1 ): + putName(msh, "Face", len(listOfNewMeshes), nro_cas) listOfNewMeshes.append(msh) return listOfNewMeshes diff --git a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py index 79bb48190..36d53fb14 100644 --- a/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py +++ b/src/Tools/blocFissure/gmu/mailleAretesEtJonction.py @@ -60,10 +60,9 @@ def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives, geomPublish(initLog.always, aretesVivesC, "aretesVives", nro_cas) meshAretesVives = smesh.Mesh(aretesVivesC) algo1d = meshAretesVives.Segment() - hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07) putName(algo1d.GetSubMesh(), "aretesVives", i_pref=nro_cas) - putName(algo1d, "algo1d_aretesVives", i_pref=nro_cas) - putName(hypo1d, "hypo1d_aretesVives", i_pref=nro_cas) + hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07) + putName(hypo1d, "aretesVives={}".format(lgAretesVives), i_pref=nro_cas) is_done = meshAretesVives.Compute() text = "meshAretesVives.Compute" diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index ac01b8cd1..546525af9 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -58,15 +58,13 @@ def mailleFacesFissure(faceFissureExterne, \ hypo2d.SetChordalError( areteFaceFissure*0.25 ) hypo2d.SetUseSurfaceCurvature (True) hypo2d.SetQuadAllowed( 0 ) - putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas) - putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas) + putName(hypo2d, "faceFiss", i_pref=nro_cas) logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName()) algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC) putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas) - putName(algo1d, "edgeFissPeau_UseExisting1DElements", i_pref=nro_cas) hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0) - putName(hypo1d, "edgeFissPeau_SourceEdges", i_pref=nro_cas) + putName(hypo1d, "SourceEdges_edgeFissPeau", i_pref=nro_cas) grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE) grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE) diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index d216abbdf..e83e79f40 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -83,8 +83,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ hypo2d.SetChordalError( dmoyen*0.25 ) hypo2d.SetUseSurfaceCurvature (True) hypo2d.SetQuadAllowed( 0 ) - putName(algo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas) - putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas) + putName(hypo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas) if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte @@ -98,10 +97,9 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ logging.info("UseExisting1DElements depuis '%s'", groupEdgesBordPeau.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) - putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas) else: @@ -114,27 +112,24 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ logging.info("UseExisting1DElements depuis groupEdgesBordPeau = '%s'", groupEdgesBordPeau.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas) - putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas) objet = geompy.MakeCompound(edgesFissurePeau) geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau") logging.info("UseExisting1DElements depuis objet = '%s'", objet.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=objet) - hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas) - putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas) - putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas) + hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) + putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), ifil, nro_cas) if bordsVifs is not None: logging.info("UseExisting1DElements depuis bordsVifs = '%s'", bordsVifs.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) - hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas) - putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas) - putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas) + hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) + putName(hypo1d, "SourceEdges_{}".format(grpAretesVives.GetName()), ifil, nro_cas) for i_aux, edgeCirc in enumerate(edgesCircPeau): texte = "i_aux = {}".format(i_aux) @@ -142,14 +137,13 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ if edgeCirc is not None: logging.info("UseExisting1DElements depuis edgeCirc = '%s'", edgeCirc.GetName()) algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ? + name = "cercle{}".format(i_aux) + putName(algo1d.GetSubMesh(), name, ifil, nro_cas) if boutFromIfil[ifil] is None: hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0) else: hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0) - name = "cercle{}".format(i_aux) - putName(algo1d.GetSubMesh(), name, ifil, nro_cas) - putName(algo1d, "algo1d_" + name, ifil, nro_cas) - putName(hypo1d, "hypo1d_" + name, ifil, nro_cas) + putName(hypo1d, "SourceEdges_" + name, ifil, nro_cas) is_done = meshFacePeau.Compute() text = "meshFacePeau {} .Compute".format(ifil) diff --git a/src/Tools/blocFissure/gmu/meshBlocPart.py b/src/Tools/blocFissure/gmu/meshBlocPart.py index 9d399c60b..a2d051ef3 100644 --- a/src/Tools/blocFissure/gmu/meshBlocPart.py +++ b/src/Tools/blocFissure/gmu/meshBlocPart.py @@ -58,76 +58,66 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle for i_aux, sharedFaces_i in enumerate(sharedFaces): algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN, geom=sharedFaces_i) + putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas) hypo2d = algo2d.Parameters(which=smesh.SIMPLE) hypo2d.SetLocalLength(lensegEllipsoide) hypo2d.LengthFromEdges() hypo2d.SetAllowQuadrangles(0) - putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas) - putName(algo2d, "{}_2d_sharedFaces".format(mailleur), i_aux, nro_cas) - putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas) + putName(hypo2d, "sharedFaces", i_aux, nro_cas) for i_aux, sharedEdges_i in enumerate(sharedEdges): algo1d = bloc1.Segment(geom=sharedEdges_i) - hypo1d = algo1d.LocalLength(lensegEllipsoide) putName(algo1d.GetSubMesh(), "sharedEdges", i_aux, nro_cas) - putName(algo1d, "algo1d_sharedEdges", i_aux, nro_cas) - putName(hypo1d, "hypo1d_sharedEdges", i_aux, nro_cas) + hypo1d = algo1d.LocalLength(lensegEllipsoide) + putName(hypo1d, "sharedEdges={}".format(lensegEllipsoide), i_aux, nro_cas) declareAlgoEllipsoideFirst = False if declareAlgoEllipsoideFirst: algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) - hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) - putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) - putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) + hypo3d = algo3d.MaxElementVolume(1000.0) + putName(hypo3d, "ellipsoide", i_pref=nro_cas) algo3d = bloc1.Prism(geom=tore) + putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas) algo2d = bloc1.Quadrangle(geom=tore) algo1d = bloc1.Segment(geom=tore) hypo1d = algo1d.NumberOfSegments(nbsegGen) - putName(algo3d.GetSubMesh(), "tore", 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) + putName(hypo1d, "tore={}".format(nbsegGen), i_pref=nro_cas) for i_aux, faces_i in enumerate(faces): algo2d = bloc1.Quadrangle(geom=faces_i) + putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas) hypo2d = smesh.CreateHypothesis('QuadrangleParams') hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i_aux]) ) hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD ) _ = bloc1.AddHypothesis(hypo2d,faces_i) - putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas) - putName(algo2d, "{}_2d_faces".format(mailleur), i_aux, nro_cas) - putName(hypo2d, "hypo2d_faces", i_aux, nro_cas) + putName(hypo2d, "faces", i_aux, nro_cas) for i_aux, edges_i in enumerate(edges): algo1d = bloc1.Segment(geom=edges_i) + putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas) if reverses[i_aux] > 0: hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges_i) ]) else: hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ]) - putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas) - putName(algo1d, "algo1d_edges", i_aux, nro_cas) - putName(hypo1d, "hypo1d_edges", i_aux, nro_cas) + putName(hypo1d, "edges", i_aux, nro_cas) for i_aux, circles_i in enumerate(circles): algo1d = bloc1.Segment(geom=circles_i) - hypo1d = algo1d.NumberOfSegments(nbsegCercle) putName(algo1d.GetSubMesh(), "circles", i_aux, nro_cas) - putName(algo1d, "algo1d_circles", i_aux, nro_cas) - putName(hypo1d, "hypo1d_circles", i_aux, nro_cas) + hypo1d = algo1d.NumberOfSegments(nbsegCercle) + putName(hypo1d, "circles={}".format(nbsegCercle), i_aux, nro_cas) if len(edgeext) == 1: densite = int(round(nbsegFis/2)) algo1d = bloc1.Segment(geom=edgeext[0]) + putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas) hypo1d = algo1d.NumberOfSegments(nbsegFis) hypo1d.SetDistrType( 2 ) hypo1d.SetConversionMode( 1 ) hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] ) - putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas) - putName(algo1d, "algo1d_edgeext", i_pref=nro_cas) - putName(hypo1d, "hypo1d_edgeext", i_pref=nro_cas) + putName(hypo1d, "edgeext", i_pref=nro_cas) else: longTotal = 0 longEdgeExts = list() @@ -139,21 +129,19 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle nbLocal = int(round(nbsegFis*longEdgeExts[i_aux]/longTotal)) densite = int(round(nbLocal/2)) algo1d = bloc1.Segment(geom=edgeext_i) + putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas) hypo1d = algo1d.NumberOfSegments(nbLocal) hypo1d.SetDistrType( 2 ) hypo1d.SetConversionMode( 1 ) hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] ) if reverext[i_aux]: hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext_i) ]) - putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas) - putName(algo1d, "algo1d_edgeext", i_aux, nro_cas) - putName(hypo1d, "hypo1d_edgeext", i_aux, nro_cas) + putName(hypo1d, "edgeext", i_aux, nro_cas) algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore) - hypo2d = algo2d.LengthFromEdges() putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas) - putName(algo2d, "{}_2d_facefissoutore".format(mailleur), i_pref=nro_cas) - putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas) + hypo2d = algo2d.LengthFromEdges() + putName(hypo2d, "facefissoutore", i_pref=nro_cas) 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): algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facesExternes_i) + putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas) hypo2d = algo2d.MaxElementArea(maxElemArea) + putName(hypo2d, "facesExternes={}".format(maxElemArea), i_aux, nro_cas) if edgesBords is None: algo1d = bloc1.Segment(geom=facesExternes_i) hypo1d = algo1d.NumberOfSegments(1) - putName(algo2d.GetSubMesh(), "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) + putName(hypo1d, "facesExternes", i_aux, nro_cas) for i_aux, aretesInternes_i in enumerate(aretesInternes): algo1d = bloc1.Segment(geom=aretesInternes_i) - hypo1d = algo1d.NumberOfSegments(nbsegExt) putName(algo1d.GetSubMesh(), "aretesInternes", i_aux, nro_cas) - putName(algo1d, "algo1d_aretesInternes", i_aux, nro_cas) - putName(hypo1d, "hypo1d_aretesInternes", i_aux, nro_cas) + hypo1d = algo1d.NumberOfSegments(nbsegExt) + putName(hypo1d, "aretesInternes={}".format(nbsegExt), i_aux, nro_cas) if edgesBords is not None: algo1d = bloc1.UseExisting1DElements(geom=edgesBords) - hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas) - putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas) - putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas) + hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0) + putName(hypo1d, "bordsLibres", i_pref=nro_cas) if not declareAlgoEllipsoideFirst: algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep) - hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas) - putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas) - putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas) + hypo3d = algo3d.MaxElementVolume(1000.0) + putName(hypo3d, "ellipsoide", i_pref=nro_cas) _ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE) _ = 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) algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN) - hypo3d = algo3d.MaxElementVolume(1000.0) putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas) - putName(algo3d, "{}_3d_bloc".format(mailleur), i_pref=nro_cas) - putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas) + hypo3d = algo3d.MaxElementVolume(1000.0) + putName(hypo3d, "bloc", i_pref=nro_cas) is_done = blocMesh.Compute() text = "blocMesh.Compute" diff --git a/src/Tools/blocFissure/gmu/peauInterne.py b/src/Tools/blocFissure/gmu/peauInterne.py index ccc1f4f91..953241e1a 100644 --- a/src/Tools/blocFissure/gmu/peauInterne.py +++ b/src/Tools/blocFissure/gmu/peauInterne.py @@ -46,31 +46,20 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones, \ #for grp in groups: #print ("\t{}".format(grp.GetName())) 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 - for grp in groups: - if grp.GetName() == nomZones + "_skin": - zoneDefaut_skin = grp - break - #print ("zoneDefaut_skin = {}".format(zoneDefaut_skin)) 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 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 - break - #print ("zoneDefaut_internalEdges = {}".format(zoneDefaut_internalEdges)) - # --- Le groupe ZoneDefaut ne doit contenir que des Hexaèdres" info = maillageSain.GetMeshInfo(zoneDefaut) @@ -106,6 +95,8 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones, \ logging.debug(texte) if listOfCorner: 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 diff --git a/src/Tools/blocFissure/ihm/fissureCoude_ihm.py b/src/Tools/blocFissure/ihm/fissureCoude_ihm.py index c6cbed803..8c3905cb4 100644 --- a/src/Tools/blocFissure/ihm/fissureCoude_ihm.py +++ b/src/Tools/blocFissure/ihm/fissureCoude_ihm.py @@ -97,8 +97,8 @@ class fissureCoude_ihm(fissureCoude): areteFaceFissure = taille cible de l'arête des triangles en face de fissure. """ self.maillageFissureParams = dict(nomRep = os.curdir, \ - nomFicSain = self.nomCas, \ - nomFicFissure = 'fissure_' + self.nomCas, \ + nomFicSain = self.nomProbleme, \ + nomFicFissure = self.nomProbleme + '_fissure', \ nbsegRad = self.dico['nbCouronnes'], \ nbsegCercle = self.dico['nbSecteurs'], \ areteFaceFissure = self.dico['aretesFaceFissure']) -- 2.39.2