mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 18:00:34 +05:00
Contrôle des calculs de maillage
This commit is contained in:
parent
65d5c162a5
commit
0068dfdcb1
@ -27,8 +27,8 @@ from .geomsmesh import smesh
|
|||||||
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
||||||
centreFondFiss, wireFondFiss, wirePipeFiss,
|
centreFondFiss, wireFondFiss, wirePipeFiss,
|
||||||
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad):
|
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad):
|
||||||
"""
|
"""preparation maillage du pipe :
|
||||||
preparation maillage du pipe :
|
|
||||||
- détections des points a respecter : jonction des edges/faces constituant
|
- détections des points a respecter : jonction des edges/faces constituant
|
||||||
la face de fissure externe au pipe
|
la face de fissure externe au pipe
|
||||||
- points sur les edges de fond de fissure et edges pipe/face fissure,
|
- points sur les edges de fond de fissure et edges pipe/face fissure,
|
||||||
@ -42,24 +42,34 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
|||||||
for edff in edgesFondFiss:
|
for edff in edgesFondFiss:
|
||||||
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
|
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
|
||||||
|
|
||||||
disfond = []
|
disfond = list()
|
||||||
for filling in facesDefaut:
|
for filling in facesDefaut:
|
||||||
disfond.append(geompy.MinDistance(centreFondFiss, filling))
|
disfond.append(geompy.MinDistance(centreFondFiss, filling))
|
||||||
disfond.sort()
|
disfond.sort()
|
||||||
rcourb = disfond[0]
|
rcourb = disfond[0]
|
||||||
|
texte = "rcourb: {}, lenEdgeFondExt: {}, lenSegPipe: {}".format(rcourb, lenEdgeFondExt, lenSegPipe)
|
||||||
|
logging.info(texte)
|
||||||
nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
|
nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
|
||||||
alpha = math.pi/(4*nbSegQuart)
|
alpha = math.pi/(4*nbSegQuart)
|
||||||
deflexion = rcourb*(1.0 -math.cos(alpha))
|
deflexion = rcourb*(1.0 -math.cos(alpha))
|
||||||
lgmin = lenSegPipe*0.25
|
lgmin = lenSegPipe*0.25
|
||||||
lgmax = lenSegPipe*1.5
|
lgmax = lenSegPipe*1.5
|
||||||
logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax)
|
texte = "==> deflexion: {}, lgmin: {}, lgmax: {}".format(deflexion, lgmin, lgmax)
|
||||||
|
logging.info(texte)
|
||||||
|
|
||||||
meshFondExt = smesh.Mesh(wireFondFiss)
|
meshFondExt = smesh.Mesh(wireFondFiss)
|
||||||
algo1d = meshFondExt.Segment()
|
algo1d = meshFondExt.Segment()
|
||||||
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
||||||
isDone = meshFondExt.Compute()
|
is_done = meshFondExt.Compute()
|
||||||
|
text = "calculePointsAxiauxPipe meshFondExt.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text)
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
|
ptGSdic = dict() # dictionnaire [paramètre sur la courbe] --> point géométrique
|
||||||
allNodeIds = meshFondExt.GetNodesId()
|
allNodeIds = meshFondExt.GetNodesId()
|
||||||
for nodeId in allNodeIds:
|
for nodeId in allNodeIds:
|
||||||
xyz = meshFondExt.GetNodeXYZ(nodeId)
|
xyz = meshFondExt.GetNodeXYZ(nodeId)
|
||||||
@ -72,16 +82,16 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
|||||||
usort = sorted(ptGSdic)
|
usort = sorted(ptGSdic)
|
||||||
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
|
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
|
||||||
|
|
||||||
centres = []
|
centres = list()
|
||||||
origins = []
|
origins = list()
|
||||||
normals = []
|
normals = list()
|
||||||
for edu in usort:
|
for edu in usort:
|
||||||
ied = edu[1]
|
ied = edu[1]
|
||||||
u = edu[2]
|
u = edu[2]
|
||||||
vertcx = ptGSdic[edu]
|
vertcx = ptGSdic[edu]
|
||||||
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
|
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
|
||||||
plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
|
plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
|
||||||
part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0)
|
part = geompy.MakePartition([plan], [wirePipeFiss], list(), list(), geompy.ShapeType["VERTEX"], 0, list(), 0)
|
||||||
liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
|
liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
|
||||||
if len(liste) == 5: # 4 coins du plan plus intersection recherchée
|
if len(liste) == 5: # 4 coins du plan plus intersection recherchée
|
||||||
for point in liste:
|
for point in liste:
|
||||||
@ -105,11 +115,11 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
|||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# --- points géométriques
|
# --- points géométriques
|
||||||
|
|
||||||
gptsdisks = [] # vertices géométrie de tous les disques
|
gptsdisks = list() # vertices géométrie de tous les disques
|
||||||
raydisks = [[] for i in range(nbsegCercle)]
|
raydisks = [list() for i in range(nbsegCercle)]
|
||||||
for i in range(len(centres)): # boucle sur les disques
|
for i, centres_i in enumerate(centres): # boucle sur les disques
|
||||||
gptdsk = [] # vertices géométrie d'un disque
|
gptdsk = list() # vertices géométrie d'un disque
|
||||||
vertcx = centres[i]
|
vertcx = centres_i
|
||||||
vertpx = origins[i]
|
vertpx = origins[i]
|
||||||
normal = normals[i]
|
normal = normals[i]
|
||||||
vec1 = geompy.MakeVector(vertcx, vertpx)
|
vec1 = geompy.MakeVector(vertcx, vertpx)
|
||||||
|
@ -318,9 +318,15 @@ def construitFissureGenerale(maillagesSains,
|
|||||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||||
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
||||||
putName(algo3d, "algo3d_boiteDefaut")
|
putName(algo3d, "algo3d_boiteDefaut")
|
||||||
isDone = meshBoiteDefaut.Compute()
|
|
||||||
putName(meshBoiteDefaut, "boiteDefaut")
|
putName(meshBoiteDefaut, "boiteDefaut")
|
||||||
logging.info("meshBoiteDefaut fini")
|
is_done = meshBoiteDefaut.Compute()
|
||||||
|
text = "meshBoiteDefaut.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], \
|
faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], \
|
||||||
'FACE1' )
|
'FACE1' )
|
||||||
|
@ -185,4 +185,8 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad):
|
|||||||
edgesCircPipeGroup = edgesCircPipeGroup \
|
edgesCircPipeGroup = edgesCircPipeGroup \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#if meshPipe:
|
||||||
|
#text = "Arrêt rapide.\n"
|
||||||
|
#logging.info(text)
|
||||||
|
#raise Exception(text)
|
||||||
return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
|
return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
|
||||||
|
@ -295,7 +295,14 @@ class fissureCoude(fissureGenerique):
|
|||||||
smesh.SetName(algo1d_long_p2, "algo1d_long_p2")
|
smesh.SetName(algo1d_long_p2, "algo1d_long_p2")
|
||||||
smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2")
|
smesh.SetName(hypo1d_long_p2, "hypo1d_long_p2")
|
||||||
|
|
||||||
isDone = 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)
|
||||||
|
|
||||||
mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
|
mp1 = maillageSain.GroupOnGeom(P1,'P1',SMESH.NODE)
|
||||||
mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
|
mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)
|
||||||
|
@ -56,11 +56,10 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize):
|
|||||||
smesh.SetName(algo2d, "algo2d_zoneFiss")
|
smesh.SetName(algo2d, "algo2d_zoneFiss")
|
||||||
smesh.SetName(hypo2d, "hypo1d_zoneFiss")
|
smesh.SetName(hypo2d, "hypo1d_zoneFiss")
|
||||||
|
|
||||||
isDone = meshFissure.Compute()
|
is_done = meshFissure.Compute()
|
||||||
|
text = "meshFissure.Compute"
|
||||||
if isDone:
|
if is_done:
|
||||||
logging.info(text+" : OK")
|
logging.info(text+" OK")
|
||||||
logging.debug(text+" : OK")
|
|
||||||
else:
|
else:
|
||||||
text = "Erreur au calcul du maillage.\n" + text
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
logging.info(text)
|
logging.info(text)
|
||||||
|
@ -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
|
||||||
#
|
#
|
||||||
|
|
||||||
|
"""procédure complète fissure générale"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@ -58,9 +60,6 @@ from .projettePointSurCourbe import projettePointSurCourbe
|
|||||||
from .prolongeWire import prolongeWire
|
from .prolongeWire import prolongeWire
|
||||||
#from getCentreFondFiss import getCentreFondFiss
|
#from getCentreFondFiss import getCentreFondFiss
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
# --- procédure complète fissure générale
|
|
||||||
|
|
||||||
def insereFissureGenerale(maillagesSains,
|
def insereFissureGenerale(maillagesSains,
|
||||||
shapesFissure, shapeFissureParams,
|
shapesFissure, shapeFissureParams,
|
||||||
maillageFissureParams, elementsDefaut, step=-1):
|
maillageFissureParams, elementsDefaut, step=-1):
|
||||||
@ -127,7 +126,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- restriction de la face de fissure au domaine solide :
|
# --- restriction de la face de fissure au domaine solide :
|
||||||
# partition face fissure étendue par fillings, on garde la plus grande face
|
# partition face fissure étendue par fillings, on garde la plus grande face
|
||||||
|
|
||||||
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, list(), list(), geompy.ShapeType["FACE"], 0, [], 0)
|
||||||
geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
|
geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
|
||||||
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
|
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
|
||||||
if isPointInterne:
|
if isPointInterne:
|
||||||
@ -197,18 +196,18 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# liste de faces externes : facesDefaut
|
# liste de faces externes : facesDefaut
|
||||||
# liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
|
# liste de partitions face externe - fissure : partitionPeauFissFond (None quand pas d'intersection)
|
||||||
|
|
||||||
partitionsPeauFissFond = [] #= global
|
partitionsPeauFissFond = list() #= global
|
||||||
ipart = 0
|
ipart = 0
|
||||||
for filling in facesDefaut:
|
for filling in facesDefaut:
|
||||||
part = geompy.MakePartition([fissPipe, filling], [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
part = geompy.MakePartition([fissPipe, filling], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
|
||||||
isPart = checkDecoupePartition([fissPipe, filling], part)
|
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
|
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]
|
otherFD = [fd for fd in facesDefaut if fd != filling]
|
||||||
if len(otherFD) > 0:
|
if len(otherFD) > 0:
|
||||||
fissPipePart = geompy.MakePartition([fissPipe], otherFD, [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
fissPipePart = geompy.MakePartition([fissPipe], otherFD, list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
|
||||||
else:
|
else:
|
||||||
fissPipePart = fissPipe
|
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)
|
partitionsPeauFissFond.append(part)
|
||||||
geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
|
geomPublish(initLog.debug, part, 'partitionPeauFissFond%d'%ipart )
|
||||||
else:
|
else:
|
||||||
@ -219,21 +218,21 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- arêtes vives détectées (dans quadranglesToShapeNoCorner
|
# --- arêtes vives détectées (dans quadranglesToShapeNoCorner
|
||||||
# et quadranglesToShapeWithCorner)
|
# et quadranglesToShapeWithCorner)
|
||||||
|
|
||||||
aretesVives = []
|
aretesVives = list()
|
||||||
aretesVivesCoupees = [] #= global
|
aretesVivesCoupees = list() #= global
|
||||||
ia = 0
|
ia = 0
|
||||||
for a in bordsPartages:
|
for a in bordsPartages:
|
||||||
if not isinstance(a, list):
|
if not isinstance(a, list):
|
||||||
aretesVives.append(a)
|
aretesVives.append(a)
|
||||||
name = "areteVive%d"%ia
|
name = "areteVive%d"%ia
|
||||||
geomPublish(initLog.debug, a, name)
|
geomPublish(initLog.debug, a, name)
|
||||||
ia += 1
|
ia += 1
|
||||||
else:
|
else:
|
||||||
if a[0] is not None:
|
if a[0] is not None:
|
||||||
aretesVives.append(a[0])
|
aretesVives.append(a[0])
|
||||||
name = "areteVive%d"%ia
|
name = "areteVive%d"%ia
|
||||||
geomPublish(initLog.debug, a[0], name)
|
geomPublish(initLog.debug, a[0], name)
|
||||||
ia += 1
|
ia += 1
|
||||||
|
|
||||||
aretesVivesC = None #= global
|
aretesVivesC = None #= global
|
||||||
if len(aretesVives) > 0:
|
if len(aretesVives) > 0:
|
||||||
@ -245,19 +244,19 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# 0, 1 ou plus edges de la face de fissure externe au pipe
|
# 0, 1 ou plus edges de la face de fissure externe au pipe
|
||||||
|
|
||||||
nbFacesFilling = len(partitionsPeauFissFond)
|
nbFacesFilling = len(partitionsPeauFissFond)
|
||||||
ptEdgeFond = [ [] for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
ptEdgeFond = [ list() for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
||||||
fsPipePeau = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
|
fsPipePeau = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
|
||||||
edRadFPiPo = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
edRadFPiPo = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
||||||
fsFissuExt = [ [] for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
|
fsFissuExt = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
|
||||||
edFisExtPe = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
|
edFisExtPe = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
|
||||||
edFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
|
edFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
|
||||||
facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
|
facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
|
||||||
edCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
|
edCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
|
||||||
ptCircPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
ptCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
||||||
gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
||||||
gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
|
gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
|
||||||
edFissPeau = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
edFissPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
||||||
ptFisExtPi = [ [] for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
|
ptFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
|
||||||
|
|
||||||
for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
|
for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
|
||||||
if partitionPeauFissFond is not None:
|
if partitionPeauFissFond is not None:
|
||||||
@ -281,7 +280,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
[facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
|
[facesInside, facesOutside, facesOnside] = extractionOrienteeMulti(facesDefaut, ifil, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
|
||||||
|
|
||||||
edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) #= global
|
edgesPipeIn = geompy.GetSharedShapesMulti([edgesPipeC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"]) #= global
|
||||||
verticesPipePeau = [] #= global
|
verticesPipePeau = list() #= global
|
||||||
|
|
||||||
for i, edge in enumerate(edgesPipeIn):
|
for i, edge in enumerate(edgesPipeIn):
|
||||||
try:
|
try:
|
||||||
@ -294,20 +293,20 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
|
logging.debug("edgePipeIn%s coupe les faces OnSide", i)
|
||||||
except:
|
except:
|
||||||
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
logging.debug("edgePipeIn%s ne coupe pas les faces OnSide", i)
|
||||||
#edgesFondOut = [] #= inutile
|
#edgesFondOut = list() #= inutile
|
||||||
edgesFondIn =[] #= global
|
edgesFondIn =list() #= global
|
||||||
if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau
|
if len(verticesPipePeau) > 0: # au moins une extrémité du pipe sur cette face de peau
|
||||||
#tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
|
#tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesOutside)], geompy.ShapeType["EDGE"])
|
||||||
#edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
|
#edgesFondOut = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
|
||||||
tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
|
tmp = geompy.GetSharedShapesMulti([edgesFondC, geompy.MakeCompound(edgesInside)], geompy.ShapeType["EDGE"])
|
||||||
edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
|
edgesFondIn = [ ed for ed in tmp if geompy.MinDistance(ed, geompy.MakeCompound(facesOnside)) < 1.e-3]
|
||||||
|
|
||||||
verticesEdgesFondIn = [] # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn)
|
verticesEdgesFondIn = list() # les points du fond de fissure au débouché du pipe sur la peau (indice de edgesFondIn)
|
||||||
pipexts = [] # les segments de pipe associés au points de fond de fissure débouchants (même indice)
|
pipexts = list() # les segments de pipe associés au points de fond de fissure débouchants (même indice)
|
||||||
cercles = [] # les cercles de generation des pipes débouchant (même indice)
|
cercles = list() # les cercles de generation des pipes débouchant (même indice)
|
||||||
facesFissExt = [] # les faces de la fissure externe associés au points de fond de fissure débouchants (même indice)
|
facesFissExt = list() # les faces de la fissure externe associés au points de fond de fissure débouchants (même indice)
|
||||||
edgesFissExtPeau = [] # edges des faces de fissure externe sur la peau (même indice)
|
edgesFissExtPeau = list() # edges des faces de fissure externe sur la peau (même indice)
|
||||||
edgesFissExtPipe = [] # edges des faces de fissure externe sur le pipe (même indice)
|
edgesFissExtPipe = list() # edges des faces de fissure externe sur le pipe (même indice)
|
||||||
#logging.debug("edgesFondIn %s", edgesFondIn)
|
#logging.debug("edgesFondIn %s", edgesFondIn)
|
||||||
|
|
||||||
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
||||||
@ -374,7 +373,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
# --- position des points extremite du pipe sur l'edge debouchante
|
# --- position des points extremite du pipe sur l'edge debouchante
|
||||||
# il faut la distance curviligne ofp du point central par rapport à une extrémité de l'edge débouchante
|
# il faut la distance curviligne ofp du point central par rapport à une extrémité de l'edge débouchante
|
||||||
locEdgePart = geompy.MakePartition([localEdgeInFondFiss],[centre], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
locEdgePart = geompy.MakePartition([localEdgeInFondFiss],[centre], list(), list(), geompy.ShapeType["EDGE"], 0, list(), 0)
|
||||||
edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False)
|
edgesLoc = geompy.ExtractShapes(locEdgePart, geompy.ShapeType["EDGE"], False)
|
||||||
edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)]
|
edgesLocSorted =[(geompy.MinDistance(edge, locPt0), kk, edge) for kk, edge in enumerate(edgesLoc)]
|
||||||
edgesLocSorted.sort()
|
edgesLocSorted.sort()
|
||||||
@ -385,7 +384,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf)
|
geomPublishInFather(initLog.debug,wireFondFiss, p1, "p1_%d"%iedf)
|
||||||
geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf)
|
geomPublishInFather(initLog.debug,wireFondFiss, p2, "p2_%d"%iedf)
|
||||||
|
|
||||||
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
|
edgePart = geompy.MakePartition([localEdgeInFondFiss], [p1,p2], list(), list(), geompy.ShapeType["EDGE"], 0, list(), 0)
|
||||||
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
edps = geompy.ExtractShapes(edgePart, geompy.ShapeType["EDGE"], True)
|
||||||
for edp in edps:
|
for edp in edps:
|
||||||
if geompy.MinDistance(centre, edp) < 1.e-3:
|
if geompy.MinDistance(centre, edp) < 1.e-3:
|
||||||
@ -396,9 +395,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
for face in facesInside:
|
for face in facesInside:
|
||||||
logging.debug("recherche edges communes entre une face inside et (faces onside, edges pipe et fond débouchante)")
|
logging.debug("recherche edges communes entre une face inside et (faces onside, edges pipe et fond débouchante)")
|
||||||
edgesPeauFis = []
|
edgesPeauFis = list()
|
||||||
edgesPipeFis = []
|
edgesPipeFis = list()
|
||||||
edgesPipeFnd = []
|
edgesPipeFnd = list()
|
||||||
try:
|
try:
|
||||||
edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
|
edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
|
||||||
logging.debug(" faces onside %s",edgesPeauFis)
|
logging.debug(" faces onside %s",edgesPeauFis)
|
||||||
@ -436,9 +435,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# il faut recenser les edges de fissure sur la face de peau
|
# il faut recenser les edges de fissure sur la face de peau
|
||||||
j = 0
|
j = 0
|
||||||
for face in facesInside:
|
for face in facesInside:
|
||||||
edgesPeauFis = []
|
edgesPeauFis = list()
|
||||||
edgesPipeFis = []
|
edgesPipeFis = list()
|
||||||
edgesPipeFnd = []
|
edgesPipeFnd = list()
|
||||||
try:
|
try:
|
||||||
edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
|
edgesPeauFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(facesOnside), face], geompy.ShapeType["EDGE"])
|
||||||
edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
|
edgesPipeFis = geompy.GetSharedShapesMulti([geompy.MakeCompound(edgesPipeIn), face], geompy.ShapeType["EDGE"])
|
||||||
@ -461,17 +460,17 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
facesAndFond = facesOnside
|
facesAndFond = facesOnside
|
||||||
facesAndFond.append(wireFondFiss)
|
facesAndFond.append(wireFondFiss)
|
||||||
try:
|
try:
|
||||||
partitionPeauByPipe = geompy.MakePartition(facesAndFond, pipexts, [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
partitionPeauByPipe = geompy.MakePartition(facesAndFond, pipexts, list(), list(), geompy.ShapeType["FACE"], 0, list(), 1)
|
||||||
except:
|
except:
|
||||||
logging.debug("probleme partition face pipe, contournement avec MakeSection")
|
logging.debug("probleme partition face pipe, contournement avec MakeSection")
|
||||||
sections = []
|
sections = list()
|
||||||
for pipext in pipexts:
|
for pipext in pipexts:
|
||||||
sections.append(geompy.MakeSection(facesOnside[0], pipext))
|
sections.append(geompy.MakeSection(facesOnside[0], pipext))
|
||||||
partitionPeauByPipe = geompy.MakePartition(facesAndFond, sections, [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
partitionPeauByPipe = geompy.MakePartition(facesAndFond, sections, list(), list(), geompy.ShapeType["FACE"], 0, list(), 1)
|
||||||
|
|
||||||
# contrôle edge en trop sur edges circulaires
|
# contrôle edge en trop sur edges circulaires
|
||||||
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
||||||
edgeEnTrop = []
|
edgeEnTrop = list()
|
||||||
outilPart = pipexts
|
outilPart = pipexts
|
||||||
facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False)
|
facesPeau = geompy.ExtractShapes(partitionPeauByPipe, geompy.ShapeType["FACE"], False)
|
||||||
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau)
|
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeau)
|
||||||
@ -497,7 +496,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if bad:
|
if bad:
|
||||||
outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0])
|
outilPart[j] = geompy.MakeProjection(cercles[j],facesOnside[0])
|
||||||
pass
|
pass
|
||||||
partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, list(), list(), geompy.ShapeType["FACE"], 0, list(), 1)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
name="partitionPeauByPipe%d"%ifil
|
name="partitionPeauByPipe%d"%ifil
|
||||||
@ -509,7 +508,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn)
|
facesPeauSorted, minsur, maxsurf = sortFaces(facesPeauFondOn)
|
||||||
facePeau = facesPeauSorted[-1] # la plus grande face
|
facePeau = facesPeauSorted[-1] # la plus grande face
|
||||||
else:
|
else:
|
||||||
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
|
facePeau =geompy.MakePartition(facesPeauFondOn, list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 1)
|
||||||
name="facePeau%d"%ifil
|
name="facePeau%d"%ifil
|
||||||
geomPublish(initLog.debug, facePeau, name)
|
geomPublish(initLog.debug, facePeau, name)
|
||||||
|
|
||||||
@ -517,9 +516,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
|
endsEdgeFond = [None for i in range(len(edgesFissExtPipe))]
|
||||||
edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))]
|
edgeRadFacePipePeau = [None for i in range(len(edgesFissExtPipe))]
|
||||||
|
|
||||||
edgesListees = []
|
edgesListees = list()
|
||||||
edgesCircPeau = []
|
edgesCircPeau = list()
|
||||||
verticesCircPeau = []
|
verticesCircPeau = list()
|
||||||
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
||||||
|
|
||||||
for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
|
for face in facesPeauSorted[:-1]: # la ou les faces débouchantes, pas la grande face de peau
|
||||||
@ -530,8 +529,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
if dist < 1e-3:
|
if dist < 1e-3:
|
||||||
for ik, edpfi in enumerate(edgesPeauFondIn):
|
for ik, edpfi in enumerate(edgesPeauFondIn):
|
||||||
if geompy.MinDistance(face, edpfi) < 1e-3:
|
if geompy.MinDistance(face, edpfi) < 1e-3:
|
||||||
|
ikok = ik
|
||||||
break
|
break
|
||||||
sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[ik]], geompy.ShapeType["VERTEX"])
|
sharedVertices = geompy.GetSharedShapesMulti([face, edgesPeauFondIn[ikok]], geompy.ShapeType["VERTEX"])
|
||||||
nameFace = "facePipePeau%d"%i
|
nameFace = "facePipePeau%d"%i
|
||||||
nameVert = "endEdgeFond%d"%i
|
nameVert = "endEdgeFond%d"%i
|
||||||
nameEdge = "edgeRadFacePipePeau%d"%i
|
nameEdge = "edgeRadFacePipePeau%d"%i
|
||||||
@ -574,7 +574,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- edges de bord de la face de peau
|
# --- edges de bord de la face de peau
|
||||||
|
|
||||||
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
||||||
edgesBords = []
|
edgesBords = list()
|
||||||
for i, edge in enumerate(edgesFilling):
|
for i, edge in enumerate(edgesFilling):
|
||||||
edgepeau = geompy.GetInPlace(facePeau, edge)
|
edgepeau = geompy.GetInPlace(facePeau, edge)
|
||||||
name = "edgepeau%d"%i
|
name = "edgepeau%d"%i
|
||||||
@ -615,7 +615,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
|
edgesPeau = geompy.ExtractShapes(facePeau, geompy.ShapeType["EDGE"], False)
|
||||||
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
|
edges = substractSubShapes(facePeau, edgesPeau, edgesListees)
|
||||||
edgesFissurePeau = []
|
edgesFissurePeau = list()
|
||||||
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
||||||
edgesFissurePeau = [None for i in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier
|
edgesFissurePeau = [None for i in range(len(verticesCircPeau))] # edges associés aux extrémités du pipe, en premier
|
||||||
for edge in edges:
|
for edge in edges:
|
||||||
@ -633,7 +633,6 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
name = "edgeFissurePeau%d"%i
|
name = "edgeFissurePeau%d"%i
|
||||||
geomPublishInFather(initLog.debug,facePeau, edge, name)
|
geomPublishInFather(initLog.debug,facePeau, edge, name)
|
||||||
|
|
||||||
|
|
||||||
ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
ptEdgeFond[ifil] = endsEdgeFond # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
||||||
fsPipePeau[ifil] = facesPipePeau # pour chaque face [faces du pipe débouchantes]
|
fsPipePeau[ifil] = facesPipePeau # pour chaque face [faces du pipe débouchantes]
|
||||||
edRadFPiPo[ifil] = edgeRadFacePipePeau # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
edRadFPiPo[ifil] = edgeRadFacePipePeau # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
||||||
@ -658,9 +657,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
# --- identification des faces et edges de fissure externe pour maillage
|
# --- identification des faces et edges de fissure externe pour maillage
|
||||||
|
|
||||||
facesFissExt = []
|
facesFissExt = list()
|
||||||
edgesFissExtPeau = []
|
edgesFissExtPeau = list()
|
||||||
edgesFissExtPipe = []
|
edgesFissExtPipe = list()
|
||||||
for ifil in range(nbFacesFilling): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?)
|
for ifil in range(nbFacesFilling): # TODO: éliminer les doublons (comparer tous les vertices triés, avec mesure de distance ?)
|
||||||
facesFissExt += fsFissuExt[ifil]
|
facesFissExt += fsFissuExt[ifil]
|
||||||
edgesFissExtPeau += edFisExtPe[ifil]
|
edgesFissExtPeau += edFisExtPe[ifil]
|
||||||
@ -669,12 +668,12 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# regroupement des faces de fissure externes au pipe.
|
# regroupement des faces de fissure externes au pipe.
|
||||||
|
|
||||||
if len(facesFissExt) > 1:
|
if len(facesFissExt) > 1:
|
||||||
faceFissureExterne = geompy.MakePartition(facesFissExt, [], [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
faceFissureExterne = geompy.MakePartition(facesFissExt, list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
|
||||||
edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur
|
edgesPipeFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesPipeFiss)) # edgesFissExtPipe peut ne pas couvrir toute la longueur
|
||||||
# edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau))
|
# edgesPeauFissureExterneC = geompy.GetInPlace(faceFissureExterne, geompy.MakeCompound(edgesFissExtPeau))
|
||||||
# il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau
|
# il peut manquer des edges de faceFissureExterne en contact avec la peau dans edgesFissExtPeau
|
||||||
(isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne)
|
(isDone, closedFreeBoundaries, openFreeBoundaries) = geompy.GetFreeBoundary(faceFissureExterne)
|
||||||
edgesBordFFE = []
|
edgesBordFFE = list()
|
||||||
for bound in closedFreeBoundaries:
|
for bound in closedFreeBoundaries:
|
||||||
edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False)
|
edgesBordFFE += geompy.ExtractShapes(bound, geompy.ShapeType["EDGE"], False)
|
||||||
edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE]
|
edgesBordFFEid = [ (ed,geompy.GetSubShapeID(faceFissureExterne, ed)) for ed in edgesBordFFE]
|
||||||
@ -707,7 +706,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
for edff in edgesFondFiss:
|
for edff in edgesFondFiss:
|
||||||
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
|
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
|
||||||
|
|
||||||
disfond = []
|
disfond = list()
|
||||||
for filling in facesDefaut:
|
for filling in facesDefaut:
|
||||||
disfond.append(geompy.MinDistance(centreFondFiss, filling))
|
disfond.append(geompy.MinDistance(centreFondFiss, filling))
|
||||||
disfond.sort()
|
disfond.sort()
|
||||||
@ -722,7 +721,14 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
meshFondExt = smesh.Mesh(wireFondFiss)
|
meshFondExt = smesh.Mesh(wireFondFiss)
|
||||||
algo1d = meshFondExt.Segment()
|
algo1d = meshFondExt.Segment()
|
||||||
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
||||||
isDone = meshFondExt.Compute()
|
is_done = meshFondExt.Compute()
|
||||||
|
text = "meshFondExt.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
|
ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
|
||||||
allNodeIds = meshFondExt.GetNodesId()
|
allNodeIds = meshFondExt.GetNodesId()
|
||||||
@ -737,16 +743,16 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
usort = sorted(ptGSdic)
|
usort = sorted(ptGSdic)
|
||||||
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
|
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
|
||||||
|
|
||||||
centres = []
|
centres = list()
|
||||||
origins = []
|
origins = list()
|
||||||
normals = []
|
normals = list()
|
||||||
for edu in usort:
|
for edu in usort:
|
||||||
ied = edu[1]
|
ied = edu[1]
|
||||||
u = edu[2]
|
u = edu[2]
|
||||||
vertcx = ptGSdic[edu]
|
vertcx = ptGSdic[edu]
|
||||||
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
|
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
|
||||||
plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
|
plan = geompy.MakePlane(vertcx, norm, 3*rayonPipe)
|
||||||
part = geompy.MakePartition([plan], [wirePipeFiss], [], [], geompy.ShapeType["VERTEX"], 0, [], 0)
|
part = geompy.MakePartition([plan], [wirePipeFiss], list(), list(), geompy.ShapeType["VERTEX"], 0, list(), 0)
|
||||||
liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
|
liste = geompy.ExtractShapes(part, geompy.ShapeType["VERTEX"], True)
|
||||||
if len(liste) == 5: # 4 coins du plan plus intersection recherchée
|
if len(liste) == 5: # 4 coins du plan plus intersection recherchée
|
||||||
for point in liste:
|
for point in liste:
|
||||||
@ -770,11 +776,11 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# --- points géométriques
|
# --- points géométriques
|
||||||
|
|
||||||
gptsdisks = [] # vertices géométrie de tous les disques
|
gptsdisks = list() # vertices géométrie de tous les disques
|
||||||
raydisks = [[] for i in range(nbsegCercle)]
|
raydisks = [list() for i in range(nbsegCercle)]
|
||||||
for i in range(len(centres)): # boucle sur les disques
|
for i, centres_i in enumerate(centres): # boucle sur les disques
|
||||||
gptdsk = [] # vertices géométrie d'un disque
|
gptdsk = list() # vertices géométrie d'un disque
|
||||||
vertcx = centres[i]
|
vertcx = centres_i
|
||||||
vertpx = origins[i]
|
vertpx = origins[i]
|
||||||
normal = normals[i]
|
normal = normals[i]
|
||||||
vec1 = geompy.MakeVector(vertcx, vertpx)
|
vec1 = geompy.MakeVector(vertcx, vertpx)
|
||||||
@ -821,15 +827,15 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
idFillingFromBout[1] = ifil
|
idFillingFromBout[1] = ifil
|
||||||
logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout)
|
logging.debug("association bouts du pipe - faces de filling: %s", idFillingFromBout)
|
||||||
|
|
||||||
facesPipePeau = []
|
facesPipePeau = list()
|
||||||
edgeRadFacePipePeau = []
|
edgeRadFacePipePeau = list()
|
||||||
for ifil in range(nbFacesFilling):
|
for ifil in range(nbFacesFilling):
|
||||||
facesPipePeau += fsPipePeau[ifil]
|
facesPipePeau += fsPipePeau[ifil]
|
||||||
edgeRadFacePipePeau += edRadFPiPo[ifil]
|
edgeRadFacePipePeau += edRadFPiPo[ifil]
|
||||||
|
|
||||||
logging.debug("recherche des disques de noeuds complètement internes")
|
logging.debug("recherche des disques de noeuds complètement internes")
|
||||||
idisklim = [] # indices des premier et dernier disques internes
|
idisklim = list() # indices des premier et dernier disques internes
|
||||||
idiskout = [] # indices des premier et dernier disques externes
|
idiskout = list() # indices des premier et dernier disques externes
|
||||||
for bout in range(2):
|
for bout in range(2):
|
||||||
if bout == 0:
|
if bout == 0:
|
||||||
idisk = -1
|
idisk = -1
|
||||||
@ -864,11 +870,11 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- listes de nappes radiales en filling à chaque extrémité débouchante
|
# --- listes de nappes radiales en filling à chaque extrémité débouchante
|
||||||
facesDebouchantes = [False, False]
|
facesDebouchantes = [False, False]
|
||||||
idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau)
|
idFacesDebouchantes = [-1, -1] # contiendra les indices des faces disque débouchantes (facesPipePeau)
|
||||||
listNappes =[]
|
listNappes =list()
|
||||||
for i, idisk in enumerate(idisklim):
|
for i, idisk in enumerate(idisklim):
|
||||||
numout = idiskout[i]
|
numout = idiskout[i]
|
||||||
logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout)
|
logging.debug("extremité %s, indices disques interne %s, externe %s",i, idisk, numout)
|
||||||
nappes = []
|
nappes = list()
|
||||||
if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante
|
if (idisk != 0) and (idisk != len(gptsdisks)-1): # si extrémité débouchante
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
@ -903,11 +909,11 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes)
|
logging.debug("idFacesDebouchantes: %s", idFacesDebouchantes)
|
||||||
|
|
||||||
# --- construction des listes d'edges radiales sur chaque extrémité débouchante
|
# --- construction des listes d'edges radiales sur chaque extrémité débouchante
|
||||||
listEdges = []
|
listEdges = list()
|
||||||
for i, nappes in enumerate(listNappes):
|
for i, nappes in enumerate(listNappes):
|
||||||
id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
|
id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
|
||||||
if id < 0:
|
if id < 0:
|
||||||
listEdges.append([])
|
listEdges.append(list())
|
||||||
else:
|
else:
|
||||||
face = facesPipePeau[id]
|
face = facesPipePeau[id]
|
||||||
edges = [edgeRadFacePipePeau[id]]
|
edges = [edgeRadFacePipePeau[id]]
|
||||||
@ -924,9 +930,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
maxl = geompy.BasicProperties(edge)[0]
|
maxl = geompy.BasicProperties(edge)[0]
|
||||||
if maxl < 0.01: # problème MakeSection
|
if maxl < 0.01: # problème MakeSection
|
||||||
logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
|
logging.debug("problème MakeSection recherche edge radiale %s, longueur trop faible: %s, utilisation partition", k, maxl)
|
||||||
partNappeFace = geompy.MakePartition([face, nappes[k]], [] , [], [], geompy.ShapeType["FACE"], 0, [], 0)
|
partNappeFace = geompy.MakePartition([face, nappes[k]], list() , list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
|
||||||
edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
|
edps= geompy.ExtractShapes(partNappeFace, geompy.ShapeType["EDGE"], False)
|
||||||
ednouv = []
|
ednouv = list()
|
||||||
for ii, ed in enumerate(edps):
|
for ii, ed in enumerate(edps):
|
||||||
vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
|
vxs = geompy.ExtractShapes(ed, geompy.ShapeType["VERTEX"], False)
|
||||||
distx = [geompy.MinDistance(vx, face) for vx in vxs]
|
distx = [geompy.MinDistance(vx, face) for vx in vxs]
|
||||||
@ -950,7 +956,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
for i, edges in enumerate(listEdges):
|
for i, edges in enumerate(listEdges):
|
||||||
id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
|
id = idFacesDebouchantes[i] # indice de face débouchante (facesPipePeau)
|
||||||
if id >= 0:
|
if id >= 0:
|
||||||
gptdsk = []
|
gptdsk = list()
|
||||||
if id > 0: # id vaut 0 ou 1
|
if id > 0: # id vaut 0 ou 1
|
||||||
id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
|
id = -1 # si id vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
|
||||||
centre = ptEdgeFond[idFillingFromBout[i]][id]
|
centre = ptEdgeFond[idFillingFromBout[i]][id]
|
||||||
@ -959,7 +965,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
|
vertPipePeau = ptFisExtPi[idFillingFromBout[i]][id]
|
||||||
geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau")
|
geomPublishInFather(initLog.debug,centre, vertPipePeau, "vertPipePeau")
|
||||||
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
grpsEdgesCirc = edCircPeau[idFillingFromBout[i]] # liste de groupes
|
||||||
edgesCirc = []
|
edgesCirc = list()
|
||||||
for grpEdgesCirc in grpsEdgesCirc:
|
for grpEdgesCirc in grpsEdgesCirc:
|
||||||
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
||||||
for k, edge in enumerate(edges):
|
for k, edge in enumerate(edges):
|
||||||
@ -986,7 +992,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
name ="bout%d"%k
|
name ="bout%d"%k
|
||||||
geomPublishInFather(initLog.debug,centre, bout, name)
|
geomPublishInFather(initLog.debug,centre, bout, name)
|
||||||
# enregistrement des points dans la structure
|
# enregistrement des points dans la structure
|
||||||
points = []
|
points = list()
|
||||||
for j in range(nbsegRad +1):
|
for j in range(nbsegRad +1):
|
||||||
u = j/float(nbsegRad)
|
u = j/float(nbsegRad)
|
||||||
points.append(geompy.MakeVertexOnCurve(edge, u))
|
points.append(geompy.MakeVertexOnCurve(edge, u))
|
||||||
@ -1008,9 +1014,9 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe)
|
verticesPFE = findWireIntermediateVertices(wirePipeFissureExterne) # vertices intermédiaires (des points en trop dans ptsInWireFissExtPipe)
|
||||||
idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté
|
idiskmin = idisklim[0] + 1 # on ne prend pas le disque sur la peau, déjà ajusté
|
||||||
idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté
|
idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté
|
||||||
idiskint = []
|
idiskint = list()
|
||||||
for vtx in verticesPFE:
|
for vtx in verticesPFE:
|
||||||
distPtVt = []
|
distPtVt = list()
|
||||||
for idisk in range(idiskmin, idiskmax):
|
for idisk in range(idiskmin, idiskmax):
|
||||||
gptdsk = gptsdisks[idisk]
|
gptdsk = gptsdisks[idisk]
|
||||||
pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe
|
pt = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe
|
||||||
@ -1045,13 +1051,13 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
|
edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
|
||||||
faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
|
faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
|
||||||
faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
|
faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
|
||||||
mptsdisks = [] # vertices maillage de tous les disques
|
mptsdisks = list() # vertices maillage de tous les disques
|
||||||
mEdges = [] # identifiants edges maillage fond de fissure
|
mEdges = list() # identifiants edges maillage fond de fissure
|
||||||
mEdgeFaces = [] # identifiants edges maillage edge face de fissure externe
|
mEdgeFaces = list() # identifiants edges maillage edge face de fissure externe
|
||||||
mFaces = [] # identifiants faces maillage fissure
|
mFaces = list() # identifiants faces maillage fissure
|
||||||
mVols = [] # identifiants volumes maillage pipe
|
mVols = list() # identifiants volumes maillage pipe
|
||||||
|
|
||||||
mptdsk = None
|
mptdsk = list()
|
||||||
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
|
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
@ -1060,10 +1066,10 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
gptdsk = gptsdisks[idisk]
|
gptdsk = gptsdisks[idisk]
|
||||||
if idisk > idisklim[0]:
|
if idisk > idisklim[0]:
|
||||||
oldmpts = mptdsk
|
oldmpts = mptdsk
|
||||||
mptdsk = [] # vertices maillage d'un disque
|
mptdsk = list() # vertices maillage d'un disque
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
points = gptdsk[k]
|
points = gptdsk[k]
|
||||||
mptids = []
|
mptids = list()
|
||||||
for j, pt in enumerate(points):
|
for j, pt in enumerate(points):
|
||||||
if j == 0 and k > 0:
|
if j == 0 and k > 0:
|
||||||
id = mptdsk[0][0]
|
id = mptdsk[0][0]
|
||||||
@ -1078,24 +1084,24 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- groupes edges cercles debouchants
|
# --- groupes edges cercles debouchants
|
||||||
|
|
||||||
if idisk == idisklim[0]:
|
if idisk == idisklim[0]:
|
||||||
pts = []
|
pts = list()
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
pts.append(mptdsk[k][-1])
|
pts.append(mptdsk[k][-1])
|
||||||
edges = []
|
edges = list()
|
||||||
for k in range(len(pts)):
|
for k, pts_k in enumerate(pts):
|
||||||
k1 = (k+1)%len(pts)
|
k1 = (k+1)%len(pts)
|
||||||
idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
|
idEdge = meshPipe.AddEdge([pts_k, pts[k1]])
|
||||||
edges.append(idEdge)
|
edges.append(idEdge)
|
||||||
edgeCircPipe0Group.Add(edges)
|
edgeCircPipe0Group.Add(edges)
|
||||||
|
|
||||||
if idisk == idisklim[1]:
|
if idisk == idisklim[1]:
|
||||||
pts = []
|
pts = list()
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
pts.append(mptdsk[k][-1])
|
pts.append(mptdsk[k][-1])
|
||||||
edges = []
|
edges = list()
|
||||||
for k in range(len(pts)):
|
for k, pts_k in enumerate(pts):
|
||||||
k1 = (k+1)%len(pts)
|
k1 = (k+1)%len(pts)
|
||||||
idEdge = meshPipe.AddEdge([pts[k], pts[k1]])
|
idEdge = meshPipe.AddEdge([pts_k, pts[k1]])
|
||||||
edges.append(idEdge)
|
edges.append(idEdge)
|
||||||
edgeCircPipe1Group.Add(edges)
|
edgeCircPipe1Group.Add(edges)
|
||||||
|
|
||||||
@ -1103,7 +1109,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
# --- groupes faces debouchantes
|
# --- groupes faces debouchantes
|
||||||
|
|
||||||
if idisk == idisklim[0]:
|
if idisk == idisklim[0]:
|
||||||
faces = []
|
faces = list()
|
||||||
for j in range(nbsegRad):
|
for j in range(nbsegRad):
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
k1 = k+1
|
k1 = k+1
|
||||||
@ -1117,7 +1123,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
faceCircPipe0Group.Add(faces)
|
faceCircPipe0Group.Add(faces)
|
||||||
|
|
||||||
if idisk == idisklim[1]:
|
if idisk == idisklim[1]:
|
||||||
faces = []
|
faces = list()
|
||||||
for j in range(nbsegRad):
|
for j in range(nbsegRad):
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
k1 = k+1
|
k1 = k+1
|
||||||
@ -1147,15 +1153,15 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
|
ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
|
||||||
mEdgeFaces.append(ide2)
|
mEdgeFaces.append(ide2)
|
||||||
edgeFaceFissGroup.Add([ide2])
|
edgeFaceFissGroup.Add([ide2])
|
||||||
idFaces = []
|
idFaces = list()
|
||||||
idVols = []
|
idVols = list()
|
||||||
|
|
||||||
for j in range(nbsegRad):
|
for j in range(nbsegRad):
|
||||||
idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]])
|
idf = meshPipe.AddFace([oldmpts[0][j], mptdsk[0][j], mptdsk[0][j+1], oldmpts[0][j+1]])
|
||||||
faceFissGroup.Add([idf])
|
faceFissGroup.Add([idf])
|
||||||
idFaces.append(idf)
|
idFaces.append(idf)
|
||||||
|
|
||||||
idVolCercle = []
|
idVolCercle = list()
|
||||||
for k in range(nbsegCercle):
|
for k in range(nbsegCercle):
|
||||||
k1 = k+1
|
k1 = k+1
|
||||||
if k == nbsegCercle-1:
|
if k == nbsegCercle-1:
|
||||||
@ -1184,7 +1190,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
|
|
||||||
aFilterManager = smesh.CreateFilterManager()
|
aFilterManager = smesh.CreateFilterManager()
|
||||||
nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
|
nbAdded, internalBoundary, _NoneGroup = internalBoundary.MakeBoundaryElements( SMESH.BND_1DFROM2D, '', '', 0, [ ])
|
||||||
criteres = []
|
criteres = list()
|
||||||
unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
|
unCritere = smesh.GetCriterion(SMESH.EDGE,SMESH.FT_FreeBorders,SMESH.FT_Undefined,0)
|
||||||
criteres.append(unCritere)
|
criteres.append(unCritere)
|
||||||
filtre = smesh.GetFilterFromCriteria(criteres)
|
filtre = smesh.GetFilterFromCriteria(criteres)
|
||||||
@ -1203,12 +1209,18 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
|
aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
|
||||||
meshAretesVives = smesh.Mesh(aretesVivesC)
|
meshAretesVives = smesh.Mesh(aretesVivesC)
|
||||||
algo1d = meshAretesVives.Segment()
|
algo1d = meshAretesVives.Segment()
|
||||||
hypo1d = algo1d.LocalLength(dmoyen,[],1e-07)
|
hypo1d = algo1d.LocalLength(dmoyen,list(),1e-07)
|
||||||
putName(algo1d.GetSubMesh(), "aretesVives")
|
putName(algo1d.GetSubMesh(), "aretesVives")
|
||||||
putName(algo1d, "algo1d_aretesVives")
|
putName(algo1d, "algo1d_aretesVives")
|
||||||
putName(hypo1d, "hypo1d_aretesVives")
|
putName(hypo1d, "hypo1d_aretesVives")
|
||||||
isDone = meshAretesVives.Compute()
|
is_done = meshAretesVives.Compute()
|
||||||
logging.info("aretesVives fini")
|
text = "meshAretesVives.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
|
grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
|
||||||
nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
|
nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
|
||||||
|
|
||||||
@ -1236,8 +1248,14 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
putName(algo1d, "algo1d_edgeFissPeau")
|
putName(algo1d, "algo1d_edgeFissPeau")
|
||||||
putName(hypo1d, "hypo1d_edgeFissPeau")
|
putName(hypo1d, "hypo1d_edgeFissPeau")
|
||||||
|
|
||||||
isDone = meshFaceFiss.Compute()
|
is_done = meshFaceFiss.Compute()
|
||||||
logging.info("meshFaceFiss fini")
|
text = "meshFaceFiss.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
|
grpFaceFissureExterne = meshFaceFiss.GroupOnGeom(faceFissureExterne, "fisOutPi", SMESH.FACE)
|
||||||
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
|
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
|
||||||
@ -1251,7 +1269,7 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
boutFromIfil[idFillingFromBout[1]] = 1
|
boutFromIfil[idFillingFromBout[1]] = 1
|
||||||
|
|
||||||
logging.debug("---------------------------- maillage faces de peau --------------")
|
logging.debug("---------------------------- maillage faces de peau --------------")
|
||||||
meshesFacesPeau = []
|
meshesFacesPeau = list()
|
||||||
for ifil in range(nbFacesFilling):
|
for ifil in range(nbFacesFilling):
|
||||||
meshFacePeau = None
|
meshFacePeau = None
|
||||||
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
|
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
|
||||||
@ -1324,8 +1342,14 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
putName(algo2d, "algo2d_facePeau", ifil)
|
putName(algo2d, "algo2d_facePeau", ifil)
|
||||||
putName(hypo2d, "hypo2d_facePeau", ifil)
|
putName(hypo2d, "hypo2d_facePeau", ifil)
|
||||||
|
|
||||||
isDone = meshFacePeau.Compute()
|
is_done = meshFacePeau.Compute()
|
||||||
logging.info("meshFacePeau %d fini", ifil)
|
text = "meshFacePeau {} Compute".format(ifil)
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
||||||
nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
|
nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
|
||||||
meshesFacesPeau.append(meshFacePeau)
|
meshesFacesPeau.append(meshFacePeau)
|
||||||
@ -1362,9 +1386,15 @@ def insereFissureGenerale(maillagesSains,
|
|||||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||||
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
||||||
putName(algo3d, "algo3d_boiteDefaut")
|
putName(algo3d, "algo3d_boiteDefaut")
|
||||||
isDone = meshBoiteDefaut.Compute()
|
|
||||||
putName(meshBoiteDefaut, "boiteDefaut")
|
putName(meshBoiteDefaut, "boiteDefaut")
|
||||||
logging.info("meshBoiteDefaut fini")
|
is_done = meshBoiteDefaut.Compute()
|
||||||
|
text = "meshBoiteDefaut.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
|
faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], 'FACE1' )
|
||||||
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
|
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
|
||||||
|
@ -449,8 +449,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
putName(algo1d.GetSubMesh(), "generatrice", i)
|
putName(algo1d.GetSubMesh(), "generatrice", i)
|
||||||
putName(algo1d, "algo1d_generatrice", i)
|
putName(algo1d, "algo1d_generatrice", i)
|
||||||
putName(hypo1d, "hypo1d_generatrice", i)
|
putName(hypo1d, "hypo1d_generatrice", i)
|
||||||
isDone = meshFondFiss.Compute()
|
is_done = meshFondFiss.Compute()
|
||||||
logging.info("meshFondFiss computed")
|
text = "meshFondFiss.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
disks = list()
|
disks = list()
|
||||||
for i, face in enumerate(disques[:4]):
|
for i, face in enumerate(disques[:4]):
|
||||||
@ -547,8 +553,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
putName(algo1d, "algo1d_groupDemiCercles", i)
|
putName(algo1d, "algo1d_groupDemiCercles", i)
|
||||||
putName(hypo1d, "hypo1d_groupDemiCercles", i)
|
putName(hypo1d, "hypo1d_groupDemiCercles", i)
|
||||||
#
|
#
|
||||||
isDone = meshFacePeau.Compute()
|
is_done = meshFacePeau.Compute()
|
||||||
logging.info("meshFacePeau computed")
|
text = "meshFacePeau.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
grpTHOR = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
|
grpTHOR = meshFacePeau.GroupOnGeom(verticesOutCercles[0], "THOR", SMESH.NODE)
|
||||||
grpTHEX = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
|
grpTHEX = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
|
||||||
|
|
||||||
@ -584,8 +596,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
putName(algo1d, "algo1d_edgeFissPeau")
|
putName(algo1d, "algo1d_edgeFissPeau")
|
||||||
putName(hypo1d, "hypo1d_edgeFissPeau")
|
putName(hypo1d, "hypo1d_edgeFissPeau")
|
||||||
#
|
#
|
||||||
isDone = meshFaceFiss.Compute()
|
is_done = meshFaceFiss.Compute()
|
||||||
logging.info("meshFaceFiss computed")
|
text = "meshFaceFiss.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
grp = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)
|
grp = meshFaceFiss.GroupOnGeom(faceFiss, "fisOutPi", SMESH.FACE)
|
||||||
|
|
||||||
@ -617,9 +635,15 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
|
|||||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||||
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
||||||
putName(algo3d, "algo3d_boiteDefaut")
|
putName(algo3d, "algo3d_boiteDefaut")
|
||||||
isDone = meshBoiteDefaut.Compute()
|
|
||||||
logging.info("meshBoiteDefaut computed")
|
|
||||||
putName(meshBoiteDefaut, "boiteDefaut")
|
putName(meshBoiteDefaut, "boiteDefaut")
|
||||||
|
is_done = meshBoiteDefaut.Compute()
|
||||||
|
text = "meshBoiteDefaut.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
groups = maillageSain.GetGroups()
|
groups = maillageSain.GetGroups()
|
||||||
grps1 = [ grp for grp in groups if grp.GetName() == 'P1']
|
grps1 = [ grp for grp in groups if grp.GetName() == 'P1']
|
||||||
|
@ -58,8 +58,14 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
|
|||||||
putName(algo1d.GetSubMesh(), "aretesVives")
|
putName(algo1d.GetSubMesh(), "aretesVives")
|
||||||
putName(algo1d, "algo1d_aretesVives")
|
putName(algo1d, "algo1d_aretesVives")
|
||||||
putName(hypo1d, "hypo1d_aretesVives")
|
putName(hypo1d, "hypo1d_aretesVives")
|
||||||
isDone = meshAretesVives.Compute()
|
is_done = meshAretesVives.Compute()
|
||||||
logging.info("aretesVives fini")
|
text = "meshAretesVives.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
|
grpAretesVives = meshAretesVives.CreateEmptyGroup( SMESH.EDGE, 'grpAretesVives' )
|
||||||
nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
|
nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFi
|
|||||||
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
|
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
|
||||||
grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
|
grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
|
||||||
|
|
||||||
isDone = meshFaceFiss.Compute()
|
is_done = meshFaceFiss.Compute()
|
||||||
text = "meshFaceFiss fini"
|
text = "meshFaceFiss.Compute"
|
||||||
if isDone:
|
if is_done:
|
||||||
logging.info(text)
|
logging.info(text+" OK")
|
||||||
else:
|
else:
|
||||||
text = "Erreur au calcul du maillage.\n" + text
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
logging.info(text)
|
logging.info(text)
|
||||||
|
@ -120,8 +120,14 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
|
|||||||
putName(algo2d, "algo2d_facePeau", ifil)
|
putName(algo2d, "algo2d_facePeau", ifil)
|
||||||
putName(hypo2d, "hypo2d_facePeau", ifil)
|
putName(hypo2d, "hypo2d_facePeau", ifil)
|
||||||
|
|
||||||
isDone = meshFacePeau.Compute()
|
is_done = meshFacePeau.Compute()
|
||||||
logging.info("meshFacePeau %d fini", ifil)
|
text = "meshFacePeau {} .Compute".format(ifil)
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
||||||
nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
|
nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
|
||||||
meshesFacesPeau.append(meshFacePeau)
|
meshesFacesPeau.append(meshFacePeau)
|
||||||
|
@ -194,7 +194,14 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
|||||||
putName(algo3d, "algo3d_ellipsoide")
|
putName(algo3d, "algo3d_ellipsoide")
|
||||||
putName(hypo3d, "hypo3d_ellipsoide")
|
putName(hypo3d, "hypo3d_ellipsoide")
|
||||||
|
|
||||||
isDone = bloc1.Compute()
|
is_done = bloc1.Compute()
|
||||||
|
text = "bloc1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
nbRemoved = bloc1.RemoveOrphanNodes()
|
nbRemoved = bloc1.RemoveOrphanNodes()
|
||||||
|
|
||||||
@ -230,9 +237,9 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
|||||||
putName(hypo3d, "hypo3d_bloc")
|
putName(hypo3d, "hypo3d_bloc")
|
||||||
|
|
||||||
is_done = blocMesh.Compute()
|
is_done = blocMesh.Compute()
|
||||||
text = "meshBlocPart Compute"
|
text = "blocMesh.Compute"
|
||||||
if is_done:
|
if is_done:
|
||||||
logging.info(text)
|
logging.info(text+" OK")
|
||||||
else:
|
else:
|
||||||
text = "Erreur au calcul du maillage.\n" + text
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
logging.info(text)
|
logging.info(text)
|
||||||
|
@ -74,13 +74,20 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
Mesh_1 = smesh.Mesh(Box_1)
|
Mesh_1 = smesh.Mesh(Box_1)
|
||||||
|
smesh.SetName(Mesh_1, 'Mesh_1')
|
||||||
Regular_1D = Mesh_1.Segment()
|
Regular_1D = Mesh_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
||||||
isDone = Mesh_1.Compute()
|
is_done = Mesh_1.Compute()
|
||||||
smesh.SetName(Mesh_1, 'Mesh_1')
|
text = "Mesh_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
|
Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
|
||||||
|
|
||||||
## set object names
|
## set object names
|
||||||
|
@ -127,10 +127,16 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
|
|||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa)
|
Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa)
|
||||||
isDone = cubeFin_1.Compute()
|
|
||||||
DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE)
|
DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE)
|
||||||
ENCASTR_1 = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE)
|
ENCASTR_1 = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE)
|
||||||
|
is_done = cubeFin_1.Compute()
|
||||||
|
text = "cubeFin_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
## Set names of Mesh objects
|
## Set names of Mesh objects
|
||||||
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
|
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
|
||||||
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
|
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
|
||||||
|
@ -148,6 +148,7 @@ smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
|
|||||||
smeshObj_1.SetNumberOfSegments( 5 )
|
smeshObj_1.SetNumberOfSegments( 5 )
|
||||||
smeshObj_1.SetDistrType( 0 )
|
smeshObj_1.SetDistrType( 0 )
|
||||||
CylindreSain_1 = smesh.Mesh(CylindreSain)
|
CylindreSain_1 = smesh.Mesh(CylindreSain)
|
||||||
|
smesh.SetName(CylindreSain_1, 'CylindreSain')
|
||||||
Regular_1D = CylindreSain_1.Segment()
|
Regular_1D = CylindreSain_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
@ -159,8 +160,14 @@ Nb_Segments_2.SetDistrType( 0 )
|
|||||||
Regular_1D_2 = CylindreSain_1.Segment(geom=radial)
|
Regular_1D_2 = CylindreSain_1.Segment(geom=radial)
|
||||||
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(6,[],[ ])
|
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(6,[],[ ])
|
||||||
Nb_Segments_3.SetDistrType( 0 )
|
Nb_Segments_3.SetDistrType( 0 )
|
||||||
isDone = CylindreSain_1.Compute()
|
is_done = CylindreSain_1.Compute()
|
||||||
smesh.SetName(CylindreSain_1, 'CylindreSain')
|
text = "CylindreSain_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
CylindreSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
|
CylindreSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
|
||||||
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
||||||
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
||||||
|
@ -76,6 +76,7 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
Disque_1 = smesh.Mesh(Disque)
|
Disque_1 = smesh.Mesh(Disque)
|
||||||
|
smesh.SetName(Disque_1, 'Disque')
|
||||||
Regular_1D = Disque_1.Segment()
|
Regular_1D = Disque_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
@ -86,8 +87,14 @@ Nb_Segments_2.SetDistrType( 0 )
|
|||||||
Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
|
Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
|
||||||
status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
|
status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
|
||||||
Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
isDone = Disque_1.Compute()
|
is_done = Disque_1.Compute()
|
||||||
smesh.SetName(Disque_1, 'Disque')
|
text = "Disque_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
|
Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
|
||||||
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
||||||
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
||||||
|
@ -92,6 +92,7 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
|
EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
|
||||||
|
smesh.SetName(EprouvetteCourbe_1, 'EprouvetteCourbe')
|
||||||
Regular_1D = EprouvetteCourbe_1.Segment()
|
Regular_1D = EprouvetteCourbe_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(50)
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(50)
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
@ -103,8 +104,14 @@ Nb_Segments_2.SetDistrType( 0 )
|
|||||||
Regular_1D_2 = EprouvetteCourbe_1.Segment(geom=Compound_y)
|
Regular_1D_2 = EprouvetteCourbe_1.Segment(geom=Compound_y)
|
||||||
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(25)
|
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(25)
|
||||||
Nb_Segments_3.SetDistrType( 0 )
|
Nb_Segments_3.SetDistrType( 0 )
|
||||||
isDone = EprouvetteCourbe_1.Compute()
|
is_done = EprouvetteCourbe_1.Compute()
|
||||||
smesh.SetName(EprouvetteCourbe_1, 'EprouvetteCourbe')
|
text = "EprouvetteCourbe_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
EprouvetteCourbe_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
|
EprouvetteCourbe_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
|
||||||
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
||||||
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
||||||
|
@ -126,6 +126,7 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
|
eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
|
||||||
|
smesh.SetName(eprouvetteDroite_1, 'eprouvetteDroite')
|
||||||
Regular_1D = eprouvetteDroite_1.Segment()
|
Regular_1D = eprouvetteDroite_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(50,[],[ ])
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(50,[],[ ])
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
@ -137,8 +138,14 @@ Nb_Segments_2.SetDistrType( 0 )
|
|||||||
Regular_1D_2 = eprouvetteDroite_1.Segment(geom=Compound_x)
|
Regular_1D_2 = eprouvetteDroite_1.Segment(geom=Compound_x)
|
||||||
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,[],[ ])
|
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,[],[ ])
|
||||||
Nb_Segments_3.SetDistrType( 0 )
|
Nb_Segments_3.SetDistrType( 0 )
|
||||||
isDone = eprouvetteDroite_1.Compute()
|
is_done = eprouvetteDroite_1.Compute()
|
||||||
smesh.SetName(eprouvetteDroite_1, 'eprouvetteDroite')
|
text = "eprouvetteDroite_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
eprouvetteDroite_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med"))
|
eprouvetteDroite_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med"))
|
||||||
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
||||||
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
||||||
|
@ -121,6 +121,7 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
objetSain_1 = smesh.Mesh(objetSain)
|
objetSain_1 = smesh.Mesh(objetSain)
|
||||||
|
smesh.SetName(objetSain_1, 'objetSain')
|
||||||
Regular_1D = objetSain_1.Segment()
|
Regular_1D = objetSain_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(10,[],[ ])
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(10,[],[ ])
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
@ -132,8 +133,14 @@ Nb_Segments_2.SetDistrType( 0 )
|
|||||||
Regular_1D_2 = objetSain_1.Segment(geom=epaisseurs)
|
Regular_1D_2 = objetSain_1.Segment(geom=epaisseurs)
|
||||||
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(5,[],[ ])
|
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(5,[],[ ])
|
||||||
Nb_Segments_3.SetDistrType( 0 )
|
Nb_Segments_3.SetDistrType( 0 )
|
||||||
isDone = objetSain_1.Compute()
|
is_done = objetSain_1.Compute()
|
||||||
smesh.SetName(objetSain_1, 'objetSain')
|
text = "objetSain_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
objetSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
|
objetSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
|
||||||
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
SubMesh_1 = Regular_1D_1.GetSubMesh()
|
||||||
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
SubMesh_2 = Regular_1D_2.GetSubMesh()
|
||||||
|
@ -95,13 +95,20 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
from salome.StdMeshers import StdMeshersBuilder
|
from salome.StdMeshers import StdMeshersBuilder
|
||||||
Mesh_1 = smesh.Mesh(objetSain)
|
Mesh_1 = smesh.Mesh(objetSain)
|
||||||
|
smesh.SetName(Mesh_1, 'Mesh_1')
|
||||||
Regular_1D = Mesh_1.Segment()
|
Regular_1D = Mesh_1.Segment()
|
||||||
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
|
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
|
||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
||||||
isDone = Mesh_1.Compute()
|
is_done = Mesh_1.Compute()
|
||||||
smesh.SetName(Mesh_1, 'Mesh_1')
|
text = "Mesh_1.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
|
Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
|
||||||
|
|
||||||
## set object names
|
## set object names
|
||||||
|
@ -211,9 +211,9 @@ conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
|
|||||||
appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
|
appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
|
||||||
p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
|
p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
|
||||||
|
|
||||||
isDone = coupe_vis_1.Compute()
|
is_done = coupe_vis_1.Compute()
|
||||||
text = "Maillage de {}".format(coupe_vis.GetName())
|
text = "coupe_vis_1.Compute"
|
||||||
if isDone:
|
if is_done:
|
||||||
logging.debug(text+" : OK")
|
logging.debug(text+" : OK")
|
||||||
else:
|
else:
|
||||||
text = "Erreur au calcul du maillage.\n" + text
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
Loading…
Reference in New Issue
Block a user