Normes python

This commit is contained in:
GERALD NICOLAS 2021-01-27 18:04:32 +01:00
parent f6ad065a74
commit 37d2759a1c
12 changed files with 117 additions and 128 deletions

View File

@ -18,27 +18,21 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase() import GEOM
import SALOMEDS
import SMESH
class cubeAngle(fissureGenerique): class cubeAngle(fissureGenerique):
"""problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan""" """problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan"""
@ -47,9 +41,10 @@ class cubeAngle(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereMaillageSain(self, geometriesSaines, meshParams): def genereMaillageSain(self, geometriesSaines, meshParams):
logging.info("genereMaillageSain pour '{}'".format(self.nomCas)) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme)) smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -61,14 +56,16 @@ class cubeAngle(fissureGenerique):
lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
""" """
logging.info("setParamShapeFissure pour '{}'".format(self.nomCas)) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
self.shapeFissureParams = dict(lgInfluence = 20, self.shapeFissureParams = dict(lgInfluence = 20,
rayonPipe = 10) rayonPipe = 10)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
"""Importe la géométrie de la fissure""" """Importe la géométrie de la fissure"""
logging.info("genereShapeFissure pour '{}'".format(self.nomCas)) texte = "genereShapeFissure pour '{}'".format(self.nomCas)
logging.info(texte)
lgInfluence = shapeFissureParams['lgInfluence'] lgInfluence = shapeFissureParams['lgInfluence']
@ -87,7 +84,8 @@ class cubeAngle(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
logging.info("setParamMaillageFissure pour '{}'".format(self.nomCas)) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomCas,
nomFicFissure = 'fissure_' + self.nomCas, nomFicFissure = 'fissure_' + self.nomCas,
@ -104,7 +102,8 @@ class cubeAngle(fissureGenerique):
def genereMaillageFissure(self, geometriesSaines, maillagesSains, def genereMaillageFissure(self, geometriesSaines, maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step): maillageFissureParams, elementsDefaut, step):
logging.info("genereMaillageFissure pour '{}'".format(self.nomCas)) texte = "genereMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
maillageFissure = construitFissureGenerale(maillagesSains, maillageFissure = construitFissureGenerale(maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step) maillageFissureParams, elementsDefaut, step)
@ -122,4 +121,3 @@ class cubeAngle(fissureGenerique):
Entity_Quad_Pyramid = 172, \ Entity_Quad_Pyramid = 172, \
Entity_Quad_Penta = 64 \ Entity_Quad_Penta = 64 \
) )

View File

@ -17,6 +17,7 @@
# #
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""problème de fissure plane coupant 2 faces (angle)"""
import os import os
@ -32,8 +33,8 @@ class cubeAngle2(cubeAngle):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamShapeFissure(self): def setParamShapeFissure(self):
""" """paramètres de la fissure pour méthode construitFissureGenerale
paramètres de la fissure pour méthode construitFissureGenerale
lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
""" """
@ -61,4 +62,3 @@ class cubeAngle2(cubeAngle):
Entity_Quad_Pyramid = 620, \ Entity_Quad_Pyramid = 620, \
Entity_Quad_Penta = 512 \ Entity_Quad_Penta = 512 \
) )

View File

@ -18,6 +18,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""problème de fissure plane coupant le cube dans un coin"""
import os import os
from blocFissure import gmu from blocFissure import gmu
@ -45,4 +47,3 @@ referencesMaillageFissure = dict( \
Entity_Quad_Pyramid = 460, \ Entity_Quad_Pyramid = 460, \
Entity_Quad_Penta = 80 \ Entity_Quad_Penta = 80 \
) )

View File

