Contrôle des calculs de maillage

This commit is contained in:
GERALD NICOLAS 2021-01-26 18:34:02 +01:00
parent 65d5c162a5
commit 0068dfdcb1
20 changed files with 469 additions and 315 deletions

View File

@ -23,43 +23,53 @@ import math
from .geomsmesh import geompy
from .geomsmesh import smesh
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
centreFondFiss, wireFondFiss, wirePipeFiss,
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad):
"""
preparation maillage du pipe :
"""preparation maillage du pipe :
- détections des points a respecter : jonction des edges/faces constituant
la face de fissure externe au pipe
- points sur les edges de fond de fissure et edges pipe/face fissure,
- vecteurs tangents au fond de fissure (normal au disque maillé)
- vecteurs tangents au fond de fissure (normal au disque maillé)
"""
logging.info('start')
# --- option de maillage selon le rayon de courbure du fond de fissure
# --- option de maillage selon le rayon de courbure du fond de fissure
lenEdgeFondExt = 0
for edff in edgesFondFiss:
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
disfond = []
disfond = list()
for filling in facesDefaut:
disfond.append(geompy.MinDistance(centreFondFiss, filling))
disfond.sort()
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
alpha = math.pi/(4*nbSegQuart)
deflexion = rcourb*(1.0 -math.cos(alpha))
lgmin = lenSegPipe*0.25
lgmax = lenSegPipe*1.5
logging.debug("rcourb: %s, lenFond:%s, deflexion: %s, lgmin: %s, lgmax: %s", rcourb, lenEdgeFondExt, deflexion, lgmin, lgmax)
lgmax = lenSegPipe*1.5
texte = "==> deflexion: {}, lgmin: {}, lgmax: {}".format(deflexion, lgmin, lgmax)
logging.info(texte)
meshFondExt = smesh.Mesh(wireFondFiss)
algo1d = meshFondExt.Segment()
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
isDone = meshFondExt.Compute()
ptGSdic = {} # dictionnaire [paramètre sur la courbe] --> point géométrique
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 = dict() # dictionnaire [paramètre sur la courbe] --> point géométrique
allNodeIds = meshFondExt.GetNodesId()
for nodeId in allNodeIds:
xyz = meshFondExt.GetNodeXYZ(nodeId)
@ -69,19 +79,19 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
ptGSdic[(edgeOrder, EdgeInWireIndex, u)] = pt
#logging.debug("nodeId %s, u %s", nodeId, str(u))
usort = sorted(ptGSdic)
usort = sorted(ptGSdic)
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
centres = []
origins = []
normals = []
centres = list()
origins = list()
normals = list()
for edu in usort:
ied = edu[1]
u = edu[2]
vertcx = ptGSdic[edu]
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], u)
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)
if len(liste) == 5: # 4 coins du plan plus intersection recherchée
for point in liste:
@ -99,21 +109,21 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
# geompy.addToStudyInFather(wireFondFiss, plan, name)
# --- maillage du pipe étendu, sans tenir compte de l'intersection avec la face de peau
logging.debug("nbsegCercle %s", nbsegCercle)
# -----------------------------------------------------------------------
# --- points géométriques
gptsdisks = [] # vertices géométrie de tous les disques
raydisks = [[] for i in range(nbsegCercle)]
for i in range(len(centres)): # boucle sur les disques
gptdsk = [] # vertices géométrie d'un disque
vertcx = centres[i]
gptsdisks = list() # vertices géométrie de tous les disques
raydisks = [list() for i in range(nbsegCercle)]
for i, centres_i in enumerate(centres): # boucle sur les disques
gptdsk = list() # vertices géométrie d'un disque
vertcx = centres_i
vertpx = origins[i]
normal = normals[i]
vec1 = geompy.MakeVector(vertcx, vertpx)
points = [vertcx] # les points du rayon de référence
for j in range(nbsegRad):
pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*float(rayonPipe)/nbsegRad)
@ -122,7 +132,7 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
pt = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe)
rayon = geompy.MakeLineTwoPnt(vertcx, pt)
raydisks[0].append(rayon)
for k in range(nbsegCercle-1):
angle = (k+1)*2*math.pi/nbsegCercle
pts = [vertcx] # les points d'un rayon obtenu par rotation
@ -132,7 +142,7 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
gptdsk.append(pts)
ray = geompy.MakeRotation(rayon, normal, angle)
raydisks[k+1].append(ray)
gptsdisks.append(gptdsk)
return (centres, gptsdisks, raydisks)

View File

@ -318,9 +318,15 @@ def construitFissureGenerale(maillagesSains,
hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "boiteDefaut")
putName(algo3d, "algo3d_boiteDefaut")
isDone = meshBoiteDefaut.Compute()
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' )

View File

@ -185,4 +185,8 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad):
edgesCircPipeGroup = edgesCircPipeGroup \
)
#if meshPipe:
#text = "Arrêt rapide.\n"
#logging.info(text)
#raise Exception(text)
return (meshPipe, meshPipeGroups, edgesCircPipeGroup)

View File

@ -295,7 +295,14 @@ class fissureCoude(fissureGenerique):
smesh.SetName(algo1d_long_p2, "algo1d_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)
mp2 = maillageSain.GroupOnGeom(P2,'P2',SMESH.NODE)

View File

@ -39,7 +39,7 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize):
-SetQuadAllowed = permission quadrangle dans maillage triangle
-On récupère les coordonnées de chaque noeud de la fissure qu'on stocke
dans une liste sous la forme : [X0, Y0, Z0, ..., Xn, Yn, Zn]"""
logging.info('start')
text = "Maillage de '{}'".format(facefiss.GetName())
logging.info(text)
@ -56,11 +56,10 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize):
smesh.SetName(algo2d, "algo2d_zoneFiss")
smesh.SetName(hypo2d, "hypo1d_zoneFiss")
isDone = meshFissure.Compute()
if isDone:
logging.info(text+" : OK")
logging.debug(text+" : OK")
is_done = meshFissure.Compute()
text = "meshFissure.Compute"
if is_done:
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)

