From: Gérald NICOLAS Date: Tue, 16 Mar 2021 15:52:38 +0000 (+0100) Subject: Préparation pour MG-CADSurf X-Git-Tag: V9_7_0a1~13^2~9^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f61ca9786ef9635a6e0dddc799d49deebedc019;p=modules%2Fsmesh.git Préparation pour MG-CADSurf --- diff --git a/src/Tools/blocFissure/CasTests/cubeAngle.py b/src/Tools/blocFissure/CasTests/cubeAngle.py index 9ed946f58..304494adc 100644 --- a/src/Tools/blocFissure/CasTests/cubeAngle.py +++ b/src/Tools/blocFissure/CasTests/cubeAngle.py @@ -62,7 +62,8 @@ class cubeAngle(fissureGenerique): rayonPipe = 10) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -75,8 +76,8 @@ class cubeAngle(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10, mailleur) centre = None @@ -100,13 +101,17 @@ class cubeAngle(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + shapesFissure, shapeFissureParams, + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): texte = "genereMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cylindre.py b/src/Tools/blocFissure/CasTests/cylindre.py index 9e29286af..2ec1daaea 100644 --- a/src/Tools/blocFissure/CasTests/cylindre.py +++ b/src/Tools/blocFissure/CasTests/cylindre.py @@ -64,7 +64,8 @@ class cylindre(fissureGenerique): rayonPipe = 5) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -75,8 +76,8 @@ class cylindre(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] @@ -98,10 +99,14 @@ class cylindre(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/cylindre_2.py b/src/Tools/blocFissure/CasTests/cylindre_2.py index 6b17ff383..4cde6a382 100644 --- a/src/Tools/blocFissure/CasTests/cylindre_2.py +++ b/src/Tools/blocFissure/CasTests/cylindre_2.py @@ -39,7 +39,8 @@ class cylindre_2(cylindre): nomProbleme = "cylindre2" # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -50,8 +51,8 @@ class cylindre_2(cylindre): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] diff --git a/src/Tools/blocFissure/CasTests/ellipse_1.py b/src/Tools/blocFissure/CasTests/ellipse_1.py index 80811a5be..5008debbb 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_1.py +++ b/src/Tools/blocFissure/CasTests/ellipse_1.py @@ -70,7 +70,8 @@ class ellipse_1(fissureGenerique): rayonPipe = 20) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -83,7 +84,8 @@ class ellipse_1(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25, mailleur) centre = None @@ -108,12 +110,17 @@ class ellipse_1(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + texte = "genereMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/ellipse_2.py b/src/Tools/blocFissure/CasTests/ellipse_2.py index 9fbef9292..5d70a1ba1 100644 --- a/src/Tools/blocFissure/CasTests/ellipse_2.py +++ b/src/Tools/blocFissure/CasTests/ellipse_2.py @@ -25,10 +25,7 @@ import logging from blocFissure import gmu from blocFissure.gmu.geomsmesh import geompy, smesh -from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut -from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale import GEOM import SALOMEDS @@ -42,7 +39,8 @@ class ellipse_2(ellipse_1): nomProbleme = "ellipse2" # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -55,7 +53,8 @@ class ellipse_2(ellipse_1): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25, mailleur) centre = None diff --git a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py index ddfb85757..9e3dfde2d 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteCourbe.py @@ -64,7 +64,8 @@ class eprouvetteCourbe(fissureGenerique): rayonPipe = 10) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -77,7 +78,8 @@ class eprouvetteCourbe(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10, mailleur) centre = None @@ -102,12 +104,17 @@ class eprouvetteCourbe(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + texte = "genereMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py index 9b4d131f0..c07ed26ae 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite.py @@ -22,8 +22,6 @@ import os from blocFissure import gmu from blocFissure.gmu.geomsmesh import geompy, smesh -import os -import math import GEOM import SALOMEDS import SMESH @@ -52,7 +50,7 @@ class eprouvetteDroite(fissureGenerique): def genereMaillageSain(self, geometriesSaines, meshParams): logging.info("genereMaillageSain %s", self.nomCas) - ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med")) + ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med")) smesh.SetName(objetSain.GetMesh(), 'objetSain') return [objetSain, True] # True : maillage hexa @@ -72,7 +70,8 @@ class eprouvetteDroite(fissureGenerique): lenSegPipe = 6) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -83,8 +82,8 @@ class eprouvetteDroite(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] @@ -106,10 +105,14 @@ class eprouvetteDroite(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py index 1db76fcbc..0a2327610 100644 --- a/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py +++ b/src/Tools/blocFissure/CasTests/eprouvetteDroite_2.py @@ -35,8 +35,6 @@ from .eprouvetteDroite import eprouvetteDroite from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut -from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -46,7 +44,8 @@ class eprouvetteDroite_2(eprouvetteDroite): nomProbleme = "eprouvetteDroite_2" # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -57,8 +56,8 @@ class eprouvetteDroite_2(eprouvetteDroite): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] diff --git a/src/Tools/blocFissure/CasTests/faceGauche.py b/src/Tools/blocFissure/CasTests/faceGauche.py index 1a554736c..20afd5c28 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche.py +++ b/src/Tools/blocFissure/CasTests/faceGauche.py @@ -68,7 +68,8 @@ class faceGauche(fissureGenerique): rayonPipe = 20) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -79,8 +80,8 @@ class faceGauche(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,50) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,50, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] @@ -102,10 +103,14 @@ class faceGauche(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/faceGauche_2.py b/src/Tools/blocFissure/CasTests/faceGauche_2.py index e9271d21d..08f2bc06c 100644 --- a/src/Tools/blocFissure/CasTests/faceGauche_2.py +++ b/src/Tools/blocFissure/CasTests/faceGauche_2.py @@ -22,7 +22,6 @@ import os from blocFissure import gmu from blocFissure.gmu.geomsmesh import geompy, smesh -import math import GEOM import SALOMEDS import SMESH @@ -50,7 +49,7 @@ class faceGauche_2(fissureGenerique): def genereMaillageSain(self, geometriesSaines, meshParams): logging.info("genereMaillageSain %s", self.nomCas) - ([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) + ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) smesh.SetName(objetSain.GetMesh(), 'objetSain') return [objetSain, True] # True : maillage hexa @@ -69,7 +68,8 @@ class faceGauche_2(fissureGenerique): rayonPipe = 20) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) lgInfluence = shapeFissureParams['lgInfluence'] @@ -80,7 +80,8 @@ class faceGauche_2(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25, mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] @@ -102,10 +103,14 @@ class faceGauche_2(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_6.py b/src/Tools/blocFissure/CasTests/fissureCoude_6.py index c002de469..43c9ebf2e 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_6.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_6.py @@ -82,7 +82,7 @@ class fissureCoude_6(fissureCoude): externe = True) # --------------------------------------------------------------------------- - + def setParamMaillageFissure(self): """ Paramètres du maillage de la fissure pour le tuyau coudé @@ -96,7 +96,7 @@ class fissureCoude_6(fissureCoude): nomFicFissure = self.nomCas + "_fissure", nbsegRad = 5, nbsegCercle = 12, - areteFaceFissure = 5) + areteFaceFissure = 5) # --------------------------------------------------------------------------- def setReferencesMaillageFissure(self): diff --git a/src/Tools/blocFissure/CasTests/fissureCoude_7.py b/src/Tools/blocFissure/CasTests/fissureCoude_7.py index e86736a5f..43369a22a 100644 --- a/src/Tools/blocFissure/CasTests/fissureCoude_7.py +++ b/src/Tools/blocFissure/CasTests/fissureCoude_7.py @@ -83,7 +83,7 @@ class fissureCoude_7(fissureCoude): externe = True) # --------------------------------------------------------------------------- - + def setParamMaillageFissure(self): """ Paramètres du maillage de la fissure pour le tuyau coudé @@ -97,7 +97,7 @@ class fissureCoude_7(fissureCoude): nomFicFissure = self.nomCas + "_fissure", nbsegRad = 5, nbsegCercle = 12, - areteFaceFissure = 5) + areteFaceFissure = 5) # --------------------------------------------------------------------------- def setReferencesMaillageFissure(self): diff --git a/src/Tools/blocFissure/CasTests/fissure_Coude.py b/src/Tools/blocFissure/CasTests/fissure_Coude.py index 861a92141..f493b1ba6 100644 --- a/src/Tools/blocFissure/CasTests/fissure_Coude.py +++ b/src/Tools/blocFissure/CasTests/fissure_Coude.py @@ -258,14 +258,14 @@ class fissure_Coude(fissureGenerique): smesh.SetName(algo1d_long_p2, "algo1d_long_p2") smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2") - mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) - mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) - ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE) - btu = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE) - clg = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE) - pei = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE) - pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) - cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) + _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) + _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) + _ = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE) + _ = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE) + _ = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE) + _ = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE) + _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) + _ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) isDone = maillageSain.Compute() @@ -294,7 +294,8 @@ class fissure_Coude(fissureGenerique): externe = True) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) logging.info("shapeFissureParams %s", shapeFissureParams) @@ -473,7 +474,8 @@ class fissure_Coude(fissureGenerique): else: pass - coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, 5 ,10) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, 5 ,10, mailleur) return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, facetubel, facetuber, planfiss, pipefiss] @@ -498,10 +500,14 @@ class fissure_Coude(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + + mailleur = self.mailleur2d3d() maillageFissure = insereFissureLongue(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/tube.py b/src/Tools/blocFissure/CasTests/tube.py index 880df4cd7..ec8ffdf23 100644 --- a/src/Tools/blocFissure/CasTests/tube.py +++ b/src/Tools/blocFissure/CasTests/tube.py @@ -62,7 +62,8 @@ class tube(fissureGenerique): rayonPipe = 0.05) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -79,7 +80,8 @@ class tube(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.025, 0.1) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.025, 0.1, mailleur) centre = None @@ -104,12 +106,17 @@ class tube(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + texte = "genereMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/CasTests/vis_1.py b/src/Tools/blocFissure/CasTests/vis_1.py index 9963dd1bd..cf3d56e35 100644 --- a/src/Tools/blocFissure/CasTests/vis_1.py +++ b/src/Tools/blocFissure/CasTests/vis_1.py @@ -70,7 +70,8 @@ class vis_1(fissureGenerique): rayonPipe = 0.1) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): """Importe la géométrie de la fissure et crée le groupe du fond de la fissure""" texte = "genereShapeFissure pour '{}'".format(self.nomCas) logging.info(texte) @@ -83,7 +84,8 @@ class vis_1(fissureGenerique): geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.1 ,0.2) + mailleur = self.mailleur2d3d() + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.1 ,0.2, mailleur) centre = None @@ -108,12 +110,17 @@ class vis_1(fissureGenerique): # --------------------------------------------------------------------------- def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + texte = "genereMaillageFissure pour '{}'".format(self.nomCas) logging.info(texte) + + mailleur = self.mailleur2d3d() maillageFissure = construitFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + maillageFissureParams, elementsDefaut, step, \ + mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index 52cd10547..00f19300f 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -116,8 +116,8 @@ class casStandard(fissureGenerique): lenSegPipe = self.lenSegPipe) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): - logging.info("genereShapeFissure %s", self.nomCas) + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): lgInfluence = shapeFissureParams['lgInfluence'] @@ -147,7 +147,8 @@ class casStandard(fissureGenerique): geomPublishInFather(initLog.debug, shellFiss, fondFiss, 'fondFiss' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1]) + coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, self.dicoParams['meshBrep'][0] ,self.dicoParams['meshBrep'][1], \ + mailleur) centre = None return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] @@ -168,12 +169,14 @@ class casStandard(fissureGenerique): return elementsDefaut # --------------------------------------------------------------------------- - def genereMaillageFissure(self, geometriesSaines, maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): + def genereMaillageFissure(self, geometriesSaines, maillagesSains, \ + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): maillageFissure = construitFissureGenerale(maillagesSains, \ - shapesFissure, shapeFissureParams, \ - maillageFissureParams, elementsDefaut, step) + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, \ + step, mailleur) return maillageFissure # --------------------------------------------------------------------------- diff --git a/src/Tools/blocFissure/gmu/construitFissureGenerale.py b/src/Tools/blocFissure/gmu/construitFissureGenerale.py index 8dfcfa527..097225e61 100644 --- a/src/Tools/blocFissure/gmu/construitFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/construitFissureGenerale.py @@ -77,13 +77,15 @@ from .fissError import fissError # ----------------------------------------------------------------------------- # --- procédure complète fissure générale -def construitFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step=-1): +def construitFissureGenerale(maillagesSains, \ + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, \ + step=-1, mailleur="MeshGems"): """ TODO: a completer """ logging.info('start') + logging.info(mailleur) shapeDefaut = shapesFissure[0] # faces de fissure, débordant fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure @@ -277,16 +279,19 @@ def construitFissureGenerale(maillagesSains, # --- maillage faces de fissure - (meshFaceFiss, grpFaceFissureExterne, - grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) = mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC, - meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad) + (meshFaceFiss, grpFaceFissureExterne, grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) = \ + mailleFacesFissure(faceFissureExterne, \ + edgesPipeFissureExterneC, edgesPeauFissureExterneC, \ + meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \ + mailleur) # --- maillage faces de peau - meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, - facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, - bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, - edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad) + meshesFacesPeau = mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ + facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \ + bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \ + edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \ + mailleur) # --- regroupement des maillages du défaut @@ -309,13 +314,17 @@ def construitFissureGenerale(maillagesSains, elif grp.GetName() == "fisInPi": group_faceFissInPipe = grp - # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D - distene=True - if distene: - algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D) + # le maillage NETGEN ne passe pas toujours ==> on force l'usage de MG_Tetra + mailleur = "MeshGems" + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.MG_Tetra) else: algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN) hypo3d = algo3d.MaxElementVolume(1000.0) + hypo3d.SetVerboseLevel( 0 ) + hypo3d.SetStandardOutputLog( 0 ) + hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut") putName(algo3d, "algo3d_boiteDefaut") putName(meshBoiteDefaut, "boiteDefaut") diff --git a/src/Tools/blocFissure/gmu/fissureCoude.py b/src/Tools/blocFissure/gmu/fissureCoude.py index 772ce40f3..edd101eb7 100644 --- a/src/Tools/blocFissure/gmu/fissureCoude.py +++ b/src/Tools/blocFissure/gmu/fissureCoude.py @@ -29,9 +29,6 @@ import math import GEOM import SALOMEDS import SMESH -#import StdMeshers -#import GHS3DPlugin -#import NETGENPlugin import logging from .fissureGenerique import fissureGenerique @@ -72,6 +69,7 @@ class fissureCoude(fissureGenerique): # --------------------------------------------------------------------------- def genereGeometrieSaine(self, geomParams): + """a écrire""" logging.info("genereGeometrieSaine %s", self.nomCas) angleCoude = geomParams['angleCoude'] @@ -304,14 +302,14 @@ class fissureCoude(fissureGenerique): logging.info(text) raise Exception(text) - mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) - mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) - ext = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE) - btu = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE) - clg = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE) - pei = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE) - pex = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) - cou = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) + _ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE) + _ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE) + _ = maillageSain.GroupOnGeom(EXTUBE,'EXTUBE',SMESH.FACE) + _ = maillageSain.GroupOnGeom(BORDTU,'BORDTU',SMESH.EDGE) + _ = maillageSain.GroupOnGeom(CLGV,'CLGV',SMESH.FACE) + _ = maillageSain.GroupOnGeom(PEAUINT,'PEAUINT',SMESH.FACE) + _ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE) + _ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME) return [maillageSain, True] # True : maillage hexa @@ -344,7 +342,8 @@ class fissureCoude(fissureGenerique): externe = True) # --------------------------------------------------------------------------- - def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \ + mailleur="MeshGems"): logging.info("genereShapeFissure %s", self.nomCas) logging.info("shapeFissureParams %s", shapeFissureParams) @@ -652,7 +651,8 @@ class fissureCoude(fissureGenerique): centre = geompy.MakeRotation(pc, axe, alfrd) geomPublish(initLog.debug, centre, 'centrefissPlace' ) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur) + coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur, \ + mailleur) return [facefiss, centre, lgInfluence, coordsNoeudsFissure, wiretube, edgetube] @@ -678,12 +678,14 @@ class fissureCoude(fissureGenerique): return elementsDefaut # --------------------------------------------------------------------------- - def genereMaillageFissure(self, geometriesSaines, maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step): - maillageFissure = construitFissureGenerale(maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step) + def genereMaillageFissure(self, geometriesSaines, maillagesSains, \ + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, step, \ + mailleur="MeshGems"): + maillageFissure = construitFissureGenerale(maillagesSains, \ + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, \ + step, mailleur) return maillageFissure # --------------------------------------------------------------------------- @@ -696,4 +698,3 @@ class fissureCoude(fissureGenerique): Entity_Quad_Hexa = 8994, Entity_Quad_Penta = 972, Entity_Quad_Pyramid = 1038) - diff --git a/src/Tools/blocFissure/gmu/fissureGenerique.py b/src/Tools/blocFissure/gmu/fissureGenerique.py index ccae1a82c..7f77fa693 100644 --- a/src/Tools/blocFissure/gmu/fissureGenerique.py +++ b/src/Tools/blocFissure/gmu/fissureGenerique.py @@ -63,7 +63,7 @@ class fissureGenerique(object): """setParamShapeFissure""" self.shapeFissureParams = dict() - def genereShapeFissure(self, geometriesSaines, geomParams, shapeFissureParams): + def genereShapeFissure(self, geometriesSaines, geomParams, shapeFissureParams, mailleur="MeshGems"): """genereShapeFissure""" shapesFissure = [None] return shapesFissure @@ -77,8 +77,10 @@ class fissureGenerique(object): elementsDefaut = [None] return elementsDefaut - def genereMaillageFissure(self, geometriesSaines, maillagesSains, shapesFissure, - maillageFissureParams, elementsDefaut): + def genereMaillageFissure(self, geometriesSaines, maillagesSains, \ + shapesFissure, maillageFissureParams, \ + elementsDefaut, \ + mailleur="MeshGems"): """genereMaillageFissure""" maillageFissure = None return maillageFissure @@ -88,6 +90,12 @@ class fissureGenerique(object): referencesMaillageFissure = dict() return referencesMaillageFissure + def mailleur2d3d(self): + """Le mailleur : NETGEN ou MeshGems""" + #mailleur = "MeshGems" + mailleur = "NETGEN" + return mailleur + # --------------------------------------------------------------------------- def executeProbleme(self, step=-1): @@ -101,26 +109,33 @@ class fissureGenerique(object): geometriesSaines = self.genereGeometrieSaine(self.geomParams) if step == 1: return + logging.info("AAAAAAAAAAAAAAAAAAAA") self.setParamMaillageSain() maillagesSains = self.genereMaillageSain(geometriesSaines, self.meshParams) if step == 2: return + logging.info("BBBBBBBBBBBBBBBBBBBBB") self.setParamShapeFissure() - shapesFissure = self.genereShapeFissure(geometriesSaines, self.geomParams, self.shapeFissureParams) + mailleur = self.mailleur2d3d() + shapesFissure = self.genereShapeFissure(geometriesSaines, self.geomParams, self.shapeFissureParams, mailleur) if step == 3: return + logging.info("CCCCCCCCCCCCCCCCCCCCCCCC") self.setParamMaillageFissure() - elementsDefaut = self.genereZoneDefaut(geometriesSaines, maillagesSains, shapesFissure, self.shapeFissureParams, self.maillageFissureParams) + elementsDefaut = self.genereZoneDefaut(geometriesSaines, maillagesSains, \ + shapesFissure, self.shapeFissureParams, self.maillageFissureParams) if step == 4: return + logging.info("DDDDDDDDDDDDDDDDDDDD") - maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, - shapesFissure, self.shapeFissureParams, - self.maillageFissureParams, elementsDefaut, step) + maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \ + shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \ + elementsDefaut, step, mailleur) + logging.info("EEEEEEEEEEEEEEEEEES") self.setReferencesMaillageFissure() ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams) return ok_maillage diff --git a/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py b/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py index 9a7225b72..e6d1763fd 100644 --- a/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py +++ b/src/Tools/blocFissure/gmu/genereElemsFissureElliptique.py @@ -32,12 +32,13 @@ from .genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut # ----------------------------------------------------------------------------- # --- création élements géométriques fissure elliptique -def genereElemsFissureElliptique(shapeFissureParams): +def genereElemsFissureElliptique(shapeFissureParams, \ + mailleur="MeshGems"): """ TODO: a completer """ logging.info('start') - + centreDefaut = shapeFissureParams['centreDefaut'] vecteurDefaut = shapeFissureParams['vecteurDefaut'] demiGrandAxe = shapeFissureParams['demiGrandAxe'] @@ -49,7 +50,7 @@ def genereElemsFissureElliptique(shapeFissureParams): allonge = demiGrandAxe/demiPetitAxe rayonTore = demiPetitAxe/5.0 - generatrice, FaceGenFiss, Pipe_1, FaceFissure, Plane_1, Pipe1Part = toreFissure(demiPetitAxe, allonge, rayonTore) + generatrice, _, Pipe_1, FaceFissure, Plane_1, Pipe1Part = toreFissure(demiPetitAxe, allonge, rayonTore) ellipsoide = ellipsoideDefaut(demiPetitAxe, allonge, rayonTore) # --- positionnement sur le bloc defaut de generatrice, tore et plan fissure @@ -70,6 +71,7 @@ def genereElemsFissureElliptique(shapeFissureParams): shapeDefaut = facefis1 xyz_defaut = geompy.PointCoordinates(centreDefaut) - coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefis1, demiPetitAxe/10.0, demiPetitAxe/5.0) + coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefis1, demiPetitAxe/10.0, demiPetitAxe/5.0, \ + mailleur) return shapeDefaut, xyz_defaut, tailleDefaut, coordsNoeudsFissure, pipe0, gener1, pipe1, facefis1, plane1, ellipsoide1 diff --git a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py index 90942514a..3a423775a 100644 --- a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py +++ b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py @@ -25,10 +25,17 @@ from salome.smesh import smeshBuilder # ----------------------------------------------------------------------------- # --- maillage face de fissure pour identification zone de defaut -def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): - """ - -Permet de générer un maillage sur l'objet géométrique 'facefiss' via - l'algorithme NETGEN_1D2D : +def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \ + mailleur="MeshGems"): + """Maillage de l'objet géométrique 'facefiss' + +. Avec l'algorithme MG_CADSurf : + -SetMaxSize = dimension max d'un élément (maxSize) + -SetSecondOrder = élément quadratique (Y=1, N=0) + -SetOptimize = élément régulier (Y=1, N=0) + -SetFineness = finesse du maillage + +. Avec l'algorithme NETGEN_1D2D : -SetMaxSize = dimension max d'un élément (maxSize) -SetSecondOrder = élément quadratique (Y=1, N=0) -SetOptimize = élément régulier (Y=1, N=0) @@ -37,22 +44,32 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): [0, 1, 2, 3, 4, 5 ] -SetMinSize = dimension min d'un élément (minSize) -SetQuadAllowed = permission quadrangle dans maillage triangle - -On récupère les coordonnées de chaque noeud de la fissure qu'on stocke + +-On récupère les coordonnées de chaque noeud de la fissure qu'on stocke dans une liste sous la forme : [X0, Y0, Z0, ..., Xn, Yn, Zn]""" logging.info('start') - text = "Maillage de '{}'".format(facefiss.GetName()) - logging.info(text) meshFissure = smesh.Mesh(facefiss) - algo2d = meshFissure.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( maxSize ) - hypo2d.SetSecondOrder( 0 ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( minSize ) - hypo2d.SetQuadAllowed( 0 ) + text = "Maillage de '{}' avec {}".format(facefiss.GetName(),mailleur) + logging.info(text) + if ( mailleur == "MeshGems"): + algo2d = meshFissure.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( maxSize ) + hypo2d.SetMinSize( maxSize/4. ) + hypo2d.SetMaxSize( maxSize*2. ) + hypo2d.SetChordalError( maxSize*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFissure.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( maxSize ) + hypo2d.SetSecondOrder( 0 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( minSize ) + hypo2d.SetQuadAllowed( 0 ) smesh.SetName(algo2d, "algo2d_zoneFiss") smesh.SetName(hypo2d, "hypo1d_zoneFiss") @@ -67,8 +84,8 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): coordsNoeudsFissure = list() nodeIds = meshFissure.GetNodesId() - for id in nodeIds: - coords = meshFissure.GetNodeXYZ(id) + for indice in nodeIds: + coords = meshFissure.GetNodeXYZ(indice) coordsNoeudsFissure.append(coords[0]) coordsNoeudsFissure.append(coords[1]) coordsNoeudsFissure.append(coords[2]) diff --git a/src/Tools/blocFissure/gmu/insereFissureGenerale.py b/src/Tools/blocFissure/gmu/insereFissureGenerale.py index b65478d75..9067f7b8c 100644 --- a/src/Tools/blocFissure/gmu/insereFissureGenerale.py +++ b/src/Tools/blocFissure/gmu/insereFissureGenerale.py @@ -39,22 +39,18 @@ from .extractionOrientee import extractionOrientee from .extractionOrienteeMulti import extractionOrienteeMulti from .sortFaces import sortFaces from .sortEdges import sortEdges -from .eliminateDoubles import eliminateDoubles from .substractSubShapes import substractSubShapes from .produitMixte import produitMixte from .findWireEndVertices import findWireEndVertices from .findWireIntermediateVertices import findWireIntermediateVertices from .orderEdgesFromWire import orderEdgesFromWire -from .getSubshapeIds import getSubshapeIds from .putName import putName -from .distance2 import distance2 from .enleveDefaut import enleveDefaut from .shapeSurFissure import shapeSurFissure from .regroupeSainEtDefaut import RegroupeSainEtDefaut from .triedreBase import triedreBase from .checkDecoupePartition import checkDecoupePartition from .whichSide import whichSide -from .whichSideMulti import whichSideMulti from .whichSideVertex import whichSideVertex from .projettePointSurCourbe import projettePointSurCourbe from .prolongeWire import prolongeWire @@ -62,10 +58,9 @@ from .prolongeWire import prolongeWire def insereFissureGenerale(maillagesSains, shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step=-1): - """ - TODO: a completer - """ + maillageFissureParams, elementsDefaut, \ + step=-1, mailleur="MeshGems"): + """ TODO: a completer""" logging.info('start') shapeDefaut = shapesFissure[0] # faces de fissure, débordant @@ -273,11 +268,11 @@ def insereFissureGenerale(maillagesSains, geomPublishInFather(initLog.debug,partitionPeauFissFond, edgesFondC, "edgesFondFiss") if aretesVivesC is None: #= global facesInside facesOnside - [edgesInside, edgesOutside, edgesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) - [facesInside, facesOutside, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) + [edgesInside, _, _] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) + [facesInside, _, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) else: - [edgesInside, edgesOutside, edgesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) - [facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) + [edgesInside, _, _] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3) + [facesInside, _, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3) edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) #= global verticesPipePeau = list() #= global @@ -407,7 +402,6 @@ def insereFissureGenerale(maillagesSains, logging.debug(" edgesFondIn %s ", edgesPipeFnd) except: logging.debug(" pb edges communes %s %s %s",edgesPeauFis, edgesPipeFis, edgesPipeFnd) - pass if (len(edgesPeauFis) > 0) and (len(edgesPipeFis) > 0) and (len(edgesPipeFnd) == 0): dist = geompy.MinDistance(geompy.MakeCompound(edgesPeauFis), ptPeau) logging.debug(" test distance extrémité reference %s", dist) @@ -417,8 +411,8 @@ def insereFissureGenerale(maillagesSains, name="faceFissExt%d"%iedf geomPublishInFather(initLog.debug,partitionPeauFissFond, face, name) dist = 1. - for ipe, edpe in enumerate(edgesPeauFis): - for ipi, edpi in enumerate(edgesPipeFis): + for _, edpe in enumerate(edgesPeauFis): + for _, edpi in enumerate(edgesPipeFis): dist = geompy.MinDistance(edpe, edpi) if dist < 1.e-3: edgesFissExtPeau.append(edpe) @@ -473,7 +467,7 @@ def insereFissureGenerale(maillagesSains, edgeEnTrop = list() outilPart = pipexts facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False) - facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau) + facesPeauSorted, _, _ = sortFaces(facesPeau) for i, face in enumerate(facesPeauSorted[:-1]): # on ne teste que la ou les petites faces "circulaires" nbv = geompy.NumberOfEdges(face) logging.debug("nombre d'edges sur face circulaire: %s", nbv) @@ -495,9 +489,7 @@ def insereFissureGenerale(maillagesSains, j = 1-i if bad: outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0]) - pass partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, list(), list(), geompy.ShapeType["FACE"], 0, list(), 1) - pass name="partitionPeauByPipe%d"%ifil geomPublish(initLog.debug, partitionPeauByPipe, name) @@ -505,7 +497,7 @@ def insereFissureGenerale(maillagesSains, [facesPeauFondIn, facesPeauFondOut, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3) if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau - facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn) + facesPeauSorted, _, _ = sortFaces(facesPeauFondOn) facePeau = facesPeauSorted[-1] # la plus grande face else: facePeau =geompy.MakePartition(facesPeauFondOn, list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 1) @@ -545,10 +537,6 @@ def insereFissureGenerale(maillagesSains, edgeRadFacePipePeau[i] = edge geomPublish(initLog.debug, edge, nameEdge) break - pass - pass - pass - pass # --- edges circulaires de la face de peau et points de jonction de la face externe de fissure logging.debug("facesPipePeau: %s", facesPipePeau) @@ -568,8 +556,7 @@ def insereFissureGenerale(maillagesSains, verticesCircPeau[i] = grpVertCircPeau name = "pointEdgeCirc%d"%i geomPublishInFather(initLog.debug,facePeau, grpVertCircPeau, name) - pass - pass # --- au moins une extrémité du pipe sur cette face de peau + # --- au moins une extrémité du pipe sur cette face de peau # --- edges de bord de la face de peau @@ -821,7 +808,7 @@ def insereFissureGenerale(maillagesSains, pt1 = centres[-1] idFillingFromBout = [None, None] # contiendra l'index du filling pour les extrémités 0 et 1 for ifil in range(nbFacesFilling): - for ipt, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face + for _, pt in enumerate(ptEdgeFond[ifil]): # il y a un ou deux points débouchant sur cette face if geompy.MinDistance(pt,pt0) < geompy.MinDistance(pt,pt1): # TODO: trouver plus fiable pour les cas tordus... idFillingFromBout[0] = ifil else: @@ -912,12 +899,12 @@ def insereFissureGenerale(maillagesSains, # --- construction des listes d'edges radiales sur chaque extrémité débouchante listEdges = list() for i, nappes in enumerate(listNappes): - id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) - if id < 0: + indice = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if indice < 0: listEdges.append(list()) else: - face = facesPipePeau[id] - edges = [edgeRadFacePipePeau[id]] + face = facesPipePeau[indice] + edges = [edgeRadFacePipePeau[indice]] for k, nappe in enumerate(nappes): if k > 0: obj = geompy.MakeSection(face, nappes[k]) # normalement une edge, parfois un compound d'edges dont un tout petit @@ -955,15 +942,15 @@ def insereFissureGenerale(maillagesSains, # --- création des points du maillage du pipe sur la face de peau for i, edges in enumerate(listEdges): - id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) - if id >= 0: + indice = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau) + if indice >= 0: gptdsk = list() - if id > 0: # id vaut 0 ou 1 - id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) - centre = ptEdgeFond[idFillingFromBout[i]][id] - name = "centre%d"%id + if indice > 0: # indice vaut 0 ou 1 + indice = -1 # si indice vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face) + centre = ptEdgeFond[idFillingFromBout[i]][indice] + name = "centre%d"%indice geomPublish(initLog.debug, centre, name) - vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id] + vertPipePeau = ptFisExtPi[idFillingFromBout[i]][indice] geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau") grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes edgesCirc = list() @@ -987,7 +974,6 @@ def insereFissureGenerale(maillagesSains, bout = extrCircs[0] else: bout = extrCircs[1] - pass else: bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], u) name ="bout%d"%k @@ -1073,11 +1059,11 @@ def insereFissureGenerale(maillagesSains, mptids = list() for j, pt in enumerate(points): if j == 0 and k > 0: - id = mptdsk[0][0] + indice = mptdsk[0][0] else: coords = geompy.PointCoordinates(pt) - id = meshPipe.AddNode(coords[0], coords[1], coords[2]) - mptids.append(id) + indice = meshPipe.AddNode(coords[0], coords[1], coords[2]) + mptids.append(indice) mptdsk.append(mptids) mptsdisks.append(mptdsk) @@ -1182,14 +1168,14 @@ def insereFissureGenerale(maillagesSains, pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' ) nbAdd = pipeFissGroup.AddFrom( meshPipe.GetMesh() ) - nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") + nb, _, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries") edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group] # --- fin du maillage du pipe # ----------------------------------------------------------------------- # --- edges de bord, faces défaut à respecter - aFilterManager = smesh.CreateFilterManager() + _ = smesh.CreateFilterManager() nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ]) criteres = list() unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0) @@ -1233,14 +1219,24 @@ def insereFissureGenerale(maillagesSains, logging.debug("---------------------------- maillage faces de fissure externes au pipe :%s --------------", len(facesFissExt)) meshFaceFiss = smesh.Mesh(faceFissureExterne) - algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( areteFaceFissure ) - hypo2d.SetSecondOrder( 0 ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( areteFaceFissure ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetMaxSize( areteFaceFissure*3. ) + hypo2d.SetChordalError( areteFaceFissure*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( areteFaceFissure ) + hypo2d.SetSecondOrder( 0 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss") putName(algo2d, "algo2d_faceFiss") putName(hypo2d, "hypo2d_faceFiss") @@ -1334,13 +1330,23 @@ def insereFissureGenerale(maillagesSains, putName(algo1d, "algo1d_" + name, ifil) putName(hypo1d, "hypo1d_" + name, ifil) - algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( dmoyen ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( dmoyen ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetMaxSize( dmoyen*3. ) + hypo2d.SetChordalError( dmoyen*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( dmoyen*0.75 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "facePeau", ifil) putName(algo2d, "algo2d_facePeau", ifil) putName(hypo2d, "hypo2d_facePeau", ifil) @@ -1381,13 +1387,17 @@ def insereFissureGenerale(maillagesSains, elif grp.GetName() == "fisInPi": group_faceFissInPipe = grp - # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D - distene=True - if distene: - algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D) + # le maillage NETGEN ne passe pas toujours ==> on force l'usage de MG_Tetra + mailleur = "MeshGems" + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.MG_Tetra) else: algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN) hypo3d = algo3d.MaxElementVolume(1000.0) + hypo3d.SetVerboseLevel( 0 ) + hypo3d.SetStandardOutputLog( 0 ) + hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut") putName(algo3d, "algo3d_boiteDefaut") putName(meshBoiteDefaut, "boiteDefaut") @@ -1401,7 +1411,7 @@ def insereFissureGenerale(maillagesSains, logging.info(text) raise Exception(text) - faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' ) + _ = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' ) maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges) putName(maillageSain, nomFicSain+"_coupe") @@ -1414,7 +1424,7 @@ def insereFissureGenerale(maillagesSains, logging.info("groupes") groups = maillageComplet.GetGroups() grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS'] - fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' ) + _ = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' ) logging.info("réorientation face de fissure FACE1") grps = [ grp for grp in groups if grp.GetName() == 'FACE1'] @@ -1425,7 +1435,7 @@ def insereFissureGenerale(maillagesSains, fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim) grps = [ grp for grp in groups if grp.GetName() == 'FACE2'] nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1)) - fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' ) + _ = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' ) logging.info("export maillage fini") maillageComplet.ExportMED(fichierMaillageFissure) diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue.py b/src/Tools/blocFissure/gmu/insereFissureLongue.py index a2f17b4c8..dcc67d138 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue.py @@ -54,9 +54,10 @@ from blocFissure.gmu.insereFissureLongue_d import insereFissureLongue_d # ----------------------------------------------------------------------------- # --- procedure complete fissure longue -def insereFissureLongue(geometriesSaines, maillagesSains, - shapesFissure, shapeFissureParams, - maillageFissureParams, elementsDefaut, step=-1): +def insereFissureLongue(geometriesSaines, maillagesSains, \ + shapesFissure, shapeFissureParams, \ + maillageFissureParams, elementsDefaut, \ + step=-1, mailleur="MeshGems"): """ TODO: a completer """ @@ -436,10 +437,9 @@ def insereFissureLongue(geometriesSaines, maillagesSains, # --- maillage meshBoiteDefaut - distene=True meshBoiteDefaut, group_faceFissInPipe, group_faceFissOutPipe = \ insereFissureLongue_d (internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \ - distene) + mailleur) groups = maillageSain.GetGroups() diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_b.py b/src/Tools/blocFissure/gmu/insereFissureLongue_b.py index 8df253dde..67eb35175 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_b.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_b.py @@ -30,18 +30,29 @@ from .putName import putName def insereFissureLongue_b (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibres, \ groupsDemiCerclesPeau, groups_demiCercles, verticesOutCercles, \ - nbSegGenLong, nbSegGenBout, profondeur): + nbSegGenLong, nbSegGenBout, profondeur, \ + mailleur="MeshGems"): """maillage face de peau""" logging.info('start') meshFacePeau = smesh.Mesh(facePeau) - algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( 1000 ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( 2 ) - hypo2d.SetQuadAllowed( 0 ) + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( 1000 ) + hypo2d.SetMinSize( 100 ) + hypo2d.SetMaxSize( 3000. ) + hypo2d.SetChordalError( 250. ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( 1000 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( 2 ) + hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "facePeau") putName(algo2d, "algo2d_facePeau") putName(hypo2d, "hypo2d_facePeau") diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py index 35988dc2a..4cdb8b29b 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_c.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_c.py @@ -30,18 +30,30 @@ from .putName import putName import math def insereFissureLongue_c (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_generFiss, groupEdgesFaceFissPipe, \ - profondeur, rayonPipe): + profondeur, rayonPipe, \ + mailleur="MeshGems"): """maillage face de fissure""" logging.info('start') meshFaceFiss = smesh.Mesh(faceFiss) - algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( (profondeur - rayonPipe)/math.sqrt(3.0) ) # pour avoir deux couches de triangles equilateraux partout sur la fissure - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( 2 ) - hypo2d.SetQuadAllowed( 0 ) + mesh_size = (profondeur - rayonPipe)/math.sqrt(3.0) # pour avoir deux couches de triangles equilateraux partout sur la fissure + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( mesh_size ) + hypo2d.SetMinSize( mesh_size/10. ) + hypo2d.SetMaxSize( mesh_size*3. ) + hypo2d.SetChordalError( mesh_size*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( mesh_size ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( 2 ) + hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss") putName(algo2d, "algo2d_faceFiss") putName(hypo2d, "hypo2d_faceFiss") diff --git a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py index ba9c382a3..03c2fae0e 100644 --- a/src/Tools/blocFissure/gmu/insereFissureLongue_d.py +++ b/src/Tools/blocFissure/gmu/insereFissureLongue_d.py @@ -28,9 +28,10 @@ import SMESH from .putName import putName def insereFissureLongue_d (internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \ - distene = True): + mailleur="MeshGems"): """maillage meshBoiteDefaut""" logging.info('start') + logging.info("insereFissureLongue_d (%s)", mailleur) meshBoiteDefaut = smesh.Concatenate( [internalBoundary.GetMesh(), \ meshFondFiss.GetMesh(), \ @@ -51,12 +52,17 @@ def insereFissureLongue_d (internalBoundary, meshFondFiss, meshFacePeau, meshFac elif grp.GetName() == "fisInPi": group_faceFissInPipe = grp - # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D - if distene: - algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D) + # le maillage NETGEN ne passe pas toujours ==> on force l'usage de MG_Tetra + mailleur = "MeshGems" + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.MG_Tetra) else: algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN) hypo3d = algo3d.MaxElementVolume(1000.0) + hypo3d.SetVerboseLevel( 0 ) + hypo3d.SetStandardOutputLog( 0 ) + hypo3d.SetRemoveLogOnSuccess( 1 ) putName(algo3d.GetSubMesh(), "boiteDefaut") putName(algo3d, "algo3d_boiteDefaut") putName(meshBoiteDefaut, "boiteDefaut") diff --git a/src/Tools/blocFissure/gmu/mailleFacesFissure.py b/src/Tools/blocFissure/gmu/mailleFacesFissure.py index d9eed2dbc..e67d7d8f4 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesFissure.py +++ b/src/Tools/blocFissure/gmu/mailleFacesFissure.py @@ -27,22 +27,32 @@ import SMESH from .putName import putName -def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC, \ - meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad): +def mailleFacesFissure(faceFissureExterne, \ + edgesPipeFissureExterneC, edgesPeauFissureExterneC, \ + meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \ + mailleur="MeshGems"): """maillage faces de fissure""" logging.info('start') - texte = "Maillage de {}".format(faceFissureExterne.GetName()) - logging.info(texte) meshFaceFiss = smesh.Mesh(faceFissureExterne) - algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( areteFaceFissure ) - hypo2d.SetSecondOrder( 0 ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( areteFaceFissure ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetMaxSize( areteFaceFissure*3. ) + hypo2d.SetChordalError( areteFaceFissure*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFaceFiss.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( areteFaceFissure ) + hypo2d.SetSecondOrder( 0 ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) putName(algo2d.GetSubMesh(), "faceFiss") putName(algo2d, "algo2d_faceFiss") putName(hypo2d, "hypo2d_faceFiss") diff --git a/src/Tools/blocFissure/gmu/mailleFacesPeau.py b/src/Tools/blocFissure/gmu/mailleFacesPeau.py index f3486985e..8bd39dba9 100644 --- a/src/Tools/blocFissure/gmu/mailleFacesPeau.py +++ b/src/Tools/blocFissure/gmu/mailleFacesPeau.py @@ -32,12 +32,14 @@ import SMESH from .putName import putName -def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, - facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, - bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, - edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad): +def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \ + facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \ + bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \ + edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \ + mailleur="MeshGems"): """maillage faces de peau""" logging.info('start') + logging.info(mailleur) nbFacesFilling = len(partitionsPeauFissFond) boutFromIfil = [None for i in range(nbFacesFilling)] if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes @@ -72,12 +74,12 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, logging.info("meshFacePeau %d coupée par la fissure", ifil) facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes) edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe] - verticesCircPeau = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] + _ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe] groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes] - print ("a") + logging.info("a") meshFacePeau = smesh.Mesh(facePeau) algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau) @@ -86,14 +88,13 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, putName(algo1d, "algo1d_bordsLibres", ifil) putName(hypo1d, "hypo1d_bordsLibres", ifil) - print ("b") + logging.info("b") algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau)) hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0) putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil) putName(algo1d, "algo1d_edgePeauFiss", ifil) putName(hypo1d, "hypo1d_edgePeauFiss", ifil) - print ("bordsVifs = {}".format(bordsVifs)) if bordsVifs is not None: algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs) hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0) @@ -102,7 +103,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, putName(hypo1d, "hypo1d_bordsVifs", ifil) for i, edgeCirc in enumerate(edgesCircPeau): - print ("i = {}".format(i)) + logging.info("i = {}".format(i)) if edgeCirc is not None: algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) if boutFromIfil[ifil] is None: @@ -114,15 +115,25 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, putName(algo1d, "algo1d_" + name, ifil) putName(hypo1d, "hypo1d_" + name, ifil) - print ("c") - algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) - hypo2d = algo2d.Parameters() - hypo2d.SetMaxSize( dmoyen ) - hypo2d.SetOptimize( 1 ) - hypo2d.SetFineness( 2 ) - hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) - hypo2d.SetQuadAllowed( 0 ) - print ("d") + logging.info("c") + logging.info("Maillage avec %s", mailleur) + if ( mailleur == "MeshGems"): + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf) + hypo2d = algo2d.Parameters() + hypo2d.SetPhySize( dmoyen ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetMaxSize( dmoyen*2. ) + hypo2d.SetChordalError( dmoyen*0.25 ) + hypo2d.SetVerbosity( 0 ) + else: + algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D) + hypo2d = algo2d.Parameters() + hypo2d.SetMaxSize( dmoyen ) + hypo2d.SetOptimize( 1 ) + hypo2d.SetFineness( 2 ) + hypo2d.SetMinSize( rayonPipe/float(nbsegRad) ) + hypo2d.SetQuadAllowed( 0 ) + logging.info("d") putName(algo2d.GetSubMesh(), "facePeau", ifil) putName(algo2d, "algo2d_facePeau", ifil) putName(hypo2d, "hypo2d_facePeau", ifil) @@ -137,7 +148,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, raise Exception(text) GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil ) - nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) + _ = GroupFaces.AddFrom( meshFacePeau.GetMesh() ) meshesFacesPeau.append(meshFacePeau) return meshesFacesPeau diff --git a/src/Tools/blocFissure/gmu/meshBlocPart.py b/src/Tools/blocFissure/gmu/meshBlocPart.py index 1a6cf33e4..c65742c78 100644 --- a/src/Tools/blocFissure/gmu/meshBlocPart.py +++ b/src/Tools/blocFissure/gmu/meshBlocPart.py @@ -32,7 +32,8 @@ from .putName import putName def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circles, faces, \ gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli, \ aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords, \ - nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, nbsegFis, dmoyen, lensegEllipsoide): + nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, nbsegFis, dmoyen, lensegEllipsoide, \ + mailleur="MeshGems"): """Maillage du bloc partitionné TODO: a completer diff --git a/src/Tools/blocFissure/materielCasTests/genereMateriel.py b/src/Tools/blocFissure/materielCasTests/genereMateriel.py index 9a3298682..a798c67ea 100644 --- a/src/Tools/blocFissure/materielCasTests/genereMateriel.py +++ b/src/Tools/blocFissure/materielCasTests/genereMateriel.py @@ -19,15 +19,15 @@ # from blocFissure.materielCasTests import cubeAngle -from blocFissure.materielCasTests import decoupeCylindre -from blocFissure.materielCasTests import eprouvetteCourbe -from blocFissure.materielCasTests import eprouvetteDroite -from blocFissure.materielCasTests import fissureGauche -from blocFissure.materielCasTests import fissureGauche2 -from blocFissure.materielCasTests import ellipse -from blocFissure.materielCasTests import ellipse_probleme -from blocFissure.materielCasTests import disque_perce -from blocFissure.materielCasTests import ellipse_disque -from blocFissure.materielCasTests import vis -from blocFissure.materielCasTests import cubeFin -from blocFissure.materielCasTests import tube +#from blocFissure.materielCasTests import decoupeCylindre +#from blocFissure.materielCasTests import eprouvetteCourbe +#from blocFissure.materielCasTests import eprouvetteDroite +#from blocFissure.materielCasTests import fissureGauche +#from blocFissure.materielCasTests import fissureGauche2 +#from blocFissure.materielCasTests import ellipse +#from blocFissure.materielCasTests import ellipse_probleme +#from blocFissure.materielCasTests import disque_perce +#from blocFissure.materielCasTests import ellipse_disque +#from blocFissure.materielCasTests import vis +#from blocFissure.materielCasTests import cubeFin +#from blocFissure.materielCasTests import tube