Correction du cas-test faceGauche2

Merge branch 'gni/evolution'
This commit is contained in:
Gérald NICOLAS 2021-04-07 16:12:37 +02:00
commit 35f01d3bc6
50 changed files with 755 additions and 770 deletions

View File

@ -29,6 +29,7 @@ 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
@ -48,7 +49,7 @@ class cubeAngle(fissureGenerique):
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CubeAngle.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -29,6 +29,7 @@ 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
@ -51,7 +52,7 @@ class cylindre(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -29,6 +29,7 @@ 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
@ -54,7 +55,7 @@ class ellipse_1(fissureGenerique):
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -29,6 +29,7 @@ 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
@ -48,7 +49,7 @@ class eprouvetteCourbe(fissureGenerique):
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteCourbe.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -22,6 +22,7 @@
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.putName import putName
import GEOM
import SALOMEDS
@ -53,7 +54,7 @@ class eprouvetteDroite(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "eprouvetteDroite.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -20,7 +20,9 @@
"""Lancement des cas-tests de blocFissure"""
import traceback
import logging
from blocFissure import gmu
from blocFissure.gmu import initLog
from blocFissure.gmu import geomsmesh
@ -33,7 +35,7 @@ from blocFissure.gmu.casStandard import casStandard
#initLog.setPerfTests()
# ---tous les cas en séquence, ou les cas sélectionnés ...
TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0] # OK
TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # OK
# 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
#RUNALL = False
RUNALL = True
@ -47,7 +49,7 @@ else:
print ("TORUN = {} # OK".format(TORUNOK))
print ("TORUN = {} # PB".format(TORUNPB))
# genereMateriel
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # aucun
TORUN = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # aucun
TORUN = [ 1, 1, 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] # cubeAngle
TORUN = [ 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cubeFin
TORUN = [ 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # decoupeCylindre
@ -56,11 +58,12 @@ else:
TORUN = [ 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, 0] # ellipse_probleme + fissureGauche2
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 + fissureGauche2
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, 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
TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0] # OK
TORUN = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0] # OK
# -----------------------------------------------------------------------------------------------
def caract_l_problemes ():
@ -142,29 +145,30 @@ def caract_l_problemes ():
n_cas = 13
# genereMateriel : fissureGauche
# genereMateriel : fissureGauche2
from blocFissure.CasTests.faceGauche import faceGauche
l_problemes.append(faceGauche(n_cas))
n_cas = 14
# genereMateriel : aucun
# genereMateriel : fissureGauche2
from blocFissure.CasTests.faceGauche_2 import faceGauche_2
l_problemes.append(faceGauche_2(n_cas))
#"boiteDefaut" has not been computed:
#- "algo3d_boiteDefaut" failed. Error: Algorithm failed. Presumably, the surface mesh is not compatible with the domain being processed (warning).
#th. 140348470327040 - Trace /home/D68518/salome-dev/DEV_package/modules/src/SMESH/src/SMESH/SMESH_subMesh.cxx [2051] : MG-Tetra failed on sub-shape #1 with error COMPERR_ALGO_FAI
#LED "Presumably, the surface mesh is not compatible with the domain being processed (warning).
#An edge is unique (i.e., bounds a hole in the surface).
#The surface mesh includes at least one hole. The domain is not well defined.
#See /tmp/GHS3D_18605_10269264.log for more information
#See /tmp/GHS3D_6406_1149841264.log for more information"
#5845 construitFissureGenerale_c[89] Erreur au calcul du maillage.
#meshBoiteDefaut.Compute
#Traceback (most recent call last):
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/execution_Cas.py", line 222, in <module>
#File "/local01/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/execution_Cas.py", line 278, in calcul_cas
#ok_maillage = cas.executeProbleme()
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/fissureGenerique.py", line 122, in executeProbleme
#self.maillageFissureParams, elementsDefaut, step)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/faceGauche_2.py", line 108, in genereMaillageFissure
#maillageFissureParams, elementsDefaut, step)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/construitFissureGenerale.py", line 330, in construitFissureGenerale
#raise Exception(text)
#Exception: Erreur au calcul du maillage.
#File "/local01/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/fissureGenerique.py", line 137, in executeProbleme
#elementsDefaut, step, mailleur)
#File "/local01/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/faceGauche_2.py", line 118, in genereMaillageFissure
#step, mailleur, self.numeroCas)
#File "/local01/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/construitFissureGenerale.py", line 227, in construitFissureGenerale
#mailleur, nro_cas )
#File "/local01/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/construitFissureGenerale_c.py", line 90, in construitFisureGenerale_c
n_cas = 15
# genereMateriel : aucun
@ -220,35 +224,11 @@ def caract_l_problemes ():
# genereMateriel : aucun
from blocFissure.CasTests.fissure_Coude import fissure_Coude
l_problemes.append(fissure_Coude(n_cas))
#"Mesh_366" has not been computed:
#- global 1D algorithm is missing
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/execution_Cas.py", line 274, in calcul_cas
#ok_maillage = cas.executeProbleme()
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/fissureGenerique.py", line 137, in executeProbleme
#elementsDefaut, step, mailleur)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/fissure_Coude.py", line 513, in genereMaillageFissure
#step, mailleur)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/insereFissureLongue.py", line 435, in insereFissureLongue
#mailleur )
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/insereFissureLongue_c.py", line 82, in insereFissureLongue_c
#raise Exception(text)
n_cas = 26
# genereMateriel : aucun
from blocFissure.CasTests.fissure_Coude_4 import fissure_Coude_4
l_problemes.append(fissure_Coude_4(n_cas))
#"Mesh_375" has not been computed:
#- global 1D algorithm is missing
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/execution_Cas.py", line 274, in calcul_cas
#ok_maillage = cas.executeProbleme()
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/fissureGenerique.py", line 137, in executeProbleme
#elementsDefaut, step, mailleur)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/CasTests/fissure_Coude.py", line 513, in genereMaillageFissure
#step, mailleur)
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/insereFissureLongue.py", line 435, in insereFissureLongue
#mailleur )
#File "/home/D68518/salome-dev/DEV_package/appli_DEV_package/lib/python3.6/site-packages/salome/blocFissure/gmu/insereFissureLongue_c.py", line 82, in insereFissureLongue_c
#raise Exception(text)
n_cas = 27
# genereMateriel : vis

View File

@ -22,6 +22,7 @@
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.putName import putName
import math
import GEOM
@ -52,7 +53,7 @@ class faceGauche(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "faceGaucheSain.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -22,6 +22,7 @@
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
from blocFissure.gmu.putName import putName
import GEOM
import SALOMEDS
@ -54,7 +55,7 @@ class faceGauche_2(fissureGenerique):
logging.info("genereMaillageSain %s", self.nomCas)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa

View File

@ -19,27 +19,25 @@
#
"""Fissure dans un coude"""
import logging
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy, smesh
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
#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
from blocFissure.gmu.insereFissureLongue import insereFissureLongue
from blocFissure.gmu.putName import putName
O, OX, OY, OZ = triedreBase()
@ -98,60 +96,61 @@ class fissure_Coude(fissureGenerique):
Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
Extrusion_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
Plane_1 = geompy.MakePlaneLCS(None, 100000, 3)
geompy.addToStudy( Plane_1, "Plane_1" )
geompy.addToStudy( Extrusion_1, "Extrusion_1" )
geompy.addToStudy( Revolution_1, "Revolution_1" )
geompy.addToStudy( Extrusion_2, "Extrusion_2" )
geomPublish(initLog.debug, Plane_1, "Plane_1" )
geomPublish(initLog.debug, Extrusion_1, "Extrusion_1" )
geomPublish(initLog.debug, Revolution_1, "Revolution_1" )
geomPublish(initLog.debug, Extrusion_2, "Extrusion_2" )
P1 = O
geompy.addToStudy( P1, "P1" )
geomPublish(initLog.always, P1, "P1", self.numeroCas )
op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
geompy.addToStudy( P2, "P2" )
geomPublish(initLog.always, P2, "P2", self.numeroCas )
# --- tube coude sain
geometrieSaine = geompy.MakePartition([Extrusion_1, Revolution_1, Extrusion_2, P1, P2], [Plane_1], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
geompy.addToStudy( geometrieSaine, self.nomCas )
geomPublish(initLog.always, geometrieSaine, self.nomCas, self.numeroCas )
[P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
[ep, circ_g, circ_d, long_p2, long_coude, long_p1] = geompy.Propagate(geometrieSaine)
geompy.addToStudyInFather( geometrieSaine, long_p1, 'long_p1' )
geompy.addToStudyInFather( geometrieSaine, ep, 'ep' )
geompy.addToStudyInFather( geometrieSaine, long_coude, 'long_coude' )
geompy.addToStudyInFather( geometrieSaine, circ_g, 'circ_g' )
geompy.addToStudyInFather( geometrieSaine, circ_d, 'circ_d' )
geompy.addToStudyInFather( geometrieSaine, long_p2, 'long_p2' )
geomPublishInFather(initLog.always, geometrieSaine, long_p1, 'long_p1' )
geomPublishInFather(initLog.always, geometrieSaine, ep, 'ep' )
geomPublishInFather(initLog.always, geometrieSaine, long_coude, 'long_coude' )
geomPublishInFather(initLog.always, geometrieSaine, circ_g, 'circ_g' )
geomPublishInFather(initLog.always, geometrieSaine, circ_d, 'circ_d' )
geomPublishInFather(initLog.always, geometrieSaine, long_p2, 'long_p2' )
# --- face extremite tube (EXTUBE)
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], OZ, GEOM.ST_ON)
EXTUBE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(EXTUBE, facesIds)
geompy.addToStudyInFather( geometrieSaine, EXTUBE, 'EXTUBE' )
geomPublishInFather(initLog.always, geometrieSaine, EXTUBE, 'EXTUBE' )
# --- edge bord extremite tube (BORDTU)
edge1Ids = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, GEOM.ST_ON)
edge2Ids = geompy.GetShapesOnCylinderIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, de/2., GEOM.ST_ON)
edgesIds = []
edgesIds = list()
for edge in edge1Ids:
if edge in edge2Ids:
edgesIds.append(edge)
BORDTU = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["EDGE"])
geompy.UnionIDs(BORDTU, edgesIds)
geompy.addToStudyInFather( geometrieSaine, BORDTU, 'BORDTU' )
geomPublishInFather(initLog.always, geometrieSaine, BORDTU, 'BORDTU' )
# --- face origine tube (CLGV)
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
vec2 = geompy.MakeVector(P2, pp2)
#geompy.addToStudy(vec2, 'vec2')
#geomPublish(initLog.debug,vec2, 'vec2')
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(CLGV, facesIds)
geompy.addToStudyInFather( geometrieSaine, CLGV, 'CLGV' )
geomPublishInFather(initLog.always, geometrieSaine, CLGV, 'CLGV' )
# --- peau tube interieur (PEAUINT)
@ -161,11 +160,11 @@ class fissure_Coude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
interne = geompy.MakeFuse(extru1, revol1)
interne = geompy.MakeFuse(extru2, interne)
geompy.addToStudy(interne, 'interne')
geomPublish(initLog.debug,interne, 'interne')
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUINT, facesIds)
geompy.addToStudyInFather( geometrieSaine, PEAUINT, 'PEAUINT' )
geomPublishInFather(initLog.always, geometrieSaine, PEAUINT, 'PEAUINT' )
# --- peau tube exterieur (PEAUEXT)
@ -177,18 +176,18 @@ class fissure_Coude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
geompy.addToStudy(externe, 'externe')
geomPublish(initLog.debug,externe, 'externe')
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUEXT, facesIds)
geompy.addToStudyInFather( geometrieSaine, PEAUEXT, 'PEAUEXT' )
geomPublishInFather(initLog.always, geometrieSaine, PEAUEXT, 'PEAUEXT' )
# --- solide sain
volIds = geompy.SubShapeAllIDs(geometrieSaine, geompy.ShapeType["SOLID"])
COUDE = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["SOLID"])
geompy.UnionIDs(COUDE, volIds)
geompy.addToStudyInFather( geometrieSaine, COUDE, 'COUDSAIN' )
geomPublishInFather(initLog.always, geometrieSaine, COUDE, 'COUDSAIN' )
geometriesSaines = [geometrieSaine, long_p1, ep, long_coude, circ_g, circ_d, long_p2, P1, P2, EXTUBE, BORDTU, CLGV, PEAUINT, PEAUEXT, COUDE]
@ -331,10 +330,12 @@ class fissure_Coude(fissureGenerique):
self.fissureLongue = bool(longueur > 2*profondeur)
if self.fissureLongue and (abs(orientation) < 45) :
if self.fissureLongue and (abs(orientation) < 45.) :
self.longitudinale = True
elif self.fissureLongue:
self.circonferentielle = True
#logging.info("longitudinale %s", self.longitudinale)
#logging.info("circonferentielle %s", self.circonferentielle)
if self.circonferentielle:
if externe:
@ -371,15 +372,15 @@ class fissure_Coude(fissureGenerique):
facetuber = geompy.MakeRotation(facetube0, OZ, -angle)
face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
plan0 = geompy.MakePlane(O, OZ, 10000)
geompy.addToStudy( face0, 'facefissOrig' )
geomPublish(initLog.debug, face0, 'facefissOrig' )
face1 = geompy.MakeRotation(face0, OZ, azimut*math.pi/180.)
face2 = geompy.MakeTranslation(face1, 0, 0, -l_tube_p1)
facefiss = geompy.MakeRotation(face2, axe, alpha*math.pi/180.)
geompy.addToStudy( facefiss, 'facefissPlace' )
geomPublish(initLog.always, facefiss, "facefissPlace", self.numeroCas )
centre = geompy.MakeRotation(pb, OZ, azimut*math.pi/180.)
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
geompy.addToStudy( centre, 'centrefissPlace' )
geomPublish(initLog.always, centre, "centrefissPlace", self.numeroCas )
arcr = geompy.MakeRotation(arcr, OZ, azimut*math.pi/180.)
arcr = geompy.MakeTranslation(arcr, 0, 0, -l_tube_p1)
arcr = geompy.MakeRotation(arcr, axe, alpha*math.pi/180.)
@ -392,24 +393,24 @@ class fissure_Coude(fissureGenerique):
wiretube = geompy.MakeRotation(wire0, OZ, azimut*math.pi/180.)
wiretube = geompy.MakeTranslation(wiretube, 0, 0, -l_tube_p1)
wiretube = geompy.MakeRotation(wiretube, axe, alpha*math.pi/180.)
geompy.addToStudy(wiretube, 'wiretubePlace' )
geomPublish(initLog.always,wiretube, "wiretubePlace", self.numeroCas )
facetubel = geompy.MakeRotation(facetubel, OZ, azimut*math.pi/180.)
facetubel = geompy.MakeTranslation(facetubel, 0, 0, -l_tube_p1)
facetubel = geompy.MakeRotation(facetubel, axe, alpha*math.pi/180.)
geompy.addToStudy(facetubel, 'facetubeGauche' )
geomPublish(initLog.debug,facetubel, 'facetubeGauche' )
facetuber = geompy.MakeRotation(facetuber, OZ, azimut*math.pi/180.)
facetuber = geompy.MakeTranslation(facetuber, 0, 0, -l_tube_p1)
facetuber = geompy.MakeRotation(facetuber, axe, alpha*math.pi/180.)
geompy.addToStudy(facetuber, 'facetubeDroit' )
geomPublish(initLog.debug,facetuber, 'facetubeDroit' )
planfiss = geompy.MakeRotation(plan0, OZ, azimut*math.pi/180.)
planfiss = geompy.MakeTranslation(planfiss, 0, 0, -l_tube_p1)
planfiss = geompy.MakeRotation(planfiss, axe, alpha*math.pi/180.)
geompy.addToStudy(planfiss, 'planfissPlace' )
geomPublish(initLog.always,planfiss, "planfissPlace", self.numeroCas )
pipefissl = geompy.MakePipe(facetubel, arcl)
pipefissi = geompy.MakePipe(facetubel, arci)
pipefissr = geompy.MakePipe(facetuber, arcr)
pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
geompy.addToStudy(pipefiss, 'pipefissPlace' )
geomPublish(initLog.always,pipefiss, "pipefissPlace", self.numeroCas )
elif self.longitudinale:
@ -438,43 +439,43 @@ class fissure_Coude(fissureGenerique):
arcr = geompy.MakeArc(pir, prr, per)
arci = geompy.MakeArc(pil, pi, pir)
arce = geompy.MakeArc(pel, pe, per)
geompy.addToStudy( arcl, 'arcl' )
geompy.addToStudy( arcr, 'arcr' )
geompy.addToStudy( arci, 'arci' )
geompy.addToStudy( arce, 'arce' )
geomPublish(initLog.debug, arcl, 'arcl' )
geomPublish(initLog.debug, arcr, 'arcr' )
geomPublish(initLog.debug, arci, 'arci' )
geomPublish(initLog.debug, arce, 'arce' )
wire0 = geompy.MakeWire([arcr, arci, arcl])
cercle0 = geompy.MakeCircle(O, OZ, profondeur/4.0)
#cercle0 = geompy.MakeRotation(cercle0, OZ, math.pi/2.0)
cercle0 = geompy.MakeTranslationTwoPoints(cercle0, O, pi)
geompy.addToStudy( cercle0, 'cercle0' )
geomPublish(initLog.debug, cercle0, 'cercle0' )
facetube0 = geompy.MakeFaceWires([cercle0], 1)
facetubel = geompy.MakeRotation(facetube0, OY, -angle)
facetuber = geompy.MakeRotation(facetube0, OY, angle)
geompy.addToStudy(facetubel , 'facetubel' )
geompy.addToStudy( facetuber, 'facetuber' )
geomPublish(initLog.debug,facetubel , 'facetubel' )
geomPublish(initLog.debug, facetuber, 'facetuber' )
face0 = geompy.MakeFaceWires([arcl,arci, arce, arcr], 1)
plan0 = geompy.MakePlane(O, OY, 10000)
geompy.addToStudy( face0, 'facefissOrig' )
geomPublish(initLog.debug, face0, 'facefissOrig' )
facefiss = geompy.MakeRotation(face0, OY, alpha*math.pi/180.)
geompy.addToStudy( facefiss, 'facefissPlace' )
geomPublish(initLog.always, facefiss, "facefissPlace", self.numeroCas )
centre = geompy.MakeRotation(pb, OY, alpha*math.pi/180.)
geompy.addToStudy( centre, 'centrefissPlace' )
geomPublish(initLog.always, centre, "centrefissPlace", self.numeroCas )
arcr = geompy.MakeRotation(arcr, OY, alpha*math.pi/180.)
arci = geompy.MakeRotation(arci, OY, alpha*math.pi/180.)
arcl = geompy.MakeRotation(arcl, OY, alpha*math.pi/180.)
wiretube = geompy.MakeRotation(wire0, OY, alpha*math.pi/180.)
geompy.addToStudy(wiretube, 'wiretubePlace' )
geomPublish(initLog.always,wiretube, "wiretubePlace", self.numeroCas )
facetubel = geompy.MakeRotation(facetubel, OY, alpha*math.pi/180.)
geompy.addToStudy(facetubel, 'facetubeGauche' )
geomPublish(initLog.debug,facetubel, 'facetubeGauche' )
facetuber = geompy.MakeRotation(facetuber, OY, alpha*math.pi/180.)
geompy.addToStudy(facetubel, 'facetubeDroit' )
geomPublish(initLog.debug,facetubel, 'facetubeDroit' )
planfiss = geompy.MakeRotation(plan0, OY, alpha*math.pi/180.)
geompy.addToStudy(planfiss, 'planfissPlace' )
geomPublish(initLog.always,planfiss, "planfissPlace", self.numeroCas )
pipefissl = geompy.MakePipe(facetubel, arcl)
pipefissi = geompy.MakePipe(facetubel, arci)
pipefissr = geompy.MakePipe(facetuber, arcr)
pipefiss = geompy.MakePartition([pipefissl, pipefissi, pipefissr], [planfiss, wiretube], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
geompy.addToStudy(pipefiss, 'pipefissPlace' )
geomPublish(initLog.always,pipefiss, "pipefissPlace", self.numeroCas )
else:
pass
@ -503,7 +504,7 @@ class fissure_Coude(fissureGenerique):
return elementsDefaut
# ---------------------------------------------------------------------------
def genereMaillageFissure(self, geometriesSaines, maillagesSains,
def genereMaillageFissure(self, geometriesSaines, maillagesSains, \
shapesFissure, shapeFissureParams, \
maillageFissureParams, elementsDefaut, step, \
mailleur="MeshGems"):

View File

@ -25,10 +25,13 @@ import logging
from blocFissure import gmu
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
@ -48,7 +51,7 @@ class tube(fissureGenerique):
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "Tube.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
@ -80,8 +83,8 @@ class tube(fissureGenerique):
l_aux.append(group)
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(fondFiss, l_aux )
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
geomPublish(initLog.always, shellFiss, "shellFiss", self.numeroCas)
geomPublishInFather(initLog.always, shellFiss, fondFiss, "fondFiss", self.numeroCas)
mailleur = self.mailleur2d3d()
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.025, 0.1, mailleur, self.numeroCas)

View File

@ -19,17 +19,21 @@
#
"""problème de fissure non plane, débouchante non normale"""
import logging
import os
from blocFissure import gmu
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
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
@ -51,7 +55,7 @@ class vis_1(fissureGenerique):
logging.info(texte)
([objetSain], _) = smesh.CreateMeshesFromMED(os.path.join(gmu.pathBloc, "materielCasTests", "visSain.med"))
smesh.SetName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme))
putName(objetSain.GetMesh(), "{}_objetSain".format(self.nomProbleme), i_pref=self.numeroCas)
return [objetSain, True] # True : maillage hexa
@ -81,8 +85,8 @@ class vis_1(fissureGenerique):
shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "visFiss.brep"))
fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, [6, 8, 3])
geompy.addToStudy( shellFiss, 'shellFiss' )
geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
geomPublish(initLog.always, shellFiss, "shellFiss", self.numeroCas)
geomPublishInFather(initLog.always, shellFiss, fondFiss, "fondFiss", self.numeroCas)
mailleur = self.mailleur2d3d()
coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 0.1 ,0.2, mailleur, self.numeroCas)