@ -18,6 +18,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""problème de fissure plane coupant le cube au milieu"""
import os import os
from blocFissure import gmu from blocFissure import gmu
@ -45,4 +47,3 @@ referencesMaillageFissure = dict( \
Entity_Quad_Pyramid = 990, \ Entity_Quad_Pyramid = 990, \
Entity_Quad_Penta = 230 \ Entity_Quad_Penta = 230 \
) )

View File

@ -18,6 +18,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""problème de fissure plane coupant le cube au milieu"""
import os import os
from blocFissure import gmu from blocFissure import gmu
@ -45,4 +47,3 @@ referencesMaillageFissure = dict( \
Entity_Quad_Pyramid = 780, \ Entity_Quad_Pyramid = 780, \
Entity_Quad_Penta = 200 \ Entity_Quad_Penta = 200 \
) )

View File

@ -18,27 +18,21 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase() import GEOM
import SALOMEDS
import SMESH
class cylindre(fissureGenerique): class cylindre(fissureGenerique):
"""problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle""" """problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle"""
@ -53,7 +47,7 @@ class cylindre(fissureGenerique):
""" """
logging.info("genereMaillageSain %s", self.nomCas) logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
smesh.SetName(objetSain.GetMesh(), 'objetSain') smesh.SetName(objetSain.GetMesh(), 'objetSain')
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -122,4 +116,3 @@ class cylindre(fissureGenerique):
Entity_Quad_Pyramid = 1110, \ Entity_Quad_Pyramid = 1110, \
Entity_Quad_Penta = 336 \ Entity_Quad_Penta = 336 \
) )

View File

