mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
Découpage de construitFissureGenerale
This commit is contained in:
parent
a685bd8705
commit
42c23b637c
@ -111,10 +111,9 @@ class cubeAngle(fissureGenerique):
|
|||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -106,10 +106,9 @@ class cylindre(fissureGenerique):
|
|||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -120,10 +120,9 @@ class ellipse_1(fissureGenerique):
|
|||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -114,10 +114,9 @@ class eprouvetteCourbe(fissureGenerique):
|
|||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -111,10 +111,9 @@ class eprouvetteDroite(fissureGenerique):
|
|||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -27,9 +27,7 @@ import math
|
|||||||
import GEOM
|
import GEOM
|
||||||
import SALOMEDS
|
import SALOMEDS
|
||||||
import SMESH
|
import SMESH
|
||||||
#import StdMeshers
|
|
||||||
#import GHS3DPlugin
|
|
||||||
#import NETGENPlugin
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
from blocFissure.gmu.fissureGenerique import fissureGenerique
|
||||||
@ -111,10 +109,9 @@ class faceGauche(fissureGenerique):
|
|||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -111,10 +111,9 @@ class faceGauche_2(fissureGenerique):
|
|||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -507,10 +507,10 @@ class fissure_Coude(fissureGenerique):
|
|||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = insereFissureLongue(geometriesSaines, maillagesSains, \
|
maillageFissure = insereFissureLongue(geometriesSaines, \
|
||||||
shapesFissure, shapeFissureParams, \
|
shapesFissure, shapeFissureParams, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
maillageFissureParams, elementsDefaut, \
|
||||||
mailleur)
|
step, mailleur)
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -116,10 +116,9 @@ class tube(fissureGenerique):
|
|||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -117,10 +117,9 @@ class vis_1(fissureGenerique):
|
|||||||
logging.info(texte)
|
logging.info(texte)
|
||||||
|
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains,
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams,
|
maillageFissureParams, elementsDefaut, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
step, mailleur)
|
||||||
mailleur)
|
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
@ -31,6 +31,9 @@ SET(plugin_SCRIPTS
|
|||||||
compoundFromList.py
|
compoundFromList.py
|
||||||
construitEdgesRadialesDebouchantes.py
|
construitEdgesRadialesDebouchantes.py
|
||||||
construitFissureGenerale.py
|
construitFissureGenerale.py
|
||||||
|
construitFissureGenerale_a.py
|
||||||
|
construitFissureGenerale_b.py
|
||||||
|
construitFissureGenerale_c.py
|
||||||
construitMaillagePipe.py
|
construitMaillagePipe.py
|
||||||
construitPartitionsPeauFissure.py
|
construitPartitionsPeauFissure.py
|
||||||
creePointsPipePeau.py
|
creePointsPipePeau.py
|
||||||
|
@ -173,8 +173,7 @@ class casStandard(fissureGenerique):
|
|||||||
shapesFissure, shapeFissureParams, \
|
shapesFissure, shapeFissureParams, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
maillageFissureParams, elementsDefaut, step, \
|
||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains, \
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams, \
|
|
||||||
maillageFissureParams, elementsDefaut, \
|
maillageFissureParams, elementsDefaut, \
|
||||||
step, mailleur)
|
step, mailleur)
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
@ -17,51 +17,23 @@
|
|||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
"""procédure complète de construction d'une fissure générale"""
|
||||||
import os
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import salome
|
import salome
|
||||||
from .geomsmesh import geompy
|
from .geomsmesh import geompy
|
||||||
from .geomsmesh import geomPublish
|
|
||||||
from .geomsmesh import geomPublishInFather
|
from .geomsmesh import geomPublishInFather
|
||||||
from . import initLog
|
from . import initLog
|
||||||
import GEOM
|
import GEOM
|
||||||
from .geomsmesh import smesh
|
from .geomsmesh import smesh
|
||||||
from salome.smesh import smeshBuilder
|
from salome.smesh import smeshBuilder
|
||||||
import SMESH
|
import SMESH
|
||||||
import math
|
|
||||||
import bisect
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
# from extractionOrientee import extractionOrientee
|
|
||||||
# from extractionOrienteeMulti import extractionOrienteeMulti
|
|
||||||
# from sortFaces import sortFaces
|
|
||||||
#from sortEdges import sortEdges
|
|
||||||
# from eliminateDoubles import eliminateDoubles
|
|
||||||
# from substractSubShapes import substractSubShapes
|
|
||||||
# from produitMixte import produitMixte
|
|
||||||
# from findWireEndVertices import findWireEndVertices
|
|
||||||
#from findWireIntermediateVertices import findWireIntermediateVertices
|
|
||||||
from .orderEdgesFromWire import orderEdgesFromWire
|
from .orderEdgesFromWire import orderEdgesFromWire
|
||||||
# from getSubshapeIds import getSubshapeIds
|
|
||||||
from .putName import putName
|
|
||||||
# from distance2 import distance2
|
|
||||||
from .enleveDefaut import enleveDefaut
|
|
||||||
from .shapeSurFissure import shapeSurFissure
|
|
||||||
from .regroupeSainEtDefaut import RegroupeSainEtDefaut
|
|
||||||
from .triedreBase import triedreBase
|
|
||||||
# from checkDecoupePartition import checkDecoupePartition
|
|
||||||
# from whichSide import whichSide
|
|
||||||
# from whichSideMulti import whichSideMulti
|
|
||||||
#from whichSideVertex import whichSideVertex
|
|
||||||
#from projettePointSurCourbe import projettePointSurCourbe
|
|
||||||
# from prolongeWire import prolongeWire
|
|
||||||
from .restreintFaceFissure import restreintFaceFissure
|
from .restreintFaceFissure import restreintFaceFissure
|
||||||
from .partitionneFissureParPipe import partitionneFissureParPipe
|
from .partitionneFissureParPipe import partitionneFissureParPipe
|
||||||
from .construitPartitionsPeauFissure import construitPartitionsPeauFissure
|
from .construitPartitionsPeauFissure import construitPartitionsPeauFissure
|
||||||
from .compoundFromList import compoundFromList
|
from .compoundFromList import compoundFromList
|
||||||
from .identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau
|
|
||||||
from .identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne
|
from .identifieFacesEdgesFissureExterne import identifieFacesEdgesFissureExterne
|
||||||
from .calculePointsAxiauxPipe import calculePointsAxiauxPipe
|
from .calculePointsAxiauxPipe import calculePointsAxiauxPipe
|
||||||
from .elimineExtremitesPipe import elimineExtremitesPipe
|
from .elimineExtremitesPipe import elimineExtremitesPipe
|
||||||
@ -72,23 +44,21 @@ from .construitMaillagePipe import construitMaillagePipe
|
|||||||
from .mailleAretesEtJonction import mailleAretesEtJonction
|
from .mailleAretesEtJonction import mailleAretesEtJonction
|
||||||
from .mailleFacesFissure import mailleFacesFissure
|
from .mailleFacesFissure import mailleFacesFissure
|
||||||
from .mailleFacesPeau import mailleFacesPeau
|
from .mailleFacesPeau import mailleFacesPeau
|
||||||
from .fissError import fissError
|
|
||||||
|
from .construitFissureGenerale_a import construitFissureGenerale_a
|
||||||
|
from .construitFissureGenerale_b import construitFissureGenerale_b
|
||||||
|
from .construitFissureGenerale_c import construitFissureGenerale_c
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- procédure complète fissure générale
|
|
||||||
|
|
||||||
def construitFissureGenerale(maillagesSains, \
|
def construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams, \
|
|
||||||
maillageFissureParams, elementsDefaut, \
|
maillageFissureParams, elementsDefaut, \
|
||||||
step=-1, mailleur="MeshGems"):
|
step=-1, mailleur="MeshGems"):
|
||||||
"""
|
"""procédure complète fissure générale"""
|
||||||
TODO: a completer
|
|
||||||
"""
|
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
logging.info(mailleur)
|
logging.info("Usage du mailleur %s", mailleur)
|
||||||
|
|
||||||
shapeDefaut = shapesFissure[0] # faces de fissure, débordant
|
shapeDefaut = shapesFissure[0] # faces de fissure, débordant
|
||||||
fondFiss = shapesFissure[4] # groupe d'edges de fond de fissure
|
|
||||||
|
|
||||||
rayonPipe = shapeFissureParams['rayonPipe']
|
rayonPipe = shapeFissureParams['rayonPipe']
|
||||||
if 'lenSegPipe' in shapeFissureParams:
|
if 'lenSegPipe' in shapeFissureParams:
|
||||||
@ -96,10 +66,6 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
else:
|
else:
|
||||||
lenSegPipe = rayonPipe
|
lenSegPipe = rayonPipe
|
||||||
|
|
||||||
nomRep = maillageFissureParams['nomRep']
|
|
||||||
nomFicSain = maillageFissureParams['nomFicSain']
|
|
||||||
nomFicFissure = maillageFissureParams['nomFicFissure']
|
|
||||||
|
|
||||||
nbsegRad = maillageFissureParams['nbsegRad'] # nombre de couches selon un rayon du pipe
|
nbsegRad = maillageFissureParams['nbsegRad'] # nombre de couches selon un rayon du pipe
|
||||||
nbsegCercle = maillageFissureParams['nbsegCercle'] # nombre de secteur dans un cercle du pipe
|
nbsegCercle = maillageFissureParams['nbsegCercle'] # nombre de secteur dans un cercle du pipe
|
||||||
areteFaceFissure = maillageFissureParams['areteFaceFissure']
|
areteFaceFissure = maillageFissureParams['areteFaceFissure']
|
||||||
@ -107,25 +73,8 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
if 'aretesVives' in maillageFissureParams:
|
if 'aretesVives' in maillageFissureParams:
|
||||||
lgAretesVives = maillageFissureParams['aretesVives']
|
lgAretesVives = maillageFissureParams['aretesVives']
|
||||||
|
|
||||||
pointIn_x = 0.0
|
# Point interne
|
||||||
pointIn_y = 0.0
|
pointInterne = construitFissureGenerale_a (geompy, shapeFissureParams)
|
||||||
pointIn_z = 0.0
|
|
||||||
isPointInterne = False
|
|
||||||
if 'pointIn_x' in shapeFissureParams:
|
|
||||||
pointIn_x = shapeFissureParams['pointIn_x']
|
|
||||||
isPointInterne = True
|
|
||||||
if 'pointIn_y' in shapeFissureParams:
|
|
||||||
pointIn_y = shapeFissureParams['pointIn_y']
|
|
||||||
isPointInterne = True
|
|
||||||
if 'pointIn_z' in shapeFissureParams:
|
|
||||||
pointIn_z = shapeFissureParams['pointIn_z']
|
|
||||||
isPointInterne = True
|
|
||||||
if isPointInterne:
|
|
||||||
pointInterne = geompy.MakeVertex(pointIn_x, pointIn_y, pointIn_z)
|
|
||||||
else:
|
|
||||||
pointInterne = None
|
|
||||||
|
|
||||||
fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure))
|
|
||||||
|
|
||||||
# fillings des faces en peau
|
# fillings des faces en peau
|
||||||
facesDefaut = elementsDefaut[0]
|
facesDefaut = elementsDefaut[0]
|
||||||
@ -148,9 +97,6 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
if lgAretesVives == 0:
|
if lgAretesVives == 0:
|
||||||
lgAretesVives = dmoyen
|
lgAretesVives = dmoyen
|
||||||
|
|
||||||
|
|
||||||
O, OX, OY, OZ = triedreBase()
|
|
||||||
|
|
||||||
# --- restriction de la face de fissure au domaine solide :
|
# --- restriction de la face de fissure au domaine solide :
|
||||||
# partition face fissure étendue par fillings, on garde la face interne
|
# partition face fissure étendue par fillings, on garde la face interne
|
||||||
|
|
||||||
@ -159,7 +105,8 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
# --- pipe de fond de fissure, prolongé, partition face fissure par pipe
|
# --- pipe de fond de fissure, prolongé, partition face fissure par pipe
|
||||||
# identification des edges communes pipe et face fissure
|
# identification des edges communes pipe et face fissure
|
||||||
|
|
||||||
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
|
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = \
|
||||||
|
partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
|
||||||
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
|
||||||
|
|
||||||
for i,edge in enumerate(edgesFondFiss):
|
for i,edge in enumerate(edgesFondFiss):
|
||||||
@ -178,59 +125,16 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
# et quadranglesToShapeWithCorner)
|
# et quadranglesToShapeWithCorner)
|
||||||
|
|
||||||
aretesVivesC = compoundFromList(bordsPartages, "areteVive")
|
aretesVivesC = compoundFromList(bordsPartages, "areteVive")
|
||||||
aretesVivesCoupees = list() # ensembles des arêtes vives identifiées sur les faces de peau dans l'itération sur partitionsPeauFissFond
|
aretesVivesCoupees = list() # ensemble des arêtes vives identifiées sur les faces de peau dans l'itération sur partitionsPeauFissFond
|
||||||
|
|
||||||
# --- inventaire des faces de peau coupées par la fissure
|
# --- inventaire des faces de peau coupées par la fissure
|
||||||
# pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
|
|
||||||
# 0, 1 ou plus edges de la face de fissure externe au pipe
|
|
||||||
|
|
||||||
nbFacesFilling = len(partitionsPeauFissFond)
|
ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, \
|
||||||
texte = "nbFacesFilling : {} ".format(nbFacesFilling)
|
facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
||||||
logging.info(texte)
|
edgeRadFacePipePeau, facesPipePeau = \
|
||||||
|
construitFissureGenerale_b( partitionsPeauFissFond, \
|
||||||
ptEdgeFond = [ list() for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
||||||
fsPipePeau = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
|
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees )
|
||||||
edRadFPiPo = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
|
||||||
fsFissuExt = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
|
|
||||||
edFisExtPe = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
|
|
||||||
edFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
|
|
||||||
facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
|
|
||||||
edCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
|
|
||||||
ptCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
|
||||||
gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
|
||||||
gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
|
|
||||||
edFissPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
|
||||||
ptFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
|
|
||||||
|
|
||||||
for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
|
|
||||||
if partitionPeauFissFond is not None:
|
|
||||||
dataPPFF,aretesVivesCoupees = identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss,
|
|
||||||
edgesFondFiss, wireFondFiss, aretesVivesC,
|
|
||||||
facesDefaut, centreFondFiss, rayonPipe,
|
|
||||||
aretesVivesCoupees)
|
|
||||||
ptEdgeFond[ifil] = dataPPFF['endsEdgeFond']
|
|
||||||
fsPipePeau[ifil] = dataPPFF['facesPipePeau']
|
|
||||||
edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau']
|
|
||||||
fsFissuExt[ifil] = dataPPFF['facesFissExt']
|
|
||||||
edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau']
|
|
||||||
edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
|
|
||||||
facesPeaux[ifil] = dataPPFF['facePeau']
|
|
||||||
edCircPeau[ifil] = dataPPFF['edgesCircPeau']
|
|
||||||
ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
|
|
||||||
gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
|
|
||||||
gpedgeVifs[ifil] = dataPPFF['bordsVifs']
|
|
||||||
edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
|
|
||||||
ptFisExtPi[ifil] = dataPPFF['verticesPipePeau']
|
|
||||||
|
|
||||||
facesPipePeau = list()
|
|
||||||
edgeRadFacePipePeau = list()
|
|
||||||
for ifil in range(nbFacesFilling):
|
|
||||||
facesPipePeau += fsPipePeau[ifil]
|
|
||||||
edgeRadFacePipePeau += edRadFPiPo[ifil]
|
|
||||||
|
|
||||||
for i, avc in enumerate(aretesVivesCoupees):
|
|
||||||
name = "areteViveCoupee%d"%i
|
|
||||||
geomPublish(initLog.debug, avc, name)
|
|
||||||
|
|
||||||
# --- identification des faces et edges de fissure externe pour maillage
|
# --- identification des faces et edges de fissure externe pour maillage
|
||||||
|
|
||||||
@ -242,8 +146,8 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
# - points sur les edges de fond de fissure et edges pipe/face fissure,
|
# - points sur les edges de fond de fissure et edges pipe/face fissure,
|
||||||
# - vecteurs tangents au fond de fissure (normal au disque maillé)
|
# - vecteurs tangents au fond de fissure (normal au disque maillé)
|
||||||
|
|
||||||
(centres, gptsdisks, raydisks) = calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
|
(centres, gptsdisks, raydisks) = calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut, \
|
||||||
centreFondFiss, wireFondFiss, wirePipeFiss,
|
centreFondFiss, wireFondFiss, wirePipeFiss, \
|
||||||
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad)
|
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad)
|
||||||
|
|
||||||
# --- recherche des points en trop (externes au volume à remailler)
|
# --- recherche des points en trop (externes au volume à remailler)
|
||||||
@ -257,12 +161,12 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
|
|
||||||
# --- construction des listes d'edges radiales sur chaque extrémité débouchante
|
# --- construction des listes d'edges radiales sur chaque extrémité débouchante
|
||||||
|
|
||||||
(listEdges, idFacesDebouchantes) = construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks,
|
(listEdges, idFacesDebouchantes) = construitEdgesRadialesDebouchantes(idisklim, idiskout, gptsdisks, raydisks, \
|
||||||
facesPipePeau, edgeRadFacePipePeau, nbsegCercle)
|
facesPipePeau, edgeRadFacePipePeau, nbsegCercle)
|
||||||
|
|
||||||
# --- création des points du maillage du pipe sur la face de peau
|
# --- création des points du maillage du pipe sur la face de peau
|
||||||
|
|
||||||
(gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
(gptsdisks, idisklim) = creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout, \
|
||||||
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
ptEdgeFond, ptFisExtPi, edCircPeau, gptsdisks, idisklim, nbsegRad)
|
||||||
|
|
||||||
# --- ajustement precis des points sur edgesPipeFissureExterneC
|
# --- ajustement precis des points sur edgesPipeFissureExterneC
|
||||||
@ -279,7 +183,7 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
|
|
||||||
# --- maillage faces de fissure
|
# --- maillage faces de fissure
|
||||||
|
|
||||||
(meshFaceFiss, grpFaceFissureExterne, grpEdgesPeauFissureExterne, grpEdgesPipeFissureExterne) = \
|
(meshFaceFiss, _, grpEdgesPeauFissureExterne, _) = \
|
||||||
mailleFacesFissure(faceFissureExterne, \
|
mailleFacesFissure(faceFissureExterne, \
|
||||||
edgesPipeFissureExterneC, edgesPeauFissureExterneC, \
|
edgesPipeFissureExterneC, edgesPeauFissureExterneC, \
|
||||||
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \
|
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \
|
||||||
@ -295,80 +199,18 @@ def construitFissureGenerale(maillagesSains, \
|
|||||||
|
|
||||||
# --- regroupement des maillages du défaut
|
# --- regroupement des maillages du défaut
|
||||||
|
|
||||||
listMeshes = [internalBoundary.GetMesh(),
|
listMeshes = [internalBoundary.GetMesh(), meshPipe.GetMesh(), meshFaceFiss.GetMesh()]
|
||||||
meshPipe.GetMesh(),
|
for mfpeau in meshesFacesPeau:
|
||||||
meshFaceFiss.GetMesh()]
|
listMeshes.append(mfpeau.GetMesh())
|
||||||
for mp in meshesFacesPeau:
|
|
||||||
listMeshes.append(mp.GetMesh())
|
|
||||||
|
|
||||||
meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False)
|
meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False)
|
||||||
# pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
|
|
||||||
# on désigne les faces de peau en quadrangles par le groupe "skinFaces"
|
|
||||||
group_faceFissOutPipe = None
|
|
||||||
group_faceFissInPipe = None
|
|
||||||
groups = meshBoiteDefaut.GetGroups()
|
|
||||||
for grp in groups:
|
|
||||||
if grp.GetType() == SMESH.FACE:
|
|
||||||
if grp.GetName() == "fisOutPi":
|
|
||||||
group_faceFissOutPipe = grp
|
|
||||||
elif grp.GetName() == "fisInPi":
|
|
||||||
group_faceFissInPipe = grp
|
|
||||||
|
|
||||||
# le maillage NETGEN ne passe pas toujours ==> on force l'usage de MG_Tetra
|
# Maillage complet
|
||||||
mailleur = "MeshGems"
|
maillageComplet = construitFissureGenerale_c( maillageSain, meshBoiteDefaut, \
|
||||||
logging.info("Maillage avec %s", mailleur)
|
zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges, \
|
||||||
if ( mailleur == "MeshGems"):
|
facesPortFissure, \
|
||||||
algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.MG_Tetra)
|
maillageFissureParams, \
|
||||||
else:
|
mailleur )
|
||||||
algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
|
|
||||||
hypo3d = algo3d.MaxElementVolume(1000.0)
|
|
||||||
hypo3d.SetVerboseLevel( 0 )
|
|
||||||
hypo3d.SetStandardOutputLog( 0 )
|
|
||||||
hypo3d.SetRemoveLogOnSuccess( 1 )
|
|
||||||
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
|
||||||
putName(algo3d, "algo3d_boiteDefaut")
|
|
||||||
putName(meshBoiteDefaut, "boiteDefaut")
|
|
||||||
|
|
||||||
is_done = meshBoiteDefaut.Compute()
|
|
||||||
text = "meshBoiteDefaut.Compute"
|
|
||||||
if is_done:
|
|
||||||
logging.info(text+" OK")
|
|
||||||
else:
|
|
||||||
text = "Erreur au calcul du maillage.\n" + text
|
|
||||||
logging.info(text)
|
|
||||||
raise Exception(text)
|
|
||||||
|
|
||||||
faceFissure = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], \
|
|
||||||
'FACE1' )
|
|
||||||
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
|
|
||||||
zoneDefaut_internalFaces, zoneDefaut_internalEdges)
|
|
||||||
putName(maillageSain, nomFicSain+"_coupe")
|
|
||||||
_, normfiss = shapeSurFissure(facesPortFissure)
|
|
||||||
maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \
|
|
||||||
None, None, 'COMPLET', normfiss)
|
|
||||||
|
|
||||||
logging.info("conversion quadratique")
|
|
||||||
maillageComplet.ConvertToQuadratic( 1 )
|
|
||||||
logging.info("groupes")
|
|
||||||
groups = maillageComplet.GetGroups()
|
|
||||||
grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
|
|
||||||
fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' )
|
|
||||||
|
|
||||||
logging.info("réorientation face de fissure FACE1")
|
|
||||||
grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
|
|
||||||
nb = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1))
|
|
||||||
|
|
||||||
logging.info("réorientation face de fissure FACE2")
|
|
||||||
plansim = geompy.MakePlane(O, normfiss, 10000)
|
|
||||||
fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
|
|
||||||
grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
|
|
||||||
nb = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
|
|
||||||
fond = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
|
|
||||||
|
|
||||||
logging.info("export maillage fini")
|
|
||||||
maillageComplet.ExportMED(fichierMaillageFissure)
|
|
||||||
putName(maillageComplet, nomFicFissure)
|
|
||||||
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
49
src/Tools/blocFissure/gmu/construitFissureGenerale_a.py
Normal file
49
src/Tools/blocFissure/gmu/construitFissureGenerale_a.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2014-2020 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
|
||||||
|
#
|
||||||
|
"""construction de la fissure générale - le point interne"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def construitFissureGenerale_a (geompy, shapeFissureParams):
|
||||||
|
"""construction de la fissure générale - le point interne"""
|
||||||
|
logging.info('start')
|
||||||
|
|
||||||
|
point_in_x = 0.0
|
||||||
|
point_in_y = 0.0
|
||||||
|
point_in_z = 0.0
|
||||||
|
is_point_interne = False
|
||||||
|
if 'pointIn_x' in shapeFissureParams:
|
||||||
|
point_in_x = shapeFissureParams['pointIn_x']
|
||||||
|
is_point_interne = True
|
||||||
|
if 'pointIn_y' in shapeFissureParams:
|
||||||
|
point_in_y = shapeFissureParams['pointIn_y']
|
||||||
|
is_point_interne = True
|
||||||
|
if 'pointIn_z' in shapeFissureParams:
|
||||||
|
point_in_z = shapeFissureParams['pointIn_z']
|
||||||
|
is_point_interne = True
|
||||||
|
|
||||||
|
if is_point_interne:
|
||||||
|
pointInterne = geompy.MakeVertex(point_in_x, point_in_y, point_in_z)
|
||||||
|
else:
|
||||||
|
pointInterne = None
|
||||||
|
|
||||||
|
return pointInterne
|
89
src/Tools/blocFissure/gmu/construitFissureGenerale_b.py
Normal file
89
src/Tools/blocFissure/gmu/construitFissureGenerale_b.py
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2014-2020 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
|
||||||
|
#
|
||||||
|
"""construction de la fissure générale - inventaire des faces de peau coupées par la fissure"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
from .geomsmesh import geomPublish
|
||||||
|
from . import initLog
|
||||||
|
|
||||||
|
from .identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def construitFissureGenerale_b( partitionsPeauFissFond, \
|
||||||
|
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
||||||
|
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees ):
|
||||||
|
"""construction de la fissure générale - inventaire des faces de peau coupées par la fissure
|
||||||
|
|
||||||
|
pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
|
||||||
|
0, 1 ou plus edges de la face de fissure externe au pipe
|
||||||
|
"""
|
||||||
|
logging.info('start')
|
||||||
|
|
||||||
|
nbFacesFilling = len(partitionsPeauFissFond)
|
||||||
|
texte = "nbFacesFilling : {} ".format(nbFacesFilling)
|
||||||
|
logging.info(texte)
|
||||||
|
|
||||||
|
ptEdgeFond = [ list() for i in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
|
||||||
|
fsPipePeau = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
|
||||||
|
edRadFPiPo = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
|
||||||
|
fsFissuExt = [ list() for i in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
|
||||||
|
edFisExtPe = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
|
||||||
|
edFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
|
||||||
|
facesPeaux = [None for i in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
|
||||||
|
edCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
|
||||||
|
ptCircPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
|
||||||
|
gpedgeBord = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
|
||||||
|
gpedgeVifs = [None for i in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
|
||||||
|
edFissPeau = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
|
||||||
|
ptFisExtPi = [ list() for i in range(nbFacesFilling)] # pour chaque face de peau : [point commun edFissPeau edCircPeau]
|
||||||
|
|
||||||
|
for ifil, partitionPeauFissFond in enumerate(partitionsPeauFissFond):
|
||||||
|
if partitionPeauFissFond is not None:
|
||||||
|
dataPPFF,aretesVivesCoupees = identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, \
|
||||||
|
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
|
||||||
|
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees)
|
||||||
|
ptEdgeFond[ifil] = dataPPFF['endsEdgeFond']
|
||||||
|
fsPipePeau[ifil] = dataPPFF['facesPipePeau']
|
||||||
|
edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau']
|
||||||
|
fsFissuExt[ifil] = dataPPFF['facesFissExt']
|
||||||
|
edFisExtPe[ifil] = dataPPFF['edgesFissExtPeau']
|
||||||
|
edFisExtPi[ifil] = dataPPFF['edgesFissExtPipe']
|
||||||
|
facesPeaux[ifil] = dataPPFF['facePeau']
|
||||||
|
edCircPeau[ifil] = dataPPFF['edgesCircPeau']
|
||||||
|
ptCircPeau[ifil] = dataPPFF['verticesCircPeau']
|
||||||
|
gpedgeBord[ifil] = dataPPFF['groupEdgesBordPeau']
|
||||||
|
gpedgeVifs[ifil] = dataPPFF['bordsVifs']
|
||||||
|
edFissPeau[ifil] = dataPPFF['edgesFissurePeau']
|
||||||
|
ptFisExtPi[ifil] = dataPPFF['verticesPipePeau']
|
||||||
|
|
||||||
|
facesPipePeau = list()
|
||||||
|
edgeRadFacePipePeau = list()
|
||||||
|
for ifil in range(nbFacesFilling):
|
||||||
|
facesPipePeau += fsPipePeau[ifil]
|
||||||
|
edgeRadFacePipePeau += edRadFPiPo[ifil]
|
||||||
|
|
||||||
|
for i, avc in enumerate(aretesVivesCoupees):
|
||||||
|
name = "areteViveCoupee%d"%i
|
||||||
|
geomPublish(initLog.debug, avc, name)
|
||||||
|
|
||||||
|
return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
|
||||||
|
ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \
|
||||||
|
edgeRadFacePipePeau, facesPipePeau
|
124
src/Tools/blocFissure/gmu/construitFissureGenerale_c.py
Normal file
124
src/Tools/blocFissure/gmu/construitFissureGenerale_c.py
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2014-2020 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
|
||||||
|
#
|
||||||
|
"""construction de la fissure générale - maillage"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import salome
|
||||||
|
from .geomsmesh import geompy
|
||||||
|
import GEOM
|
||||||
|
from .geomsmesh import smesh
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
import SMESH
|
||||||
|
|
||||||
|
from .putName import putName
|
||||||
|
from .enleveDefaut import enleveDefaut
|
||||||
|
from .shapeSurFissure import shapeSurFissure
|
||||||
|
from .regroupeSainEtDefaut import RegroupeSainEtDefaut
|
||||||
|
from .triedreBase import triedreBase
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
|
||||||
|
zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges, \
|
||||||
|
facesPortFissure, \
|
||||||
|
maillageFissureParams, \
|
||||||
|
mailleur="MeshGems"):
|
||||||
|
"""construction de la fissure générale - maillage"""
|
||||||
|
logging.info('start')
|
||||||
|
logging.info("Usage du mailleur %s", mailleur)
|
||||||
|
|
||||||
|
nomRep = maillageFissureParams['nomRep']
|
||||||
|
nomFicSain = maillageFissureParams['nomFicSain']
|
||||||
|
nomFicFissure = maillageFissureParams['nomFicFissure']
|
||||||
|
|
||||||
|
O, _, _, _ = triedreBase()
|
||||||
|
|
||||||
|
# pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
|
||||||
|
# on désigne les faces de peau en quadrangles par le groupe "skinFaces"
|
||||||
|
group_faceFissOutPipe = None
|
||||||
|
group_faceFissInPipe = None
|
||||||
|
groups = meshBoiteDefaut.GetGroups()
|
||||||
|
for grp in groups:
|
||||||
|
if grp.GetType() == SMESH.FACE:
|
||||||
|
if grp.GetName() == "fisOutPi":
|
||||||
|
group_faceFissOutPipe = grp
|
||||||
|
elif grp.GetName() == "fisInPi":
|
||||||
|
group_faceFissInPipe = grp
|
||||||
|
|
||||||
|
# le maillage NETGEN ne passe pas toujours ==> on force l'usage de MG_Tetra
|
||||||
|
mailleur = "MeshGems"
|
||||||
|
logging.info("Maillage avec %s", mailleur)
|
||||||
|
if ( mailleur == "MeshGems"):
|
||||||
|
algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.MG_Tetra)
|
||||||
|
else:
|
||||||
|
algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
|
||||||
|
hypo3d = algo3d.MaxElementVolume(1000.0)
|
||||||
|
hypo3d.SetVerboseLevel( 0 )
|
||||||
|
hypo3d.SetStandardOutputLog( 0 )
|
||||||
|
hypo3d.SetRemoveLogOnSuccess( 1 )
|
||||||
|
putName(algo3d.GetSubMesh(), "boiteDefaut")
|
||||||
|
putName(algo3d, "algo3d_boiteDefaut")
|
||||||
|
putName(meshBoiteDefaut, "boiteDefaut")
|
||||||
|
|
||||||
|
is_done = meshBoiteDefaut.Compute()
|
||||||
|
text = "meshBoiteDefaut.Compute"
|
||||||
|
if is_done:
|
||||||
|
logging.info(text+" OK")
|
||||||
|
else:
|
||||||
|
text = "Erreur au calcul du maillage.\n" + text
|
||||||
|
logging.info(text)
|
||||||
|
raise Exception(text)
|
||||||
|
|
||||||
|
_ = meshBoiteDefaut.GetMesh().UnionListOfGroups( [ group_faceFissOutPipe, group_faceFissInPipe ], \
|
||||||
|
'FACE1' )
|
||||||
|
maillageSain = enleveDefaut(maillageSain, zoneDefaut, zoneDefaut_skin,
|
||||||
|
zoneDefaut_internalFaces, zoneDefaut_internalEdges)
|
||||||
|
putName(maillageSain, nomFicSain+"_coupe")
|
||||||
|
_, normfiss = shapeSurFissure(facesPortFissure)
|
||||||
|
maillageComplet = RegroupeSainEtDefaut(maillageSain, meshBoiteDefaut, \
|
||||||
|
None, None, 'COMPLET', normfiss)
|
||||||
|
|
||||||
|
logging.info("conversion quadratique")
|
||||||
|
maillageComplet.ConvertToQuadratic( 1 )
|
||||||
|
logging.info("groupes")
|
||||||
|
groups = maillageComplet.GetGroups()
|
||||||
|
grps = [ grp for grp in groups if grp.GetName() == 'FONDFISS']
|
||||||
|
_ = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FONDFISS' )
|
||||||
|
|
||||||
|
logging.info("réorientation face de fissure FACE1")
|
||||||
|
grps = [ grp for grp in groups if grp.GetName() == 'FACE1']
|
||||||
|
_ = maillageComplet.Reorient2D( grps[0], normfiss, grps[0].GetID(1))
|
||||||
|
|
||||||
|
logging.info("réorientation face de fissure FACE2")
|
||||||
|
plansim = geompy.MakePlane(O, normfiss, 10000)
|
||||||
|
fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
|
||||||
|
grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
|
||||||
|
_ = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
|
||||||
|
_ = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
|
||||||
|
|
||||||
|
logging.info("export maillage fini")
|
||||||
|
fichierMaillageFissure = os.path.join (nomRep , '{}.med'.format(nomFicFissure))
|
||||||
|
maillageComplet.ExportMED(fichierMaillageFissure)
|
||||||
|
putName(maillageComplet, nomFicFissure)
|
||||||
|
logging.info("fichier maillage fissure %s", fichierMaillageFissure)
|
||||||
|
|
||||||
|
return maillageComplet
|
@ -682,8 +682,7 @@ class fissureCoude(fissureGenerique):
|
|||||||
shapesFissure, shapeFissureParams, \
|
shapesFissure, shapeFissureParams, \
|
||||||
maillageFissureParams, elementsDefaut, step, \
|
maillageFissureParams, elementsDefaut, step, \
|
||||||
mailleur="MeshGems"):
|
mailleur="MeshGems"):
|
||||||
maillageFissure = construitFissureGenerale(maillagesSains, \
|
maillageFissure = construitFissureGenerale(shapesFissure, shapeFissureParams, \
|
||||||
shapesFissure, shapeFissureParams, \
|
|
||||||
maillageFissureParams, elementsDefaut, \
|
maillageFissureParams, elementsDefaut, \
|
||||||
step, mailleur)
|
step, mailleur)
|
||||||
return maillageFissure
|
return maillageFissure
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from blocFissure import gmu
|
from blocFissure import gmu
|
||||||
from blocFissure.gmu.initEtude import initEtude
|
from .initEtude import initEtude
|
||||||
from blocFissure.gmu.getStatsMaillageFissure import getStatsMaillageFissure
|
from .getStatsMaillageFissure import getStatsMaillageFissure
|
||||||
|
|
||||||
class fissureGenerique(object):
|
class fissureGenerique(object):
|
||||||
"""classe générique problème fissure:
|
"""classe générique problème fissure:
|
||||||
@ -34,12 +34,17 @@ class fissureGenerique(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
nomProbleme = "fissureGenerique"
|
nomProbleme = "fissureGenerique"
|
||||||
|
geomParams = dict()
|
||||||
|
meshParams = dict()
|
||||||
|
shapeFissureParams = dict()
|
||||||
|
maillageFissureParams = dict()
|
||||||
|
|
||||||
def __init__(self, numeroCas):
|
def __init__(self, numeroCas):
|
||||||
initEtude()
|
initEtude()
|
||||||
self.numeroCas = numeroCas
|
self.numeroCas = numeroCas
|
||||||
self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
|
self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas)
|
||||||
self.fissureLongue = False
|
self.fissureLongue = False
|
||||||
|
self.referencesMaillageFissure = None
|
||||||
|
|
||||||
def setParamGeometrieSaine(self):
|
def setParamGeometrieSaine(self):
|
||||||
"""setParamGeometrieSaine"""
|
"""setParamGeometrieSaine"""
|
||||||
@ -109,33 +114,28 @@ class fissureGenerique(object):
|
|||||||
geometriesSaines = self.genereGeometrieSaine(self.geomParams)
|
geometriesSaines = self.genereGeometrieSaine(self.geomParams)
|
||||||
if step == 1:
|
if step == 1:
|
||||||
return
|
return
|
||||||
logging.info("AAAAAAAAAAAAAAAAAAAA")
|
|
||||||
|
|
||||||
self.setParamMaillageSain()
|
self.setParamMaillageSain()
|
||||||
maillagesSains = self.genereMaillageSain(geometriesSaines, self.meshParams)
|
maillagesSains = self.genereMaillageSain(geometriesSaines, self.meshParams)
|
||||||
if step == 2:
|
if step == 2:
|
||||||
return
|
return
|
||||||
logging.info("BBBBBBBBBBBBBBBBBBBBB")
|
|
||||||
|
|
||||||
self.setParamShapeFissure()
|
self.setParamShapeFissure()
|
||||||
mailleur = self.mailleur2d3d()
|
mailleur = self.mailleur2d3d()
|
||||||
shapesFissure = self.genereShapeFissure(geometriesSaines, self.geomParams, self.shapeFissureParams, mailleur)
|
shapesFissure = self.genereShapeFissure(geometriesSaines, self.geomParams, self.shapeFissureParams, mailleur)
|
||||||
if step == 3:
|
if step == 3:
|
||||||
return
|
return
|
||||||
logging.info("CCCCCCCCCCCCCCCCCCCCCCCC")
|
|
||||||
|
|
||||||
self.setParamMaillageFissure()
|
self.setParamMaillageFissure()
|
||||||
elementsDefaut = self.genereZoneDefaut(geometriesSaines, maillagesSains, \
|
elementsDefaut = self.genereZoneDefaut(geometriesSaines, maillagesSains, \
|
||||||
shapesFissure, self.shapeFissureParams, self.maillageFissureParams)
|
shapesFissure, self.shapeFissureParams, self.maillageFissureParams)
|
||||||
if step == 4:
|
if step == 4:
|
||||||
return
|
return
|
||||||
logging.info("DDDDDDDDDDDDDDDDDDDD")
|
|
||||||
|
|
||||||
maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
|
maillageFissure = self.genereMaillageFissure(geometriesSaines, maillagesSains, \
|
||||||
shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
|
shapesFissure, self.shapeFissureParams, self.maillageFissureParams, \
|
||||||
elementsDefaut, step, mailleur)
|
elementsDefaut, step, mailleur)
|
||||||
|
|
||||||
logging.info("EEEEEEEEEEEEEEEEEES")
|
|
||||||
self.setReferencesMaillageFissure()
|
self.setReferencesMaillageFissure()
|
||||||
ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
|
ok_maillage = getStatsMaillageFissure(maillageFissure, self.referencesMaillageFissure, self.maillageFissureParams)
|
||||||
return ok_maillage
|
return ok_maillage
|
||||||
|
@ -25,9 +25,8 @@ import SMESH
|
|||||||
|
|
||||||
|
|
||||||
def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissureParams):
|
def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissureParams):
|
||||||
"""
|
""""Statistiques maillage"""
|
||||||
TODO: a completer
|
|
||||||
"""
|
|
||||||
logging.debug('start')
|
logging.debug('start')
|
||||||
|
|
||||||
if 'nomRep' in maillageFissureParams:
|
if 'nomRep' in maillageFissureParams:
|
||||||
@ -75,17 +74,17 @@ def getStatsMaillageFissure(maillage, referencesMaillageFissure, maillageFissure
|
|||||||
fic_stat.write(text+"\n")
|
fic_stat.write(text+"\n")
|
||||||
text_2 += " {} = {}, \\\n".format(key,d_resu[key])
|
text_2 += " {} = {}, \\\n".format(key,d_resu[key])
|
||||||
|
|
||||||
|
|
||||||
if ok_maillage:
|
if ok_maillage:
|
||||||
print ("Calcul cohérent avec la référence.")
|
text = "Calcul cohérent avec la référence."
|
||||||
else:
|
else:
|
||||||
# Résultats de référence pour intégration dans le python du cas pour une mise à jour
|
|
||||||
with open(fichierNewRef, "w") as fic_info :
|
|
||||||
fic_info.write(text_2[:-4]+" \\")
|
|
||||||
text = "Calcul différent de la référence.\n"
|
text = "Calcul différent de la référence.\n"
|
||||||
text += "Voir le fichier {}\n".format(fichierStatMaillageFissure)
|
text += "Voir le fichier {}\n".format(fichierStatMaillageFissure)
|
||||||
text += "La nouvelle référence est disponible dans le fichier :\n{}\n".format(fichierNewRef)
|
text += "La nouvelle référence est disponible dans le fichier :\n{}\n".format(fichierNewRef)
|
||||||
text += "Il faut l'insérer pour créer le dictionnaire 'referencesMaillageFissure' dans le paramétrage du cas."
|
text += "Il faut l'insérer pour créer le dictionnaire 'referencesMaillageFissure' dans le paramétrage du cas."
|
||||||
print (text)
|
# Résultats de référence pour intégration dans le python du cas pour une mise à jour
|
||||||
|
with open(fichierNewRef, "w") as fic_info :
|
||||||
|
fic_info.write(text_2[:-4]+" \\")
|
||||||
|
|
||||||
|
print (text)
|
||||||
|
|
||||||
return ok_maillage
|
return ok_maillage
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#
|
#
|
||||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
#
|
#
|
||||||
|
"""procédure complète de construction d'une fissure longue"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -46,27 +47,22 @@ from .shapeSurFissure import shapeSurFissure
|
|||||||
from .regroupeSainEtDefaut import RegroupeSainEtDefaut
|
from .regroupeSainEtDefaut import RegroupeSainEtDefaut
|
||||||
from .triedreBase import triedreBase
|
from .triedreBase import triedreBase
|
||||||
|
|
||||||
from blocFissure.gmu.insereFissureLongue_a import insereFissureLongue_a
|
from .insereFissureLongue_a import insereFissureLongue_a
|
||||||
from blocFissure.gmu.insereFissureLongue_b import insereFissureLongue_b
|
from .insereFissureLongue_b import insereFissureLongue_b
|
||||||
from blocFissure.gmu.insereFissureLongue_c import insereFissureLongue_c
|
from .insereFissureLongue_c import insereFissureLongue_c
|
||||||
from blocFissure.gmu.insereFissureLongue_d import insereFissureLongue_d
|
from .insereFissureLongue_d import insereFissureLongue_d
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# --- procedure complete fissure longue
|
|
||||||
|
|
||||||
def insereFissureLongue(geometriesSaines, maillagesSains, \
|
def insereFissureLongue(geometriesSaines, \
|
||||||
shapesFissure, shapeFissureParams, \
|
shapesFissure, shapeFissureParams, \
|
||||||
maillageFissureParams, elementsDefaut, \
|
maillageFissureParams, elementsDefaut, \
|
||||||
step=-1, mailleur="MeshGems"):
|
step=-1, mailleur="MeshGems"):
|
||||||
"""
|
"""procedure complete fissure longue"""
|
||||||
TODO: a completer
|
|
||||||
"""
|
|
||||||
logging.info('start')
|
logging.info('start')
|
||||||
logging.info("Usage du mailleur %s", mailleur)
|
logging.info("Usage du mailleur %s", mailleur)
|
||||||
|
|
||||||
#geometrieSaine = geometriesSaines[0]
|
#geometrieSaine = geometriesSaines[0]
|
||||||
#maillageSain = maillagesSains[0]
|
|
||||||
#isHexa = maillagesSains[1]
|
|
||||||
shapeDefaut = shapesFissure[0] # face de fissure, debordant
|
shapeDefaut = shapesFissure[0] # face de fissure, debordant
|
||||||
#tailleDefaut = shapesFissure[2]
|
#tailleDefaut = shapesFissure[2]
|
||||||
wiretube = shapesFissure[4] # wire fond de fissure, debordant
|
wiretube = shapesFissure[4] # wire fond de fissure, debordant
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from blocFissure import gmu
|
from blocFissure import gmu
|
||||||
from blocFissure.gmu.initEtude import initEtude
|
from .initEtude import initEtude
|
||||||
initEtude()
|
initEtude()
|
||||||
from blocFissure.gmu.triedreBase import triedreBase
|
from .triedreBase import triedreBase
|
||||||
O, OX, OY, OZ = triedreBase()
|
O, OX, OY, OZ = triedreBase()
|
||||||
|
|
||||||
from blocFissure.gmu.distance2 import distance2
|
from .distance2 import distance2
|
||||||
a=[10, 20, 30]
|
a=[10, 20, 30]
|
||||||
b=[5, 7, 3]
|
b=[5, 7, 3]
|
||||||
c=distance2(a,b)
|
c=distance2(a,b)
|
||||||
|
Loading…
Reference in New Issue
Block a user