#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+"""Cas standard"""
import os
from .geomsmesh import geompy, smesh
- les numéros d'arêtes (edges géométriques) correspondant au fond de fissure
- les paramètres de maillage de la fissure
"""
+ referencesMaillageFissure = None
# ---------------------------------------------------------------------------
def __init__ (self, dicoParams, references = None, numeroCas = 0):
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+"""Construit les arêtes débouchantes"""
import logging
from .geomsmesh import geompy
from .geomsmesh import geomPublish
-from .geomsmesh import geomPublishInFather
+#from .geomsmesh import geomPublishInFather
from . import initLog
import GEOM
from .sortEdges import sortEdges
def construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
facesPipePeau, edgeRadFacePipePeau, nbsegCercle):
- """
- construction des listes d'edges radiales sur chaque extrémité débouchante
- """
+ """construction des listes d'edges radiales sur chaque extrémité débouchante"""
logging.info('start')
# --- listes de nappes radiales en filling à chaque extrémité débouchante
vs = geompy.ExtractShapes(obj, geompy.ShapeType["VERTEX"], False)
if len(vs) > 2:
eds = geompy.ExtractShapes(obj, geompy.ShapeType["EDGE"], False)
- [edsorted, minl,maxl] = sortEdges(eds)
+ [edsorted, _, maxl] = sortEdges(eds)
edge = edsorted[-1]
else:
maxl = geompy.BasicProperties(edge)[0]
logging.debug(" edges issues de la partition: %s", ednouv)
for ii, ed in enumerate(ednouv):
geomPublish(initLog.debug, ed, "ednouv%d"%ii)
- [edsorted, minl,maxl] = sortEdges(ednouv)
+ [edsorted, _, maxl] = sortEdges(ednouv)
logging.debug(" longueur edge trouvée: %s", maxl)
edge = edsorted[-1]
else:
logging.debug("nombre vertex candidats %s", len(vxnouv))
if len(vxnouv) >= 2:
eds = [geompy.MakeEdge(vxnouv[j],vxnouv[(j+1)%len(vxnouv)]) for j in range(len(vxnouv))]
- [edsorted2, minl,maxl] = sortEdges(eds)
+ [edsorted2, _, maxl] = sortEdges(eds)
edge = edsorted2[-1]
logging.debug("lg edge: %s", maxl)
else:
geomPublish(initLog.debug, edge, name)
listEdges.append(edges)
- return (listEdges, idFacesDebouchantes)
\ No newline at end of file
+ return (listEdges, idFacesDebouchantes)
centreFondFiss = elementsDefaut[15]
#tgtCentre = elementsDefaut[16]
if lgAretesVives == 0:
- lgAretesVives = dmoyen
+ lgAretesVives = dmoyen
O, OX, OY, OZ = triedreBase()
# 0, 1 ou plus edges de la face de fissure externe au pipe
nbFacesFilling = len(partitionsPeauFissFond)
- logging.info("nbFacesFilling : {} ".format(nbFacesFilling))
+ texte = "nbFacesFilling : {} ".format(nbFacesFilling)
+ logging.info(texte)
ptEdgeFond = [ list() for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
fsPipePeau = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
# --- identification des faces et edges de fissure externe pour maillage
- (faceFissureExterne, edgesPipeFissureExterneC,
- wirePipeFissureExterne, edgesPeauFissureExterneC) = identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe,
- edFisExtPi, edgesPipeFiss)
+ (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC) = \
+ identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss)
# --- preparation maillage du pipe :
# - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe
putName(meshBoiteDefaut, "boiteDefaut")
logging.info("meshBoiteDefaut fini")
- faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
+ faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], \
+ 'FACE1' )
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
zoneDefaut_internalFaces, zoneDefaut_internalEdges)
putName(maillageSain, nomFicSain+"_coupe")
- extrusionFaceFissure, normfiss = shapeSurFissure(facesPortFissure)
- maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut,
+ _, normfiss = shapeSurFissure(facesPortFissure)
+ maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \
None, None, 'COMPLET', normfiss)
logging.info("conversion quadratique")
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+"""Maillage du pipe"""
import logging
import SMESH
def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad):
- """
- maillage effectif du pipe
- """
+ """maillage effectif du pipe"""
logging.info('start')
meshPipe = smesh.Mesh(None, "meshPipe")
fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
-
- mptsdisks = [] # vertices maillage de tous les disques
- mEdges = [] # identifiants edges maillage fond de fissure
- mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe
- mFaces = [] # identifiants faces maillage fissure
- mVols = [] # identifiants volumes maillage pipe
-
- mptdsk = None
+
+ mptsdisks = list() # vertices maillage de tous les disques
+ mEdges = list() # identifiants edges maillage fond de fissure
+ mEdgeFaces = list() # identifiants edges maillage edge face de fissure externe
+ mFaces = list() # identifiants faces maillage fissure
+ mVols = list() # identifiants volumes maillage pipe
+
+ mptdsk = list()
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
-
+
# -----------------------------------------------------------------------
# --- points
-
+
gptdsk = gptsdisks[idisk]
if idisk > idisklim[0]:
oldmpts = mptdsk
- mptdsk = [] # vertices maillage d'un disque
+ mptdsk = list() # vertices maillage d'un disque
for k in range(nbsegCercle):
points = gptdsk[k]
- mptids = []
+ mptids = list()
for j, pt in enumerate(points):
if j == 0 and k > 0:
id = mptdsk[0][0]
mptids.append(id)
mptdsk.append(mptids)
mptsdisks.append(mptdsk)
-
+
# -----------------------------------------------------------------------
# --- groupes edges cercles debouchants
-
+
if idisk == idisklim[0]:
- pts = []
+ pts = list()
for k in range(nbsegCercle):
pts.append(mptdsk[k][-1])
- edges = []
- for k in range(len(pts)):
- k1 = (k+1)%len(pts)
+ edges = list()
+ nb_pts = len(pts)
+ for k in range(nb_pts):
+ k1 = (k+1)%nb_pts
idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
edges.append(idEdge)
edgeCircPipe0Group.Add(edges)
-
+
if idisk == idisklim[1]:
- pts = []
+ pts = list()
for k in range(nbsegCercle):
pts.append(mptdsk[k][-1])
- edges = []
- for k in range(len(pts)):
- k1 = (k+1)%len(pts)
+ edges = list()
+ nb_pts = len(pts)
+ for k in range(nb_pts):
+ k1 = (k+1)%nb_pts
idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
edges.append(idEdge)
edgeCircPipe1Group.Add(edges)
-
+
# -----------------------------------------------------------------------
# --- groupes faces debouchantes
-
+
if idisk == idisklim[0]:
- faces = []
+ faces = list()
for j in range(nbsegRad):
for k in range(nbsegCercle):
k1 = k+1
faceCircPipe0Group.Add(faces)
if idisk == idisklim[1]:
- faces = []
+ faces = list()
for j in range(nbsegRad):
for k in range(nbsegCercle):
k1 = k+1
idf = meshPipe.AddFace([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j]]) # quadrangle
faces.append(idf)
faceCircPipe1Group.Add(faces)
-
+
# -----------------------------------------------------------------------
# --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure
-
+
if idisk == idisklim[0]:
mEdges.append(0)
mEdgeFaces.append(0)
ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
mEdgeFaces.append(ide2)
edgeFaceFissGroup.Add([ide2])
- idFaces = []
- idVols = []
-
+ idFaces = list()
+ idVols = list()
+
for j in range(nbsegRad):
idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]])
faceFissGroup.Add([idf])
idFaces.append(idf)
-
- idVolCercle = []
+
+ idVolCercle = list()
for k in range(nbsegCercle):
k1 = k+1
if k == nbsegCercle-1:
k1 = 0
if j == 0:
- idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1],
+ idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], \
oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1]])
else:
- idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j],
+ idv = meshPipe.AddVolume([mptdsk[k][j], mptdsk[k][j+1], mptdsk[k1][j+1], mptdsk[k1][j], \
oldmpts[k][j], oldmpts[k][j+1], oldmpts[k1][j+1], oldmpts[k1][j]])
idVolCercle.append(idv)
- idVols.append(idVolCercle)
-
+ idVols.append(idVolCercle)
+
mFaces.append(idFaces)
mVols.append(idVols)
nb, new_mesh, new_group = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries")
edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group]
- meshPipeGroups = dict(fondFissGroup = fondFissGroup,
- nodesFondFissGroup = nodesFondFissGroup,
- faceFissGroup = faceFissGroup,
- edgeFaceFissGroup = edgeFaceFissGroup,
- edgeCircPipe0Group = edgeCircPipe0Group,
- edgeCircPipe1Group = edgeCircPipe1Group,
- faceCircPipe0Group = faceCircPipe0Group,
- faceCircPipe1Group = faceCircPipe1Group,
- pipeFissGroup = pipeFissGroup,
- edgesCircPipeGroup = edgesCircPipeGroup
+ meshPipeGroups = dict(fondFissGroup = fondFissGroup, \
+ nodesFondFissGroup = nodesFondFissGroup, \
+ faceFissGroup = faceFissGroup, \
+ edgeFaceFissGroup = edgeFaceFissGroup, \
+ edgeCircPipe0Group = edgeCircPipe0Group, \
+ edgeCircPipe1Group = edgeCircPipe1Group, \
+ faceCircPipe0Group = faceCircPipe0Group, \
+ faceCircPipe1Group = faceCircPipe1Group, \
+ pipeFissGroup = pipeFissGroup, \
+ edgesCircPipeGroup = edgesCircPipeGroup \
)
-
- return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
\ No newline at end of file
+
+ return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
# liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
def construitPartitionsPeauFissure(facesDefaut, fissPipe):
- """
- partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée.
+ """partition peau défaut - face de fissure prolongée - wire de fond de fissure prolongée.
+
Il peut y avoir plusieurs faces externes, dont certaines sont découpées par la fissure.
@param facesDefaut liste de faces externes
@param fissPipe partition face de fissure etendue par pipe prolongé
@return partitionsPeauFissFond : liste de partitions face externe - fissure (None quand pas d'intersection)
"""
-
+
logging.info('start')
- partitionsPeauFissFond = []
+ partitionsPeauFissFond = list()
ipart = 0
- for filling in facesDefaut:
- part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ for filling in facesDefaut:
+ part = geompy.MakePartition([fissPipe, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
isPart = checkDecoupePartition([fissPipe, filling], part)
if isPart: # on recrée la partition avec toutes les faces filling en outil pour avoir une face de fissure correcte
otherFD = [fd for fd in facesDefaut if fd != filling]
if otherFD:
- fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ fissPipePart = geompy.MakePartition([fissPipe], otherFD, list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
else:
fissPipePart = fissPipe
- part = geompy.MakePartition([fissPipePart, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
+ part = geompy.MakePartition([fissPipePart, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
partitionsPeauFissFond.append(part)
geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
else:
def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFissureExterneC,
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad):
- """
- maillage faces de fissure
- """
+ """maillage faces de fissure"""
logging.info('start')
logging.info("Maillage de {}".format(faceFissureExterne.GetName()))
putName(algo2d, "algo2d_faceFiss")
putName(hypo2d, "hypo2d_faceFiss")
- logging.info('Récupération des arêtes de {}'.format(edgesPipeFissureExterneC.GetName()))
+ logging.info("Récupération des arêtes de '{}'".format(edgesPipeFissureExterneC.GetName()))
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0)
putName(algo1d.GetSubMesh(), "edgeFissPeau")