@ -18,25 +18,21 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
import os import os
import logging
from blocFissure import gmu from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
import math
import GEOM import GEOM
import SALOMEDS import SALOMEDS
import SMESH import SMESH
import logging
from .cylindre import cylindre from .cylindre import cylindre
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()
class cylindre_2(cylindre): class cylindre_2(cylindre):
"""problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline""" """problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
@ -72,4 +68,3 @@ class cylindre_2(cylindre):
Entity_Quad_Pyramid = 1158, \ Entity_Quad_Pyramid = 1158, \
Entity_Quad_Penta = 384 \ Entity_Quad_Penta = 384 \
) )

View File

@ -18,6 +18,8 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
"""disque percé"""
import os import os
from blocFissure import gmu from blocFissure import gmu
@ -45,4 +47,3 @@ referencesMaillageFissure = dict ( \
Entity_Quad_Pyramid = 172, \ Entity_Quad_Pyramid = 172, \
Entity_Quad_Penta = 64 \ Entity_Quad_Penta = 64 \
) )

View File

@ -18,27 +18,21 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure non plane, débouchante non normale"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase() import GEOM
import SALOMEDS
import SMESH
class ellipse_1(fissureGenerique): class ellipse_1(fissureGenerique):
"""problème de fissure non plane, débouchante non normale""" """problème de fissure non plane, débouchante non normale"""
@ -53,10 +47,11 @@ class ellipse_1(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereMaillageSain(self, geometriesSaines, meshParams): def genereMaillageSain(self, geometriesSaines, meshParams):
logging.info("genereMaillageSain %s", self.nomCas) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
([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') smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -69,13 +64,16 @@ class ellipse_1(fissureGenerique):
convexe : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne convexe : optionnel, True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
pointIn_x : optionnel, coordonnée x d'un point dans le solide sain (pour orienter la face) pointIn_x : optionnel, coordonnée x d'un point dans le solide sain (pour orienter la face)
""" """
logging.info("setParamShapeFissure %s", self.nomCas) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
self.shapeFissureParams = dict(lgInfluence = 50, self.shapeFissureParams = dict(lgInfluence = 50,
rayonPipe = 20) rayonPipe = 20)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
logging.info("genereShapeFissure %s", self.nomCas) """Importe la géométrie de la fissure"""
texte = "genereShapeFissure pour '{}'".format(self.nomCas)
logging.info(texte)
lgInfluence = shapeFissureParams['lgInfluence'] lgInfluence = shapeFissureParams['lgInfluence']
@ -85,14 +83,16 @@ class ellipse_1(fissureGenerique):
geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25) coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
centre = None centre = None
return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomCas,
nomFicFissure = 'fissure_' + self.nomCas, nomFicFissure = 'fissure_' + self.nomCas,
@ -109,6 +109,8 @@ class ellipse_1(fissureGenerique):
def genereMaillageFissure(self, geometriesSaines, maillagesSains, def genereMaillageFissure(self, geometriesSaines, maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step): maillageFissureParams, elementsDefaut, step):
texte = "genereMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
maillageFissure = construitFissureGenerale(maillagesSains, maillageFissure = construitFissureGenerale(maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step) maillageFissureParams, elementsDefaut, step)
@ -126,4 +128,3 @@ class ellipse_1(fissureGenerique):
Entity_Quad_Pyramid = 199, \ Entity_Quad_Pyramid = 199, \
Entity_Quad_Penta = 120 \ Entity_Quad_Penta = 120 \
) )

View File

@ -18,27 +18,23 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure non plane, débouchante non normale"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from .ellipse_1 import ellipse_1 from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.triedreBase import triedreBase from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase() import GEOM
import SALOMEDS
import SMESH
from .ellipse_1 import ellipse_1
class ellipse_2(ellipse_1): class ellipse_2(ellipse_1):
"""problème de fissure non plane, débouchante non normale""" """problème de fissure non plane, débouchante non normale"""
@ -47,7 +43,9 @@ class ellipse_2(ellipse_1):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
logging.info("genereShapeFissure %s", self.nomCas) """Importe la géométrie de la fissure"""
texte = "genereShapeFissure pour '{}'".format(self.nomCas)
logging.info(texte)
lgInfluence = shapeFissureParams['lgInfluence'] lgInfluence = shapeFissureParams['lgInfluence']
@ -57,10 +55,10 @@ class ellipse_2(ellipse_1):
geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25) coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
centre = None centre = None
return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -18,27 +18,21 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
O, OX, OY, OZ = triedreBase() import GEOM
import SALOMEDS
import SMESH
class eprouvetteCourbe(fissureGenerique): class eprouvetteCourbe(fissureGenerique):
"""problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale""" """problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale"""
@ -47,9 +41,10 @@ class eprouvetteCourbe(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereMaillageSain(self, geometriesSaines, meshParams): def genereMaillageSain(self, geometriesSaines, meshParams):
logging.info("genereMaillageSain %s", self.nomCas) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
smesh.SetName(objetSain.GetMesh(), 'objetSain') smesh.SetName(objetSain.GetMesh(), 'objetSain')
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -63,13 +58,16 @@ class eprouvetteCourbe(fissureGenerique):
convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne convexe : optionnel True : la face est convexe (vue de l'exterieur) sert si on ne donne pas de point interne
pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face) pointIn_x : optionnel coordonnée x d'un point dans le solide sain (pour orienter la face)
""" """
logging.info("setParamShapeFissure %s", self.nomCas) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
self.shapeFissureParams = dict(lgInfluence = 30, self.shapeFissureParams = dict(lgInfluence = 30,
rayonPipe = 10) rayonPipe = 10)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
logging.info("genereShapeFissure %s", self.nomCas) """Importe la géométrie de la fissure"""
texte = "genereShapeFissure pour '{}'".format(self.nomCas)
logging.info(texte)
lgInfluence = shapeFissureParams['lgInfluence'] lgInfluence = shapeFissureParams['lgInfluence']
@ -79,14 +77,16 @@ class eprouvetteCourbe(fissureGenerique):
geompy.addToStudy( shellFiss, 'shellFiss' ) geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' ) geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10) coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10)
centre = None centre = None
return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss] return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomCas,
nomFicFissure = 'fissure_' + self.nomCas, nomFicFissure = 'fissure_' + self.nomCas,
@ -103,6 +103,8 @@ class eprouvetteCourbe(fissureGenerique):
def genereMaillageFissure(self, geometriesSaines, maillagesSains, def genereMaillageFissure(self, geometriesSaines, maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step): maillageFissureParams, elementsDefaut, step):
texte = "genereMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
maillageFissure = construitFissureGenerale(maillagesSains, maillageFissure = construitFissureGenerale(maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step) maillageFissureParams, elementsDefaut, step)
@ -120,4 +122,3 @@ class eprouvetteCourbe(fissureGenerique):
Entity_Quad_Pyramid = 578, \ Entity_Quad_Pyramid = 578, \
Entity_Quad_Penta = 128 \ Entity_Quad_Penta = 128 \
) )

View File

@ -18,26 +18,22 @@
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# #
import os """problème de fissure plane dans un tube"""
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
import math import os
import GEOM
import SALOMEDS
import SMESH
#import StdMeshers
#import GHS3DPlugin
#import NETGENPlugin
import logging import logging
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.fissureGenerique import fissureGenerique from blocFissure.gmu.fissureGenerique import fissureGenerique
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
import GEOM
import SALOMEDS
import SMESH
class tube(fissureGenerique): class tube(fissureGenerique):
"""problème de fissure plane dans un tube""" """problème de fissure plane dans un tube"""
@ -45,9 +41,10 @@ class tube(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereMaillageSain(self, geometriesSaines, meshParams): def genereMaillageSain(self, geometriesSaines, meshParams):
logging.info("genereMaillageSain pour '{}'".format(self.nomCas)) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
([objetSain], status) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med")) ([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme)) smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
return [objetSain, True] # True : maillage hexa return [objetSain, True] # True : maillage hexa
@ -59,18 +56,19 @@ class tube(fissureGenerique):
lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage) lgInfluence : distance autour de la shape de fissure a remailler (A ajuster selon le maillage)
rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure rayonPipe : le rayon du pile maillé en hexa autour du fond de fissure
""" """
logging.info("setParamShapeFissure pour '{}'".format(self.nomCas)) texte = "genereMaillageSain pour '{}'".format(self.nomCas)
logging.info(texte)
self.shapeFissureParams = dict(lgInfluence = 1., self.shapeFissureParams = dict(lgInfluence = 1.,
rayonPipe = 0.05) rayonPipe = 0.05)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams): def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
"""Importe la géométrie de la fissure""" """Importe la géométrie de la fissure"""
logging.info("genereShapeFissure pour '{}'".format(self.nomCas)) texte = "genereShapeFissure pour '{}'".format(self.nomCas)
logging.info(texte)
lgInfluence = shapeFissureParams['lgInfluence'] lgInfluence = shapeFissureParams['lgInfluence']
(_, shellFiss, _, l_groups, _) = geompy.ImportXAO(os.path.join(gmu.pathBloc, "materielCasTests", "TubeFiss.xao")) (_, shellFiss, _, l_groups, _) = geompy.ImportXAO(os.path.join(gmu.pathBloc, "materielCasTests", "TubeFiss.xao"))
l_aux = list() l_aux = list()
for group in l_groups: for group in l_groups:
@ -89,7 +87,8 @@ class tube(fissureGenerique):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
def setParamMaillageFissure(self): def setParamMaillageFissure(self):
logging.info("setParamMaillageFissure pour '{}'".format(self.nomCas)) texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir, self.maillageFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas, nomFicSain = self.nomCas,
nomFicFissure = 'fissure_' + self.nomCas, nomFicFissure = 'fissure_' + self.nomCas,
@ -106,7 +105,8 @@ class tube(fissureGenerique):
def genereMaillageFissure(self, geometriesSaines, maillagesSains, def genereMaillageFissure(self, geometriesSaines, maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step): maillageFissureParams, elementsDefaut, step):
logging.info("genereMaillageFissure pour '{}'".format(self.nomCas)) texte = "genereMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
maillageFissure = construitFissureGenerale(maillagesSains, maillageFissure = construitFissureGenerale(maillagesSains,
shapesFissure, shapeFissureParams, shapesFissure, shapeFissureParams,
maillageFissureParams, elementsDefaut, step) maillageFissureParams, elementsDefaut, step)
@ -124,4 +124,3 @@ class tube(fissureGenerique):
Entity_Quad_Pyramid = 172, \ Entity_Quad_Pyramid = 172, \
Entity_Quad_Penta = 64 \ Entity_Quad_Penta = 64 \
) )