View File

@ -30,7 +30,7 @@ from .putName import putName
def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
centreFondFiss, wireFondFiss, wirePipeFiss,
lenSegPipe, rayonPipe, nbsegCercle, nbsegRad, \
nro_cas=-1):
nro_cas=None):
"""Préparation maillage du pipe :
- détections des points a respecter : jonction des edges/faces constituant
@ -63,6 +63,7 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
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)
@ -95,14 +96,12 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
origins = list()
normals = list()
for edu in usort:
ied = edu[1]
parametre = edu[2]
vertcx = ptGSdic[edu]
norm = geompy.MakeTangentOnCurve(edgesFondFiss[ied], parametre)
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
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
@ -135,8 +134,8 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
points = [vertcx] # les points du rayon de référence
dist_0 = rayonPipe/float(nbsegRad)
for j in range(nbsegRad):
point = geompy.MakeTranslationVectorDistance(vertcx, vec1, (j+1)*dist_0)
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)
@ -144,15 +143,15 @@ def calculePointsAxiauxPipe(edgesFondFiss, edgesIdByOrientation, facesDefaut,
raydisks[0].append(rayon)
angle_0 = 2.*math.pi/float(nbsegCercle)
for k in range(nbsegCercle-1):
angle = float(k+1)*angle_0
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 in range(nbsegRad):
point = geompy.MakeRotation(points[j+1], normal, angle)
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+1].append(ray)
raydisks[k_aux+1].append(ray)
gptsdisks.append(gptdsk)

View File

@ -47,6 +47,7 @@ from .construitMaillagePipe import construitMaillagePipe
from .mailleAretesEtJonction import mailleAretesEtJonction
from .mailleFacesFissure import mailleFacesFissure
from .mailleFacesPeau import mailleFacesPeau
from .putName import putName
from .construitFissureGenerale_a import construitFissureGenerale_a
from .construitFissureGenerale_b import construitFissureGenerale_b
@ -56,7 +57,7 @@ from .construitFissureGenerale_c import construitFissureGenerale_c
def construitFissureGenerale(shapesFissure, shapeFissureParams, \
maillageFissureParams, elementsDefaut, \
step=-1, mailleur="MeshGems", nro_cas=-1):
step=-1, 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°%d", mailleur, nro_cas)
@ -103,17 +104,19 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
# --- restriction de la face de fissure au domaine solide :
# partition face fissure étendue par fillings, on garde la face interne
facesPortFissure = restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne)
facesPortFissure = restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne, \
nro_cas)
# --- pipe de fond de fissure, prolongé, partition face fissure par pipe
# identification des edges communes pipe et face fissure
(fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss) = \
partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe)
partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe, \
nro_cas)
edgesFondFiss, edgesIdByOrientation = orderEdgesFromWire(wireFondFiss)
for i,edge in enumerate(edgesFondFiss):
geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss%d"%i)
for i_aux, edge in enumerate(edgesFondFiss):
geomPublishInFather(initLog.debug, wireFondFiss, edge, "edgeFondFiss{}".format(i_aux), nro_cas)
# --- peau et face de fissure
#
@ -137,12 +140,14 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
edgeRadFacePipePeau, facesPipePeau = \
construitFissureGenerale_b( partitionsPeauFissFond, \
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees )
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
nro_cas )
# --- identification des faces et edges de fissure externe pour maillage
(faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC) = \
identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss)
identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss, \
nro_cas)
# --- preparation maillage du pipe :
# - détections des points a respecter : jonction des edges/faces constituant la face de fissure externe au pipe
@ -180,7 +185,8 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
# --- maillage effectif du pipe
(meshPipe, meshPipeGroups, edgesCircPipeGroup) = \
construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad)
construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
nro_cas)
# --- edges de bord, faces défaut à respecter
@ -211,6 +217,7 @@ def construitFissureGenerale(shapesFissure, shapeFissureParams, \
listMeshes.append(mfpeau.GetMesh())
meshBoiteDefaut = smesh.Concatenate(listMeshes, 1, 1, 1e-05,False)
putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
# Maillage complet
maillageComplet = construitFissureGenerale_c( maillageSain, meshBoiteDefaut, \

View File

@ -29,7 +29,8 @@ from .identifieElementsGeometriquesPeau import identifieElementsGeometriquesPeau
def construitFissureGenerale_b( partitionsPeauFissFond, \
edgesPipeFiss, edgesFondFiss, wireFondFiss, aretesVivesC, \
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees ):
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
nro_cas=None ):
"""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
@ -41,25 +42,26 @@ pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
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]
ptEdgeFond = [ list() for _ in range(nbFacesFilling)] # pour chaque face [points edge fond de fissure aux débouchés du pipe]
fsPipePeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face [faces du pipe débouchantes]
edRadFPiPo = [ list() for _ in range(nbFacesFilling)] # pour chaque face [edge radiale des faces du pipe débouchantes ]
fsFissuExt = [ list() for _ in range(nbFacesFilling)] # pour chaque face [faces de fissure externes au pipe]
edFisExtPe = [ list() for _ in range(nbFacesFilling)] # pour chaque face [edge en peau des faces de fissure externes (pas subshape facePeau)]
edFisExtPi = [ list() for _ in range(nbFacesFilling)] # pour chaque face [edge commun au pipe des faces de fissure externes]
facesPeaux = [None for _ in range(nbFacesFilling)] # pour chaque face : la face de peau finale a mailler (percée des faces débouchantes)
edCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge circulaire aux débouchés du pipe]
ptCircPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape point sur edge circulaire aux débouchés du pipe]
gpedgeBord = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupe subshape des edges aux bords liés à la partie saine
gpedgeVifs = [None for _ in range(nbFacesFilling)] # pour chaque face de peau : groupes subshape des edges aux arêtes vives entre fillings
edFissPeau = [ list() for _ in range(nbFacesFilling)] # pour chaque face de peau : [subshape edge en peau des faces de fissure externes]
ptFisExtPi = [ list() for _ 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)
facesDefaut, centreFondFiss, rayonPipe, aretesVivesCoupees, \
nro_cas)
ptEdgeFond[ifil] = dataPPFF['endsEdgeFond']
fsPipePeau[ifil] = dataPPFF['facesPipePeau']
edRadFPiPo[ifil] = dataPPFF['edgeRadFacePipePeau']
@ -80,9 +82,9 @@ pour chaque face de peau : 0, 1 ou 2 faces débouchante du fond de fissure
facesPipePeau += fsPipePeau[ifil]
edgeRadFacePipePeau += edRadFPiPo[ifil]
for i, avc in enumerate(aretesVivesCoupees):
name = "areteViveCoupee%d"%i
geomPublish(initLog.debug, avc, name)
for i_aux, avc in enumerate(aretesVivesCoupees):
name = "areteViveCoupee{}".format(i_aux)
geomPublish(initLog.debug, avc, name, nro_cas)
return ptEdgeFond, fsFissuExt, edFisExtPe, edFisExtPi, facesPeaux, edCircPeau, \
ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, ptFisExtPi, \

View File

