mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-24 23:30:34 +05:00
Merge branch 'gni/evolution'
This commit is contained in:
commit
140b89fcdf
@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS
|
||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
class cubeAngle(fissureGenerique):
|
||||
"""problème de fissure plane coupant 2 faces (angle), débouches normaux, objet plan"""
|
||||
|
||||
@ -115,7 +111,7 @@ class cubeAngle(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS
|
||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
class cylindre(fissureGenerique):
|
||||
"""problème de fissure plane sur cylindre, grand fond de fissure en arc de cercle"""
|
||||
|
||||
@ -110,7 +106,7 @@ class cylindre(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -24,12 +24,9 @@ import os
|
||||
import logging
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
from blocFissure.gmu.geomsmesh import geompy
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
|
||||
from .cylindre import cylindre
|
||||
|
||||
|
@ -38,12 +38,12 @@ dicoParams = dict(nomCas = 'disque',
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
referencesMaillageFissure = dict ( \
|
||||
Entity_Quad_Edge = 376, \
|
||||
Entity_Quad_Quadrangle = 2748, \
|
||||
Entity_Quad_Hexa = 6232, \
|
||||
Entity_Node = 43889, \
|
||||
Entity_Quad_Edge = 376, \
|
||||
Entity_Quad_Triangle = 1366, \
|
||||
Entity_Quad_Tetra = 9112, \
|
||||
Entity_Node = 43479, \
|
||||
Entity_Quad_Triangle = 1340, \
|
||||
Entity_Quad_Tetra = 8821, \
|
||||
Entity_Quad_Pyramid = 466, \
|
||||
Entity_Quad_Penta = 448 \
|
||||
)
|
||||
)
|
||||
|
@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS
|
||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
class ellipse_1(fissureGenerique):
|
||||
"""problème de fissure non plane, débouchante non normale"""
|
||||
|
||||
@ -124,7 +120,7 @@ class ellipse_1(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -24,13 +24,9 @@ import os
|
||||
import logging
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.geomsmesh import geompy
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
from .ellipse_1 import ellipse_1
|
||||
|
||||
class ellipse_2(ellipse_1):
|
||||
|
@ -31,10 +31,6 @@ from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetS
|
||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
class eprouvetteCourbe(fissureGenerique):
|
||||
"""problème de fissure plane coupant 3 faces (éprouvette), faces au débouché non planes, incidence presque normale"""
|
||||
|
||||
@ -118,7 +114,7 @@ class eprouvetteCourbe(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -20,18 +20,13 @@
|
||||
"""problème de fissure plane coupant 3 faces (éprouvette), débouches normaux, objet plan"""
|
||||
|
||||
import os
|
||||
|
||||
import logging
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
#import StdMeshers
|
||||
#import GHS3DPlugin
|
||||
#import NETGENPlugin
|
||||
import logging
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
|
||||
from blocFissure.gmu.triedreBase import triedreBase
|
||||
@ -115,7 +110,7 @@ class eprouvetteDroite(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -20,18 +20,14 @@
|
||||
"""problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan"""
|
||||
|
||||
import os
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
import logging
|
||||
|
||||
from .eprouvetteDroite import eprouvetteDroite
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
|
||||
from .eprouvetteDroite import eprouvetteDroite
|
||||
|
||||
class eprouvetteDroite_2(eprouvetteDroite):
|
||||
"""problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan"""
|
||||
|
||||
|
@ -23,9 +23,7 @@ import traceback
|
||||
|
||||
import logging
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu import initLog
|
||||
from blocFissure.gmu import geomsmesh
|
||||
from blocFissure.gmu.casStandard import casStandard
|
||||
|
||||
# -----------------------------------------------------------------------------------------------
|
||||
@ -59,7 +57,7 @@ else:
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteCourbe
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # eprouvetteDroite
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2 fissureGauche2
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # fissureGauche2
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0] # vis
|
||||
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] # tube
|
||||
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
|
||||
@ -244,8 +242,9 @@ def calcul_cas (n_cas, cas, d_aux, ligne):
|
||||
ok_maillage = cas.executeProbleme()
|
||||
except:
|
||||
traceback.print_exc()
|
||||
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
|
||||
ok_maillage = False
|
||||
if not ok_maillage:
|
||||
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
|
||||
print(ligne)
|
||||
return ok_maillage, texte
|
||||
#=============================================================
|
||||
|
@ -20,19 +20,14 @@
|
||||
"""problème de fissure non plane, débouchante non normale"""
|
||||
|
||||
import os
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import math
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
import logging
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy
|
||||
from blocFissure.gmu.geomsmesh import smesh
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
from blocFissure.gmu.triedreBase import triedreBase
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
|
||||
@ -113,18 +108,18 @@ class faceGauche(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
def setReferencesMaillageFissure(self):
|
||||
self.referencesMaillageFissure = dict( \
|
||||
Entity_Quad_Quadrangle = 3997, \
|
||||
Entity_Quad_Hexa = 5904, \
|
||||
Entity_Node = 77735, \
|
||||
Entity_Quad_Edge = 725, \
|
||||
Entity_Quad_Triangle = 2176, \
|
||||
Entity_Quad_Tetra = 32320, \
|
||||
Entity_Quad_Pyramid = 1156, \
|
||||
Entity_Quad_Penta = 856 \
|
||||
Entity_Quad_Edge = 750, \
|
||||
Entity_Quad_Quadrangle = 4177, \
|
||||
Entity_Quad_Hexa = 6224, \
|
||||
Entity_Node = 81588, \
|
||||
Entity_Quad_Triangle = 2298, \
|
||||
Entity_Quad_Tetra = 33764, \
|
||||
Entity_Quad_Pyramid = 1236, \
|
||||
Entity_Quad_Penta = 936 \
|
||||
)
|
||||
|
@ -20,21 +20,12 @@
|
||||
"""problème de fissure non plane, débouchante non normale"""
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
from blocFissure import gmu
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
#import StdMeshers
|
||||
#import GHS3DPlugin
|
||||
#import NETGENPlugin
|
||||
import logging
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
|
||||
|
||||
from blocFissure.gmu.triedreBase import triedreBase
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
|
||||
@ -115,7 +106,7 @@ class faceGauche_2(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -23,16 +23,16 @@ import logging
|
||||
import os
|
||||
import math
|
||||
|
||||
from blocFissure.gmu import initLog
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.geomsmesh import geomPublish
|
||||
from blocFissure.gmu.geomsmesh import geomPublishInFather
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
from blocFissure.gmu.geomsmesh import geompy
|
||||
from blocFissure.gmu.geomsmesh import smesh
|
||||
from blocFissure.gmu.geomsmesh import geomPublish
|
||||
from blocFissure.gmu.geomsmesh import geomPublishInFather
|
||||
|
||||
from blocFissure.gmu import initLog
|
||||
from blocFissure.gmu.putName import putName
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
from blocFissure.gmu.triedreBase import triedreBase
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
@ -233,8 +233,8 @@ class fissure_Coude(fissureGenerique):
|
||||
|
||||
algo3d = maillageSain.Hexahedron()
|
||||
algo2d = maillageSain.Quadrangle()
|
||||
putName(algo3d, "algo3d_maillageSain", i_pref=self.numeroCas)
|
||||
putName(algo2d, "algo2d_maillageSain", i_pref=self.numeroCas)
|
||||
putName(algo3d, "3d_maillageSain", i_pref=self.numeroCas)
|
||||
putName(algo2d, "2d_maillageSain", i_pref=self.numeroCas)
|
||||
|
||||
algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
|
||||
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
|
||||
@ -510,10 +510,9 @@ class fissure_Coude(fissureGenerique):
|
||||
mailleur="MeshGems"):
|
||||
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = insereFissureLongue(geometriesSaines, \
|
||||
shapesFissure, shapeFissureParams, \
|
||||
maillageFissure = insereFissureLongue(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -28,16 +28,13 @@ from blocFissure.gmu import initLog
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.geomsmesh import geomPublish
|
||||
from blocFissure.gmu.geomsmesh import geomPublishInFather
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
|
||||
from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
class tube(fissureGenerique):
|
||||
"""problème de fissure plane dans un tube"""
|
||||
|
||||
@ -123,7 +120,7 @@ class tube(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -27,12 +27,8 @@ from blocFissure.gmu import initLog
|
||||
from blocFissure.gmu.geomsmesh import geompy, smesh
|
||||
from blocFissure.gmu.geomsmesh import geomPublish
|
||||
from blocFissure.gmu.geomsmesh import geomPublishInFather
|
||||
|
||||
from blocFissure.gmu.putName import putName
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||
from blocFissure.gmu.triedreBase import triedreBase
|
||||
from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
|
||||
@ -124,7 +120,7 @@ class vis_1(fissureGenerique):
|
||||
mailleur = self.mailleur2d3d()
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -25,6 +25,9 @@ SET(plugin_SCRIPTS
|
||||
ajustePointsEdgePipeFissure.py
|
||||
blocDefaut.py
|
||||
calculePointsAxiauxPipe.py
|
||||
calculePointsAxiauxPipe_a.py
|
||||
calculePointsAxiauxPipe_b.py
|
||||
calculePointsAxiauxPipe_c.py
|
||||
casStandard.py
|
||||
checkDecoupePartition.py
|
||||
commonSubShapes.py
|
||||
|
@ -17,7 +17,7 @@
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
"""Ajustement precis des points sur edgesPipeFissureExterneC"""
|
||||
"""Ajustement précis des points sur edgesPipeFissureExterneC"""
|
||||
|
||||
import logging
|
||||
|
||||
@ -26,16 +26,17 @@ from .findWireIntermediateVertices import findWireIntermediateVertices
|
||||
from .projettePointSurCourbe import projettePointSurCourbe
|
||||
|
||||
def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne, gptsdisks, idisklim):
|
||||
"""Ajustement precis des points sur edgesPipeFissureExterneC"""
|
||||
"""Ajustement précis des points sur edgesPipeFissureExterneC"""
|
||||
logging.info('start')
|
||||
|
||||
edgesPFE = geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False)
|
||||
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é
|
||||
idiskmax = idisklim[1] # on ne prend pas le disque sur la peau, déjà ajusté
|
||||
idiskint = []
|
||||
idiskmax = idisklim[1]
|
||||
idiskint = list()
|
||||
|
||||
for vtx in verticesPFE:
|
||||
distPtVt = []
|
||||
distPtVt = list()
|
||||
for idisk in range(idiskmin, idiskmax):
|
||||
gptdsk = gptsdisks[idisk]
|
||||
point = gptdsk[0][-1] # le point sur l'edge de la fissure externe au pipe
|
||||
@ -44,6 +45,7 @@ def ajustePointsEdgePipeFissure(edgesPipeFissureExterneC, wirePipeFissureExterne
|
||||
idiskint.append(distPtVt[0][1])
|
||||
gptsdisks[idiskint[-1]][0][-1] = vtx
|
||||
logging.debug("ajustement point sur edgePipeFissureExterne, vertex: %s %s", idiskint[-1], distPtVt[0][0])
|
||||
|
||||
for idisk in range(idiskmin, idiskmax):
|
||||
if idisk in idiskint:
|
||||
break
|
||||
|
@ -20,21 +20,18 @@
|
||||
"""Préparation maillage du pipe"""
|
||||
|
||||
import logging
|
||||
import math
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import smesh
|
||||
from .calculePointsAxiauxPipe_a import calculePointsAxiauxPipe_a
|
||||
from .calculePointsAxiauxPipe_b import calculePointsAxiauxPipe_b
|
||||
from .calculePointsAxiauxPipe_c import calculePointsAxiauxPipe_c
|
||||
|
||||
from .putName import putName
|
||||
|
||||
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
||||
centreFondFiss, wireFondFiss, wirePipeFiss,
|
||||
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, \
|
||||
centreFondFiss, wireFondFiss, wirePipeFiss, \
|
||||
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad, \
|
||||
nro_cas=None):
|
||||
"""Préparation maillage du pipe :
|
||||
|
||||
- détections des points a respecter : jonction des edges/faces constituant
|
||||
la face de fissure externe au 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é)
|
||||
"""
|
||||
@ -42,117 +39,19 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
||||
logging.info('start')
|
||||
logging.info("Pour le cas n°%s", nro_cas)
|
||||
|
||||
# --- option de maillage selon le rayon de courbure du fond de fissure
|
||||
lenEdgeFondExt = 0
|
||||
for edff in edgesFondFiss:
|
||||
lenEdgeFondExt += geompy.BasicProperties(edff)[0]
|
||||
# --- Maillage selon le rayon de courbure du fond de fissure
|
||||
|
||||
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
|
||||
texte = "==> deflexion: {}, lgmin: {}, lgmax: {}".format(deflexion, lgmin, lgmax)
|
||||
logging.info(texte)
|
||||
|
||||
meshFondExt = smesh.Mesh(wireFondFiss)
|
||||
putName(meshFondExt, "wireFondFiss", i_pref=nro_cas)
|
||||
algo1d = meshFondExt.Segment()
|
||||
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
||||
putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas)
|
||||
putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas)
|
||||
putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas)
|
||||
|
||||
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)
|
||||
#logging.debug("nodeId %s, coords %s", nodeId, str(xyz))
|
||||
point = geompy.MakeVertex(xyz[0], xyz[1], xyz[2])
|
||||
parametre, _, EdgeInWireIndex = geompy.MakeProjectionOnWire(point, wireFondFiss) # parametre compris entre 0 et 1
|
||||
edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
|
||||
ptGSdic[(edgeOrder, EdgeInWireIndex, parametre)] = point
|
||||
#logging.debug("nodeId %s, parametre %s", nodeId, str(parametre))
|
||||
usort = sorted(ptGSdic)
|
||||
logging.debug("nombre de points obtenus par deflexion %s",len(usort))
|
||||
|
||||
centres = list()
|
||||
origins = list()
|
||||
normals = list()
|
||||
for edu in usort:
|
||||
vertcx = ptGSdic[edu]
|
||||
norm = geompy.MakeTangentOnCurve(edgesFondFiss[edu[1]], edu[2])
|
||||
plan = geompy.MakePlane(vertcx, norm, 3.*rayonPipe)
|
||||
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:
|
||||
if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin
|
||||
vertpx = point
|
||||
break
|
||||
centres.append(vertcx)
|
||||
origins.append(vertpx)
|
||||
normals.append(norm)
|
||||
# name = "vertcx%d"%i
|
||||
# geompy.addToStudyInFather(wireFondFiss, vertcx, name)
|
||||
# name = "vertpx%d"%i
|
||||
# geompy.addToStudyInFather(wireFondFiss, vertpx, name)
|
||||
# name = "plan%d"%i
|
||||
# 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)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
meshFondFiss = calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \
|
||||
lenSegPipe, \
|
||||
nro_cas)
|
||||
# --- points géométriques
|
||||
|
||||
gptsdisks = list() # vertices géométrie de tous les disques
|
||||
raydisks = [list() for _ in range(nbsegCercle)]
|
||||
for indice, centres_i in enumerate(centres): # boucle sur les disques
|
||||
gptdsk = list() # vertices géométrie d'un disque
|
||||
vertcx = centres_i
|
||||
vertpx = origins[indice]
|
||||
normal = normals[indice]
|
||||
vec1 = geompy.MakeVector(vertcx, vertpx)
|
||||
centres, origins, normals = calculePointsAxiauxPipe_b(meshFondFiss, \
|
||||
edgesFondFiss, edgesIdByOrientation, \
|
||||
wireFondFiss, wirePipeFiss, \
|
||||
rayonPipe)
|
||||
|
||||
points = [vertcx] # les points du rayon de référence
|
||||
dist_0 = rayonPipe/float(nbsegRad)
|
||||
for j_aux in range(nbsegRad):
|
||||
point = geompy.MakeTranslationVectorDistance(vertcx, vec1, float(j_aux+1)*dist_0)
|
||||
points.append(point)
|
||||
gptdsk.append(points)
|
||||
point = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe)
|
||||
rayon = geompy.MakeLineTwoPnt(vertcx, point)
|
||||
raydisks[0].append(rayon)
|
||||
|
||||
angle_0 = 2.*math.pi/float(nbsegCercle)
|
||||
for k_aux in range(nbsegCercle-1):
|
||||
angle = float(k_aux+1)*angle_0
|
||||
pts = [vertcx] # les points d'un rayon obtenu par rotation
|
||||
for j_aux in range(nbsegRad):
|
||||
point = geompy.MakeRotation(points[j_aux+1], normal, angle)
|
||||
pts.append(point)
|
||||
gptdsk.append(pts)
|
||||
ray = geompy.MakeRotation(rayon, normal, angle)
|
||||
raydisks[k_aux+1].append(ray)
|
||||
|
||||
gptsdisks.append(gptdsk)
|
||||
gptsdisks, raydisks = calculePointsAxiauxPipe_c(centres, origins, normals, \
|
||||
rayonPipe, nbsegCercle, nbsegRad)
|
||||
|
||||
return (centres, gptsdisks, raydisks)
|
||||
|
73
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py
Normal file
73
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_a.py
Normal file
@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2021 EDF R&D
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
"""Maillage selon le rayon de courbure du fond de fissure"""
|
||||
|
||||
import logging
|
||||
import math
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import smesh
|
||||
|
||||
from .putName import putName
|
||||
|
||||
def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \
|
||||
lenSegPipe, \
|
||||
nro_cas=None):
|
||||
"""Maillage selon le rayon de courbure du fond de fissure"""
|
||||
|
||||
logging.info('start')
|
||||
|
||||
# Rayon de courbure maximal
|
||||
disfond = list()
|
||||
for filling in facesDefaut:
|
||||
disfond.append(geompy.MinDistance(centreFondFiss, filling))
|
||||
disfond.sort()
|
||||
|
||||
texte = "rcourb: {}, lenSegPipe: {}".format(disfond[0], lenSegPipe)
|
||||
logging.info(texte)
|
||||
|
||||
# Maillage 1D
|
||||
lgmin = lenSegPipe*0.25
|
||||
lgmax = lenSegPipe*1.5
|
||||
# la déflexion ets la distance maximale entre une arête du maillage et la courbe support
|
||||
nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
|
||||
alpha = math.pi/(4*nbSegQuart)
|
||||
deflexion = disfond[0]*(1.0 -math.cos(alpha))
|
||||
texte = "==> lgmin: {}, lgmax: {}, deflexion: {}".format(deflexion, lgmin, lgmax)
|
||||
logging.info(texte)
|
||||
|
||||
meshFondFiss = smesh.Mesh(wireFondFiss)
|
||||
putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas)
|
||||
algo1d = meshFondFiss.Segment()
|
||||
hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
|
||||
putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas)
|
||||
putName(algo1d, "algo1d_wireFondFiss", i_pref=nro_cas)
|
||||
putName(hypo1d, "hypo1d_wireFondFiss", i_pref=nro_cas)
|
||||
|
||||
is_done = meshFondFiss.Compute()
|
||||
text = "calculePointsAxiauxPipe meshFondFiss.Compute"
|
||||
if is_done:
|
||||
logging.info(text)
|
||||
else:
|
||||
text = "Erreur au calcul du maillage.\n" + text
|
||||
logging.info(text)
|
||||
raise Exception(text)
|
||||
|
||||
return meshFondFiss
|
75
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py
Normal file
75
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_b.py
Normal file
@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2021 EDF R&D
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
"""Préparation maillage du pipe"""
|
||||
|
||||
import logging
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
||||
from . import initLog
|
||||
|
||||
def calculePointsAxiauxPipe_b(meshFondFiss, \
|
||||
edgesFondFiss, edgesIdByOrientation, \
|
||||
wireFondFiss, wirePipeFiss, \
|
||||
rayonPipe):
|
||||
"""Préparation 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é)
|
||||
"""
|
||||
|
||||
logging.info('start')
|
||||
|
||||
ptGSdic = dict() # dictionnaire [paramètre sur la courbe] --> point géométrique
|
||||
allNodeIds = meshFondFiss.GetNodesId()
|
||||
for nodeId in allNodeIds:
|
||||
xyz = meshFondFiss.GetNodeXYZ(nodeId)
|
||||
#logging.debug("nodeId %s, coords %s", nodeId, str(xyz))
|
||||
point = geompy.MakeVertex(xyz[0], xyz[1], xyz[2])
|
||||
parametre, _, EdgeInWireIndex = geompy.MakeProjectionOnWire(point, wireFondFiss) # parametre compris entre 0 et 1
|
||||
edgeOrder = edgesIdByOrientation[EdgeInWireIndex]
|
||||
ptGSdic[(edgeOrder, EdgeInWireIndex, parametre)] = point
|
||||
#logging.debug("nodeId %s, parametre %s", nodeId, str(parametre))
|
||||
usort = sorted(ptGSdic)
|
||||
logging.debug("nombre de points obtenus par deflexion : %s",len(usort))
|
||||
|
||||
centres = list()
|
||||
origins = list()
|
||||
normals = list()
|
||||
for i_aux, edu in enumerate(usort):
|
||||
vertcx = ptGSdic[edu]
|
||||
geomPublishInFather(initLog.debug, wireFondFiss, vertcx, "vertcx_{}".format(i_aux))
|
||||
norm = geompy.MakeTangentOnCurve(edgesFondFiss[edu[1]], edu[2])
|
||||
plan = geompy.MakePlane(vertcx, norm, 3.*rayonPipe)
|
||||
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:
|
||||
if geompy.MinDistance(point, vertcx) < 1.1*rayonPipe: # les quatre coins sont plus loin
|
||||
vertpx = point
|
||||
geomPublishInFather(initLog.debug, wireFondFiss, vertpx, "vertpx_{}".format(i_aux))
|
||||
break
|
||||
centres.append(vertcx)
|
||||
origins.append(vertpx)
|
||||
normals.append(norm)
|
||||
|
||||
return centres, origins, normals
|
76
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py
Normal file
76
src/Tools/blocFissure/gmu/calculePointsAxiauxPipe_c.py
Normal file
@ -0,0 +1,76 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2014-2021 EDF R&D
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
"""Préparation maillage du pipe"""
|
||||
|
||||
import logging
|
||||
import math
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
||||
def calculePointsAxiauxPipe_c(centres, origins, normals, \
|
||||
rayonPipe, nbsegCercle, nbsegRad):
|
||||
"""Préparation 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é)
|
||||
"""
|
||||
|
||||
logging.info('start')
|
||||
logging.debug("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# --- points géométriques
|
||||
|
||||
gptsdisks = list() # vertices géométrie de tous les disques
|
||||
raydisks = [list() for _ in range(nbsegCercle)]
|
||||
|
||||
# boucle sur les disques
|
||||
for indice, centres_i in enumerate(centres):
|
||||
gptdsk = list() # vertices géométrie d'un disque
|
||||
vertcx = centres_i
|
||||
vertpx = origins[indice]
|
||||
normal = normals[indice]
|
||||
vec1 = geompy.MakeVector(vertcx, vertpx)
|
||||
|
||||
points = [vertcx] # les points du rayon de référence
|
||||
dist_0 = rayonPipe/float(nbsegRad)
|
||||
for j_aux in range(nbsegRad):
|
||||
point = geompy.MakeTranslationVectorDistance(vertcx, vec1, float(j_aux+1)*dist_0)
|
||||
points.append(point)
|
||||
gptdsk.append(points)
|
||||
point = geompy.MakeTranslationVectorDistance(vertcx, vec1, 1.5*rayonPipe)
|
||||
rayon = geompy.MakeLineTwoPnt(vertcx, point)
|
||||
raydisks[0].append(rayon)
|
||||
|
||||
angle_0 = 2.*math.pi/float(nbsegCercle)
|
||||
for k_aux in range(nbsegCercle-1):
|
||||
angle = float(k_aux+1)*angle_0
|
||||
pts = [vertcx] # les points d'un rayon obtenu par rotation
|
||||
for j_aux in range(nbsegRad):
|
||||
point = geompy.MakeRotation(points[j_aux+1], normal, angle)
|
||||
pts.append(point)
|
||||
gptdsk.append(pts)
|
||||
ray = geompy.MakeRotation(rayon, normal, angle)
|
||||
raydisks[k_aux+1].append(ray)
|
||||
|
||||
gptsdisks.append(gptdsk)
|
||||
|
||||
return gptsdisks, raydisks
|
@ -22,10 +22,6 @@
|
||||
import os
|
||||
import logging
|
||||
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
from .geomsmesh import geompy, smesh
|
||||
from .geomsmesh import geomPublish
|
||||
from .geomsmesh import geomPublishInFather
|
||||
@ -178,7 +174,7 @@ class casStandard(fissureGenerique):
|
||||
mailleur="MeshGems"):
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
@ -20,9 +20,6 @@
|
||||
"""Construit les arêtes débouchantes"""
|
||||
|
||||
import logging
|
||||
import GEOM
|
||||
|
||||
from . import initLog
|
||||
|
||||
from .construitEdgesRadialesDebouchantes_a import construitEdgesRadialesDebouchantes_a
|
||||
from .construitEdgesRadialesDebouchantes_b import construitEdgesRadialesDebouchantes_b
|
||||
|
@ -20,11 +20,11 @@
|
||||
"""Mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)"""
|
||||
|
||||
import logging
|
||||
import GEOM
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublish
|
||||
from . import initLog
|
||||
#from .geomsmesh import geomPublish
|
||||
|
||||
#from . import initLog
|
||||
|
||||
def construitEdgesRadialesDebouchantes_b(facesPipePeau, facesDebouchantes, listNappes):
|
||||
"""Mise en correspondance avec les indices des faces disque débouchantes (facesPipePeau)"""
|
||||
|
@ -20,11 +20,12 @@
|
||||
"""Construction des listes d'edges radiales sur chaque extrémité débouchante"""
|
||||
|
||||
import logging
|
||||
import GEOM
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublish
|
||||
|
||||
from . import initLog
|
||||
|
||||
from .sortEdges import sortEdges
|
||||
|
||||
def construitEdgesRadialesDebouchantes_c(facesPipePeau, edgeRadFacePipePeau, \
|
||||
|
@ -24,9 +24,6 @@ import logging
|
||||
from . import initLog
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import GEOM
|
||||
import SMESH
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublishInFather
|
||||
@ -57,7 +54,7 @@ from .construitFissureGenerale_c import construitFissureGenerale_c
|
||||
|
||||
def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step=-1, mailleur="MeshGems", nro_cas=None):
|
||||
mailleur="MeshGems", nro_cas=None):
|
||||
"""procédure complète fissure générale"""
|
||||
logging.info('start')
|
||||
logging.info("Usage du mailleur %s pour le cas n°%s", mailleur, nro_cas)
|
||||
@ -162,8 +159,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
# --- recherche des points en trop (externes au volume à remailler)
|
||||
# - on associe chaque extrémité du pipe à une face filling
|
||||
# - on part des disques aux extrémités du pipe
|
||||
# - pour chaque disque, on prend les vertices de géométrie,
|
||||
# on marque leur position relative à la face.
|
||||
# - pour chaque disque, on prend les vertices de géométrie on marque leur position relative à la face.
|
||||
# - on s'arrete quand tous les noeuds sont dedans
|
||||
|
||||
(idFillingFromBout, idisklim, idiskout) = elimineExtremitesPipe(ptEdgeFond, facesDefaut, centres, gptsdisks, nbsegCercle)
|
||||
@ -175,8 +171,8 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
|
||||
# --- création des points du maillage du pipe sur la face de peau
|
||||
|
||||
(gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \
|
||||
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
||||
gptsdisks = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \
|
||||
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
||||
|
||||
# --- ajustement precis des points sur edgesPipeFissureExterneC
|
||||
|
||||
@ -184,7 +180,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
|
||||
# --- maillage effectif du pipe
|
||||
|
||||
(meshPipe, meshPipeGroups, edgesCircPipeGroup) = \
|
||||
(meshPipe, edgeFaceFissGroup, edgesCircPipeGroup) = \
|
||||
construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
nro_cas)
|
||||
|
||||
@ -199,7 +195,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
(meshFaceFiss, _, grpEdgesPeauFissureExterne, _) = \
|
||||
mailleFacesFissure(faceFissureExterne, \
|
||||
edgesPipeFissureExterneC, edgesPeauFissureExterneC, \
|
||||
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \
|
||||
edgeFaceFissGroup, areteFaceFissure, rayonPipe, nbsegRad, \
|
||||
mailleur, nro_cas)
|
||||
|
||||
# --- maillage faces de peau
|
||||
|
@ -23,13 +23,10 @@ import os
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import GEOM
|
||||
import SMESH
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import smesh
|
||||
|
||||
from .putName import putName
|
||||
from .enleveDefaut import enleveDefaut
|
||||
@ -78,7 +75,7 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
|
||||
hypo3d.SetStandardOutputLog( 0 )
|
||||
hypo3d.SetRemoveLogOnSuccess( 1 )
|
||||
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
|
||||
|
||||
is_done = meshBoiteDefaut.Compute()
|
||||
text = "meshBoiteDefaut.Compute"
|
||||
|
@ -32,20 +32,21 @@ from .construitMaillagePipe_c import construitMaillagePipe_c
|
||||
from .construitMaillagePipe_d import construitMaillagePipe_d
|
||||
|
||||
def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
nro_cas=None):
|
||||
nro_cas=None):
|
||||
"""maillage effectif du pipe"""
|
||||
logging.info('start')
|
||||
logging.info("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad)
|
||||
logging.info("idisklim[0] = %d, idisklim[1] = %d", idisklim[0], idisklim[1])
|
||||
|
||||
meshPipe = smesh.Mesh(None, "meshPipe")
|
||||
putName(meshPipe, "meshPipe", i_pref=nro_cas)
|
||||
|
||||
edgesCircPipeGroup = list()
|
||||
|
||||
fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
|
||||
nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis")
|
||||
faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi")
|
||||
edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss")
|
||||
edgeCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0")
|
||||
edgeCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
|
||||
faceCircPipe0Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
|
||||
faceCircPipe1Group = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
|
||||
|
||||
mptdsk = list() # vertices de chaque disque au fur et à mesure
|
||||
mptsdisks = list() # vertices maillage de tous les disques
|
||||
@ -55,14 +56,14 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
mVols = list() # identifiants volumes maillage pipe
|
||||
|
||||
for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
|
||||
#print ("\nidisk = {}".format(idisk))
|
||||
#logging.info(". Prise en compte du disque n°%d", idisk)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# --- Les points
|
||||
|
||||
oldmpts = mptdsk
|
||||
mptdsk = construitMaillagePipe_a(idisk, \
|
||||
gptsdisks, idisklim, nbsegCercle, \
|
||||
gptsdisks, nbsegCercle, \
|
||||
meshPipe, mptsdisks)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
@ -72,7 +73,7 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
construitMaillagePipe_b(idisk, \
|
||||
idisklim, nbsegCercle, \
|
||||
meshPipe, mptdsk, \
|
||||
edgeCircPipe0Group, edgeCircPipe1Group)
|
||||
edgesCircPipeGroup)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# --- Les groupes des faces débouchantes
|
||||
@ -80,8 +81,7 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
if idisk in (idisklim[0],idisklim[1]):
|
||||
construitMaillagePipe_c(idisk, \
|
||||
idisklim, nbsegCercle, \
|
||||
meshPipe, mptdsk, nbsegRad, \
|
||||
faceCircPipe0Group, faceCircPipe1Group)
|
||||
meshPipe, mptdsk, nbsegRad)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure
|
||||
@ -97,23 +97,10 @@ def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
|
||||
_ = pipeFissGroup.AddFrom( meshPipe.GetMesh() )
|
||||
|
||||
_, _, _ = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries")
|
||||
edgesCircPipeGroup = [edgeCircPipe0Group, edgeCircPipe1Group]
|
||||
|
||||
meshPipeGroups = dict(fondFissGroup = fondFissGroup, \
|
||||
nodesFondFissGroup = nodesFondFissGroup, \
|
||||
faceFissGroup = faceFissGroup, \
|
||||
edgeFaceFissGroup = edgeFaceFissGroup, \
|
||||
edgeCircPipe0Group = edgeCircPipe0Group, \
|
||||
edgeCircPipe1Group = edgeCircPipe1Group, \
|
||||
faceCircPipe0Group = faceCircPipe0Group, \
|
||||
faceCircPipe1Group = faceCircPipe1Group, \
|
||||
pipeFissGroup = pipeFissGroup, \
|
||||
edgesCircPipeGroup = edgesCircPipeGroup \
|
||||
)
|
||||
|
||||
#if meshPipe:
|
||||
#text = "Arrêt rapide.\n"
|
||||
#logging.info(text)
|
||||
#raise Exception(text)
|
||||
|
||||
return (meshPipe, meshPipeGroups, edgesCircPipeGroup)
|
||||
return (meshPipe, edgeFaceFissGroup, edgesCircPipeGroup)
|
||||
|
@ -19,12 +19,10 @@
|
||||
#
|
||||
"""Les points"""
|
||||
|
||||
import logging
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
||||
def construitMaillagePipe_a(idisk, \
|
||||
gptsdisks, idisklim, nbsegCercle, \
|
||||
gptsdisks, nbsegCercle, \
|
||||
meshPipe, mptsdisks):
|
||||
"""Les points"""
|
||||
#logging.info('start')
|
||||
|
@ -19,18 +19,19 @@
|
||||
#
|
||||
"""Les groupes des edges des cercles débouchants"""
|
||||
|
||||
import logging
|
||||
import SMESH
|
||||
|
||||
def construitMaillagePipe_b(idisk, \
|
||||
idisklim, nbsegCercle, \
|
||||
meshPipe, mptdsk, \
|
||||
edgeCircPipe0Group, edgeCircPipe1Group):
|
||||
edgesCircPipeGroup):
|
||||
"""Les groupes des edges des cercles débouchants"""
|
||||
#logging.info('start')
|
||||
|
||||
pts = list()
|
||||
for n_cercle in range(nbsegCercle):
|
||||
pts.append(mptdsk[n_cercle][-1])
|
||||
|
||||
edges = list()
|
||||
nb_pts = len(pts)
|
||||
for n_cercle in range(nb_pts):
|
||||
@ -39,8 +40,11 @@ def construitMaillagePipe_b(idisk, \
|
||||
edges.append(id_edge)
|
||||
|
||||
if idisk == idisklim[0]:
|
||||
edgeCircPipe0Group.Add(edges)
|
||||
groupe = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe0")
|
||||
else:
|
||||
edgeCircPipe1Group.Add(edges)
|
||||
groupe = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeCircPipe1")
|
||||
|
||||
groupe.Add(edges)
|
||||
edgesCircPipeGroup.append(groupe)
|
||||
|
||||
return
|
||||
|
@ -19,12 +19,11 @@
|
||||
#
|
||||
"""Les groupes des faces débouchantes"""
|
||||
|
||||
import logging
|
||||
import SMESH
|
||||
|
||||
def construitMaillagePipe_c(idisk, \
|
||||
idisklim, nbsegCercle, \
|
||||
meshPipe, mptdsk, nbsegRad, \
|
||||
faceCircPipe0Group, faceCircPipe1Group):
|
||||
meshPipe, mptdsk, nbsegRad):
|
||||
"""Les groupes des faces débouchantes"""
|
||||
#logging.info('start')
|
||||
|
||||
@ -41,8 +40,10 @@ def construitMaillagePipe_c(idisk, \
|
||||
faces.append(id_face)
|
||||
|
||||
if idisk == idisklim[0]:
|
||||
faceCircPipe0Group.Add(faces)
|
||||
groupe = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe0")
|
||||
else:
|
||||
faceCircPipe1Group.Add(faces)
|
||||
groupe = meshPipe.CreateEmptyGroup(SMESH.FACE, "faceCircPipe1")
|
||||
|
||||
groupe.Add(faces)
|
||||
|
||||
return
|
||||
|
@ -19,10 +19,6 @@
|
||||
#
|
||||
"""Mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure"""
|
||||
|
||||
import logging
|
||||
|
||||
import SMESH
|
||||
|
||||
def construitMaillagePipe_d(idisk, \
|
||||
idisklim, nbsegCercle, nbsegRad, \
|
||||
meshPipe, mptdsk, oldmpts, \
|
||||
|
@ -33,33 +33,38 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
||||
logging.info('start')
|
||||
|
||||
for n_edges, edges in enumerate(listEdges):
|
||||
|
||||
idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau)
|
||||
logging.info("idf: %d", idf)
|
||||
if idf >= 0:
|
||||
gptdsk = list()
|
||||
if idf > 0: # idf vaut 0 ou 1
|
||||
idf = -1 # si idf 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[n_edges]][idf]
|
||||
name = "centre%d"%idf
|
||||
name = "centre_{}".format(idf)
|
||||
geomPublish(initLog.debug, centre, name)
|
||||
vertPipePeau = ptFisExtPi[idFillingFromBout[n_edges]][idf]
|
||||
geomPublishInFather(initLog.debug, centre, vertPipePeau, "vertPipePeau")
|
||||
grpsEdgesCirc = edCircPeau[idFillingFromBout[n_edges]] # liste de groupes
|
||||
|
||||
edgesCirc = list()
|
||||
for grpEdgesCirc in grpsEdgesCirc:
|
||||
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
||||
for k, edge in enumerate(edges):
|
||||
logging.info("edgesCirc: %s", edgesCirc)
|
||||
|
||||
for i_aux, edge in enumerate(edges):
|
||||
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
|
||||
if geompy.MinDistance(centre, extrems[0]) < geompy.MinDistance(centre, extrems[1]):
|
||||
bout = extrems[1]
|
||||
else:
|
||||
bout = extrems[0]
|
||||
# ajustement du point extrémité (bout) sur l'edge circulaire en face de peau
|
||||
logging.debug("edgesCirc: %s", edgesCirc)
|
||||
distEdgeCirc = [(geompy.MinDistance(bout, edgeCirc), k2, edgeCirc) for k2, edgeCirc in enumerate(edgesCirc)]
|
||||
distEdgeCirc.sort()
|
||||
logging.debug("distEdgeCirc: %s", distEdgeCirc)
|
||||
dist = projettePointSurCourbe(bout, distEdgeCirc[0][2])
|
||||
if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02): # les points très proches d'une extrémité doivent y être mis précisément.
|
||||
# les points très proches d'une extrémité doivent y être mis précisément.
|
||||
if (abs(dist) < 0.02) or (abs(1.-dist) < 0.02):
|
||||
extrCircs = geompy.ExtractShapes(distEdgeCirc[0][2], geompy.ShapeType["VERTEX"], True)
|
||||
if geompy.MinDistance(bout, extrCircs[0]) < geompy.MinDistance(bout, extrCircs[1]):
|
||||
bout = extrCircs[0]
|
||||
@ -67,7 +72,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
||||
bout = extrCircs[1]
|
||||
else:
|
||||
bout = geompy.MakeVertexOnCurve(distEdgeCirc[0][2], dist)
|
||||
name ="bout%d"%k
|
||||
name = "bout_{}".format(i_aux)
|
||||
geomPublishInFather(initLog.debug, centre, bout, name)
|
||||
# enregistrement des points dans la structure
|
||||
points = list()
|
||||
@ -78,6 +83,8 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
||||
points[0] = centre
|
||||
points[-1] = bout
|
||||
gptdsk.append(points)
|
||||
|
||||
# Enregistrement des extrémités
|
||||
if n_edges == 0:
|
||||
gptsdisks[idisklim[0] -1] = gptdsk
|
||||
idisklim[0] = idisklim[0] -1
|
||||
@ -85,4 +92,4 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
||||
gptsdisks[idisklim[1] +1] = gptdsk
|
||||
idisklim[1] = idisklim[1] +1
|
||||
|
||||
return (gptsdisks, idisklim)
|
||||
return gptsdisks
|
||||
|
@ -22,8 +22,6 @@
|
||||
import os
|
||||
|
||||
import logging
|
||||
import SMESH
|
||||
import SALOMEDS
|
||||
|
||||
from .geomsmesh import smesh
|
||||
|
||||
|
@ -23,6 +23,8 @@ import logging
|
||||
|
||||
from . import initLog
|
||||
|
||||
import GEOM
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
from . import initLog
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
||||
from .findWireVertices import findWireVertices
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
from . import initLog
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
||||
from .findWireVertices import findWireVertices
|
||||
|
@ -24,7 +24,6 @@ import os
|
||||
import logging
|
||||
import math
|
||||
import GEOM
|
||||
import SALOMEDS
|
||||
import SMESH
|
||||
|
||||
from . import initLog
|
||||
@ -263,8 +262,8 @@ class fissureCoude(fissureGenerique):
|
||||
|
||||
algo3d = maillageSain.Hexahedron()
|
||||
algo2d = maillageSain.Quadrangle()
|
||||
putName(algo3d, "algo3d_maillageSain", i_pref=self.numeroCas)
|
||||
putName(algo2d, "algo2d_maillageSain", i_pref=self.numeroCas)
|
||||
putName(algo3d, "{}_3d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
|
||||
putName(algo2d, "{}_2d_maillageSain".format(self.mailleur2d3d()), i_pref=self.numeroCas)
|
||||
|
||||
algo1d_long_p1 = maillageSain.Segment(geom=long_p1)
|
||||
hypo1d_long_p1 = algo1d_long_p1.NumberOfSegments(n_long_p1)
|
||||
@ -682,16 +681,18 @@ class fissureCoude(fissureGenerique):
|
||||
mailleur="MeshGems"):
|
||||
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step, mailleur, self.numeroCas)
|
||||
mailleur, self.numeroCas)
|
||||
return maillageFissure
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
def setReferencesMaillageFissure(self):
|
||||
self.referencesMaillageFissure = dict(Entity_Node = 77917,
|
||||
Entity_Quad_Edge = 975,
|
||||
Entity_Quad_Triangle = 2182,
|
||||
Entity_Quad_Quadrangle = 6842,
|
||||
Entity_Quad_Tetra = 20135,
|
||||
Entity_Quad_Hexa = 8994,
|
||||
Entity_Quad_Penta = 972,
|
||||
Entity_Quad_Pyramid = 1038)
|
||||
self.referencesMaillageFissure = dict( \
|
||||
Entity_Quad_Edge = 975, \
|
||||
Entity_Quad_Quadrangle = 6842, \
|
||||
Entity_Quad_Hexa = 8994, \
|
||||
Entity_Node = 77917, \
|
||||
Entity_Quad_Triangle = 2182, \
|
||||
Entity_Quad_Tetra = 20135, \
|
||||
Entity_Quad_Pyramid = 1038, \
|
||||
Entity_Quad_Penta = 972 \
|
||||
)
|
||||
|
@ -76,7 +76,7 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \
|
||||
hypo2d.SetFineness( 2 )
|
||||
hypo2d.SetMinSize( minSize )
|
||||
hypo2d.SetQuadAllowed( 0 )
|
||||
putName(algo2d, "algo2d_zoneFiss", i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_zoneFiss".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo2d, "hypo1d_zoneFiss", i_pref=nro_cas)
|
||||
|
||||
is_done = meshFissure.Compute()
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
import os
|
||||
import logging
|
||||
import SMESH
|
||||
|
||||
|
||||
def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissureParams):
|
||||
""""Statistiques maillage"""
|
||||
@ -51,7 +49,9 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure
|
||||
text_2 = ""
|
||||
ok_maillage = True
|
||||
with open(fichierStatMaillageFissure, "w") as fic_stat :
|
||||
for key in ('Entity_Quad_Quadrangle', 'Entity_Quad_Hexa'):
|
||||
|
||||
# Le nombre d'arêtes, de quadrangles ou d'hexaèdres doit être rigoureusement identique
|
||||
for key in ('Entity_Quad_Edge', 'Entity_Quad_Quadrangle', 'Entity_Quad_Hexa'):
|
||||
if d_resu[key] != referencesMaillageFissure[key]:
|
||||
text = "Ecart"
|
||||
ok_maillage = False
|
||||
@ -61,14 +61,18 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure
|
||||
logging.info(text)
|
||||
fic_stat.write(text+"\n")
|
||||
text_2 += " {} = {}, \\\n".format(key,d_resu[key])
|
||||
|
||||
# Le nombre de noeuds, de triangles, de tétraèdres ou de pyramides peut varier du fait des algorithmes. On tolère 5% d'écart.
|
||||
tolerance = 0.05
|
||||
for key in ('Entity_Node', 'Entity_Quad_Edge', 'Entity_Quad_Triangle', 'Entity_Quad_Tetra', 'Entity_Quad_Pyramid', 'Entity_Quad_Penta'):
|
||||
if (d_resu[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \
|
||||
or (d_resu[key] > (1.0 + tolerance)*referencesMaillageFissure[key]):
|
||||
text = "Ecart"
|
||||
for key in ('Entity_Node', 'Entity_Quad_Triangle', 'Entity_Quad_Tetra', 'Entity_Quad_Pyramid', 'Entity_Quad_Penta'):
|
||||
if d_resu[key] == referencesMaillageFissure[key]:
|
||||
text = "Valeur_OK"
|
||||
elif (d_resu[key] < (1.0 - tolerance)*referencesMaillageFissure[key]) \
|
||||
or (d_resu[key] > (1.0 + tolerance)*referencesMaillageFissure[key]):
|
||||
text = "Ecart de plus de {}%".format(tolerance*100.)
|
||||
ok_maillage = False
|
||||
else:
|
||||
text = "Valeur_OK"
|
||||
text = "Valeur_OK à moins de {}%".format(tolerance*100.)
|
||||
text += ": {} reference: {} calcul: {}".format(key,referencesMaillageFissure[key],d_resu[key])
|
||||
logging.info(text)
|
||||
fic_stat.write(text+"\n")
|
||||
|
@ -26,7 +26,8 @@ from .identifieEdgesPeau_b import identifieEdgesPeau_b
|
||||
from .identifieEdgesPeau_c import identifieEdgesPeau_c
|
||||
|
||||
def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
|
||||
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees):
|
||||
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
|
||||
nro_cas=None):
|
||||
"""Identification précise des edges et disques des faces de peau selon index extremité fissure"""
|
||||
logging.info('start')
|
||||
|
||||
@ -38,7 +39,8 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
|
||||
if len(verticesPipePeau) > 0: # --- au moins une extrémité du pipe sur cette face de peau
|
||||
|
||||
edgesCircPeau, verticesCircPeau = identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \
|
||||
endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees)
|
||||
endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \
|
||||
nro_cas)
|
||||
else:
|
||||
edgesCircPeau = list()
|
||||
verticesCircPeau = list()
|
||||
@ -47,7 +49,8 @@ def identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSo
|
||||
# --- edges de bord de la face de peau
|
||||
|
||||
groupEdgesBordPeau, bordsVifs = identifieEdgesPeau_b(facePeau, edgesListees, \
|
||||
fillingFaceExterne, aretesVivesC, aretesVivesCoupees)
|
||||
fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
|
||||
nro_cas)
|
||||
|
||||
# --- edges de la face de peau partagées avec la face de fissure
|
||||
|
||||
|
@ -28,7 +28,8 @@ from .geomsmesh import geomPublish
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
||||
def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauFondIn, \
|
||||
endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees):
|
||||
endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesListees, \
|
||||
nro_cas=None):
|
||||
"""Identification précise des edges et disques des faces de peau selon index extremité fissure"""
|
||||
logging.info('start')
|
||||
|
||||
@ -48,13 +49,13 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
|
||||
nameEdge = "edgeRadFacePipePeau{}".format(i_aux)
|
||||
facesPipePeau[i_aux] = face
|
||||
endsEdgeFond[i_aux] = sharedVertices[0]
|
||||
geomPublish(initLog.debug, face, nameFace)
|
||||
geomPublish(initLog.debug, sharedVertices[0], nameVert)
|
||||
geomPublish(initLog.debug, face, nameFace, nro_cas)
|
||||
geomPublish(initLog.debug, sharedVertices[0], nameVert, nro_cas)
|
||||
edgesFace = geompy.ExtractShapes(face, geompy.ShapeType["EDGE"], True)
|
||||
for edge in edgesFace:
|
||||
if geompy.MinDistance(edge, sharedVertices[0]) < 1e-3:
|
||||
edgeRadFacePipePeau[i_aux] = edge
|
||||
geomPublish(initLog.debug, edge, nameEdge)
|
||||
geomPublish(initLog.debug, edge, nameEdge, nro_cas)
|
||||
break
|
||||
|
||||
# --- edges circulaires de la face de peau et points de jonction de la face externe de fissure
|
||||
@ -67,7 +68,7 @@ def identifieEdgesPeau_a(edgesFissExtPipe, facePeau, facesPeauSorted, edgesPeauF
|
||||
geompy.UnionList(grpEdgesCirc, edges)
|
||||
edgesCircPeau[i_aux] = grpEdgesCirc
|
||||
name = "edgeCirc{}".format(i_aux)
|
||||
geomPublishInFather(initLog.debug, facePeau, grpEdgesCirc, name)
|
||||
geomPublishInFather(initLog.always, facePeau, grpEdgesCirc, name)
|
||||
edgesListees = edgesListees + edges
|
||||
vertices = geompy.GetSharedShapesMulti([facePeau, fcirc], geompy.ShapeType["VERTEX"])
|
||||
grpVertCircPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["VERTEX"])
|
||||
|
@ -27,15 +27,16 @@ from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
||||
def identifieEdgesPeau_b(facePeau, edgesListees, \
|
||||
fillingFaceExterne, aretesVivesC, aretesVivesCoupees):
|
||||
fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
|
||||
nro_cas=None):
|
||||
"""edges de bord de la face de peau"""
|
||||
logging.info('start')
|
||||
|
||||
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
|
||||
edgesBords = list()
|
||||
for i, edge in enumerate(edgesFilling):
|
||||
for i_aux, edge in enumerate(edgesFilling):
|
||||
edgepeau = geompy.GetInPlace(facePeau, edge)
|
||||
name = "edgepeau%d"%i
|
||||
name = "edgepeau{}".format(i_aux)
|
||||
geomPublishInFather(initLog.debug, facePeau,edgepeau, name)
|
||||
logging.debug("edgepeau %s", geompy.ShapeInfo(edgepeau))
|
||||
if geompy.ShapeInfo(edgepeau)['EDGE'] > 1:
|
||||
@ -74,7 +75,7 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
|
||||
geompy.AddObject(bordsVifs, geompy.GetSubShapeID(facePeau, edge))
|
||||
|
||||
if bordsVifs is not None:
|
||||
geomPublishInFather(initLog.debug, facePeau, bordsVifs, "bordsVifs")
|
||||
geomPublishInFather(initLog.always, facePeau, bordsVifs, "bordsVifs")
|
||||
groupEdgesBordPeau = geompy.CutGroups(groupEdgesBordPeau, bordsVifs)
|
||||
grptmp = None
|
||||
if len(aretesVivesCoupees) > 0:
|
||||
@ -89,6 +90,6 @@ def identifieEdgesPeau_b(facePeau, edgesListees, \
|
||||
aretesVivesCoupees += edv
|
||||
|
||||
logging.debug("aretesVivesCoupees %s",aretesVivesCoupees)
|
||||
geomPublishInFather(initLog.debug, facePeau, groupEdgesBordPeau , "EdgesBords")
|
||||
geomPublishInFather(initLog.always, facePeau, groupEdgesBordPeau , "EdgesBords")
|
||||
|
||||
return groupEdgesBordPeau, bordsVifs
|
||||
|
@ -72,7 +72,8 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss
|
||||
(endsEdgeFond, facesPipePeau, edgeRadFacePipePeau, edgesCircPeau, verticesCircPeau, groupEdgesBordPeau, \
|
||||
bordsVifs, edgesFissurePeau, aretesVivesCoupees) = \
|
||||
identifieEdgesPeau(edgesFissExtPipe, verticesPipePeau, facePeau, facesPeauSorted, \
|
||||
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees)
|
||||
edgesPeauFondIn, fillingFaceExterne, aretesVivesC, aretesVivesCoupees, \
|
||||
nro_cas)
|
||||
|
||||
dataPPFF = dict(endsEdgeFond = endsEdgeFond, # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
||||
facesPipePeau = facesPipePeau, # pour chaque face [faces du pipe débouchantes]
|
||||
|
@ -19,8 +19,6 @@
|
||||
#
|
||||
"""Création d'une nouvelle étude"""
|
||||
|
||||
import logging
|
||||
|
||||
def initEtude():
|
||||
"""Création nouvelle etude salome"""
|
||||
from . import geomsmesh
|
||||
|
@ -24,7 +24,6 @@ import os
|
||||
import logging
|
||||
|
||||
import salome
|
||||
import SMESH
|
||||
|
||||
from .partitionBlocDefaut import partitionBlocDefaut
|
||||
from .facesVolumesToriques import facesVolumesToriques
|
||||
@ -39,9 +38,6 @@ from .enleveDefaut import enleveDefaut
|
||||
from .regroupeSainEtDefaut import RegroupeSainEtDefaut
|
||||
from .putName import putName
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# --- procedure complete fissure elliptique
|
||||
|
||||
def insereFissureElliptique(geometriesSaines, maillagesSains, \
|
||||
shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, step=-1):
|
||||
|
@ -17,7 +17,7 @@
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
"""procédure complète de construction d'une fissure longue"""
|
||||
"""Procédure complète de construction d'une fissure longue"""
|
||||
|
||||
import os
|
||||
|
||||
@ -39,15 +39,13 @@ from .insereFissureLongue_g import insereFissureLongue_g
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
def insereFissureLongue(geometriesSaines, \
|
||||
shapesFissure, shapeFissureParams, \
|
||||
def insereFissureLongue(shapesFissure, shapeFissureParams, \
|
||||
maillageFissureParams, elementsDefaut, \
|
||||
step=-1, mailleur="MeshGems", nro_cas=None):
|
||||
"""procedure complete fissure longue"""
|
||||
mailleur="MeshGems", nro_cas=None):
|
||||
"""Procédure complète de construction d'une fissure longue"""
|
||||
logging.info('start')
|
||||
logging.info("Usage du mailleur %s pour le cas n°%s", mailleur, nro_cas)
|
||||
|
||||
#geometrieSaine = geometriesSaines[0]
|
||||
shapeDefaut = shapesFissure[0] # face de fissure, debordant
|
||||
#tailleDefaut = shapesFissure[2]
|
||||
wiretube = shapesFissure[4] # wire fond de fissure, debordant
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublish
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
@ -21,8 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import SMESH
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
@ -22,7 +22,6 @@
|
||||
import logging
|
||||
import math
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import SMESH
|
||||
|
||||
@ -45,16 +44,19 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl
|
||||
meshFondFiss = smesh.Mesh(pipeFondFiss)
|
||||
putName(meshFondFiss, "pipeFondFiss", i_pref=nro_cas)
|
||||
|
||||
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||
algo3d = meshFondFiss.Prism()
|
||||
putName(algo3d.GetSubMesh(), "pipe", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_pipe", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_pipe", i_pref=nro_cas)
|
||||
putName(algo3d, "Prism", i_pref=nro_cas)
|
||||
|
||||
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||
putName(algo2d, "QUADRANGLE", i_pref=nro_cas)
|
||||
|
||||
for i_aux, face in enumerate(disques):
|
||||
#print (i_aux)
|
||||
# la commande suivante entraîne addToStudy() failed
|
||||
algo2d = meshFondFiss.Quadrangle(algo=smeshBuilder.RADIAL_QUAD,geom=face)
|
||||
putName(algo2d.GetSubMesh(), "disque", i_aux, nro_cas)
|
||||
putName(algo2d, "algo2d_disque", i_aux, nro_cas)
|
||||
putName(algo2d, "RADIAL_QUAD", i_aux, nro_cas)
|
||||
|
||||
for i_aux, edge in enumerate(rayons):
|
||||
algo1d = meshFondFiss.Segment(geom=edge)
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import SMESH
|
||||
|
||||
@ -58,7 +57,7 @@ def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibr
|
||||
hypo2d.SetMinSize( 2 )
|
||||
hypo2d.SetQuadAllowed( 0 )
|
||||
putName(algo2d.GetSubMesh(), "facePeau", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_facePeau", i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_facePeau".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo2d, "hypo2d_facePeau", i_pref=nro_cas)
|
||||
#
|
||||
lenEdgePeauFiss = geompy.BasicProperties(edgePeauFiss)[0]
|
||||
|
@ -24,7 +24,6 @@ import math
|
||||
|
||||
import SMESH
|
||||
from salome.smesh import smeshBuilder
|
||||
import salome
|
||||
|
||||
from .geomsmesh import smesh
|
||||
|
||||
@ -58,7 +57,7 @@ def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_gen
|
||||
hypo2d.SetMinSize( 2 )
|
||||
hypo2d.SetQuadAllowed( 0 )
|
||||
putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_faceFiss", i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
|
||||
#
|
||||
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgePeauFiss)
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
from salome.smesh import smeshBuilder
|
||||
import SMESH
|
||||
|
||||
@ -66,7 +65,7 @@ def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFac
|
||||
hypo3d.SetStandardOutputLog( 0 )
|
||||
hypo3d.SetRemoveLogOnSuccess( 1 )
|
||||
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_boiteDefaut".format(mailleur), i_pref=nro_cas)
|
||||
putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
|
||||
|
||||
is_done = meshBoiteDefaut.Compute()
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
import logging
|
||||
|
||||
import salome
|
||||
import SMESH
|
||||
|
||||
from .geomsmesh import geompy
|
||||
|
@ -30,7 +30,7 @@ from .putName import putName
|
||||
|
||||
def mailleFacesFissure(faceFissureExterne, \
|
||||
edgesPipeFissureExterneC, edgesPeauFissureExterneC, \
|
||||
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \
|
||||
edgeFaceFissGroup, areteFaceFissure, rayonPipe, nbsegRad, \
|
||||
mailleur="MeshGems", nro_cas=None):
|
||||
"""maillage faces de fissure"""
|
||||
logging.info('start')
|
||||
@ -54,15 +54,15 @@ def mailleFacesFissure(faceFissureExterne, \
|
||||
hypo2d.SetOptimize( 1 )
|
||||
hypo2d.SetFineness( 2 )
|
||||
hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
|
||||
hypo2d.SetChordalError( areteFaceFissure*0.25 )
|
||||
hypo2d.SetQuadAllowed( 0 )
|
||||
putName(algo2d.GetSubMesh(), "faceFiss", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_faceFiss", i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_faceFiss".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo2d, "hypo2d_faceFiss", i_pref=nro_cas)
|
||||
|
||||
texte = "Récupération des arêtes de '{}'".format(edgesPipeFissureExterneC.GetName())
|
||||
logging.info(texte)
|
||||
logging.info("UseExisting1DElements depuis '%s'", edgesPipeFissureExterneC.GetName())
|
||||
algo1d = meshFaceFiss.UseExisting1DElements(geom=edgesPipeFissureExterneC)
|
||||
hypo1d = algo1d.SourceEdges([ meshPipeGroups['edgeFaceFissGroup'] ],0,0)
|
||||
hypo1d = algo1d.SourceEdges([ edgeFaceFissGroup ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "edgeFissPeau", i_pref=nro_cas)
|
||||
putName(algo1d, "algo1d_edgeFissPeau", i_pref=nro_cas)
|
||||
putName(hypo1d, "hypo1d_edgeFissPeau", i_pref=nro_cas)
|
||||
|
@ -44,7 +44,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||
|
||||
nbFacesFilling = len(partitionsPeauFissFond)
|
||||
boutFromIfil = [None for _ in range(nbFacesFilling)]
|
||||
if idFillingFromBout[0] != idFillingFromBout[1]: # repérage des extremites du pipe quand elles débouchent sur des faces différentes
|
||||
# repérage des extremites du pipe quand elles débouchent sur des faces différentes :
|
||||
if ( idFillingFromBout[0] != idFillingFromBout[1] ):
|
||||
boutFromIfil[idFillingFromBout[0]] = 0
|
||||
boutFromIfil[idFillingFromBout[1]] = 1
|
||||
|
||||
@ -52,71 +53,17 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||
logging.info("nbFacesFilling = %d", nbFacesFilling)
|
||||
meshesFacesPeau = list()
|
||||
for ifil in range(nbFacesFilling):
|
||||
meshFacePeau = None
|
||||
|
||||
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
|
||||
|
||||
logging.debug("meshFacePeau %d intacte", ifil)
|
||||
# --- edges de bord de la face de filling
|
||||
filling = facesDefaut[ifil]
|
||||
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
||||
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, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
|
||||
|
||||
logging.info("face de peau %d intacte", ifil)
|
||||
facePeau = facesDefaut[ifil]
|
||||
else:
|
||||
logging.info("face de peau %d coupée par la fissure", ifil)
|
||||
# pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
|
||||
facePeau = facesPeaux[ifil]
|
||||
meshFacePeau = smesh.Mesh(facePeau)
|
||||
putName(meshFacePeau.GetMesh(), "facePeau", ifil, nro_cas)
|
||||
|
||||
logging.info("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]
|
||||
_ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
||||
groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
||||
bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
|
||||
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, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
|
||||
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau))
|
||||
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas)
|
||||
|
||||
if bordsVifs is not None:
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
|
||||
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas)
|
||||
|
||||
for i_aux, edgeCirc in enumerate(edgesCircPeau):
|
||||
texte = "i_aux = {}".format(i_aux)
|
||||
logging.info(texte)
|
||||
if edgeCirc is not None:
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ?
|
||||
if boutFromIfil[ifil] is None:
|
||||
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0)
|
||||
else:
|
||||
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0)
|
||||
name = "cercle{}".format(i_aux)
|
||||
putName(algo1d.GetSubMesh(), name, ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_" + name, ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_" + name, ifil, nro_cas)
|
||||
|
||||
logging.info("Maillage avec %s", mailleur)
|
||||
if ( mailleur == "MeshGems"):
|
||||
algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf)
|
||||
hypo2d = algo2d.Parameters()
|
||||
@ -132,11 +79,76 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||
hypo2d.SetOptimize( 1 )
|
||||
hypo2d.SetFineness( 2 )
|
||||
hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
|
||||
hypo2d.SetChordalError( dmoyen*0.25 )
|
||||
hypo2d.SetQuadAllowed( 0 )
|
||||
putName(algo2d.GetSubMesh(), "facePeau", ifil, nro_cas)
|
||||
putName(algo2d, "algo2d_facePeau", ifil, nro_cas)
|
||||
putName(algo2d, "{}_2d_facePeau".format(mailleur), ifil, nro_cas)
|
||||
putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas)
|
||||
|
||||
if partitionsPeauFissFond[ifil] is None: # face de peau maillage sain intacte
|
||||
|
||||
logging.debug("face de peau %d intacte", ifil)
|
||||
# --- edges de bord de la face de filling
|
||||
filling = facesDefaut[ifil]
|
||||
edgesFilling = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], False)
|
||||
groupEdgesBordPeau = geompy.CreateGroup(filling, geompy.ShapeType["EDGE"])
|
||||
geompy.UnionList(groupEdgesBordPeau, edgesFilling)
|
||||
geomPublishInFather(initLog.always, filling, groupEdgesBordPeau, "EdgesBords", nro_cas)
|
||||
|
||||
logging.info("UseExisting1DElements depuis '%s'", groupEdgesBordPeau.GetName())
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
|
||||
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
|
||||
|
||||
else:
|
||||
|
||||
logging.info("face de peau %d coupée par la fissure", ifil)
|
||||
edgesCircPeau = edCircPeau[ifil] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
|
||||
_ = ptCircPeau[ifil] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
||||
groupEdgesBordPeau = gpedgeBord[ifil] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
||||
bordsVifs = gpedgeVifs[ifil] # pour chaque face de peau : groupe subshape des edges aux bords correspondant à des arêtes vives
|
||||
edgesFissurePeau = edFissPeau[ifil] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
||||
|
||||
logging.info("UseExisting1DElements depuis groupEdgesBordPeau = '%s'", groupEdgesBordPeau.GetName())
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
|
||||
hypo1d = algo1d.SourceEdges([ bordsLibres ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "bordsLibres", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
|
||||
|
||||
objet = geompy.MakeCompound(edgesFissurePeau)
|
||||
geomPublishInFather(initLog.always, facePeau, objet, "edgesFissurePeau")
|
||||
logging.info("UseExisting1DElements depuis objet = '%s'", objet.GetName())
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=objet)
|
||||
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_edgePeauFiss", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_edgePeauFiss", ifil, nro_cas)
|
||||
|
||||
if bordsVifs is not None:
|
||||
logging.info("UseExisting1DElements depuis bordsVifs = '%s'", bordsVifs.GetName())
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=bordsVifs)
|
||||
hypo1d = algo1d.SourceEdges([ grpAretesVives ],0,0)
|
||||
putName(algo1d.GetSubMesh(), "bordsVifs", ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_bordsVifs", ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_bordsVifs", ifil, nro_cas)
|
||||
|
||||
for i_aux, edgeCirc in enumerate(edgesCircPeau):
|
||||
texte = "i_aux = {}".format(i_aux)
|
||||
logging.info(texte)
|
||||
if edgeCirc is not None:
|
||||
logging.info("UseExisting1DElements depuis edgeCirc = '%s'", edgeCirc.GetName())
|
||||
algo1d = meshFacePeau.UseExisting1DElements(geom=edgeCirc) # addToStudy() failed ?
|
||||
if boutFromIfil[ifil] is None:
|
||||
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[i_aux] ],0,0)
|
||||
else:
|
||||
hypo1d = algo1d.SourceEdges([ edgesCircPipeGroup[boutFromIfil[ifil]] ],0,0)
|
||||
name = "cercle{}".format(i_aux)
|
||||
putName(algo1d.GetSubMesh(), name, ifil, nro_cas)
|
||||
putName(algo1d, "algo1d_" + name, ifil, nro_cas)
|
||||
putName(hypo1d, "hypo1d_" + name, ifil, nro_cas)
|
||||
|
||||
is_done = meshFacePeau.Compute()
|
||||
text = "meshFacePeau {} .Compute".format(ifil)
|
||||
if is_done:
|
||||
@ -146,8 +158,8 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
|
||||
logging.info(text)
|
||||
raise Exception(text)
|
||||
|
||||
GroupFaces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
||||
_ = GroupFaces.AddFrom( meshFacePeau.GetMesh() )
|
||||
groupe_des_faces = meshFacePeau.CreateEmptyGroup( SMESH.FACE, "facePeau%d"%ifil )
|
||||
_ = groupe_des_faces.AddFrom( meshFacePeau.GetMesh() )
|
||||
meshesFacesPeau.append(meshFacePeau)
|
||||
|
||||
return meshesFacesPeau
|
||||
|
@ -63,7 +63,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
hypo2d.LengthFromEdges()
|
||||
hypo2d.SetAllowQuadrangles(0)
|
||||
putName(algo2d.GetSubMesh(), "sharedFaces", i_aux, nro_cas)
|
||||
putName(algo2d, "algo2d_sharedFaces", i_aux, nro_cas)
|
||||
putName(algo2d, "{}_2d_sharedFaces".format(mailleur), i_aux, nro_cas)
|
||||
putName(hypo2d, "hypo2d_sharedFaces", i_aux, nro_cas)
|
||||
|
||||
for i_aux, sharedEdges_i in enumerate(sharedEdges):
|
||||
@ -78,7 +78,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
|
||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
|
||||
|
||||
algo3d = bloc1.Prism(geom=tore)
|
||||
@ -86,8 +86,8 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo1d = bloc1.Segment(geom=tore)
|
||||
hypo1d = algo1d.NumberOfSegments(nbsegGen)
|
||||
putName(algo3d.GetSubMesh(), "tore", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_tore", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_tore", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_tore".format(mailleur), i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_tore".format(mailleur), i_pref=nro_cas)
|
||||
putName(algo1d, "algo1d_tore", i_pref=nro_cas)
|
||||
putName(hypo1d, "hypo1d_tore", i_pref=nro_cas)
|
||||
|
||||
@ -98,7 +98,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
hypo2d.SetQuadType( StdMeshersBuilder.QUAD_STANDARD )
|
||||
_ = bloc1.AddHypothesis(hypo2d,faces_i)
|
||||
putName(algo2d.GetSubMesh(), "faces", i_aux, nro_cas)
|
||||
putName(algo2d, "algo2d_faces", i_aux, nro_cas)
|
||||
putName(algo2d, "{}_2d_faces".format(mailleur), i_aux, nro_cas)
|
||||
putName(hypo2d, "hypo2d_faces", i_aux, nro_cas)
|
||||
|
||||
for i_aux, edges_i in enumerate(edges):
|
||||
@ -152,7 +152,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo2d = bloc1.Triangle(algo=smeshBuilder.NETGEN_2D, geom=facefissoutore)
|
||||
hypo2d = algo2d.LengthFromEdges()
|
||||
putName(algo2d.GetSubMesh(), "facefissoutore", i_pref=nro_cas)
|
||||
putName(algo2d, "algo2d_facefissoutore", i_pref=nro_cas)
|
||||
putName(algo2d, "{}_2d_facefissoutore".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo2d, "hypo2d_facefissoutore", i_pref=nro_cas)
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo1d = bloc1.Segment(geom=facesExternes_i)
|
||||
hypo1d = algo1d.NumberOfSegments(1)
|
||||
putName(algo2d.GetSubMesh(), "facesExternes", i_aux, nro_cas)
|
||||
putName(algo2d, "algo2d_facesExternes", i_aux, nro_cas)
|
||||
putName(algo2d, "{}2d_facesExternes".format(mailleur), i_aux, nro_cas)
|
||||
putName(hypo2d, "hypo2d_facesExternes", i_aux, nro_cas)
|
||||
if edgesBords is None:
|
||||
putName(algo1d, "algo1d_facesExternes", i_aux, nro_cas)
|
||||
@ -190,7 +190,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo3d = bloc1.Tetrahedron(algo=smeshBuilder.NETGEN,geom=ellipsoidep)
|
||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||
putName(algo3d.GetSubMesh(), "ellipsoide", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_ellipsoide", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_ellipsoide".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo3d, "hypo3d_ellipsoide", i_pref=nro_cas)
|
||||
|
||||
_ = bloc1.GroupOnGeom(faceFissure,'FACE1',SMESH.FACE)
|
||||
@ -232,7 +232,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
|
||||
algo3d = blocMesh.Tetrahedron(algo=smeshBuilder.NETGEN)
|
||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||
putName(algo3d.GetSubMesh(), "bloc", i_pref=nro_cas)
|
||||
putName(algo3d, "algo3d_bloc", i_pref=nro_cas)
|
||||
putName(algo3d, "{}_3d_bloc".format(mailleur), i_pref=nro_cas)
|
||||
putName(hypo3d, "hypo3d_bloc", i_pref=nro_cas)
|
||||
|
||||
is_done = blocMesh.Compute()
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
import logging
|
||||
|
||||
import GEOM
|
||||
|
||||
from .geomsmesh import geompy
|
||||
from .geomsmesh import geomPublish
|
||||
from .geomsmesh import geomPublishInFather
|
||||
|
Loading…
Reference in New Issue
Block a user