1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 """Maillage du pipe"""
26 from .geomsmesh import smesh
27 from .putName import putName
29 from .construitMaillagePipe_a import construitMaillagePipe_a
30 from .construitMaillagePipe_b import construitMaillagePipe_b
31 from .construitMaillagePipe_c import construitMaillagePipe_c
32 from .construitMaillagePipe_d import construitMaillagePipe_d
34 def construitMaillagePipe(gptsdisks, idisklim, nbsegCercle, nbsegRad, \
36 """maillage effectif du pipe"""
38 logging.info("nbsegCercle = %d, nbsegRad = %d", nbsegCercle, nbsegRad)
39 logging.info("idisklim[0] = %d, idisklim[1] = %d", idisklim[0], idisklim[1])
41 meshPipe = smesh.Mesh(None, "meshPipe")
42 putName(meshPipe, "meshPipe", i_pref=nro_cas)
44 edgesCircPipeGroup = list()
46 fondFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "FONDFISS")
47 nodesFondFissGroup = meshPipe.CreateEmptyGroup(SMESH.NODE, "nfondfis")
48 faceFissGroup = meshPipe.CreateEmptyGroup(SMESH.FACE, "fisInPi")
49 edgeFaceFissGroup = meshPipe.CreateEmptyGroup(SMESH.EDGE, "edgeFaceFiss")
51 mptdsk = list() # vertices de chaque disque au fur et à mesure
52 mptsdisks = list() # vertices maillage de tous les disques
53 mEdges = list() # identifiants edges maillage fond de fissure
54 mEdgeFaces = list() # identifiants edges maillage edge face de fissure externe
55 mFaces = list() # identifiants faces maillage fissure
56 mVols = list() # identifiants volumes maillage pipe
58 for idisk in range(idisklim[0], idisklim[1]+1): # boucle sur les disques internes
59 #logging.info(". Prise en compte du disque n°%d", idisk)
61 # -----------------------------------------------------------------------
65 mptdsk = construitMaillagePipe_a(idisk, \
66 gptsdisks, nbsegCercle, \
69 # -----------------------------------------------------------------------
70 # --- Les groupes des edges des cercles débouchants
72 if idisk in (idisklim[0],idisklim[1]):
73 construitMaillagePipe_b(idisk, \
74 idisklim, nbsegCercle, \
78 # -----------------------------------------------------------------------
79 # --- Les groupes des faces débouchantes
81 if idisk in (idisklim[0],idisklim[1]):
82 construitMaillagePipe_c(idisk, \
83 idisklim, nbsegCercle, \
84 meshPipe, mptdsk, nbsegRad)
86 # -----------------------------------------------------------------------
87 # --- mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure
89 construitMaillagePipe_d(idisk, \
90 idisklim, nbsegCercle, nbsegRad, \
91 meshPipe, mptdsk, oldmpts, \
92 fondFissGroup, edgeFaceFissGroup, faceFissGroup, \
93 mEdges, mEdgeFaces, mFaces, mVols, nodesFondFissGroup)
96 pipeFissGroup = meshPipe.CreateEmptyGroup( SMESH.VOLUME, 'PIPEFISS' )
97 _ = pipeFissGroup.AddFrom( meshPipe.GetMesh() )
99 _, _, _ = meshPipe.MakeBoundaryElements(SMESH.BND_2DFROM3D, "pipeBoundaries")
102 #text = "Arrêt rapide.\n"
104 #raise Exception(text)
106 return (meshPipe, edgeFaceFissGroup, edgesCircPipeGroup)