@ -43,7 +43,7 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges, \
facesPortFissure, \
maillageFissureParams, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""construction de la fissure générale - maillage"""
logging.info('start')
logging.info("Usage du mailleur %s pour le cas n°%d", mailleur, nro_cas)
@ -79,7 +79,6 @@ def construitFissureGenerale_c(maillageSain, meshBoiteDefaut, \
hypo3d.SetRemoveLogOnSuccess( 1 )
putName(algo3d.GetSubMesh(), "boiteDefaut", i_pref=nro_cas)
putName(algo3d, "algo3d_boiteDefaut", i_pref=nro_cas)
putName(meshBoiteDefaut, "boiteDefaut", i_pref=nro_cas)
is_done = meshBoiteDefaut.Compute()
text = "meshBoiteDefaut.Compute"

View File

@ -24,16 +24,20 @@ import logging
import SMESH
from .geomsmesh import smesh
from .putName import putName
from .construitMaillagePipe_a import construitMaillagePipe_a
from .construitMaillagePipe_b import construitMaillagePipe_b
from .construitMaillagePipe_c import construitMaillagePipe_c
from .construitMaillagePipe_d import construitMaillagePipe_d
def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad):
def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
nro_cas=None):
"""maillage effectif du pipe"""
logging.info('start')
meshPipe = smesh.Mesh(None, "meshPipe")
putName(meshPipe, "meshPipe", i_pref=nro_cas)
fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis")
faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi")

View File

@ -33,10 +33,11 @@ from .quadranglesToShapeNoCorner import quadranglesToShapeNoCorner
from .creeZoneDefautFilling import creeZoneDefautFilling
from .creeZoneDefautGeom import creeZoneDefautGeom
from .getCentreFondFiss import getCentreFondFiss
from .putName import putName
def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, \
shapeFissureParams, maillageFissureParams, \
nro_cas=-1):
nro_cas=None):
"""
#TODO: a compléter
"""
@ -89,6 +90,7 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure,
isPlane = False
if isHexa and not isPlane:
meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0)
putName(meshQuad, "meshQuad", i_pref=nro_cas)
fillings, _, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss)

View File

@ -93,22 +93,22 @@ class fissureCoude(fissureGenerique):
Rotation_2 = geompy.MakeRotation(OZ, OY, angleCoude*math.pi/180.0)
tube_2 = geompy.MakePrismVecH(Rotation_1, Rotation_2, -l_tube_p2)
plan_y = geompy.MakePlaneLCS(None, 100000, 3)
geomPublish(initLog.debug, plan_y, "plan_y" )
geomPublish(initLog.debug, tube_1, "tube_1" )
geomPublish(initLog.debug, coude, "coude" )
geomPublish(initLog.debug, tube_2, "tube_2" )
geomPublish(initLog.debug, plan_y, "plan_y", self.numeroCas )
geomPublish(initLog.debug, tube_1, "tube_1", self.numeroCas )
geomPublish(initLog.debug, coude, "coude", self.numeroCas )
geomPublish(initLog.debug, tube_2, "tube_2", self.numeroCas )
P1 = O
geompy.addToStudy(P1, "P1" )
geomPublish(initLog.always, P1, "P1", self.numeroCas )
op2 = geompy.MakeVertex(0, 0, -l_tube_p1)
P2 = geompy.MakeRotation(op2, axe, angleCoude*math.pi/180.0)
P2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, -l_tube_p2)
geompy.addToStudy(P2, "P2" )
geomPublish(initLog.always, P2, "P2", self.numeroCas )
# --- tube coude sain
geometrieSaine = geompy.MakePartition([tube_1, coude, tube_2, P1, P2], [plan_y], [], [], geompy.ShapeType["SOLID"], 0, [], 1)
geomPublish(initLog.debug, geometrieSaine, self.nomCas )
geomPublish(initLog.debug, geometrieSaine, self.nomCas, self.numeroCas )
[P1, P2] = geompy.RestoreGivenSubShapes(geometrieSaine, [P1, P2], GEOM.FSM_GetInPlaceByHistory, False, True)
xmin = -de -r_cintr -l_tube_p2
@ -148,7 +148,7 @@ class fissureCoude(fissureGenerique):
grped = geompy.CutGroups(grped, long_p2)
ep = geompy.CutGroups(grped, long_coude)
geomPublishInFather(initLog.debug, geometrieSaine, long_p1, 'long_p1' )
geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep' )
geomPublishInFather(initLog.debug, geometrieSaine, ep, 'ep')
geomPublishInFather(initLog.debug, geometrieSaine, long_coude, 'long_coude' )
geomPublishInFather(initLog.debug, geometrieSaine, circ_g, 'circ_g' )
geomPublishInFather(initLog.debug, geometrieSaine, circ_d, 'circ_d' )
@ -165,7 +165,7 @@ class fissureCoude(fissureGenerique):
edge1Ids = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, GEOM.ST_ON)
edge2Ids = geompy.GetShapesOnCylinderIDs(geometrieSaine, geompy.ShapeType["EDGE"], OZ, de/2. -epais, GEOM.ST_ON)
edgesIds = []
edgesIds = list()
for edge in edge1Ids:
if edge in edge2Ids:
edgesIds.append(edge)
@ -177,7 +177,7 @@ class fissureCoude(fissureGenerique):
pp2 = geompy.MakeTranslationVectorDistance(P2, Rotation_2, 10)
vec2 = geompy.MakeVector(P2, pp2)
#geomPublish(initLog.debug, vec2, 'vec2')
#geomPublish(initLog.debug, vec2, 'vec2', self.numeroCas)
facesIds = geompy.GetShapesOnPlaneIDs(geometrieSaine, geompy.ShapeType["FACE"], vec2, GEOM.ST_ON)
CLGV = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(CLGV, facesIds)
@ -191,7 +191,7 @@ class fissureCoude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
interne = geompy.MakeFuse(extru1, revol1)
interne = geompy.MakeFuse(extru2, interne)
geomPublish(initLog.debug, interne, 'interne')
geomPublish(initLog.debug, interne, 'interne', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(interne, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ONIN)
PEAUINT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUINT, facesIds)
@ -206,7 +206,7 @@ class fissureCoude(fissureGenerique):
extru2 = geompy.MakePrismVecH(rot1, Rotation_2, -l_tube_p2)
externe = geompy.MakeFuse(extru1, revol1)
externe = geompy.MakeFuse(extru2, externe)
geomPublish(initLog.debug, externe, 'externe')
geomPublish(initLog.debug, externe, 'externe', self.numeroCas)
facesIds = geompy.GetShapesOnShapeIDs(externe, geometrieSaine, geompy.ShapeType["FACE"], GEOM.ST_ON)
PEAUEXT = geompy.CreateGroup(geometrieSaine, geompy.ShapeType["FACE"])
geompy.UnionIDs(PEAUEXT, facesIds)
@ -368,7 +368,7 @@ class fissureCoude(fissureGenerique):
azimut = -azimut # axe inverse / ASCOUF
axe = geompy.MakeTranslation(OY, -r_cintr, 0, -l_tube_p1)
geomPublish(initLog.debug, axe,"axe")
geomPublish(initLog.debug, axe,"axe", self.numeroCas)
if not lgInfluence:
lgInfluence = profondeur
@ -403,39 +403,39 @@ class fissureCoude(fissureGenerique):
pi = geompy.MakeVertex(rayint, 0, 0)
pbl = geompy.MakeRotation(pb, OZ, angle)
pbr = geompy.MakeRotation(pb, OZ, -angle)
geomPublish(initLog.debug, pbl,"pbl")
geomPublish(initLog.debug, pbr,"pbr")
geomPublish(initLog.debug, pbl,"pbl", self.numeroCas)
geomPublish(initLog.debug, pbr,"pbr", self.numeroCas)
pal = geompy.MakeTranslationVector(pbl, OZ)
par = geompy.MakeTranslationVector(pbr, OZ)
axl = geompy.MakeVector(pbl,pal)
axr = geompy.MakeVector(pbr,par)
pil = geompy.MakeRotation(pi, OZ, angle)
pir = geompy.MakeRotation(pi, OZ, -angle)
points = []
points = list()
nbp = 3*nbp1
for i in range(nbp):
angi = dp*(nbp -i)*(2.0*math.pi/3.0)/nbp
for i_aux in range(nbp):
angi = dp*(nbp - i_aux)*(2.0*math.pi/3.0)/nbp
pt = geompy.MakeRotation(pil, axl, angi)
points.append(pt)
for i in range(nbp):
angi = angle -2.0*i*angle/nbp
for i_aux in range(nbp):
angi = angle -2.0*float(i_aux)*angle/nbp
pt = geompy.MakeRotation(pi, OZ, angi)
points.append(pt)
for i in range(nbp+1):
angi = -dp*i*(2.0*math.pi/3.0)/nbp
for i_aux in range(nbp+1):
angi = -dp*float(i_aux)*(2.0*math.pi/3.0)/nbp
pt = geompy.MakeRotation(pir, axr, angi)
points.append(pt)
for i, pt in enumerate(points):
for i_aux, pt in enumerate(points):
pt = geompy.MakeRotation(pt, OZ, azimut*math.pi/180.)
pt = geompy.MakeTranslation(pt, 0, 0, -l_tube_p1)
pt = geompy.MakeRotation(pt, axe, alpha*math.pi/180.)
points[i] = pt
points[i_aux] = pt
wire0 = geompy.MakeInterpol(points[0:nbp+1])
wire1 = geompy.MakeInterpol(points[nbp:2*nbp+1])
wire2 = geompy.MakeInterpol(points[2*nbp:3*nbp+1])
#wiretube = geompy.MakeInterpol(points)
wiretube=geompy.MakeWire([wire0,wire1,wire2])
geomPublish(initLog.debug, wiretube,"wiretube")
geomPublish(initLog.debug, wiretube,"wiretube", self.numeroCas)
pe = geompy.MakeVertex(rayext, 0, 0)
pe = geompy.MakeRotation(pe, OZ, azimut*math.pi/180.)
@ -443,22 +443,22 @@ class fissureCoude(fissureGenerique):
pe = geompy.MakeRotation(pe, axe, alpha*math.pi/180.)
arce = geompy.MakeArc(points[0], pe, points[-1])
geomPublish(initLog.debug, arce,"arce")
geomPublish(initLog.debug, arce,"arce", self.numeroCas)
facefiss = geompy.MakeFaceWires([arce, wiretube], 1)
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
geomPublish(initLog.debug, facefiss, 'facefissPlace', self.numeroCas )
pc = geompy.MakeVertex((raybor + rayint)/2.0, 0, 0)
centre = geompy.MakeRotation(pc, OZ, azimut*math.pi/180.)
centre = geompy.MakeTranslation(centre, 0, 0, -l_tube_p1)
centre = geompy.MakeRotation(centre, axe, alpha*math.pi/180.)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
geomPublish(initLog.debug, centre, 'centrefissPlace', self.numeroCas )
wiretube = geompy.GetInPlace(facefiss, wiretube)
geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
geomPublish(initLog.debug, wiretube, 'wiretubePlace', self.numeroCas )
try:
edgetube = geompy.MakeEdgeWire(wiretube)
geomPublish(initLog.debug, edgetube,"edgetube")
geomPublish(initLog.debug, edgetube,"edgetube", self.numeroCas)
except:
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgetube = None
@ -491,109 +491,109 @@ class fissureCoude(fissureGenerique):
pil = geompy.MakeRotation(pi, axe, alfrd -angle, "pil")
pir = geompy.MakeRotation(pi, axe, alfrd +angle, "pir")
curves = []
curves = list()
points = []
points = list()
nbp = 3*nbp1
xs = []
xs = list()
totx = 0
for i in range(nbp+2):
x = math.sin(i*math.pi/(nbp+1)) # fonction de répartition des points : distance relative
for i_aux in range(nbp+2):
x = math.sin(float(i_aux)*math.pi/(nbp+1)) # fonction de répartition des points : distance relative
x2 = x*x
totx += x2
xs.append(totx)
logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp+1):
#posi = nbp -i # répartition équidistante des points sur la courbe
posi = nbp*(1 -xs[i]/totx) # points plus resserrés aux extrémités de la courbe
for i_aux in range(nbp+1):
#posi = nbp - i_aux # répartition équidistante des points sur la courbe
posi = nbp*(1 -xs[i_aux]/totx) # points plus resserrés aux extrémités de la courbe
angi = -dp*posi*(5.0*math.pi/8.0)/nbp
pt = geompy.MakeRotation(pil, axl, angi)
points.append(pt)
curves.append(geompy.MakeInterpol(points))
point0 = points[0]
geomPublish(initLog.debug, curves[-1],"curve0")
# for i, pt in enumerate(points):
# name = "point%d"%i
geomPublish(initLog.debug, curves[-1],"curve0", self.numeroCas)
# for i_aux, pt in enumerate(points):
# name = "point%d"%i_aux
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
points = []
points = list()
nbp = 3*nbp1
xs =[]
xs = list()
totx = 0
for i in range(nbp+1):
x = math.sin(i*math.pi/nbp)
for i_aux in range(nbp+1):
x = math.sin(float(i_aux)*math.pi/nbp)
#x = 1.0 # répartition équidistante des points sur la courbe
x2 = x*x # points plus resserrés aux extrémités de la courbe
totx += x2
xs.append(totx)
logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp):
angi = alfrd -angle +2.0*angle*xs[i]/totx
for i_aux in range(nbp):
angi = alfrd -angle +2.0*angle*xs[i_aux]/totx
pt = geompy.MakeRotation(pi, axe, angi)
points.append(pt)
curves.append(geompy.MakeInterpol(points))
geomPublish(initLog.debug, curves[-1],"curve1")
# for i, pt in enumerate(points):
# name = "point%d"%i
geomPublish(initLog.debug, curves[-1],"curve1", self.numeroCas)
# for i_aux, pt in enumerate(points):
# name = "point%d"%i_aux
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
points = []
points = list()
nbp = 3*nbp1
xs = []
xs = list()
totx = 0
for i in range(nbp+2):
x = math.sin(i*math.pi/(nbp+1))
for i_aux in range(nbp+2):
x = math.sin(float(i_aux)*math.pi/(nbp+1))
x2 = x*x
totx += x2
xs.append(totx)
logging.debug("x2: %s, totx: %s", x2, totx)
for i in range(nbp+1):
#posi = nbp -i # répartition équidistante des points sur la courbe
posi = nbp*xs[i]/totx # points plus resserrés aux extrémités de la courbe
for i_aux in range(nbp+1):
#posi = nbp - i_aux # répartition équidistante des points sur la courbe
posi = nbp*xs[i_aux]/totx # points plus resserrés aux extrémités de la courbe
angi = dp*posi*(5.0*math.pi/8.0)/nbp
pt = geompy.MakeRotation(pir, axr, angi)
points.append(pt)
curves.append(geompy.MakeInterpol(points))
point1 = points[-1]
geomPublish(initLog.debug, curves[-1],"curve2")
# for i, pt in enumerate(points):
# name = "point%d"%i
geomPublish(initLog.debug, curves[-1],"curve2", self.numeroCas)
# for i_aux, pt in enumerate(points):
# name = "point%d"%i_aux
# geomPublishInFather(initLog.debug,curves[-1], pt, name)
wiretube = geompy.MakeWire(curves)
geomPublish(initLog.debug, wiretube,"wiretube")
geomPublish(initLog.debug, wiretube,"wiretube", self.numeroCas)
try:
edgetube = geompy.MakeEdgeWire(wiretube)
geomPublish(initLog.debug, edgetube,"edgetube")
geomPublish(initLog.debug, edgetube,"edgetube", self.numeroCas)
except:
logging.debug("erreur MakeEdgeWire sur fond de fissure, on fait sans")
edgetube = None
pts = []
pts = list()
pts.append(point0)
dpr = prof*math.cos(5.0*math.pi/8.0)
pe = geompy.MakeTranslation(pb, dpr*cosaz, dpr*sinaz, 0., "pe")
for i in range(nbp):
angi = alfrd -angle +2.0*i*angle/nbp
for i_aux in range(nbp):
angi = alfrd -angle +2.0*float(i_aux)*angle/nbp
pt = geompy.MakeRotation(pe, axe, angi)
pts.append(pt)
pts.append(point1)
arce = geompy.MakeInterpol(pts)
geomPublish(initLog.debug, arce,"arce")
geomPublish(initLog.debug, arce,"arce", self.numeroCas)
facefiss = geompy.MakeFaceWires([arce, wiretube], 0)
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
geomPublish(initLog.debug, facefiss, 'facefissPlace', self.numeroCas)
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
geomPublish(initLog.debug, centre, 'centrefissPlace', self.numeroCas)
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
edgesTriees, _, _ = sortEdges(edges)
edges = edgesTriees[:-1] # la plus grande correspond à arce, on l'elimine
wiretube = geompy.MakeWire(edges)
#wiretube = edgesTriees[-1]
geomPublish(initLog.debug, wiretube, 'wiretubePlace' )
geomPublish(initLog.debug, wiretube, 'wiretubePlace', self.numeroCas)
# ---------------------------------------------------------
@ -638,7 +638,7 @@ class fissureCoude(fissureGenerique):
arci = geompy.MakePosition(arco, originLCS, localLCS, "arci")
arce = geompy.MakePosition(lino, originLCS, localLCS, "arce")
facefiss = geompy.MakeFaceWires([arce, arci], 0)
geomPublish(initLog.debug, facefiss, 'facefissPlace' )
geomPublish(initLog.debug, facefiss, 'facefissPlace', self.numeroCas )
edges = geompy.ExtractShapes(facefiss, geompy.ShapeType["EDGE"], True)
edgesTriees, _, _ = sortEdges(edges)
edgetube = edgesTriees[-1] # la plus grande correspond à arci
@ -646,7 +646,7 @@ class fissureCoude(fissureGenerique):
pc = geompy.MakeTranslation(pb, 0.5*prof*cosaz, 0.5*prof*sinaz, 0.)
centre = geompy.MakeRotation(pc, axe, alfrd)
geomPublish(initLog.debug, centre, 'centrefissPlace' )
geomPublish(initLog.debug, centre, 'centrefissPlace', self.numeroCas )
coordsNoeudsFissure = genereMeshCalculZoneDefaut(facefiss, profondeur/2. ,profondeur, \
mailleur, self.numeroCas)

View File

@ -2,7 +2,7 @@
# 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
# modify it under the terms of th79e 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.
#
@ -37,7 +37,7 @@ from .putName import putName
def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible, \
zoneDefaut_skin, shapeDefaut, listOfCorners, \
nro_cas=-1):
nro_cas=None):
"""Groupe de quadrangles de face transformé en face géométrique par filling"""
logging.info("start")
@ -76,7 +76,7 @@ def fusionMaillageDefaut(maillageSain, maillageDefautCible, maillageInterneCible
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
logging.debug("face de filling non coupee")
geompy.addToStudy( filling, "faceNonCoupee_{0}".format(i_aux+1)) # doit etre publie pour critere OK plus bas
geompy.addToStudy( filling, "faceNonCoupee_{0}".format(i_aux+1)) # doit etre publié pour critère OK plus bas
facesNonCoupees.append(filling)
maillagesNonCoupes.append(listOfNewMeshes[i_aux])
else:

View File

@ -24,7 +24,6 @@ from . import initLog
from .geomsmesh import geompy
from .geomsmesh import geomPublish
from .geomsmesh import geomPublishInFather
from .toreFissure import toreFissure
from .ellipsoideDefaut import ellipsoideDefaut
@ -32,7 +31,7 @@ from .rotTrans import rotTrans
from .genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
def genereElemsFissureElliptique(shapeFissureParams, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""Création élements géométriques fissure elliptique"""
logging.info('start')

