maillageFissure = insereFissureLongue(geometriesSaines, \
shapesFissure, shapeFissureParams, \
maillageFissureParams, elementsDefaut, \
- step, mailleur)
+ step, mailleur, self.numeroCas)
return maillageFissure
# ---------------------------------------------------------------------------
def insereFissureLongue(geometriesSaines, \
shapesFissure, shapeFissureParams, \
maillageFissureParams, elementsDefaut, \
- step=-1, mailleur="MeshGems"):
+ step=-1, mailleur="MeshGems", nro_cas=-1):
"""procedure complete fissure longue"""
logging.info('start')
- logging.info("Usage du mailleur %s", mailleur)
+ logging.info("Usage du mailleur %s pour le cas n° %d", mailleur, nro_cas)
#geometrieSaine = geometriesSaines[0]
shapeDefaut = shapesFissure[0] # face de fissure, debordant
planfiss, planBord1, planBord2, \
facePeau, verticesOutCercles, verticesEdgePeauFiss, \
fillingFaceExterne, rayonPipe, \
- internalBoundary)
+ internalBoundary)
# --- maillage pipe fond fissure
insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCerclesPeau, generatrices, \
VerticesEndPipeFiss, verticesEdgePeauFiss, \
groupFaceFissInPipe, groupEdgeFondFiss, groupsDemiCerclesPipe, groupGenerFiss, \
- profondeur, rayonPipe)
+ profondeur, rayonPipe, \
+ nro_cas)
# --- maillage face de peau
insereFissureLongue_d ( facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibres, \
groupsDemiCerclesPeau, groups_demiCercles, verticesOutCercles, \
nbSegGenLong, nbSegGenBout, profondeur, \
- mailleur )
+ mailleur, nro_cas )
# --- maillage face de fissure
meshFaceFiss = \
insereFissureLongue_e ( faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_generFiss, groupEdgesFaceFissPipe, \
profondeur, rayonPipe, \
- mailleur )
+ mailleur, nro_cas )
# --- maillage meshBoiteDefaut
meshBoiteDefaut, group_faceFissInPipe, group_faceFissOutPipe = \
insereFissureLongue_f ( internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \
- mailleur )
+ mailleur, nro_cas )
# --- maillage complet
insereFissureLongue_g (nomFicFissure, fichierMaillageFissure, nomFicSain, maillageSain, \
meshBoiteDefaut, facePorteFissure, \
group_faceFissInPipe, group_faceFissOutPipe, \
- zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces)
+ zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces, \
+ nro_cas)
if salome.sg.hasDesktop():
edgesFacePeauSorted, _, _ = sortEdges(edgesFacePeau)
demiCerclesPeau = edgesFacePeauSorted[0:4]
verticesDemiCerclesPeau = list()
- for i, edge in enumerate(demiCerclesPeau):
- name = "demiCerclePeau_%d"%i
+ for i_aux, edge in enumerate(demiCerclesPeau):
+ name = "demiCerclePeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, edge, name)
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
- for i, vertex in enumerate(verticesDemiCerclesPeau):
- name = "verticesDemiCerclesPeau_%d"%i
+ for i_aux, vertex in enumerate(verticesDemiCerclesPeau):
+ name = "verticesDemiCerclesPeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
- for i, vertex in enumerate(verticesOutCercles):
- name = "verticesOutCercles_%d"%i
+ for i_aux, vertex in enumerate(verticesOutCercles):
+ name = "verticesOutCercles_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
# --- demi cercles regroupés
groupsDemiCerclesPeau = list()
- for i, vertex in enumerate(verticesEdgePeauFiss):
+ for i_aux, vertex in enumerate(verticesEdgePeauFiss):
demis = list()
for edge in demiCerclesPeau:
- if geompy.MinDistance(vertex, edge) < 1.e-5:
+ if ( geompy.MinDistance(vertex, edge) < 1.e-5 ):
demis.append(edge)
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(group, demis)
- name = "Cercle%d"%i
+ name = "Cercle{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, group , name)
groupsDemiCerclesPeau.append(group)
def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCerclesPeau, generatrices, \
VerticesEndPipeFiss, verticesEdgePeauFiss, \
groupFaceFissInPipe, groupEdgeFondFiss, groupsDemiCerclesPipe, groupGenerFiss, \
- profondeur, rayonPipe):
+ profondeur, rayonPipe, \
+ nro_cas=-1):
"""maillage pipe fond fissure"""
logging.info('start')
meshFondFiss = smesh.Mesh(pipeFondFiss)
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
algo3d = meshFondFiss.Prism()
- putName(algo3d.GetSubMesh(), "pipe")
- putName(algo3d, "algo3d_pipe")
- putName(algo2d, "algo2d_pipe")
+ putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas)
+ putName(algo3d, "algo3d_pipe", i_pref=nro_cas)
+ putName(algo2d, "algo2d_pipe", i_pref=nro_cas)
- for i, face in enumerate(disques):
+ for i_aux, face in enumerate(disques):
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face)
- putName(algo2d.GetSubMesh(), "disque", i)
- putName(algo2d, "algo2d_disque", i)
+ putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas)
+ putName(algo2d, "algo2d_disque", i_aux, nro_cas)
- for i, edge in enumerate(rayons):
+ for i_aux, edge in enumerate(rayons):
algo1d = meshFondFiss.Segment(geom=edge)
hypo1d = algo1d.NumberOfSegments(4)
- putName(algo1d.GetSubMesh(), "rayon", i)
- putName(algo1d, "algo1d_rayon", i)
- putName(hypo1d, "hypo1d_rayon", i)
+ putName(algo1d.GetSubMesh(), "rayon", i_aux, nro_cas)
+ putName(algo1d, "algo1d_rayon", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_rayon", i_aux, nro_cas)
- for i, edge in enumerate(demiCercles):
+ for i_aux, edge in enumerate(demiCercles):
algo1d = meshFondFiss.Segment(geom=edge)
hypo1d = algo1d.NumberOfSegments(6)
- putName(algo1d.GetSubMesh(), "demiCercle", i)
- putName(algo1d, "algo1d_demiCercle", i)
- putName(hypo1d, "hypo1d_demiCercle", i)
+ putName(algo1d.GetSubMesh(), "demiCercle", i_aux, nro_cas)
+ putName(algo1d, "algo1d_demiCercle", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_demiCercle", 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
nbSegGenBout = 6
logging.info("min %s, max %s, nombre de segments %s, nombre de generatrices %s", minlg, maxlg, nbSegGenLong, len(generSorted))
- for i, edge in enumerate(generSorted):
+ for i_aux, edge in enumerate(generSorted):
algo1d = meshFondFiss.Segment(geom=edge)
- if i < 6:
+ if i_aux < 6:
hypo1d = algo1d.NumberOfSegments(nbSegGenBout)
else:
hypo1d = algo1d.NumberOfSegments(nbSegGenLong)
- putName(algo1d.GetSubMesh(), "generatrice", i)
- putName(algo1d, "algo1d_generatrice", i)
- putName(hypo1d, "hypo1d_generatrice", i)
+ putName(algo1d.GetSubMesh(), "generatrice", i_aux, nro_cas)
+ putName(algo1d, "algo1d_generatrice", i_aux, nro_cas)
+ putName(hypo1d, "hypo1d_generatrice", i_aux, nro_cas)
disks = list()
- for i, face in enumerate(disques[:4]):
- name = "disk%d"%i
+ for i_aux, face in enumerate(disques[:4]):
+ name = "disk{}".format(i_aux)
disks.append(meshFondFiss.GroupOnGeom(face, name, SMESH.FACE))
_ = meshFondFiss.GetMesh().UnionListOfGroups( disks, 'PEAUEXT' )
groups_demiCercles = list()
groupnodes_demiCercles = list()
- for i, group in enumerate(groupsDemiCerclesPipe):
- name = "Cercle%d"%i
+ for i_aux, group in enumerate(groupsDemiCerclesPipe):
+ name = "Cercle{}".format(i_aux)
groups_demiCercles.append(meshFondFiss.GroupOnGeom(group, name, SMESH.EDGE))
- name = "nCercle%d"%i
+ name = "nCercle{}".format(i_aux)
groupnodes_demiCercles.append(meshFondFiss.GroupOnGeom(group, name, SMESH.NODE))
group_generFiss = meshFondFiss.GroupOnGeom(groupGenerFiss, "GenFiss", SMESH.EDGE)
groupnode_generFiss = meshFondFiss.GroupOnGeom(groupGenerFiss, "GenFiss", SMESH.NODE)
minDist = 100000
minCoord = None
imin = -1
- for i, edge in enumerate(demiCerclesPeau):
+ for i_aux, edge in enumerate(demiCerclesPeau):
discoord = geompy.MinDistanceComponents(vertex, edge)
if discoord[0] <minDist:
minDist = discoord[0]
minCoord = discoord[1:]
- imin = i
+ imin = i_aux
if imin >= 0 and minDist > 1.E-6:
logging.debug("node id moved : %s distance=%s", idNode, minDist)
meshFondFiss.MoveNode(idNode, coordMesh[0] + minCoord[0], coordMesh[1] + minCoord[1], coordMesh[2] + minCoord[2])
def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibres, \
groupsDemiCerclesPeau, groups_demiCercles, verticesOutCercles, \
nbSegGenLong, nbSegGenBout, profondeur, \
- mailleur="MeshGems"):
+ mailleur="MeshGems", nro_cas=-1):
"""maillage face de peau"""
logging.info('start')
hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( 2 )
hypo2d.SetQuadAllowed( 0 )
- putName(algo2d.GetSubMesh(), "facePeau")
- putName(algo2d, "algo2d_facePeau")
- putName(hypo2d, "hypo2d_facePeau")
+ putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas)
+ putName(algo2d, "algo2d_facePeau", i_pref=nro_cas)
+ putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas)
#
lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0]
frac = profondeur/lenEdgePeauFiss
hypo1d.SetDistrType( 2 )
hypo1d.SetConversionMode( 1 )
hypo1d.SetTableFunction( [ 0, ratio, frac, 1, (1.-frac), 1, 1, ratio ] )
- putName(algo1d.GetSubMesh(), "edgePeauFiss")
- putName(algo1d, "algo1d_edgePeauFiss")
- putName(hypo1d, "hypo1d_edgePeauFiss")
+ putName(algo1d.GetSubMesh(), "edgePeauFiss", i_pref=nro_cas)
+ putName(algo1d, "algo1d_edgePeauFiss", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_edgePeauFiss", i_pref=nro_cas)
#
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
- putName(algo1d.GetSubMesh(), "bordsLibres")
- putName(algo1d, "algo1d_bordsLibres")
- putName(hypo1d, "hypo1d_bordsLibres")
+ putName(algo1d.GetSubMesh(), "bordsLibres", i_pref=nro_cas)
+ putName(algo1d, "algo1d_bordsLibres", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_bordsLibres", i_pref=nro_cas)
#
- for i in range(2):
- algo1d = meshFacePeau.UseExisting1DElements(geom=groupsDemiCerclesPeau[i])
- hypo1d = algo1d.SourceEdges([ groups_demiCercles[i] ],0,0)
- putName(algo1d.GetSubMesh(), "DemiCercles", i)
- putName(algo1d, "algo1d_groupDemiCercles", i)
- putName(hypo1d, "hypo1d_groupDemiCercles", i)
+ 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)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
_ = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_generFiss, groupEdgesFaceFissPipe, \
profondeur, rayonPipe, \
- mailleur="MeshGems"):
+ mailleur="MeshGems", nro_cas=-1):
"""maillage face de fissure"""
logging.info('start')
hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( 2 )
hypo2d.SetQuadAllowed( 0 )
- putName(algo2d.GetSubMesh(), "faceFiss")
- putName(algo2d, "algo2d_faceFiss")
- putName(hypo2d, "hypo2d_faceFiss")
+ putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas)
+ putName(algo2d, "algo2d_faceFiss", i_pref=nro_cas)
+ putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
#
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss)
hypo1d = algo1d.SourceEdges([ groupEdgesPeauFiss ],0,0)
- putName(algo1d.GetSubMesh(), "edgeFissPeau")
- putName(algo1d, "algo1d_edgeFissPeau")
- putName(hypo1d, "hypo1d_edgeFissPeau")
+ putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
+ putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
#
algo1d = meshFaceFiss.UseExisting1DElements(geom=groupEdgesFaceFissPipe)
hypo1d = algo1d.SourceEdges([ group_generFiss ],0,0)
- putName(algo1d.GetSubMesh(), "edgeFissPeau")
- putName(algo1d, "algo1d_edgeFissPeau")
- putName(hypo1d, "hypo1d_edgeFissPeau")
+ putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
+ putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas)
+ putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
_ = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)
from .putName import putName
def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \
- mailleur="MeshGems"):
+ mailleur="MeshGems", nro_cas=-1):
"""maillage meshBoiteDefaut"""
logging.info('start')
logging.info("insereFissureLongue_f (%s)", mailleur)
meshFondFiss.GetMesh(), \
meshFacePeau.GetMesh(), \
meshFaceFiss.GetMesh()], \
- 1, 1, 1e-05,False)
+ 1, 1, 1e-05,False )
# pour aider l'algo hexa-tetra a ne pas mettre de pyramides a l'exterieur des volumes replies sur eux-memes
# on designe les faces de peau en quadrangles par le groupe "skinFaces"
group_faceFissOutPipe = None
hypo3d.SetVerboseLevel( 0 )
hypo3d.SetStandardOutputLog( 0 )
hypo3d.SetRemoveLogOnSuccess( 1 )
- putName(algo3d.GetSubMesh(), "boiteDefaut")
- putName(algo3d, "algo3d_boiteDefaut")
- putName(meshBoiteDefaut, "boiteDefaut")
+ putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
+ putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas)
+ putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute()
text = "meshBoiteDefaut.Compute"
def insereFissureLongue_g(nomFicFissure, fichierMaillageFissure, nomFicSain, maillageSain, \
meshBoiteDefaut, facePorteFissure, \
group_faceFissInPipe, group_faceFissOutPipe, \
- zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces):
+ zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces, \
+ nro_cas=-1):
"""Les groupes de la fissure longue"""
logging.info('start')
_ = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges)
- putName(maillageSain, nomFicSain+"_coupe")
+ putName(maillageSain, nomFicSain+"_coupe", i_pref=nro_cas)
extrusionFaceFissure, normfiss = shapeSurFissure(facePorteFissure)
maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, extrusionFaceFissure, facePorteFissure, 'COUDE')