File diff suppressed because it is too large Load Diff

View File

@ -449,8 +449,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
putName(algo1d.GetSubMesh(), "generatrice", i)
putName(algo1d, "algo1d_generatrice", i)
putName(hypo1d, "hypo1d_generatrice", i)
isDone = meshFondFiss.Compute()
logging.info("meshFondFiss computed")
is_done = meshFondFiss.Compute()
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()
for i, face in enumerate(disques[:4]):
@ -547,8 +553,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
putName(algo1d, "algo1d_groupDemiCercles", i)
putName(hypo1d, "hypo1d_groupDemiCercles", i)
#
isDone = meshFacePeau.Compute()
logging.info("meshFacePeau computed")
is_done = meshFacePeau.Compute()
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)
grpTHEX = meshFacePeau.GroupOnGeom(verticesOutCercles[1], "THEX", SMESH.NODE)
@ -584,8 +596,14 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
putName(algo1d, "algo1d_edgeFissPeau")
putName(hypo1d, "hypo1d_edgeFissPeau")
#
isDone = meshFaceFiss.Compute()
logging.info("meshFaceFiss computed")
is_done = meshFaceFiss.Compute()
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)
@ -617,9 +635,15 @@ def insereFissureLongue(geometriesSaines, maillagesSains,
hypo3d = algo3d.MaxElementVolume(1000.0)
putName(algo3d.GetSubMesh(), "boiteDefaut")
putName(algo3d, "algo3d_boiteDefaut")
isDone = meshBoiteDefaut.Compute()
logging.info("meshBoiteDefaut computed")
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()
grps1 = [ grp for grp in groups if grp.GetName() == 'P1']

View File

@ -25,7 +25,7 @@ from .geomsmesh import smesh
import SMESH
from .putName import putName
def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
"""
edges de bord, faces défaut à respecter
@ -48,7 +48,7 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
nbAdd = skinFaces.AddFrom( internalBoundary.GetMesh() )
# --- maillage des éventuelles arêtes vives entre faces reconstruites
grpAretesVives = None
if len(aretesVivesCoupees) > 0:
aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
@ -58,9 +58,15 @@ def mailleAretesEtJonction(internalBoundary, aretesVivesCoupees, lgAretesVives):
putName(algo1d.GetSubMesh(), "aretesVives")
putName(algo1d, "algo1d_aretesVives")
putName(hypo1d, "hypo1d_aretesVives")
isDone = meshAretesVives.Compute()
logging.info("aretesVives fini")
is_done = meshAretesVives.Compute()
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' )
nbAdd = grpAretesVives.AddFrom( meshAretesVives.GetMesh() )
return (internalBoundary, bordsLibres, grpAretesVives)
return (internalBoundary, bordsLibres, grpAretesVives)

View File

@ -59,10 +59,10 @@ def mailleFacesFissure(faceFissureExterne, edgesPipeFissureExterneC, edgesPeauFi
grpEdgesPeauFissureExterne = meshFaceFiss.GroupOnGeom(edgesPeauFissureExterneC,'edgesPeauFissureExterne',SMESH.EDGE)
grpEdgesPipeFissureExterne = meshFaceFiss.GroupOnGeom(edgesPipeFissureExterneC,'edgesPipeFissureExterne',SMESH.EDGE)
isDone = meshFaceFiss.Compute()
text = "meshFaceFiss fini"
if isDone:
logging.info(text)
is_done = meshFaceFiss.Compute()
text = "meshFaceFiss.Compute"
if is_done:
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)

View File

@ -43,7 +43,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes
boutFromIfil[idFillingFromBout[0]] = 0
boutFromIfil[idFillingFromBout[1]] = 1
logging.debug("---------------------------- maillage faces de peau --------------")
meshesFacesPeau = []
for ifil in range(nbFacesFilling):
@ -57,17 +57,17 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
geomPublishInFather(initLog.debug,filling, groupEdgesBordPeau , "EdgesBords")
meshFacePeau = smesh.Mesh(facesDefaut[ifil])
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
putName(algo1d, "algo1d_bordsLibres", ifil)
putName(hypo1d, "hypo1d_bordsLibres", ifil)
else:
logging.debug("meshFacePeau %d coupée par la fissure", ifil)
facePeau = facesPeaux[ifil] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
@ -77,26 +77,26 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
meshFacePeau = smesh.Mesh(facePeau)
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
putName(algo1d.GetSubMesh(), "bordsLibres", ifil)
putName(algo1d, "algo1d_bordsLibres", ifil)
putName(hypo1d, "hypo1d_bordsLibres", ifil)
algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau))
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil)
putName(algo1d, "algo1d_edgePeauFiss", ifil)
putName(hypo1d, "hypo1d_edgePeauFiss", ifil)
if bordsVifs is not None:
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
putName(algo1d.GetSubMesh(), "bordsVifs", ifil)
putName(algo1d, "algo1d_bordsVifs", ifil)
putName(hypo1d, "hypo1d_bordsVifs", ifil)
for i, edgeCirc in enumerate(edgesCircPeau):
if edgeCirc is not None:
algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc)
@ -108,7 +108,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
putName(algo1d.GetSubMesh(), name, ifil)
putName(algo1d, "algo1d_" + name, ifil)
putName(hypo1d, "hypo1d_" + name, ifil)
algo2d = meshFacePeau.Triangle(algo=smeshBuilder.NETGEN_1D2D)
hypo2d = algo2d.Parameters()
hypo2d.SetMaxSize( dmoyen )
@ -119,11 +119,17 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut,
putName(algo2d.GetSubMesh(), "facePeau", ifil)
putName(algo2d, "algo2d_facePeau", ifil)
putName(hypo2d, "hypo2d_facePeau", ifil)
isDone = meshFacePeau.Compute()
logging.info("meshFacePeau %d fini", ifil)
is_done = meshFacePeau.Compute()
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 )
nbAdd = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
meshesFacesPeau.append(meshFacePeau)
return meshesFacesPeau
return meshesFacesPeau

View File

@ -194,7 +194,14 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
putName(algo3d, "algo3d_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()
@ -230,9 +237,9 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
putName(hypo3d, "hypo3d_bloc")
is_done = blocMesh.Compute()
text = "meshBlocPart Compute"
text = "blocMesh.Compute"
if is_done:
logging.info(text)
logging.info(text+" OK")
else:
text = "Erreur au calcul du maillage.\n" + text
logging.info(text)

View File

@ -74,13 +74,20 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(Box_1)
smesh.SetName(Mesh_1, 'Mesh_1')
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
isDone = Mesh_1.Compute()
smesh.SetName(Mesh_1, 'Mesh_1')
is_done = Mesh_1.Compute()
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"))
## set object names

View File

@ -127,10 +127,16 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa)
isDone = cubeFin_1.Compute()
DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',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
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')

View File

@ -148,6 +148,7 @@ smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
smeshObj_1.SetNumberOfSegments( 5 )
smeshObj_1.SetDistrType( 0 )
CylindreSain_1 = smesh.Mesh(CylindreSain)
smesh.SetName(CylindreSain_1, 'CylindreSain')
Regular_1D = CylindreSain_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
@ -159,8 +160,14 @@ Nb_Segments_2.SetDistrType( 0 )
Regular_1D_2 = CylindreSain_1.Segment(geom=radial)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(6,[],[ ])
Nb_Segments_3.SetDistrType( 0 )
isDone = CylindreSain_1.Compute()
smesh.SetName(CylindreSain_1, 'CylindreSain')
is_done = CylindreSain_1.Compute()
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"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()

View File

@ -76,6 +76,7 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Disque_1 = smesh.Mesh(Disque)
smesh.SetName(Disque_1, 'Disque')
Regular_1D = Disque_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
Nb_Segments_1.SetDistrType( 0 )
@ -86,8 +87,14 @@ Nb_Segments_2.SetDistrType( 0 )
Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Disque_1.Compute()
smesh.SetName(Disque_1, 'Disque')
is_done = Disque_1.Compute()
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"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()

View File

@ -92,6 +92,7 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
EprouvetteCourbe_1 = smesh.Mesh(EprouvetteCourbe)
smesh.SetName(EprouvetteCourbe_1, 'EprouvetteCourbe')
Regular_1D = EprouvetteCourbe_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(50)
Nb_Segments_1.SetDistrType( 0 )
@ -103,8 +104,14 @@ Nb_Segments_2.SetDistrType( 0 )
Regular_1D_2 = EprouvetteCourbe_1.Segment(geom=Compound_y)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(25)
Nb_Segments_3.SetDistrType( 0 )
isDone = EprouvetteCourbe_1.Compute()
smesh.SetName(EprouvetteCourbe_1, 'EprouvetteCourbe')
is_done = EprouvetteCourbe_1.Compute()
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"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()

View File

@ -126,6 +126,7 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
eprouvetteDroite_1 = smesh.Mesh(eprouvetteDroite)
smesh.SetName(eprouvetteDroite_1, 'eprouvetteDroite')
Regular_1D = eprouvetteDroite_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(50,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
@ -137,8 +138,14 @@ Nb_Segments_2.SetDistrType( 0 )
Regular_1D_2 = eprouvetteDroite_1.Segment(geom=Compound_x)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,[],[ ])
Nb_Segments_3.SetDistrType( 0 )
isDone = eprouvetteDroite_1.Compute()
smesh.SetName(eprouvetteDroite_1, 'eprouvetteDroite')
is_done = eprouvetteDroite_1.Compute()
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"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()

View File

@ -121,6 +121,7 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
objetSain_1 = smesh.Mesh(objetSain)
smesh.SetName(objetSain_1, 'objetSain')
Regular_1D = objetSain_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
@ -132,8 +133,14 @@ Nb_Segments_2.SetDistrType( 0 )
Regular_1D_2 = objetSain_1.Segment(geom=epaisseurs)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(5,[],[ ])
Nb_Segments_3.SetDistrType( 0 )
isDone = objetSain_1.Compute()
smesh.SetName(objetSain_1, 'objetSain')
is_done = objetSain_1.Compute()
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"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()

View File

@ -95,13 +95,20 @@ from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(objetSain)
smesh.SetName(Mesh_1, 'Mesh_1')
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
isDone = Mesh_1.Compute()
smesh.SetName(Mesh_1, 'Mesh_1')
is_done = Mesh_1.Compute()
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"))
## set object names

View File

@ -211,9 +211,9 @@ conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',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)
isDone = coupe_vis_1.Compute()
text = "Maillage de {}".format(coupe_vis.GetName())
if isDone:
is_done = coupe_vis_1.Compute()
text = "coupe_vis_1.Compute"
if is_done:
logging.debug(text+" : OK")
else:
text = "Erreur au calcul du maillage.\n" + text