View File

@ -28,7 +28,7 @@ from .geomsmesh import smesh
from .putName import putName
def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""Maillage de l'objet géométrique 'facefiss'
. Avec l'algorithme MG_CADSurf :

View File

@ -30,12 +30,43 @@ smesh = smeshBuilder.New()
from . import initLog
def geomPublish(level,aShape, aName):
"""Publication d'un objet"""
def geomPublish(level,aShape, aName, i_pref=None):
"""Publication d'un objet sous GEOM
@level niveau d'impression voulu
@aShape objet à nommer
@aName le nom brut
@i_pref un éventuel préfixe
"""
#print ("initLog.getLogLevel() = {}".format(initLog.getLogLevel()))
#print ("level = {}".format(level))
if initLog.getLogLevel() <= level:
# préfixe éventuel :
if ( i_pref is not None):
if isinstance(i_pref,int):
prefixe = "Cas{:02d}_".format(i_pref)
else:
prefixe = "{}_".format(i_pref)
aName = prefixe + aName
geompy.addToStudy(aShape, aName)
def geomPublishInFather(level, aFather, aShape, aName):
"""Publication d'un objet sous son ascendant"""
def geomPublishInFather(level, aFather, aShape, aName, i_pref=None):
"""Publication d'un objet sous son ascendant sous GEOM
@level niveau d'impression voulu
@aFather objet ascendant
@aShape objet à nommer
@aName le nom brut
@i_pref un éventuel préfixe
"""
if initLog.getLogLevel() <= level:
# préfixe éventuel :
if ( i_pref is not None):
if isinstance(i_pref,int):
prefixe = "Cas{:02d}_".format(i_pref)
else:
prefixe = "{}_".format(i_pref)
aName = prefixe + aName
geompy.addToStudyInFather(aFather, aShape, aName)

View File

@ -30,7 +30,8 @@ from .identifieEdgesPeau import identifieEdgesPeau
def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss, \
edgesFondFiss, wireFondFiss, aretesVivesC, \
facesDefaut, centreFondFiss, rayonPipe, \
aretesVivesCoupees):
aretesVivesCoupees, \
nro_cas=None):
"""Identification des éléments géométriques de la face de peau"""
logging.info('start')
fillingFaceExterne = facesDefaut[ifil]
@ -63,7 +64,8 @@ def identifieElementsGeometriquesPeau(ifil, partitionPeauFissFond, edgesPipeFiss
(facePeau, facesPeauSorted, edgesPeauFondIn) = identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, \
verticesEdgesFondIn, pipexts, cercles, \
fillingFaceExterne, centreFondFiss)
fillingFaceExterne, centreFondFiss, \
nro_cas)
# --- identification précise des edges et disques des faces de peau selon index extremité fissure

View File

@ -27,7 +27,8 @@ from .geomsmesh import geompy
from .geomsmesh import geomPublish
from .geomsmesh import geomPublishInFather
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss, \
nro_cas=None):
"""Identification des faces et edges de fissure externe pour maillage"""
logging.info('start')
@ -75,9 +76,10 @@ def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesP
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
geomPublish(initLog.always, faceFissureExterne, "faceFissureExterne", nro_cas)
geomPublishInFather(initLog.always, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne", nro_cas)
geomPublishInFather(initLog.always, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne", nro_cas)
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)

View File

@ -29,9 +29,10 @@ from .geomsmesh import geomPublish
from .sortFaces import sortFaces
from .extractionOrientee import extractionOrientee
def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
verticesEdgesFondIn, pipexts, cercles,
fillingFaceExterne, centreFondFiss):
def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss, \
verticesEdgesFondIn, pipexts, cercles, \
fillingFaceExterne, centreFondFiss, \
nro_cas=None):
"""Inventaire des faces de peau : face de peau percée du pipe, extrémités du pipe
La partition avec le pipe peut créer un vertex (et un edge) de trop sur le cercle projeté,
@ -77,7 +78,7 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
outilPart[j_aux] = geompy.MakeProjection(cercles[j_aux],facesOnside[0])
partitionPeauByPipe = geompy.MakePartition(facesAndFond, outilPart, [], [], geompy.ShapeType["FACE"], 0, [], 1)
name="partitionPeauByPipe{}".format(ifil)
name="partitionPeauByPipe_{}".format(ifil)
geomPublish(initLog.debug, partitionPeauByPipe, name)
[edgesPeauFondIn, _, _] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "EDGE", 1.e-3)
[_, _, facesPeauFondOn] = extractionOrientee(fillingFaceExterne, partitionPeauByPipe, centreFondFiss, "FACE", 1.e-3)
@ -89,7 +90,7 @@ def identifieFacesPeau(ifil, verticesPipePeau, facesOnside, wireFondFiss,
facePeau =geompy.MakePartition(facesPeauFondOn, [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
facesPeauSorted = [facePeau]
name="facePeau{}".format(ifil)
geomPublish(initLog.debug, facePeau, name)
name="facePeau_{}".format(ifil)
geomPublish(initLog.always, facePeau, name, nro_cas)
return (facePeau, facesPeauSorted, edgesPeauFondIn)

View File

@ -21,16 +21,22 @@
import logging
import os
import tempfile
debug = 10
info = 20
warning = 30
error = 40
critical = 50
always = 100
filelog = os.path.join(tempfile.gettempdir(),"blocFissure.log")
loglevel = warning
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s',
level=logging.WARNING)
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', \
level=logging.WARNING, \
filename=filelog)
ch = None
fh = None

View File

@ -42,7 +42,7 @@ from .insereFissureLongue_g import insereFissureLongue_g
def insereFissureLongue(geometriesSaines, \
shapesFissure, shapeFissureParams, \
maillageFissureParams, elementsDefaut, \
step=-1, mailleur="MeshGems", nro_cas=-1):
step=-1, mailleur="MeshGems", nro_cas=None):
"""procedure complete fissure longue"""
logging.info('start')
logging.info("Usage du mailleur %s pour le cas n°%d", mailleur, nro_cas)
@ -103,7 +103,7 @@ def insereFissureLongue(geometriesSaines, \
insereFissureLongue_a (facePorteFissure, WirePorteFondFissure, \
fillingFaceExterne, \
pipefiss, rayonPipe, \
mailleur )
mailleur, nro_cas )
# -----------------------------------------------------------------------------
# --- pipe de fond de fissure
pipeFondFiss, disques, rayons, \
@ -156,7 +156,6 @@ def insereFissureLongue(geometriesSaines, \
zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces, \
nro_cas)
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -40,7 +40,7 @@ from .substractSubShapes import substractSubShapes
def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
fillingFaceExterne, \
pipefiss, rayonPipe, \
mailleur="MeshGems"):
mailleur="MeshGems", nro_cas=None):
"""procedure complete fissure longue"""
logging.info('start')
logging.info("Usage du mailleur %s", mailleur)
@ -51,7 +51,7 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
# --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond' )
geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond', nro_cas )
edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
@ -64,49 +64,49 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
lgmax = longueur
imax = i_aux
edgemax = edges[imax]
geomPublish(initLog.debug, edgemax, 'edgemax')
geomPublish(initLog.debug, edgemax, 'edgemax', nro_cas)
centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss')
geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss', nro_cas)
tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss')
geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss', nro_cas)
bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss')
geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss', nro_cas)
tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss')
geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss', nro_cas)
bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss')
geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss', nro_cas)
tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss')
geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss', nro_cas)
planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
geomPublish(initLog.debug, planBord1, 'planBord1')
geomPublish(initLog.debug, planBord2, 'planBord2')
geomPublish(initLog.debug, planBord1, 'planBord1', nro_cas)
geomPublish(initLog.debug, planBord2, 'planBord2', nro_cas)
[edgesInside, _, _] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
[facesInside, _, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
# --- partition peau -face fissure - pipe fond de fissure prolongé
partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
geomPublish(initLog.debug, partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
geomPublish(initLog.always, partitionPeauFissByPipe, 'partitionPeauFissByPipe', nro_cas )
# --- identification face de peau
[facesPeauFissInside, _, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
facesPeauSorted, _, _ = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
facePeau = facesPeauSorted[-1] # la plus grande face
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau")
geomPublishInFather(initLog.always, partitionPeauFissByPipe, facePeau, "facePeau", nro_cas)
# --- identification edges de bord face peau
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
edgesBords = list()
for i, edge in enumerate(edgesFilling):
for edge in edgesFilling:
edgepeau = geompy.GetInPlace(facePeau, edge)
edgesBords.append(edgepeau)
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesBords)
geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords")
geomPublishInFather(initLog.always, facePeau, groupEdgesBordPeau , "EdgesBords", nro_cas)
# --- identification face fissure externe au pipe et edge commune peau fissure
for face in facesPeauFissInside:
@ -115,9 +115,9 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
if sharedEdges is not None:
faceFiss = face
edgePeauFiss = sharedEdges[0]
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss")
geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss")
geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss")
geomPublishInFather(initLog.always, partitionPeauFissByPipe, faceFiss, "faceFiss", nro_cas)
geomPublishInFather(initLog.always, faceFiss, edgePeauFiss, "edgePeauFiss", nro_cas)
geomPublishInFather(initLog.always, facePeau, edgePeauFiss, "edgePeauFiss", nro_cas)
break
except:
pass
@ -130,16 +130,16 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
verticesDemiCerclesPeau = list()
for i_aux, edge in enumerate(demiCerclesPeau):
name = "demiCerclePeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, edge, name)
geomPublishInFather(initLog.debug,facePeau, edge, name, nro_cas)
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
for i_aux, vertex in enumerate(verticesDemiCerclesPeau):
name = "verticesDemiCerclesPeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
geomPublishInFather(initLog.debug,facePeau, vertex, name, nro_cas)
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
for i_aux, vertex in enumerate(verticesOutCercles):
name = "verticesOutCercles_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
geomPublishInFather(initLog.debug,facePeau, vertex, name, nro_cas)
# --- demi cercles regroupés
groupsDemiCerclesPeau = list()
@ -151,7 +151,7 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(group, demis)
name = "Cercle{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, group , name)
geomPublishInFather(initLog.always,facePeau, group , name, nro_cas)
groupsDemiCerclesPeau.append(group)
# --- identification edges commune pipe face fissure externe au pipe
@ -162,10 +162,10 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
edgesFaceFissPipe.append(edge)
name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
geomPublishInFather(initLog.debug,faceFiss, edge, name)
geomPublishInFather(initLog.debug,faceFiss, edge, name, nro_cas)
groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe", nro_cas)
return edgesInside, centreFondFiss, tangentFondFiss, \
planBord1, planBord2, \

View File

@ -46,7 +46,7 @@ def insereFissureLongue_b (edgesInside, centreFondFiss, tangentFondFiss, \
facePeau, verticesOutCercles, verticesEdgePeauFiss, \
fillingFaceExterne, rayonPipe, \
internalBoundary, \
nro_cas=-1):
nro_cas=None):
"""procedure complete fissure longue"""
logging.info('start')
logging.info("Maillage pour le cas n°%d", nro_cas)
@ -86,8 +86,8 @@ def insereFissureLongue_b (edgesInside, centreFondFiss, tangentFondFiss, \
#pipeFondFiss = geompy.MakePartition([pipeFondFiss], [planfiss, wireFondFiss, planBord1, planBord2], list(), list(), geompy.ShapeType["SOLID"], 0, list(), 0)
geomPublish(initLog.debug, disque, 'disque')
geomPublish(initLog.debug, wireFondFiss, 'wireFondFiss')
geomPublish(initLog.debug, pipeFondFiss, 'pipeFondFiss')
geomPublish(initLog.always, wireFondFiss, 'wireFondFiss', nro_cas)
geomPublish(initLog.always, pipeFondFiss, 'pipeFondFiss', nro_cas)
VerticesEndFondFiss, _ = findWireEndVertices(wireFondFiss)
for i_aux, vertex in enumerate(VerticesEndFondFiss):

View File

@ -37,7 +37,7 @@ def insereFissureLongue_c (pipeFondFiss, disques, rayons, demiCercles, demiCercl
VerticesEndPipeFiss, verticesEdgePeauFiss, \
groupFaceFissInPipe, groupEdgeFondFiss, groupsDemiCerclesPipe, groupGenerFiss, \
profondeur, rayonPipe, \
nro_cas=-1):
nro_cas=None):
"""maillage pipe fond fissure"""
logging.info('start')
logging.info("Maillage pour le cas n°%d", nro_cas)

View File

@ -33,7 +33,7 @@ from .putName import putName
def insereFissureLongue_d (facePeau, edgePeauFiss, groupEdgesBordPeau, bordsLibres, \
groupsDemiCerclesPeau, groups_demiCercles, verticesOutCercles, \
nbSegGenLong, nbSegGenBout, profondeur, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""maillage face de peau"""
logging.info('start')
logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)

