logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 10)
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 32,
areteFaceFissure = 5)
from blocFissure import gmu
dicoParams = dict(nomCas = "cubeCoin",
+ nomProbleme = "cubeCoin",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Coin.brep"),
edgeFiss = [3],
from blocFissure import gmu
dicoParams = dict(nomCas = "cubeMilieu",
+ nomProbleme = "cubeMilieu",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Milieu.brep"),
edgeFiss = [3],
from blocFissure import gmu
dicoParams = dict(nomCas = "cubeTransverse",
+ nomProbleme = "cubeTransverse",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Transverse.brep"),
edgeFiss = [6],
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 20)
from blocFissure import gmu
dicoParams = dict(nomCas = 'disque',
+ nomProbleme = "disque",
maillageSain = os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"),
CAOFaceFissure = os.path.join(gmu.pathBloc, "materielCasTests", "ellipse_disque.brep"),
edgeFiss = [3],
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 1000)
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 15)
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 15)
"""Calcul de tous les cas"""
ligne = "---------------------------------------------------------------------"
- texte = ""
+ texte = "\n"
nb_cas_ok = 0
nb_cas_nook = 0
for n_cas, cas in enumerate(l_problemes):
else:
texte += "Les {} tests se sont bien passés.\n".format(nb_cas)
print (texte+ligne)
+ logging.critical(ligne+texte)
return
#=============================================================
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 1000)
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 1000)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 6,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 3,
nbsegCercle = 8,
areteFaceFissure = 2.5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 6,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 6,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 6,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 12,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 12,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 4,
nbsegCercle = 16,
areteFaceFissure = 5)
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 6,
nbsegCercle = 20,
areteFaceFissure = 2.5)
# ---------------------------------------------------------------------------
def genereGeometrieSaine(self, geomParams):
+ """a écrire"""
logging.info("genereGeometrieSaine %s", self.nomCas)
angleCoude = geomParams['angleCoude']
P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
geomPublish(initLog.always, P2, "P2", self.numeroCas )
-
# --- tube coude sain
geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
vec2 = geompy.MakeVector(P2, pp2)
- #geomPublish(initLog.debug,vec2, 'vec2')
+ #geomPublish(initLog.debug, vec2, 'vec2', self.numeroCas)
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(CLGV, facesIds)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
interne = geompy.MakeFuse(extru1, revol1)
interne = geompy.MakeFuse(extru2, interne)
- geomPublish(initLog.debug,interne, 'interne')
+ geomPublish(initLog.debug, interne, 'interne', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUINT, facesIds)
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
- geomPublish(initLog.debug,externe, 'externe')
+ geomPublish(initLog.debug, externe, 'externe', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUEXT, facesIds)
n_long_p2 = meshParams['n_long_p2']
maillageSain = smesh.Mesh(geometrieSaine)
+ putName(maillageSain, "maillageSain", i_pref=self.numeroCas)
algo3d = maillageSain.Hexahedron()
algo2d = maillageSain.Quadrangle()
- putName(algo3d, "3d_maillageSain", i_pref=self.numeroCas)
- putName(algo2d, "2d_maillageSain", i_pref=self.numeroCas)
algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
- putName(algo1d_long_p1, "algo1d_long_p1", i_pref=self.numeroCas)
- putName(hypo1d_long_p1, "hypo1d_long_p1", i_pref=self.numeroCas)
+ putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas)
algo1d_ep = maillageSain.Segment(geom=ep)
hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
- putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas)
- putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas)
+ putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas)
algo1d_long_coude = maillageSain.Segment(geom=long_coude)
hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
- putName(algo1d_long_coude, "algo1d_long_coude", i_pref=self.numeroCas)
- putName(hypo1d_long_coude, "hypo1d_long_coude", i_pref=self.numeroCas)
+ putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas)
algo1d_circ_g = maillageSain.Segment(geom=circ_g)
hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
- putName(algo1d_circ_g, "algo1d_circ_g", i_pref=self.numeroCas)
- putName(hypo1d_circ_g, "hypo1d_circ_g", i_pref=self.numeroCas)
+ putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas)
algo1d_circ_d = maillageSain.Segment(geom=circ_d)
hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
- putName(algo1d_circ_d, "algo1d_circ_d", i_pref=self.numeroCas)
- putName(hypo1d_circ_d, "hypo1d_circ_d", i_pref=self.numeroCas)
+ putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas)
algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
- putName(algo1d_long_p2, "algo1d_long_p2", i_pref=self.numeroCas)
- putName(hypo1d_long_p2, "hypo1d_long_p2", i_pref=self.numeroCas)
+ putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas)
_ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
_ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
_ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
_ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
- _ = maillageSain.Compute()
+ is_done = maillageSain.Compute()
+ text = "maillageSain.Compute"
+ if is_done:
+ logging.info(text+" OK")
+ else:
+ text = "Erreur au calcul du maillage.\n" + text
+ logging.info(text)
+ raise Exception(text)
return [maillageSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamShapeFissure(self):
"""
- paramètres de la fissure
+ paramètres de la fissure pour le tuyau coude
profondeur : 0 < profondeur <= épaisseur
azimut : entre 0 et 360°
alpha : 0 < alpha < angleCoude
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegExt = 5,
nbsegGen = 25,
nbsegRad = 5,
"""
self.shapeFissureParams = dict(nomRep = os.curdir,
nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicFissure = self.nomProbleme + "_fissure",
profondeur = 10,
azimut = 90,
alpha = 20,
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 8,
areteFaceFissure = 0.5)
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "visSain.med"))
- putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), self.nomProbleme, i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
texte = "setParamMaillageFissure pour '{}'".format(self.nomCas)
logging.info(texte)
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = self.nomCas + "_fissure",
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 32,
areteFaceFissure = 0.1)
meshFondFiss = smesh.Mesh(wireFondFiss)
putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas)
algo1d = meshFondFiss.Segment()
- hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas)
- putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas)
+ hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
+ putName(hypo1d, "Adaptive_wireFondFiss", i_pref=nro_cas)
is_done = meshFondFiss.Compute()
text = "calculePointsAxiauxPipe meshFondFiss.Compute"
referencesMaillageFissure = None
# ---------------------------------------------------------------------------
- def __init__ (self, dicoParams, references = None, numeroCas = 0):
+ def __init__ (self, dicoParams, references = None, numeroCas = None):
initEtude()
self.references = references
self.dicoParams = dicoParams
+ self.numeroCas = numeroCas
+
+ if 'nomProbleme' in self.dicoParams:
+ self.nomProbleme = self.dicoParams['nomProbleme']
+
if 'nomCas' in self.dicoParams:
self.nomCas = self.dicoParams['nomCas']
elif 'nomres' in self.dicoParams:
self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0]
+ elif ( self.numeroCas is not None ):
+ self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
else:
self.nomCas = 'casStandard'
+
if 'reptrav' in self.dicoParams:
self.reptrav = self.dicoParams['reptrav']
else:
self.reptrav = os.curdir
- self.numeroCas = numeroCas
- if self.numeroCas != 0:
- self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
- else:
- self.nomProbleme = self.nomCas
+
if 'lenSegPipe' in self.dicoParams:
self.lenSegPipe = self.dicoParams['lenSegPipe']
else:
- self.lenSegPipe =self.dicoParams['rayonPipe']
+ self.lenSegPipe = self.dicoParams['rayonPipe']
+
if 'step' in self.dicoParams:
step = self.dicoParams['step']
else:
step = -1 # exécuter toutes les étapes
+
if 'aretesVives' not in self.dicoParams:
self.dicoParams['aretesVives'] = 0
- if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
+
+ # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes
+ if ( self.numeroCas is None ):
self.executeProbleme(step)
# ---------------------------------------------------------------------------
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(self.dicoParams['maillageSain'])
- putName(objetSain.GetMesh(), 'objetSain', i_pref=self.numeroCas)
+ putName(objetSain.GetMesh(), objetSain.GetName(), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
def setParamMaillageFissure(self):
self.maillageFissureParams = dict(nomRep = self.reptrav,
- nomFicSain = self.nomCas +'_sain',
- nomFicFissure = self.nomCas,
+ nomFicSain = self.nomCas,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = self.dicoParams['nbSegRad'],
nbsegCercle = self.dicoParams['nbSegCercle'],
areteFaceFissure = self.dicoParams['areteFaceFissure'],
hypo3d.SetStandardOutputLog( 0 )
hypo3d.SetRemoveLogOnSuccess( 1 )
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
- putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute()
text = "meshBoiteDefaut.Compute"
_, normfiss = shapeSurFissure(facesPortFissure)
maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \
None, None, 'COMPLET', normfiss)
+ putName(maillageComplet, nomFicFissure)
logging.info("conversion quadratique")
maillageComplet.ConvertToQuadratic( 1 )
+
logging.info("groupes")
groups = maillageComplet.GetGroups()
grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
logging.info("export maillage fini")
fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure))
maillageComplet.ExportMED(fichierMaillageFissure)
- putName(maillageComplet, nomFicFissure)
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
return maillageComplet
#
"""Fissure dans un coude"""
-import os
-
import logging
+import os
import math
+
import GEOM
import SMESH
n_long_p2 = meshParams['n_long_p2']
maillageSain = smesh.Mesh(geometrieSaine)
+ putName(maillageSain, "maillageSain", i_pref=self.numeroCas)
algo3d = maillageSain.Hexahedron()
algo2d = maillageSain.Quadrangle()
- putName(algo3d, "{}_3d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
- putName(algo2d, "{}_2d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
- putName(algo1d_long_p1, "algo1d_long_p1", i_pref=self.numeroCas)
- putName(hypo1d_long_p1, "hypo1d_long_p1", i_pref=self.numeroCas)
+ putName(hypo1d_long_p1, "n_long_p1={}".format(n_long_p1), i_pref=self.numeroCas)
algo1d_ep = maillageSain.Segment(geom=ep)
hypo1d_ep = algo1d_ep.NumberOfSegments(n_ep)
- putName(algo1d_ep, "algo1d_ep", i_pref=self.numeroCas)
- putName(hypo1d_ep, "hypo1d_ep", i_pref=self.numeroCas)
+ putName(hypo1d_ep, "n_ep={}".format(n_ep), i_pref=self.numeroCas)
algo1d_long_coude = maillageSain.Segment(geom=long_coude)
hypo1d_long_coude = algo1d_long_coude.NumberOfSegments(n_long_coude)
- putName(algo1d_long_coude, "algo1d_long_coude", i_pref=self.numeroCas)
- putName(hypo1d_long_coude, "hypo1d_long_coude", i_pref=self.numeroCas)
+ putName(hypo1d_long_coude, "n_long_coude={}".format(n_long_coude), i_pref=self.numeroCas)
algo1d_circ_g = maillageSain.Segment(geom=circ_g)
hypo1d_circ_g = algo1d_circ_g.NumberOfSegments(n_circ_g)
- putName(algo1d_circ_g, "algo1d_circ_g", i_pref=self.numeroCas)
- putName(hypo1d_circ_g, "hypo1d_circ_g", i_pref=self.numeroCas)
+ putName(hypo1d_circ_g, "n_circ_g={}".format(n_circ_g), i_pref=self.numeroCas)
algo1d_circ_d = maillageSain.Segment(geom=circ_d)
hypo1d_circ_d = algo1d_circ_d.NumberOfSegments(n_circ_d)
- putName(algo1d_circ_d, "algo1d_circ_d", i_pref=self.numeroCas)
- putName(hypo1d_circ_d, "hypo1d_circ_d", i_pref=self.numeroCas)
+ putName(hypo1d_circ_d, "n_circ_d={}".format(n_circ_d), i_pref=self.numeroCas)
algo1d_long_p2 = maillageSain.Segment(geom=long_p2)
hypo1d_long_p2 = algo1d_long_p2.NumberOfSegments(n_long_p2)
- putName(algo1d_long_p2, "algo1d_long_p2", i_pref=self.numeroCas)
- putName(hypo1d_long_p2, "hypo1d_long_p2", i_pref=self.numeroCas)
-
- is_done = maillageSain.Compute()
- text = "maillageSain.Compute"
- if is_done:
- logging.info(text+" OK")
- else:
- text = "Erreur au calcul du maillage.\n" + text
- logging.info(text)
- raise Exception(text)
+ putName(hypo1d_long_p2, "n_long_p2={}".format(n_long_p2), i_pref=self.numeroCas)
_ = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
_ = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
_ = maillageSain.GroupOnGeom(PEAUEXT,'PEAUEXT',SMESH.FACE)
_ = maillageSain.GroupOnGeom(COUDE,'COUDSAIN',SMESH.VOLUME)
+ is_done = maillageSain.Compute()
+ text = "maillageSain.Compute"
+ if is_done:
+ logging.info(text+" OK")
+ else:
+ text = "Erreur au calcul du maillage.\n" + text
+ logging.info(text)
+ raise Exception(text)
+
return [maillageSain, True] # True : maillage hexa
# ---------------------------------------------------------------------------
azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
- geomPublish(initLog.debug, axe,"axe", self.numeroCas)
+ geomPublish(initLog.debug, axe, "axe", self.numeroCas)
if not lgInfluence:
lgInfluence = profondeur
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir,
- nomFicSain = self.nomCas,
- nomFicFissure = 'fissure_' + self.nomCas,
+ nomFicSain = self.nomProbleme,
+ nomFicFissure = self.nomProbleme + "_fissure",
nbsegRad = 5,
nbsegCercle = 6,
areteFaceFissure = 5)
maillagesCoupes = list()
# On crée une liste contenant le maillage de chaque face.
- listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners)
+ listOfNewMeshes = createNewMeshesFromCorner(maillageDefautCible, listOfCorners, nro_cas)
i_aux = 0
while i_aux < len(listOfNewMeshes):
listOfInternMeshes = [maillageInterneCible] + [msh.GetMesh() for msh in maillagesNonCoupes]
newMaillageInterne = smesh.Concatenate(listOfInternMeshes, 1, 1, 1e-05, False)
+ putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas)
facesEnTrop = list()
criteres = [smesh.GetCriterion(SMESH.FACE, SMESH.FT_BelongToGenSurface, SMESH.FT_Undefined, face) for face in facesNonCoupees]
newZoneDefaut_skin = maillageSain.GetMesh().CutListOfGroups([zoneDefaut_skin], facesEnTrop, 'newZoneDefaut_skin')
- putName(newMaillageInterne, 'newInternalBoundary', i_pref=nro_cas)
-
return newZoneDefaut_skin, newMaillageInterne
hypo2d.SetChordalError( maxSize*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 )
- putName(algo2d, "{}_2d_zoneFiss".format(mailleur), i_pref=nro_cas)
- putName(hypo2d, "hypo1d_zoneFiss", i_pref=nro_cas)
+ putName(hypo2d, "zoneFiss", i_pref=nro_cas)
is_done = meshFissure.Compute()
text = "meshFissure.Compute"
putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas)
algo3d = meshFondFiss.Prism()
- putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas)
- putName(algo3d, "Prism", i_pref=nro_cas)
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
- putName(algo2d, "QUADRANGLE", i_pref=nro_cas)
for i_aux, face in enumerate(disques):
#print (i_aux)
# la commande suivante entraîne addToStudy() failed
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face)
putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas)
- putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas)
for i_aux, edge in enumerate(rayons):
algo1d = meshFondFiss.Segment(geom=edge)
- hypo1d = algo1d.NumberOfSegments(4)
putName(algo1d.GetSubMesh(), "rayon", i_aux, nro_cas)
- putName(algo1d, "algo1d_rayon", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_rayon", i_aux, nro_cas)
+ hypo1d = algo1d.NumberOfSegments(4)
+ putName(hypo1d, "rayon={}".format(4), i_aux, nro_cas)
for i_aux, edge in enumerate(demiCercles):
algo1d = meshFondFiss.Segment(geom=edge)
- hypo1d = algo1d.NumberOfSegments(6)
putName(algo1d.GetSubMesh(), "demiCercle", i_aux, nro_cas)
- putName(algo1d, "algo1d_demiCercle", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_demiCercle", i_aux, nro_cas)
+ hypo1d = algo1d.NumberOfSegments(6)
+ putName(hypo1d, "demiCercle={}".format(6), i_aux, nro_cas)
generSorted, minlg, maxlg = sortEdges(generatrices)
nbSegGenLong = int(math.sqrt(3.0)*maxlg/(profondeur - rayonPipe)) # on veut 2 triangles equilateraux dans la largeur de la face
logging.info("min %s, max %s, nombre de segments %s, nombre de generatrices %s", minlg, maxlg, nbSegGenLong, len(generSorted))
for i_aux, edge in enumerate(generSorted):
algo1d = meshFondFiss.Segment(geom=edge)
+ putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas)
if i_aux < 6:
- hypo1d = algo1d.NumberOfSegments(nbSegGenBout)
+ nbSeg = nbSegGenBout
else:
- hypo1d = algo1d.NumberOfSegments(nbSegGenLong)
- putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas)
- putName(algo1d, "algo1d_generatrice", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_generatrice", i_aux, nro_cas)
+ nbSeg = nbSegGenLong
+ hypo1d = algo1d.NumberOfSegments(nbSeg)
+ putName(hypo1d, "generatrice={}".format(nbSeg), i_aux, nro_cas)
disks = list()
for i_aux, face in enumerate(disques[:4]):
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 )
putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas)
- putName(algo2d, "{}_2d_facePeau".format(mailleur), i_pref=nro_cas)
- putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas)
+ putName(hypo2d, "facePeau", i_pref=nro_cas)
#
lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0]
frac = profondeur/lenEdgePeauFiss
hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] )
putName(algo1d.GetSubMesh(), "edgePeauFiss", i_pref=nro_cas)
- putName(algo1d, "algo1d_edgePeauFiss", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_edgePeauFiss", i_pref=nro_cas)
+ putName(hypo1d, "edgePeauFiss", i_pref=nro_cas)
#
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
- putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas)
+ putName(hypo1d, "bordsLibres", i_pref=nro_cas)
#
for i_aux in range(2):
algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i_aux])
hypo1d = algo1d.SourceEdges([ groups_demiCercles[i_aux] ],0,0)
putName(algo1d.GetSubMesh(), "DemiCercles", i_aux, nro_cas)
- putName(algo1d, "algo1d_groupDemiCercles", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_groupDemiCercles", i_aux, nro_cas)
+ putName(hypo1d, "groupDemiCercles", i_aux, nro_cas)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 )
putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas)
- putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas)
- putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
+ putName(hypo2d, "faceFiss", i_pref=nro_cas)
#
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss)
hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
- putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
+ putName(hypo1d, "edgeFissPeau", i_pref=nro_cas)
#
algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe)
hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
- putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
+ putName(hypo1d, "edgeFissPeau", i_pref=nro_cas)
_ = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)
hypo3d.SetStandardOutputLog( 0 )
hypo3d.SetRemoveLogOnSuccess( 1 )
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
- putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute()
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-"""Cette fonction permet de scanner la liste de noeuds qui composent le maillage passé en paramètre
+"""Fonctions générrales sur les maillages
Created on Mon Jun 23 14:49:36 2014
@author: I48174 (Olivier HOAREAU)
"""
import logging
+
import SMESH
from .geomsmesh import smesh
+from .putName import putName
+
def lookForCorner(maillageAScanner):
""" Cette fonction permet de scanner la liste de noeuds qui composent le
return nodelines
-def createNewMeshesFromCorner(maillageSupport, listOfCorners):
+def createNewMeshesFromCorner(maillageSupport, listOfCorners, \
+ nro_cas=None):
""" Cette fonction permet de générer un nouveau maillage plus facile à
utiliser. On démarre d'un coin et on récupère les trois éléments
tmp = list()
listOfNewMeshes = list()
+ n_msh = -1
for corner in listOfCorners:
elems = maillageSupport.GetNodeInverseElements(corner)
- for i_aux, elem in enumerate(elems):
+ for elem in elems:
# --- Filtre selon le critère 'coplanar' --- #
critere = smesh.GetCriterion(SMESH.FACE, SMESH.FT_CoplanarFaces, \
SMESH.FT_Undefined, elem, SMESH.FT_Undefined, SMESH.FT_Undefined, 30)
filtre = smesh.GetFilterFromCriteria([critere])
- grp = maillageSupport.GroupOnFilter(SMESH.FACE, 'grp', filtre)
+ n_msh += 1
+ nom = "coin_{}".format(n_msh)
+ grp = maillageSupport.GroupOnFilter(SMESH.FACE, nom, filtre)
# On copie le maillage en fonction du filtre
- msh = smesh.CopyMesh(grp, 'new_{0}'.format(i_aux+1), False, True)
+ msh = smesh.CopyMesh(grp, nom, False, True)
+ putName(msh, nom, i_pref=nro_cas)
# On stocke l'ensemble des noeuds du maillage dans tmp
# On ajoute le maillage à la liste des nouveaux maillages
# seulement s'il n'y est pas déjà
tmp.append(msh.GetNodesId())
if ( tmp.count(msh.GetNodesId()) <= 1 ):
+ putName(msh, "Face", len(listOfNewMeshes), nro_cas)
listOfNewMeshes.append(msh)
return listOfNewMeshes
geomPublish(initLog.always, aretesVivesC, "aretesVives", nro_cas)
meshAretesVives = smesh.Mesh(aretesVivesC)
algo1d = meshAretesVives.Segment()
- hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)
putName(algo1d.GetSubMesh(), "aretesVives", i_pref=nro_cas)
- putName(algo1d, "algo1d_aretesVives", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_aretesVives", i_pref=nro_cas)
+ hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)
+ putName(hypo1d, "aretesVives={}".format(lgAretesVives), i_pref=nro_cas)
is_done = meshAretesVives.Compute()
text = "meshAretesVives.Compute"
hypo2d.SetChordalError( areteFaceFissure*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 )
- putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas)
- putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
+ putName(hypo2d, "faceFiss", i_pref=nro_cas)
logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName())
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
- putName(algo1d, "edgeFissPeau_UseExisting1DElements", i_pref=nro_cas)
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
- putName(hypo1d, "edgeFissPeau_SourceEdges", i_pref=nro_cas)
+ putName(hypo1d, "SourceEdges_edgeFissPeau", i_pref=nro_cas)
grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
hypo2d.SetChordalError( dmoyen*0.25 )
hypo2d.SetUseSurfaceCurvature (True)
hypo2d.SetQuadAllowed( 0 )
- putName(algo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas)
- putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas)
+ putName(hypo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas)
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
logging.info("UseExisting1DElements depuis '%s'", groupEdgesBordPeau.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
- hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
- putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
- putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
else:
logging.info("UseExisting1DElements depuis groupEdgesBordPeau = '%s'", groupEdgesBordPeau.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
- hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
- putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
- putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(hypo1d, "SourceEdges_{}".format(bordsLibres.GetName()), ifil, nro_cas)
objet = geompy.MakeCompound(edgesFissurePeau)
geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
logging.info("UseExisting1DElements depuis objet = '%s'", objet.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
- hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas)
- putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas)
- putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas)
+ hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
+ putName(hypo1d, "SourceEdges_{}".format(grpEdgesPeauFissureExterne.GetName()), ifil, nro_cas)
if bordsVifs is not None:
logging.info("UseExisting1DElements depuis bordsVifs = '%s'", bordsVifs.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
- hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
- putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas)
- putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas)
+ hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
+ putName(hypo1d, "SourceEdges_{}".format(grpAretesVives.GetName()), ifil, nro_cas)
for i_aux, edgeCirc in enumerate(edgesCircPeau):
texte = "i_aux = {}".format(i_aux)
if edgeCirc is not None:
logging.info("UseExisting1DElements depuis edgeCirc = '%s'", edgeCirc.GetName())
algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ?
+ name = "cercle{}".format(i_aux)
+ putName(algo1d.GetSubMesh(), name, ifil, nro_cas)
if boutFromIfil[ifil] is None:
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0)
else:
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0)
- name = "cercle{}".format(i_aux)
- putName(algo1d.GetSubMesh(), name, ifil, nro_cas)
- putName(algo1d, "algo1d_" + name, ifil, nro_cas)
- putName(hypo1d, "hypo1d_" + name, ifil, nro_cas)
+ putName(hypo1d, "SourceEdges_" + name, ifil, nro_cas)
is_done = meshFacePeau.Compute()
text = "meshFacePeau {} .Compute".format(ifil)
for i_aux, sharedFaces_i in enumerate(sharedFaces):
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN, geom=sharedFaces_i)
+ putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas)
hypo2d = algo2d.Parameters(which=smesh.SIMPLE)
hypo2d.SetLocalLength(lensegEllipsoide)
hypo2d.LengthFromEdges()
hypo2d.SetAllowQuadrangles(0)
- putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas)
- putName(algo2d, "{}_2d_sharedFaces".format(mailleur), i_aux, nro_cas)
- putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas)
+ putName(hypo2d, "sharedFaces", i_aux, nro_cas)
for i_aux, sharedEdges_i in enumerate(sharedEdges):
algo1d = bloc1.Segment(geom=sharedEdges_i)
- hypo1d = algo1d.LocalLength(lensegEllipsoide)
putName(algo1d.GetSubMesh(), "sharedEdges", i_aux, nro_cas)
- putName(algo1d, "algo1d_sharedEdges", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_sharedEdges", i_aux, nro_cas)
+ hypo1d = algo1d.LocalLength(lensegEllipsoide)
+ putName(hypo1d, "sharedEdges={}".format(lensegEllipsoide), i_aux, nro_cas)
declareAlgoEllipsoideFirst = False
if declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
- hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
- putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas)
- putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(hypo3d, "ellipsoide", i_pref=nro_cas)
algo3d = bloc1.Prism(geom=tore)
+ putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas)
algo2d = bloc1.Quadrangle(geom=tore)
algo1d = bloc1.Segment(geom=tore)
hypo1d = algo1d.NumberOfSegments(nbsegGen)
- putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas)
- putName(algo3d, "{}_3d_tore".format(mailleur), i_pref=nro_cas)
- putName(algo2d, "{}_2d_tore".format(mailleur), i_pref=nro_cas)
- putName(algo1d, "algo1d_tore", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_tore", i_pref=nro_cas)
+ putName(hypo1d, "tore={}".format(nbsegGen), i_pref=nro_cas)
for i_aux, faces_i in enumerate(faces):
algo2d = bloc1.Quadrangle(geom=faces_i)
+ putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas)
hypo2d = smesh.CreateHypothesis('QuadrangleParams')
hypo2d.SetTriaVertex( geompy.GetSubShapeID(blocPartition,centres[i_aux]) )
hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD )
_ = bloc1.AddHypothesis(hypo2d,faces_i)
- putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas)
- putName(algo2d, "{}_2d_faces".format(mailleur), i_aux, nro_cas)
- putName(hypo2d, "hypo2d_faces", i_aux, nro_cas)
+ putName(hypo2d, "faces", i_aux, nro_cas)
for i_aux, edges_i in enumerate(edges):
algo1d = bloc1.Segment(geom=edges_i)
+ putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas)
if reverses[i_aux] > 0:
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ geompy.GetSubShapeID(blocPartition,edges_i) ])
else:
hypo1d = algo1d.NumberOfSegments(nbsegRad, scaleRad,[ ])
- putName(algo1d.GetSubMesh(), "edges", i_aux, nro_cas)
- putName(algo1d, "algo1d_edges", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_edges", i_aux, nro_cas)
+ putName(hypo1d, "edges", i_aux, nro_cas)
for i_aux, circles_i in enumerate(circles):
algo1d = bloc1.Segment(geom=circles_i)
- hypo1d = algo1d.NumberOfSegments(nbsegCercle)
putName(algo1d.GetSubMesh(), "circles", i_aux, nro_cas)
- putName(algo1d, "algo1d_circles", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_circles", i_aux, nro_cas)
+ hypo1d = algo1d.NumberOfSegments(nbsegCercle)
+ putName(hypo1d, "circles={}".format(nbsegCercle), i_aux, nro_cas)
if len(edgeext) == 1:
densite = int(round(nbsegFis/2))
algo1d = bloc1.Segment(geom=edgeext[0])
+ putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas)
hypo1d = algo1d.NumberOfSegments(nbsegFis)
hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, densite, 0.4, 1, 0.6, 1, 1, densite ] )
- putName(algo1d.GetSubMesh(), "edgeext", i_pref=nro_cas)
- putName(algo1d, "algo1d_edgeext", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_edgeext", i_pref=nro_cas)
+ putName(hypo1d, "edgeext", i_pref=nro_cas)
else:
longTotal = 0
longEdgeExts = list()
nbLocal = int(round(nbsegFis*longEdgeExts[i_aux]/longTotal))
densite = int(round(nbLocal/2))
algo1d = bloc1.Segment(geom=edgeext_i)
+ putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas)
hypo1d = algo1d.NumberOfSegments(nbLocal)
hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, densite, 0.8, 1, 1, 1 ] )
if reverext[i_aux]:
hypo1d.SetReversedEdges([ geompy.GetSubShapeID(blocPartition, edgeext_i) ])
- putName(algo1d.GetSubMesh(), "edgeext", i_aux, nro_cas)
- putName(algo1d, "algo1d_edgeext", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_edgeext", i_aux, nro_cas)
+ putName(hypo1d, "edgeext", i_aux, nro_cas)
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore)
- hypo2d = algo2d.LengthFromEdges()
putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas)
- putName(algo2d, "{}_2d_facefissoutore".format(mailleur), i_pref=nro_cas)
- putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas)
+ hypo2d = algo2d.LengthFromEdges()
+ putName(hypo2d, "facefissoutore", i_pref=nro_cas)
maxElemArea = 0.5*dmoyen*dmoyen
for i_aux, facesExternes_i in enumerate(facesExternes):
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facesExternes_i)
+ putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas)
hypo2d = algo2d.MaxElementArea(maxElemArea)
+ putName(hypo2d, "facesExternes={}".format(maxElemArea), i_aux, nro_cas)
if edgesBords is None:
algo1d = bloc1.Segment(geom=facesExternes_i)
hypo1d = algo1d.NumberOfSegments(1)
- putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas)
- putName(algo2d, "{}2d_facesExternes".format(mailleur), i_aux, nro_cas)
- putName(hypo2d, "hypo2d_facesExternes", i_aux, nro_cas)
- if edgesBords is None:
- putName(algo1d, "algo1d_facesExternes", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_facesExternes", i_aux, nro_cas)
+ putName(hypo1d, "facesExternes", i_aux, nro_cas)
for i_aux, aretesInternes_i in enumerate(aretesInternes):
algo1d = bloc1.Segment(geom=aretesInternes_i)
- hypo1d = algo1d.NumberOfSegments(nbsegExt)
putName(algo1d.GetSubMesh(), "aretesInternes", i_aux, nro_cas)
- putName(algo1d, "algo1d_aretesInternes", i_aux, nro_cas)
- putName(hypo1d, "hypo1d_aretesInternes", i_aux, nro_cas)
+ hypo1d = algo1d.NumberOfSegments(nbsegExt)
+ putName(hypo1d, "aretesInternes={}".format(nbsegExt), i_aux, nro_cas)
if edgesBords is not None:
algo1d = bloc1.UseExisting1DElements(geom=edgesBords)
- hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
- putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas)
- putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas)
+ hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
+ putName(hypo1d, "bordsLibres", i_pref=nro_cas)
if not declareAlgoEllipsoideFirst:
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
- hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
- putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas)
- putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(hypo3d, "ellipsoide", i_pref=nro_cas)
_ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE)
_ = bloc1.GroupOnGeom(gencnt,'nfondfis',SMESH.NODE)
blocMesh = smesh.Concatenate(meshesBloc, 1, 1, 1e-05,False)
algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN)
- hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas)
- putName(algo3d, "{}_3d_bloc".format(mailleur), i_pref=nro_cas)
- putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas)
+ hypo3d = algo3d.MaxElementVolume(1000.0)
+ putName(hypo3d, "bloc", i_pref=nro_cas)
is_done = blocMesh.Compute()
text = "blocMesh.Compute"
#for grp in groups:
#print ("\t{}".format(grp.GetName()))
zoneDefaut = None
- for grp in groups:
- logging.debug("groupe %s",grp.GetName())
- if grp.GetName() == nomZones + "_vol":
- zoneDefaut = grp
- break
- #print ("zoneDefaut = {}".format(zoneDefaut))
zoneDefaut_skin = None
- for grp in groups:
- if grp.GetName() == nomZones + "_skin":
- zoneDefaut_skin = grp
- break
- #print ("zoneDefaut_skin = {}".format(zoneDefaut_skin))
zoneDefaut_internalFaces = None
- for grp in groups:
- if grp.GetName() == nomZones + "_internalFaces":
- zoneDefaut_internalFaces = grp
- break
- #print ("zoneDefaut_internalFaces = {}".format(zoneDefaut_internalFaces))
zoneDefaut_internalEdges = None
for grp in groups:
- if grp.GetName() == nomZones + "_internalEdges":
+ nom = grp.GetName()
+ logging.debug("groupe %s",nom)
+ if ( nom == nomZones + "_vol" ):
+ zoneDefaut = grp
+ elif ( nom == nomZones + "_skin" ):
+ zoneDefaut_skin = grp
+ elif ( nom == nomZones + "_internalFaces" ):
+ zoneDefaut_internalFaces = grp
+ elif ( nom == nomZones + "_internalEdges" ):
zoneDefaut_internalEdges = grp
- break
- #print ("zoneDefaut_internalEdges = {}".format(zoneDefaut_internalEdges))
-
# --- Le groupe ZoneDefaut ne doit contenir que des Hexaèdres"
info = maillageSain.GetMeshInfo(zoneDefaut)
logging.debug(texte)
if listOfCorner:
logging.info("présence de coins à la surface externe de la zone à reconstruire")
- zoneDefaut_skin, internalBoundary = fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner)
+ zoneDefaut_skin, internalBoundary = \
+ fusionMaillageDefaut(maillageSain, maillageDefautCible, internalBoundary, zoneDefaut_skin, shapeDefaut, listOfCorner, \
+ nro_cas)
return maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges
areteFaceFissure = taille cible de l'arête des triangles en face de fissure.
"""
self.maillageFissureParams = dict(nomRep = os.curdir, \
- nomFicSain = self.nomCas, \
- nomFicFissure = 'fissure_' + self.nomCas, \
+ nomFicSain = self.nomProbleme, \
+ nomFicFissure = self.nomProbleme + '_fissure', \
nbsegRad = self.dico['nbCouronnes'], \
nbsegCercle = self.dico['nbSecteurs'], \
areteFaceFissure = self.dico['aretesFaceFissure'])