View File

@ -32,7 +32,7 @@ from .putName import putName
def insereFissureLongue_e (faceFiss, edgePeauFiss, groupEdgesPeauFiss, group_generFiss, groupEdgesFaceFissPipe, \
profondeur, rayonPipe, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""maillage face de fissure"""
logging.info('start')
logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)

View File

@ -30,7 +30,7 @@ from .geomsmesh import smesh
from .putName import putName
def insereFissureLongue_f (internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""maillage meshBoiteDefaut"""
logging.info('start')
logging.info("Usage du mailleur %s pour le cas n°%d", mailleur, nro_cas)

View File

@ -38,10 +38,10 @@ def insereFissureLongue_g(nomFicFissure, fichierMaillageFissure, nomFicSain, mai
meshBoiteDefaut, facePorteFissure, \
group_faceFissInPipe, group_faceFissOutPipe, \
zoneDefaut, zoneDefaut_skin, zoneDefaut_internalEdges, zoneDefaut_internalFaces, \
nro_cas=-1):
nro_cas=None):
"""Les groupes de la fissure longue"""
logging.info('start')
logging.info("Pour le cas n°%d", mailleur, nro_cas)
logging.info("Pour le cas n°%d", nro_cas)
O, _, _, _ = triedreBase()

View File

@ -25,11 +25,13 @@ import SMESH
from .geomsmesh import geompy
from .geomsmesh import smesh
from .geomsmesh import geomPublish
from . import initLog
from .putName import putName
def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives, \
nro_cas=-1):
nro_cas=None):
"""edges de bord, faces défaut à respecter"""
logging.info('start')
logging.info("Pour le cas n°%d", nro_cas)
@ -43,7 +45,7 @@ def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives,
bordsLibres = internalBoundary.MakeGroupByFilter( 'bords', filtre )
putName(bordsLibres, 'bordsLibres', i_pref=nro_cas)
# --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'exterieur des volumes repliés sur eux-mêmes
# --- pour aider l'algo hexa-tetra à ne pas mettre de pyramides à l'extérieur des volumes repliés sur eux-mêmes
# on désigne les faces de peau en quadrangles par le groupe "skinFaces"
skinFaces = internalBoundary.CreateEmptyGroup( SMESH.FACE, 'skinFaces' )
@ -55,6 +57,7 @@ def mailleAretesEtJonction (internalBoundary, aretesVivesCoupees, lgAretesVives,
if aretesVivesCoupees:
aretesVivesC = geompy.MakeCompound(aretesVivesCoupees)
geomPublish(initLog.always, aretesVivesC, "aretesVives", nro_cas)
meshAretesVives = smesh.Mesh(aretesVivesC)
algo1d = meshAretesVives.Segment()
hypo1d = algo1d.LocalLength(lgAretesVives,[],1e-07)

View File

@ -31,7 +31,7 @@ from .putName import putName
def mailleFacesFissure(faceFissureExterne, \
edgesPipeFissureExterneC, edgesPeauFissureExterneC, \
meshPipeGroups, areteFaceFissure, rayonPipe, nbsegRad, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""maillage faces de fissure"""
logging.info('start')
logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)

View File

@ -37,7 +37,7 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
facesPeaux, edCircPeau, ptCircPeau, gpedgeBord, gpedgeVifs, edFissPeau, \
bordsLibres, grpEdgesPeauFissureExterne, grpAretesVives, \
edgesCircPipeGroup, dmoyen, rayonPipe, nbsegRad, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""maillage faces de peau"""
logging.info('start')
logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)
@ -81,7 +81,6 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
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("a")
meshFacePeau = smesh.Mesh(facePeau)
algo1d = meshFacePeau.UseExisting1DElements(geom=groupEdgesBordPeau)
@ -90,7 +89,6 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
putName(algo1d, "algo1d_bordsLibres", ifil, nro_cas)
putName(hypo1d, "hypo1d_bordsLibres", ifil, nro_cas)
logging.info("b")
algo1d = meshFacePeau.UseExisting1DElements(geom=geompy.MakeCompound(edgesFissurePeau))
hypo1d = algo1d.SourceEdges([ grpEdgesPeauFissureExterne ],0,0)
putName(algo1d.GetSubMesh(), "edgePeauFiss", ifil, nro_cas)
@ -118,7 +116,6 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
putName(algo1d, "algo1d_" + name, ifil, nro_cas)
putName(hypo1d, "hypo1d_" + name, ifil, nro_cas)
logging.info("c")
logging.info("Maillage avec %s", mailleur)
if ( mailleur == "MeshGems"):
algo2d = meshFacePeau.Triangle(algo=smeshBuilder.MG_CADSurf)
@ -136,7 +133,6 @@ def mailleFacesPeau(partitionsPeauFissFond, idFillingFromBout, facesDefaut, \
hypo2d.SetFineness( 2 )
hypo2d.SetMinSize( rayonPipe/float(nbsegRad) )
hypo2d.SetQuadAllowed( 0 )
logging.info("d")
putName(algo2d.GetSubMesh(), "facePeau", ifil, nro_cas)
putName(algo2d, "algo2d_facePeau", ifil, nro_cas)
putName(hypo2d, "hypo2d_facePeau", ifil, nro_cas)

View File

@ -36,7 +36,7 @@ def meshBlocPart(blocPartition, faceFissure, tore, centres, edges, diams, circle
gencnt, facefissoutore, edgeext, facesExternes, facesExtBloc, facesExtElli, \
aretesInternes, internalBoundary, ellipsoidep, sharedFaces, sharedEdges, edgesBords, \
nbsegExt, nbsegGen, nbsegRad, scaleRad, reverses, reverext, nbsegCercle, nbsegFis, dmoyen, lensegEllipsoide, \
mailleur="MeshGems", nro_cas=-1):
mailleur="MeshGems", nro_cas=None):
"""Maillage du bloc partitionné"""
logging.info('start')
logging.info("Maillage avec %s pour le cas n°%d", mailleur, nro_cas)

View File

@ -32,7 +32,8 @@ from .findWireEndVertices import findWireEndVertices
from .prolongeWire import prolongeWire
from .fissError import fissError
def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe, \
nro_cas=None):
"""
pipe de fond de fissure, prolongé, partition face fissure par pipe
identification des edges communes pipe et face fissure
@ -47,14 +48,14 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe', nro_cas)
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe', nro_cas)
extrem, norms = findWireEndVertices(fondFiss, True)
logging.debug("extrem: %s, norm: %s",extrem, norms)
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
geomPublish(initLog.debug, cercle, 'cercle')
geomPublish(initLog.debug, cercle, 'cercle', nro_cas)
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
try:
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
@ -62,24 +63,24 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
texte = "génération du pipe le long de la ligne de fond de fissure prolongée impossible. "
texte += "Cause possible : la ligne s'autointersecte lorsqu'on la prolonge."
raise fissError(traceback.extract_stack(),texte)
geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
geomPublish(initLog.debug, pipeFiss, 'pipeFiss', nro_cas)
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
geomPublish(initLog.debug, partFissPipe, 'partFissPipe', nro_cas)
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
geomPublish(initLog.debug, fissPipe, 'fissPipe')
geomPublish(initLog.debug, fissPipe, 'fissPipe', nro_cas)
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
geomPublish(initLog.debug, partPipe, 'partPipe')
geomPublish(initLog.debug, partPipe, 'partPipe', nro_cas)
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
for i_aux, edge in enumerate(edgesPipeFiss):
name = "edgePipe{}".format(i_aux)
geomPublishInFather(initLog.debug,fissPipe, edge, name)
geomPublishInFather(initLog.debug,fissPipe, edge, name, nro_cas)
try:
wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
except:
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
logging.debug("wirePipeFiss construit sous forme de compound")
geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
geomPublish(initLog.always, wirePipeFiss, "wirePipeFiss", nro_cas)
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
@ -87,6 +88,6 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
name = "edgeFondFiss{}".format(i_aux)
geomPublishInFather(initLog.debug,fissPipe, edge, name)
wireFondFiss = geompy.MakeWire(edgesFondFiss)
geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
geomPublish(initLog.always, wireFondFiss, "wireFondFiss", nro_cas)
return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)

View File

@ -32,7 +32,7 @@ from .fusionMaillageAttributionDefaut import fusionMaillageDefaut
from .putName import putName
def peauInterne(fichierMaillage, shapeDefaut, nomZones, \
nro_cas=-1):
nro_cas=None):
"""Retrouve les groupes de défaut dans le maillage sain modifié par CreateHoleSkin (CreeZoneDefautMaillage)
On récupère le volume et la peau de la zone de défaut, les éventuelles faces et arêtes internes de cette zone.
@ -97,6 +97,7 @@ def peauInterne(fichierMaillage, shapeDefaut, nomZones, \
_, maillageSain, DefautBoundary = maillageSain.MakeBoundaryElements( SMESH.BND_2DFROM3D, 'DefBound', '', 0, [ zoneDefaut ])
internal = maillageSain.GetMesh().CutListOfGroups( [ DefautBoundary ], [ zoneDefaut_skin ], 'internal' )
internalBoundary = smesh.CopyMesh( internal, 'internalBoundary', 0, 0)
putName(internalBoundary, "internalBoundary", i_pref=nro_cas)
maillageDefautCible = smesh.CopyMesh(zoneDefaut_skin, 'maillageCible', 0, 0)
putName(maillageDefautCible, "maillageCible", i_pref=nro_cas)

View File

@ -22,7 +22,7 @@
#import logging
from .geomsmesh import smesh
def putName (objmesh, name, i_suff=-1, i_pref=-1):
def putName (objmesh, name, i_suff=-1, i_pref=None):
"""Nommage des objets mesh
@objmesh objet à nommer
@ -31,15 +31,20 @@ def putName (objmesh, name, i_suff=-1, i_pref=-1):
@i_pref un éventuel préfixe
"""
#logging.info("putName pour %s - i_suff=%d, i_pref=%d", name, i_suff, i_pref)
#texte = "Name = {}, i_suff = {}, i_pref = {}".format(name,i_suff,i_pref)
#print(texte)
#logging.info(texte)
# suffixe éventuel :
if i_suff >= 0:
if ( i_suff >= 0 ):
suffixe = "_{}".format(i_suff)
name += suffixe
# préfixe éventuel :
if i_pref >= 0:
prefixe = "Cas{:02d}_".format(i_pref)
if ( i_pref is not None):
if isinstance(i_pref,int):
prefixe = "Cas{:02d}_".format(i_pref)
else:
prefixe = "{}_".format(i_pref)
name = prefixe + name
#logging.info("Au final : %s", name)

View File

@ -78,11 +78,11 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, listOfCorners):
tmpFace.append(line)
setOfLines.append(tmpFace)
for i, face in enumerate(setOfLines):
for i_aux, face in enumerate(setOfLines):
# A partir des lignes de chaque face,
# on recrée un objet GEOM temporaire par filling.
filling = geompy.MakeFilling(geompy.MakeCompound(face), 2, 5, 0.0001, 0.0001, 0, GEOM.FOM_Default, True)
geomPublish(initLog.debug, filling, 'filling_{}'.format(i + 1))
geomPublish(initLog.debug, filling, 'filling_{}'.format(i_aux+1))
tmpFillings.append(filling)
for face in setOfNodes:
@ -96,27 +96,27 @@ def quadranglesToShapeWithCorner(meshQuad, shapeDefaut, listOfCorners):
line = geompy.MakeInterpol(tmpPoints, False, False)
tmpBords.append(line)
for i, filling in enumerate(tmpFillings):
for i_aux, filling in enumerate(tmpFillings):
tmpPartition = geompy.MakePartition([filling], [shapeDefaut], list(), list(), geompy.ShapeType["FACE"], 0, list(), 0, True)
tmpExplodeRef = geompy.ExtractShapes(filling, geompy.ShapeType["EDGE"], True)
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
geomPublish(initLog.debug, filling, "faceNonCoupee_{}".format(i + 1))
geomPublish(initLog.debug, filling, "faceNonCoupee_{}".format(i_aux+1))
facesNonCoupees.append(filling)
else:
geomPublish(initLog.debug, filling, "faceCoupee_{}".format(i + 1))
geomPublish(initLog.debug, filling, "faceCoupee_{}".format(i_aux+1))
facesCoupees.append(filling)
fillings = facesCoupees, facesNonCoupees
for i, filling in enumerate(tmpBords):
for i_aux, filling in enumerate(tmpBords):
tmpPartition = geompy.MakePartition([shapeDefaut], [filling], list(), list(), geompy.ShapeType["SHELL"], 0, list(), 0, True)
tmpExplodeRef = geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(shapeDefaut, geompy.ShapeType["VERTEX"], True)
tmpExplodeNum = geompy.ExtractShapes(tmpPartition, geompy.ShapeType["EDGE"], True) + geompy.ExtractShapes(tmpPartition, geompy.ShapeType["VERTEX"], True)
if len(tmpExplodeRef) == len(tmpExplodeNum):
geomPublish(initLog.debug, filling, "areteNonCoupee_{}".format(i + 1))
geomPublish(initLog.debug, filling, "areteNonCoupee_{}".format(i_aux+1))
aretesNonCoupees.append(filling)
else:
geomPublish(initLog.debug, filling, "areteCoupee_{}".format(i + 1))
geomPublish(initLog.debug, filling, "areteCoupee_{}".format(i_aux+1))
aretesCoupees.append(filling)
bords_Partages = aretesCoupees, aretesNonCoupees

View File

@ -31,7 +31,8 @@ from . import initLog
from .sortFaces import sortFaces
from .fissError import fissError
def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne, \
nro_cas=None):
"""restriction de la face de fissure au domaine solide
partition face fissure étendue par fillings
@ -39,13 +40,13 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
logging.info('start')
partShapeDefaut = geompy.MakePartition([shapeDefaut], facesDefaut, [], [], geompy.ShapeType["FACE"], 0, [], 0)
geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut')
geomPublish(initLog.debug, partShapeDefaut, 'partShapeDefaut', i_pref=nro_cas)
facesPartShapeDefaut = geompy.ExtractShapes(partShapeDefaut, geompy.ShapeType["FACE"], False)
if pointInterne is not None:
distfaces = [(geompy.MinDistance(face,pointInterne), i, face) for i, face in enumerate(facesPartShapeDefaut)]
distfaces.sort()
texte = "selection de la face la plus proche du point interne, distance={}".format(distfaces[0][0])
texte = "lection de la face la plus proche du point interne, distance={}".format(distfaces[0][0])
logging.debug(texte)
facesPortFissure = distfaces[0][2]
else:
@ -63,6 +64,6 @@ def restreintFaceFissure(shapeDefaut, facesDefaut, pointInterne):
logging.debug(texte)
facesPortFissure = facesPartShapeDefautSorted[-1]
geomPublish(initLog.debug, facesPortFissure, "facesPortFissure")
geomPublish(initLog.debug, facesPortFissure, "facesPortFissure", i_pref=nro_cas)
return facesPortFissure

View File

@ -17,34 +17,40 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométries et maillages de base nécessaires aux cas-tests :
. cubeAngle
. cubeAngle2
"""
"""Cas-test de blocFissure pour un cube"""
import logging
import os
from blocFissure import gmu
import logging
import salome
import GEOM
from salome.geom import geomBuilder
import SMESH
from salome.smesh import smeshBuilder
import GEOM
import SMESH
import SALOMEDS
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
#=============== Options ====================
# 1. NOM_OBJET = nom de l'objet
NOM_OBJET = "CubeAngle"
#============================================
salome.salome_init()
###
### GEOM component
###
geompy = geomBuilder.New()
O, OX, OY, OZ = triedreBase()
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
Vertex_1 = geompy.MakeVertex(0, 0, 100)
Disk_1 = geompy.MakeDiskPntVecR(Vertex_1, OZ, 60)
@ -53,14 +59,13 @@ Vertex_3 = geompy.MakeVertex(65, 65, 110)
Box_2 = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
Common_1 = geompy.MakeCommon(Disk_1, Box_2)
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Box_1, 'Box_1' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Disk_1, 'Disk_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( Box_2, 'Box_2' )
geompy.addToStudy( Common_1, NOM_OBJET )
geompy.addToStudy( Box_1, NOM_OBJET )
geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
geomPublish(initLog.debug, Disk_1, 'Disk_1' )
geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
geomPublish(initLog.debug, Box_2, 'Box_2' )
geompy.addToStudy( Common_1, NOM_OBJET+'_Fissure' )
ficcao = os.path.join(gmu.pathBloc, "materielCasTests", "{}Fiss.brep".format(NOM_OBJET))
text = ".. Exportation de la géométrie de la fissure dans le fichier '{}'".format(ficcao)
@ -71,16 +76,22 @@ geompy.ExportBREP(Common_1, ficcao)
### SMESH component
###
smesh = smeshBuilder.New()
Mesh_1 = smesh.Mesh(Box_1)
smesh.SetName(Mesh_1, NOM_OBJET)
putName(Mesh_1, NOM_OBJET)
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
## set object names
#putName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#putName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#putName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='cubeAngle')
is_done = Mesh_1.Compute()
text = "Mesh_1.Compute"
if is_done:
@ -95,11 +106,5 @@ text = ".. Archivage du maillage dans le fichier '{}'".format(ficmed)
logging.info(text)
Mesh_1.ExportMED(ficmed)
## set object names
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -17,35 +17,38 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométries et maillages de base nécessaires aux cas-tests :
. cubeFin_Transverse
. cubeFin_Coin
. cubeFin_Milieu
"""
import os
import math
import logging
import sys
import salome
from salome.smesh import smeshBuilder
import GEOM
import SMESH
import SALOMEDS
salome.salome_init()
import salome_notebook
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.geomsmesh import geomPublishInFather
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
O, OX, OY, OZ = triedreBase()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
cubeFin = geompy.MakeBoxDXDYDZ(200, 200, 200)
[DEPL,ENCASTR] = geompy.SubShapes(cubeFin, [27, 23])
origCoin = geompy.MakeVertex(0, 160, 200)
@ -72,45 +75,38 @@ Arc_1 = geompy.MakeArc(Line_1_vertex_3, Vertex_5, Line_3_vertex_2)
Face_1 = geompy.MakeFaceWires([Line_1, Line_3, Line_4, Arc_1], 1)
cubeFin_Coin = geompy.MakeCommonList([Rotation_1, Face_1], True)
cubeFin_Milieu = geompy.MakeCommonList([Scale_1, cubeFin_Transverse], True)
O_1 = geompy.MakeVertex(0, 0, 0)
OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1)
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( cubeFin, 'cubeFin' )
geompy.addToStudyInFather( cubeFin, DEPL, 'DEPL' )
geompy.addToStudyInFather( cubeFin, ENCASTR, 'ENCASTR' )
geompy.addToStudy( origCoin, 'origCoin' )
geompy.addToStudy( Disk_1, 'Disk_1' )
geompy.addToStudy( Translation_1, 'Translation_1' )
geompy.addToStudy( Vector_1, 'Vector_1' )
geompy.addToStudy( Rotation_1, 'Rotation_1' )
geompy.addToStudy( origMilieu, 'origMilieu' )
geompy.addToStudy( Translation_2, 'Translation_2' )
geompy.addToStudy( Scale_1, 'Scale_1' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Line_1, 'Line_1' )
geompy.addToStudy( Line_2, 'Line_2' )
geompy.addToStudy( Line_3, 'Line_3' )
geompy.addToStudy( Line_4, 'Line_4' )
geompy.addToStudy( cubeFin_Transverse, 'cubeFin_Transverse' )
geompy.addToStudyInFather( Line_1, Line_1_vertex_3, 'Line_1:vertex_3' )
geompy.addToStudy( Vertex_5, 'Vertex_5' )
geompy.addToStudyInFather( Line_3, Line_3_vertex_2, 'Line_3:vertex_2' )
geompy.addToStudy( Arc_1, 'Arc_1' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( cubeFin_Coin, 'cubeFin_Coin' )
geompy.addToStudy( cubeFin_Milieu, 'cubeFin_Milieu' )
geompy.addToStudy( O_1, 'O' )
geompy.addToStudy( OX_1, 'OX' )
geompy.addToStudy( OY_1, 'OY' )
geompy.addToStudy( OZ_1, 'OZ' )
geomPublish(initLog.debug, origCoin, 'origCoin' )
geomPublish(initLog.debug, Disk_1, 'Disk_1' )
geomPublish(initLog.debug, Translation_1, 'Translation_1' )
geomPublish(initLog.debug, Vector_1, 'Vector_1' )
geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
geomPublish(initLog.debug, origMilieu, 'origMilieu' )
geomPublish(initLog.debug, Translation_2, 'Translation_2' )
geomPublish(initLog.debug, Scale_1, 'Scale_1' )
geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
geomPublish(initLog.debug, Vertex_4, 'Vertex_4' )
geomPublish(initLog.debug, Line_1, 'Line_1' )
geomPublish(initLog.debug, Line_2, 'Line_2' )
geomPublish(initLog.debug, Line_3, 'Line_3' )
geomPublish(initLog.debug, Line_4, 'Line_4' )
geomPublishInFather(initLog.debug, Line_1, Line_1_vertex_3, 'Line_1:vertex_3' )
geomPublish(initLog.debug, Vertex_5, 'Vertex_5' )
geomPublishInFather(initLog.debug, Line_3, Line_3_vertex_2, 'Line_3:vertex_2' )
geomPublish(initLog.debug, Arc_1, 'Arc_1' )
geomPublish(initLog.debug, Face_1, 'Face_1' )
geompy.addToStudy( cubeFin_Transverse, 'cubeFin_Transverse_fissure' )
geompy.addToStudy( cubeFin_Coin, 'cubeFin_Coin_fissure' )
geompy.addToStudy( cubeFin_Milieu, 'cubeFin_Milieu_fissure' )
geompy.ExportBREP(cubeFin_Transverse, os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Transverse.brep"))
geompy.ExportBREP(cubeFin_Coin, os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Coin.brep"))
geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin_Milieu.brep"))
@ -119,18 +115,23 @@ geompy.ExportBREP(cubeFin_Milieu, os.path.join(gmu.pathBloc, "materielCasTests",
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
cubeFin_1 = smesh.Mesh(cubeFin)
putName(cubeFin_1.GetMesh(), 'cubeFin')
Regular_1D = cubeFin_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(20)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = cubeFin_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = cubeFin_1.Hexahedron(algo=smeshBuilder.Hexa)
DEPL_1 = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE)
ENCASTR_1 = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE)
_ = cubeFin_1.GroupOnGeom(DEPL,'DEPL',SMESH.FACE)
_ = cubeFin_1.GroupOnGeom(ENCASTR,'ENCASTR',SMESH.FACE)
## Set names of Mesh objects
#putName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#putName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#putName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='cubeFin')
is_done = cubeFin_1.Compute()
text = "cubeFin_1.Compute"
@ -141,15 +142,6 @@ else:
logging.info(text)
raise Exception(text)
## Set names of Mesh objects
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
smesh.SetName(DEPL_1, 'DEPL')
smesh.SetName(ENCASTR_1, 'ENCASTR')
smesh.SetName(cubeFin_1.GetMesh(), 'cubeFin')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
cubeFin_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "cubeFin.med"))
if salome.sg.hasDesktop():

View File

@ -17,40 +17,37 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométries et maillages de base nécessaires aux cas-tests :
. cylindre
. cylindre_2
"""
import os
import math
import logging
import sys
import salome
from salome.smesh import smeshBuilder
import GEOM
import SMESH
import SALOMEDS
salome.salome_init()
import salome_notebook
notebook = salome_notebook.notebook
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.geomsmesh import geomPublishInFather
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
O, OX, OY, OZ = triedreBase()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
O_1 = geompy.MakeVertex(0, 0, 0)
OX_1 = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY_1 = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ_1 = geompy.MakeVectorDXDYDZ(0, 0, 1)
Vertex_1 = geompy.MakeVertex(0, 0, 500)
Vertex_2 = geompy.MakeVertex(100, 0, 500)
Vertex_3 = geompy.MakeVertex(110, 0, 500)
@ -72,85 +69,78 @@ Mirror_1_7 = geompy.MakeMirrorByPlane(Vertex_8, Plane_1)
Mirror_1_8 = geompy.MakeMirrorByPlane(Vertex_9, Plane_1)
Mirror_1_9 = geompy.MakeMirrorByPlane(Vertex_10, Plane_1)
Curve_2 = geompy.MakeInterpol([Mirror_1_9, Mirror_1_8, Mirror_1_7, Mirror_1_6, Mirror_1_5, Mirror_1_4, Mirror_1_3, Mirror_1_2, Mirror_1_1, Vertex_1, Vertex_2, Vertex_3, Vertex_4, Vertex_5, Vertex_6, Vertex_7, Vertex_8, Vertex_9, Vertex_10], False, False)
Divided_Cylinder_1 = geompy.MakeDividedCylinder(145, 800, GEOM.SQUARE)
CylindreSain = geompy.MakeRotation(Divided_Cylinder_1, OZ, 45*math.pi/180.0)
[Compound_1, vertical, radial, Compound_4] = geompy.Propagate(CylindreSain)
geompy.addToStudy( CylindreSain, 'CylindreSain' )
geomPublishInFather(initLog.debug,CylindreSain, Compound_1, 'Compound_1' )
geompy.addToStudyInFather(CylindreSain, vertical, 'vertical' )
geompy.addToStudyInFather(CylindreSain, radial, 'radial' )
geompy.addToStudyInFather(CylindreSain, Compound_4, 'Compound_4' )
Circle_1 = geompy.MakeCircle(Vertex_1, None, 145)
Vertex_11 = geompy.MakeVertex(0, -165, 500)
Curve_2_vertex_2 = geompy.GetSubShape(Curve_2, [2])
Curve_2_vertex_3 = geompy.GetSubShape(Curve_2, [3])
Arc_1 = geompy.MakeArc(Curve_2_vertex_2, Vertex_11, Curve_2_vertex_3)
FissInCylindre = geompy.MakeFaceWires([Curve_2, Arc_1], 1)
Divided_Cylinder_1 = geompy.MakeDividedCylinder(145, 800, GEOM.SQUARE)
CylindreSain = geompy.MakeRotation(Divided_Cylinder_1, OZ, 45*math.pi/180.0)
[Compound_1, vertical, radial, Compound_4] = geompy.Propagate(CylindreSain)
geompy.addToStudy( FissInCylindre, 'cylindre_fissure' )
geompy.ExportBREP(FissInCylindre, os.path.join(gmu.pathBloc, "materielCasTests", "FissInCylindre.brep"))
Vertex_12 = geompy.MakeVertex(0, -145, 500)
Circle_2 = geompy.MakeCircle(Vertex_12, None, 145)
Face_1 = geompy.MakeFaceWires([Circle_2], 1)
Vertex_13 = geompy.MakeVertex(0, 0, 500)
Disk_1 = geompy.MakeDiskPntVecR(Vertex_13, OZ_1, 170)
Disk_1 = geompy.MakeDiskPntVecR(Vertex_13, OZ, 170)
FissInCylindre2 = geompy.MakeCommon(Face_1, Disk_1)
geompy.addToStudy( FissInCylindre2, 'cylindre_2_fissure' )
geompy.ExportBREP(FissInCylindre2, os.path.join(gmu.pathBloc, "materielCasTests", "FissInCylindre2.brep"))
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( O_1, 'O' )
geompy.addToStudy( OX_1, 'OX' )
geompy.addToStudy( OY_1, 'OY' )
geompy.addToStudy( OZ_1, 'OZ' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Vertex_5, 'Vertex_5' )
geompy.addToStudy( Vertex_6, 'Vertex_6' )
geompy.addToStudy( Vertex_7, 'Vertex_7' )
geompy.addToStudy( Vertex_8, 'Vertex_8' )
geompy.addToStudy( Vertex_9, 'Vertex_9' )
geompy.addToStudy( Vertex_10, 'Vertex_10' )
geompy.addToStudy( Plane_1, 'Plane_1' )
geompy.addToStudy( Mirror_1_1, 'Mirror_1_1' )
geompy.addToStudy( Mirror_1_2, 'Mirror_1_2' )
geompy.addToStudy( Mirror_1_3, 'Mirror_1_3' )
geompy.addToStudy( Mirror_1_4, 'Mirror_1_4' )
geompy.addToStudy( Mirror_1_5, 'Mirror_1_5' )
geompy.addToStudy( Mirror_1_6, 'Mirror_1_6' )
geompy.addToStudy( Mirror_1_7, 'Mirror_1_7' )
geompy.addToStudy( Mirror_1_8, 'Mirror_1_8' )
geompy.addToStudy( Mirror_1_9, 'Mirror_1_9' )
geompy.addToStudy( Curve_2, 'Curve_2' )
geompy.addToStudy( Circle_1, 'Circle_1' )
geompy.addToStudy( Vertex_11, 'Vertex_11' )
geompy.addToStudyInFather( Curve_2, Curve_2_vertex_2, 'Curve_2:vertex_2' )
geompy.addToStudyInFather( Curve_2, Curve_2_vertex_3, 'Curve_2:vertex_3' )
geompy.addToStudy( Arc_1, 'Arc_1' )
geompy.addToStudy( FissInCylindre, 'FissInCylindre' )
geompy.addToStudy( Divided_Cylinder_1, 'Divided Cylinder_1' )
geompy.addToStudy( CylindreSain, 'CylindreSain' )
geompy.addToStudyInFather( CylindreSain, Compound_1, 'Compound_1' )
geompy.addToStudyInFather( CylindreSain, vertical, 'vertical' )
geompy.addToStudyInFather( CylindreSain, radial, 'radial' )
geompy.addToStudyInFather( CylindreSain, Compound_4, 'Compound_4' )
geompy.addToStudy( Vertex_12, 'Vertex_12' )
geompy.addToStudy( Circle_2, 'Circle_2' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( Vertex_13, 'Vertex_13' )
geompy.addToStudy( Disk_1, 'Disk_1' )
geompy.addToStudy( FissInCylindre2, 'FissInCylindre2' )
geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
geomPublish(initLog.debug, Vertex_4, 'Vertex_4' )
geomPublish(initLog.debug, Vertex_5, 'Vertex_5' )
geomPublish(initLog.debug, Vertex_6, 'Vertex_6' )
geomPublish(initLog.debug, Vertex_7, 'Vertex_7' )
geomPublish(initLog.debug, Vertex_8, 'Vertex_8' )
geomPublish(initLog.debug, Vertex_9, 'Vertex_9' )
geomPublish(initLog.debug, Vertex_10, 'Vertex_10' )
geomPublish(initLog.debug, Plane_1, 'Plane_1' )
geomPublish(initLog.debug, Mirror_1_1, 'Mirror_1_1' )
geomPublish(initLog.debug, Mirror_1_2, 'Mirror_1_2' )
geomPublish(initLog.debug, Mirror_1_3, 'Mirror_1_3' )
geomPublish(initLog.debug, Mirror_1_4, 'Mirror_1_4' )
geomPublish(initLog.debug, Mirror_1_5, 'Mirror_1_5' )
geomPublish(initLog.debug, Mirror_1_6, 'Mirror_1_6' )
geomPublish(initLog.debug, Mirror_1_7, 'Mirror_1_7' )
geomPublish(initLog.debug, Mirror_1_8, 'Mirror_1_8' )
geomPublish(initLog.debug, Mirror_1_9, 'Mirror_1_9' )
geomPublish(initLog.debug, Curve_2, 'Curve_2' )
geomPublish(initLog.debug, Circle_1, 'Circle_1' )
geomPublish(initLog.debug, Vertex_11, 'Vertex_11' )
geomPublishInFather(initLog.debug, Curve_2, Curve_2_vertex_2, 'Curve_2:vertex_2' )
geomPublishInFather(initLog.debug, Curve_2, Curve_2_vertex_3, 'Curve_2:vertex_3' )
geomPublish(initLog.debug, Arc_1, 'Arc_1' )
geomPublish(initLog.debug, FissInCylindre, 'FissInCylindre' )
geomPublish(initLog.debug, Divided_Cylinder_1, 'Divided Cylinder_1' )
geomPublish(initLog.debug, Vertex_12, 'Vertex_12' )
geomPublish(initLog.debug, Circle_2, 'Circle_2' )
geomPublish(initLog.debug, Face_1, 'Face_1' )
geomPublish(initLog.debug, Vertex_13, 'Vertex_13' )
geomPublish(initLog.debug, Disk_1, 'Disk_1' )
geomPublish(initLog.debug, FissInCylindre2, 'FissInCylindre2' )
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
smeshObj_1 = smesh.CreateHypothesis('NumberOfSegments')
smeshObj_1.SetNumberOfSegments( 5 )
smeshObj_1.SetDistrType( 0 )
CylindreSain_1 = smesh.Mesh(CylindreSain)
smesh.SetName(CylindreSain_1, 'CylindreSain')
putName(CylindreSain_1.GetMesh(), 'CylindreSain')
Regular_1D = CylindreSain_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
@ -163,6 +153,14 @@ Regular_1D_2 = CylindreSain_1.Segment(geom=radial)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(6,[],[ ])
Nb_Segments_3.SetDistrType( 0 )
## set object names
#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='cylindre')
putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='cylindre')
putName(Nb_Segments_3, 'Nb. Segments_3', i_pref='cylindre')
is_done = CylindreSain_1.Compute()
text = "CylindreSain_1.Compute"
if is_done:
@ -173,23 +171,6 @@ else:
raise Exception(text)
CylindreSain_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "CylindreSain.med"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()
## some objects were removed
aStudyBuilder = salome.myStudy.NewBuilder()
SO = salome.myStudy.FindObjectIOR(salome.myStudy.ConvertObjectToIOR(smeshObj_1))
if SO is not None: aStudyBuilder.RemoveObjectWithChildren(SO)
## set object names
smesh.SetName(CylindreSain_1.GetMesh(), 'CylindreSain')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
smesh.SetName(SubMesh_1, 'SubMesh_1')
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -17,68 +17,61 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométrie et maillage de base nécessaire au cas-test :
. disque_perce
"""
import os
import logging
import sys
import salome
from salome.smesh import smeshBuilder
from salome.StdMeshers import StdMeshersBuilder
import GEOM
import SMESH
import SALOMEDS
salome.salome_init()
import salome_notebook
notebook = salome_notebook.notebook
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.geomsmesh import geomPublishInFather
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
O, OX, OY, OZ = triedreBase()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Cylinder_1 = geompy.MakeCylinderRH(100, 300)
Cylinder_2 = geompy.MakeCylinderRH(600, 200)
Cut_1 = geompy.MakeCut(Cylinder_2, Cylinder_1)
Face_1 = geompy.MakeFaceHW(500, 1500, 3)
Disque = geompy.MakePartition([Cut_1], [Face_1], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
[Compound_1, Compound_2, Compound_3, Compound_4] = geompy.Propagate(Disque)
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Cylinder_1, 'Cylinder_1' )
geompy.addToStudy( Cylinder_2, 'Cylinder_2' )
geompy.addToStudy( Cut_1, 'Cut_1' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( Disque, 'Disque' )
geompy.addToStudyInFather( Disque, Compound_1, 'Compound_1' )
geompy.addToStudyInFather( Disque, Compound_2, 'Compound_2' )
geompy.addToStudyInFather( Disque, Compound_3, 'Compound_3' )
geompy.addToStudyInFather( Disque, Compound_4, 'Compound_4' )
geomPublish(initLog.debug, Cylinder_1, 'Cylinder_1' )
geomPublish(initLog.debug, Cylinder_2, 'Cylinder_2' )
geomPublish(initLog.debug, Cut_1, 'Cut_1' )
geomPublish(initLog.debug, Face_1, 'Face_1' )
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Disque_1 = smesh.Mesh(Disque)
smesh.SetName(Disque_1, 'Disque')
putName(Disque_1.GetMesh(), 'Disque')
Regular_1D = Disque_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
Nb_Segments_1.SetDistrType( 0 )
@ -90,6 +83,13 @@ Regular_1D_2 = Disque_1.Segment(geom=Compound_4)
status = Disque_1.AddHypothesis(Nb_Segments_2,Compound_4)
Quadrangle_2D = Disque_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
## set object names
#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='Disque')
putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='Disque')
is_done = Disque_1.Compute()
text = "Disque_1.Compute"
if is_done:
@ -100,18 +100,6 @@ else:
raise Exception(text)
Disque_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "disque.med"))
SubMesh_1 = Regular_1D_1.GetSubMesh()
SubMesh_2 = Regular_1D_2.GetSubMesh()
## set object names
smesh.SetName(Disque_1.GetMesh(), 'Disque')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(SubMesh_1, 'SubMesh_1')
smesh.SetName(SubMesh_2, 'SubMesh_2')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -17,93 +17,98 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométrie et maillage de base nécessaire au cas-test :
. faceGauche_2
"""
import os
import math
import logging
import sys
import salome
from salome.smesh import smeshBuilder
from salome.StdMeshers import StdMeshersBuilder
import GEOM
import SMESH
import SALOMEDS
salome.salome_init()
import salome_notebook
notebook = salome_notebook.notebook
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.geomsmesh import geomPublishInFather
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
O, OX, OY, OZ = triedreBase()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Circle_1 = geompy.MakeCircle(O, OX, 500)
Circle_1 = geompy.MakeCircle(O, OX, 500.)
Extrusion_1 = geompy.MakePrismVecH2Ways(Circle_1, OX, 500)
Vertex_1 = geompy.MakeVertex(500, 0, 0)
Vertex_1 = geompy.MakeVertex(500., 0., 0.)
Circle_3 = geompy.MakeCircle(Vertex_1, OZ, 300)
Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000)
Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
[Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13])
FaceFissExt = geompy.MakeFuse(Face_2, Face_1)
geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep"))
Vertex_2 = geompy.MakeVertex(0, -500, 0)
Vertex_3 = geompy.MakeVertex(400, 500, 800)
objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2)
Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, 180*math.pi/180.0)
geompy.addToStudy( objetSain, 'objetSain' )
Rotation_1 = geompy.MakeRotation(Extrusion_1, OX, math.pi)
Partition_2 = geompy.MakePartition([Rotation_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0)
geompy.addToStudy( Partition_2, 'Partition_2' )
[FaceFissExtSimple] = geompy.SubShapes(Partition_2, [13])
geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' )
Plane_1 = geompy.MakePlaneLCS(None, 2000, 3)
Plane_1 = geompy.MakePlaneLCS(None, 2000., 3)
FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0)
geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Circle_1, 'Circle_1' )
geompy.addToStudy( Extrusion_1, 'Extrusion_1' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Circle_3, 'Circle_3' )
geompy.addToStudy( Extrusion_2, 'Extrusion_2' )
geompy.addToStudy( Partition_1, 'Partition_1' )
geompy.addToStudyInFather( Partition_1, Face_1, 'Face_1' )
geompy.addToStudyInFather( Partition_1, Face_2, 'Face_2' )
geompy.addToStudy( FaceFissExt, 'FaceFissExt' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudy( objetSain, 'objetSain' )
geompy.addToStudy( Rotation_1, 'Rotation_1' )
geompy.addToStudy( Plane_1, 'Plane_1' )
geompy.addToStudy( FaceFissExtCoupe, 'FaceFissExtCoupe' )
geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep"))
geomPublish(initLog.debug, Circle_1, 'Circle_1' )
geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
geomPublish(initLog.debug, Circle_3, 'Circle_3' )
geomPublish(initLog.debug, Extrusion_2, 'Extrusion_2' )
geomPublish(initLog.debug, Partition_1, 'Partition_1' )
geomPublishInFather(initLog.debug, Partition_1, Face_1, 'Face_1' )
geomPublishInFather(initLog.debug, Partition_1, Face_2, 'Face_2' )
geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
geomPublish(initLog.debug, Rotation_1, 'Rotation_1' )
geomPublish(initLog.debug, Plane_1, 'Plane_1' )
###
### SMESH component
###
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
from salome.StdMeshers import StdMeshersBuilder
Mesh_1 = smesh.Mesh(objetSain)
smesh.SetName(Mesh_1, 'Mesh_1')
putName(Mesh_1.GetMesh(), 'Mesh_1')
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ])
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
## set object names
#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='fissuregauche2')
is_done = Mesh_1.Compute()
text = "Mesh_1.Compute"
if is_done:
@ -115,12 +120,5 @@ else:
Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med"))
## set object names
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -17,21 +17,26 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométrie et maillage de base nécessaire au cas-test :
. tube
"""
"""Cas-test de blocFissure sur un tube"""
__revision__ = "V02.06"
__revision__ = "V02.07"
import logging
import os
from blocFissure import gmu
import logging
import salome
from SketchAPI import *
from salome.shaper import model
import SHAPERSTUDY
import SMESH
from salome.smesh import smeshBuilder
from salome.StdMeshers import StdMeshersBuilder
import SMESH
from blocFissure import gmu
from blocFissure.gmu.putName import putName
#=============== Options ====================
# 1. NOM_OBJET = nom de l'objet
@ -234,7 +239,7 @@ l_groups = l_aux[1:]
smesh = smeshBuilder.New()
Maillage_tube = smesh.Mesh(objet)
smesh.SetName(Maillage_tube, NOM_OBJET)
putName(Maillage_tube.GetMesh(), NOM_OBJET)
for groupe in l_groups:
groupe_nom = groupe.GetName()
@ -260,6 +265,15 @@ Regular_1D_2 = Maillage_tube.Segment(geom=group_h)
Number_of_Segments_2 = Regular_1D_2.NumberOfSegments(NB_S_H)
Propagation_of_1D_Hyp_1 = Regular_1D_2.Propagation()
## set object names
#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
#smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='tube')
putName(Number_of_Segments_1, 'Number_of_Segments_1', i_pref='tube')
putName(Number_of_Segments_2, 'Number_of_Segments_2', i_pref='tube')
putName(Propagation_of_1D_Hyp, 'Propagation', i_pref='tube')
is_done = Maillage_tube.Compute()
text = "Maillage_tube.Compute"
if is_done:
@ -274,11 +288,5 @@ text = ".. Archivage du maillage dans le fichier '{}'".format(ficmed)
logging.info(text)
Maillage_tube.ExportMED(ficmed)
## set object names
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Hexa_3D.GetAlgorithm(), 'Hexa_3D')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()

View File

@ -17,37 +17,37 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
"""Géométrie et maillage de base nécessaire au cas-test :
. vis_1
"""
import os
import math
import logging
import sys
import salome
from salome.smesh import smeshBuilder
from salome.StdMeshers import StdMeshersBuilder
import GEOM
import SMESH
import SALOMEDS
salome.salome_init()
import salome_notebook
notebook = salome_notebook.notebook
import os
from blocFissure import gmu
from blocFissure.gmu.geomsmesh import geompy
from blocFissure.gmu.geomsmesh import geomPublish
from blocFissure.gmu.geomsmesh import geomPublishInFather
logging.info('start')
from blocFissure.gmu.triedreBase import triedreBase
from blocFissure.gmu.putName import putName
from blocFissure.gmu import initLog
###
### GEOM component
###
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
O, OX, OY, OZ = triedreBase()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
geomObj_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
geomObj_2 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
sk = geompy.Sketcher2D()
@ -83,6 +83,31 @@ geompy.UnionIDs(appui, [39])
p_imp = geompy.CreateGroup(coupe_vis, geompy.ShapeType["EDGE"])
geompy.UnionIDs(p_imp, [11])
geomPublish(initLog.debug, Sketch_1, 'Sketch_1' )
geomPublish(initLog.debug, Face_1, 'Face_1' )
geomPublish(initLog.debug, Vertex_1, 'Vertex_1' )
geomPublish(initLog.debug, Vertex_2, 'Vertex_2' )
geomPublish(initLog.debug, Vertex_3, 'Vertex_3' )
geomPublishInFather(initLog.debug, Face_1, Face_1_vertex_17, 'Face_1:vertex_17' )
geomPublish(initLog.debug, Line_1, 'Line_1' )
geomPublishInFather(initLog.debug, Face_1, Face_1_vertex_9, 'Face_1:vertex_9' )
geomPublish(initLog.debug, Line_2, 'Line_2' )
geomPublishInFather(initLog.debug, Face_1, Face_1_vertex_19, 'Face_1:vertex_19' )
geomPublishInFather(initLog.debug, Face_1, Face_1_vertex_7, 'Face_1:vertex_7' )
geomPublish(initLog.debug, Line_3, 'Line_3' )
geomPublish(initLog.debug, Line_4, 'Line_4' )
geompy.addToStudy( coupe_vis, 'coupe_vis' )
geompy.addToStudyInFather( coupe_vis, tige, 'tige' )
geompy.addToStudyInFather( coupe_vis, section, 'section' )
geompy.addToStudyInFather( coupe_vis, tige_haute, 'tige_haute' )
geompy.addToStudyInFather( coupe_vis, rond, 'rond' )
geompy.addToStudyInFather( coupe_vis, tete, 'tete' )
geompy.addToStudyInFather( coupe_vis, section_tete, 'section_tete' )
geompy.addToStudyInFather( coupe_vis, conge, 'conge' )
geompy.addToStudyInFather( coupe_vis, appui, 'appui' )
geompy.addToStudyInFather( coupe_vis, p_imp, 'p_imp' )
Vertex_4 = geompy.MakeVertex(11.25, 98.75, 0)
Vertex_5 = geompy.MakeVertexWithRef(Vertex_4, -0.5, 0.5, 0)
Vertex_6 = geompy.MakeVertexWithRef(Vertex_4, -5, 5, 0)
@ -119,80 +144,54 @@ Revolution_2 = geompy.MakeRevolution2Ways(generatrice, OY, 65*math.pi/180.0)
Fissure = geompy.MakeCommonList([Extrusion_1, Revolution_2], True)
fondFiss = geompy.CreateGroup(Fissure, geompy.ShapeType["EDGE"])
geompy.UnionIDs(fondFiss, [9, 7, 4])
geompy.ExportBREP(Fissure, os.path.join(gmu.pathBloc, "materielCasTests", "visFiss.brep"))
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( Sketch_1, 'Sketch_1' )
geompy.addToStudy( Face_1, 'Face_1' )
geompy.addToStudy( Vertex_1, 'Vertex_1' )
geompy.addToStudy( Vertex_2, 'Vertex_2' )
geompy.addToStudy( Vertex_3, 'Vertex_3' )
geompy.addToStudyInFather( Face_1, Face_1_vertex_17, 'Face_1:vertex_17' )
geompy.addToStudy( Line_1, 'Line_1' )
geompy.addToStudyInFather( Face_1, Face_1_vertex_9, 'Face_1:vertex_9' )
geompy.addToStudy( Line_2, 'Line_2' )
geompy.addToStudyInFather( Face_1, Face_1_vertex_19, 'Face_1:vertex_19' )
geompy.addToStudyInFather( Face_1, Face_1_vertex_7, 'Face_1:vertex_7' )
geompy.addToStudy( Line_3, 'Line_3' )
geompy.addToStudy( Line_4, 'Line_4' )
geompy.addToStudy( coupe_vis, 'coupe_vis' )
geompy.addToStudyInFather( coupe_vis, tige, 'tige' )
geompy.addToStudyInFather( coupe_vis, section, 'section' )
geompy.addToStudyInFather( coupe_vis, tige_haute, 'tige_haute' )
geompy.addToStudyInFather( coupe_vis, rond, 'rond' )
geompy.addToStudyInFather( coupe_vis, tete, 'tete' )
geompy.addToStudyInFather( coupe_vis, section_tete, 'section_tete' )
geompy.addToStudyInFather( coupe_vis, conge, 'conge' )
geompy.addToStudyInFather( coupe_vis, appui, 'appui' )
geompy.addToStudyInFather( coupe_vis, p_imp, 'p_imp' )
geompy.addToStudy( Vertex_4, 'Vertex_4' )
geompy.addToStudy( Vertex_6, 'Vertex_6' )
geompy.addToStudy( Vertex_5, 'Vertex_5' )
geompy.addToStudy( Line_5, 'Line_5' )
geompy.addToStudy( Partition_1, 'Partition_1' )
geompy.addToStudyInFather( Partition_1, Vertex_7, 'Vertex_7' )
geompy.addToStudy( Vertex_8, 'Vertex_8' )
geompy.addToStudy( generatrice, 'generatrice' )
geompy.addToStudy( Revolution_1, 'Revolution_1' )
geompy.addToStudy( Partition_2, 'Partition_2' )
geompy.addToStudyInFather( Partition_2, Partition_2_vertex_11, 'Partition_2:vertex_11' )
geompy.addToStudy( Plane_1, 'Plane_1' )
geompy.addToStudy( Partition_3, 'Partition_3' )
geompy.addToStudy( Vertex_9, 'Vertex_9' )
geompy.addToStudy( Vertex_10, 'Vertex_10' )
geompy.addToStudy( Vertex_11, 'Vertex_11' )
geompy.addToStudy( Vertex_12, 'Vertex_12' )
geompy.addToStudy( Vertex_13, 'Vertex_13' )
geompy.addToStudy( Vertex_14, 'Vertex_14' )
geompy.addToStudy( Vertex_15, 'Vertex_15' )
geompy.addToStudy( Vertex_16, 'Vertex_16' )
geompy.addToStudy( Arc_1, 'Arc_1' )
geompy.addToStudy( Arc_2, 'Arc_2' )
geompy.addToStudy( Line_6, 'Line_6' )
geompy.addToStudy( Line_8, 'Line_8' )
geompy.addToStudy( Wire_1, 'Wire_1' )
geompy.addToStudy( Face_2, 'Face_2' )
geompy.addToStudy( Extrusion_1, 'Extrusion_1' )
geompy.addToStudy( Revolution_2, 'Revolution_2' )
geompy.addToStudy( Fissure, 'Fissure' )
geomPublish(initLog.debug, Vertex_4, 'Vertex_4' )
geomPublish(initLog.debug, Vertex_6, 'Vertex_6' )
geomPublish(initLog.debug, Vertex_5, 'Vertex_5' )
geomPublish(initLog.debug, Line_5, 'Line_5' )
geomPublish(initLog.debug, Partition_1, 'Partition_1' )
geomPublishInFather(initLog.debug, Partition_1, Vertex_7, 'Vertex_7' )
geomPublish(initLog.debug, Vertex_8, 'Vertex_8' )
geomPublish(initLog.debug, generatrice, 'generatrice' )
geomPublish(initLog.debug, Revolution_1, 'Revolution_1' )
geomPublish(initLog.debug, Partition_2, 'Partition_2' )
geomPublishInFather(initLog.debug, Partition_2, Partition_2_vertex_11, 'Partition_2:vertex_11' )
geomPublish(initLog.debug, Plane_1, 'Plane_1' )
geomPublish(initLog.debug, Partition_3, 'Partition_3' )
geomPublish(initLog.debug, Vertex_9, 'Vertex_9' )
geomPublish(initLog.debug, Vertex_10, 'Vertex_10' )
geomPublish(initLog.debug, Vertex_11, 'Vertex_11' )
geomPublish(initLog.debug, Vertex_12, 'Vertex_12' )
geomPublish(initLog.debug, Vertex_13, 'Vertex_13' )
geomPublish(initLog.debug, Vertex_14, 'Vertex_14' )
geomPublish(initLog.debug, Vertex_15, 'Vertex_15' )
geomPublish(initLog.debug, Vertex_16, 'Vertex_16' )
geomPublish(initLog.debug, Arc_1, 'Arc_1' )
geomPublish(initLog.debug, Arc_2, 'Arc_2' )
geomPublish(initLog.debug, Line_6, 'Line_6' )
geomPublish(initLog.debug, Line_8, 'Line_8' )
geomPublish(initLog.debug, Wire_1, 'Wire_1' )
geomPublish(initLog.debug, Face_2, 'Face_2' )
geomPublish(initLog.debug, Extrusion_1, 'Extrusion_1' )
geomPublish(initLog.debug, Revolution_2, 'Revolution_2' )
geompy.addToStudy( Fissure, 'vis_Fissure' )
geompy.addToStudyInFather( Fissure, fondFiss, 'fondFiss' )
ficcao = os.path.join(gmu.pathBloc, "materielCasTests", "visFiss.brep")
text = ".. Exportation de la géométrie de la fissure dans le fichier '{}'".format(ficcao)
logging.info(text)
geompy.ExportBREP(Fissure, ficcao)
###
### SMESH component
###
logging.info("Maillage de {}".format(coupe_vis.GetName()))
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
logging.info("Maillage de %s", coupe_vis.GetName())
smesh = smeshBuilder.New()
coupe_vis_1 = smesh.Mesh(coupe_vis)
putName(coupe_vis_1.GetMesh(), 'coupe_vis')
Regular_1D = coupe_vis_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
Quadrangle_2D = coupe_vis_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
@ -201,15 +200,22 @@ Nb_Segments_2 = Regular_1D_1.NumberOfSegments(30)
Regular_1D_2 = coupe_vis_1.Segment(geom=section)
Nb_Segments_3 = Regular_1D_2.NumberOfSegments(10,1,[ 7, 11, 16, 23 ])
tige_1 = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE)
section_1 = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE)
tige_haute_1 = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE)
rond_1 = coupe_vis_1.GroupOnGeom(rond,'rond',SMESH.EDGE)
tete_1 = coupe_vis_1.GroupOnGeom(tete,'tete',SMESH.EDGE)
section_tete_1 = coupe_vis_1.GroupOnGeom(section_tete,'section_tete',SMESH.EDGE)
conge_1 = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
appui_1 = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
p_imp_1 = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(tige,'tige',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(section,'section',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(tige_haute,'tige_haute',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(rond,'rond',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(tete,'tete',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(section_tete,'section_tete',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(conge,'conge',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(appui,'appui',SMESH.EDGE)
_ = coupe_vis_1.GroupOnGeom(p_imp,'p_imp',SMESH.EDGE)
## set object names
#smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
#smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
putName(Nb_Segments_1, 'Nb. Segments_1', i_pref='vis')
putName(Nb_Segments_2, 'Nb. Segments_2', i_pref='vis')
putName(Nb_Segments_3, 'Nb. Segments_3', i_pref='vis')
is_done = coupe_vis_1.Compute()
text = "coupe_vis_1.Compute"
@ -238,64 +244,16 @@ else:
raise Exception(text)
visHex80 = smesh.CopyMesh( coupe_vis_1, 'visHex80', 1, 0)
putName(visHex80.GetMesh(), 'visHex80')
_ = visHex80.RotationSweepObjects( [ visHex80 ], [ visHex80 ], [ visHex80 ], SMESH.AxisStruct( 0, 0, 0, 0, 10, 0 ), 0.0785398, 40, 1e-05, 1 )
[ tige_2, section_2, tige_haute_2, rond_2, tete_2, section_tete_2, conge_2, appui_2, p_imp_2, \
tige_rotated, tige_top, section_rotated, section_top, tige_haute_rotated, tige_haute_top, \
rond_rotated, rond_top, tete_rotated, tete_top, section_tete_rotated, section_tete_top, \
conge_rotated, conge_top, appui_rotated, appui_top, p_imp_rotated, p_imp_top ] = visHex80.GetGroups()
Sub_mesh_1 = Regular_1D_1.GetSubMesh()
Sub_mesh_2 = Regular_1D_2.GetSubMesh()
visHex80.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "visSain.med"))
ficmed = os.path.join(gmu.pathBloc, "materielCasTests","visSain.med")
text = ".. Archivage du maillage dans le fichier '{}'".format(ficmed)
logging.info(text)
visHex80.ExportMED(ficmed)
## Set names of Mesh objects
smesh.SetName(tige_2, 'tige')
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
smesh.SetName(Nb_Segments_2, 'Nb. Segments_2')
smesh.SetName(Nb_Segments_1, 'Nb. Segments_1')
smesh.SetName(Nb_Segments_3, 'Nb. Segments_3')
smesh.SetName(coupe_vis_1.GetMesh(), 'coupe_vis')
smesh.SetName(visHex80.GetMesh(), 'visHex80')
smesh.SetName(p_imp_top, 'p_imp_top')
smesh.SetName(appui_top, 'appui_top')
smesh.SetName(conge_top, 'conge_top')
smesh.SetName(section_tete_top, 'section_tete_top')
smesh.SetName(tete_top, 'tete_top')
smesh.SetName(rond_top, 'rond_top')
smesh.SetName(tige_haute_top, 'tige_haute_top')
smesh.SetName(section_top, 'section_top')
smesh.SetName(tige_top, 'tige_top')
smesh.SetName(Sub_mesh_2, 'Sub-mesh_2')
smesh.SetName(Sub_mesh_1, 'Sub-mesh_1')
smesh.SetName(p_imp_1, 'p_imp')
smesh.SetName(p_imp_rotated, 'p_imp_rotated')
smesh.SetName(appui_1, 'appui')
smesh.SetName(appui_rotated, 'appui_rotated')
smesh.SetName(conge_rotated, 'conge_rotated')
smesh.SetName(section_tete_rotated, 'section_tete_rotated')
smesh.SetName(tete_rotated, 'tete_rotated')
smesh.SetName(rond_rotated, 'rond_rotated')
smesh.SetName(tige_haute_rotated, 'tige_haute_rotated')
smesh.SetName(section_rotated, 'section_rotated')
smesh.SetName(tige_1, 'tige')
smesh.SetName(tige_rotated, 'tige_rotated')
smesh.SetName(tige_haute_1, 'tige_haute')
smesh.SetName(section_1, 'section')
smesh.SetName(tete_1, 'tete')
smesh.SetName(rond_1, 'rond')
smesh.SetName(conge_1, 'conge')
smesh.SetName(appui_2, 'appui')
smesh.SetName(section_tete_1, 'section_tete')
smesh.SetName(p_imp_2, 'p_imp')
smesh.SetName(section_tete_2, 'section_tete')
smesh.SetName(conge_2, 'conge')
smesh.SetName(rond_2, 'rond')
smesh.SetName(tete_2, 'tete')
smesh.SetName(section_2, 'section')
smesh.SetName(tige_haute_2, 'tige_haute')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser()