Salome HOME
simplification
[modules/smesh.git] / src / Tools / blocFissure / gmu / construitMaillagePipe_d.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2021  EDF R&D
3 #
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.
8 #
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.
13 #
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
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 """Mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure"""
21
22 def construitMaillagePipe_d(idisk, \
23                             idisklim, nbsegCercle, nbsegRad, \
24                             meshPipe, mptdsk, oldmpts, \
25                             fondFissGroup, edgeFaceFissGroup, faceFissGroup, \
26                             mEdges, mEdgeFaces, mFaces, mVols, nodesFondFissGroup):
27   """Mailles volumiques, groupes noeuds et edges de fond de fissure, groupe de face de fissure"""
28   #logging.info('start')
29
30   if idisk == idisklim[0]:
31     mEdges.append(0)
32     mEdgeFaces.append(0)
33     mFaces.append([0])
34     mVols.append([[0]])
35     nodesFondFissGroup.Add([mptdsk[0][0]])
36
37   else:
38     ide = meshPipe.AddEdge([oldmpts[0][0], mptdsk[0][0]])
39     mEdges.append(ide)
40     fondFissGroup.Add([ide])
41     nodesFondFissGroup.Add([mptdsk[0][0]])
42     ide2 = meshPipe.AddEdge([oldmpts[0][-1], mptdsk[0][-1]])
43     mEdgeFaces.append(ide2)
44     edgeFaceFissGroup.Add([ide2])
45
46     id_faces = list()
47     id_volumes = list()
48
49     for n_srad in range(nbsegRad):
50       idf = meshPipe.AddFace([oldmpts[0][n_srad], mptdsk[0][n_srad], mptdsk[0][n_srad+1], oldmpts[0][n_srad+1]])
51       faceFissGroup.Add([idf])
52       id_faces.append(idf)
53
54       id_vol_cercle = list()
55       for n_cercle in range(nbsegCercle):
56         n_cercle_1 = n_cercle+1
57         if n_cercle ==  nbsegCercle-1:
58           n_cercle_1 = 0
59         if n_srad == 0:
60           idv = meshPipe.AddVolume([mptdsk[n_cercle][n_srad], mptdsk[n_cercle][n_srad+1], mptdsk[n_cercle_1][n_srad+1], \
61                                     oldmpts[n_cercle][n_srad], oldmpts[n_cercle][n_srad+1], oldmpts[n_cercle_1][n_srad+1]])
62         else:
63           idv = meshPipe.AddVolume([mptdsk[n_cercle][n_srad], mptdsk[n_cercle][n_srad+1], mptdsk[n_cercle_1][n_srad+1], mptdsk[n_cercle_1][n_srad], \
64                                     oldmpts[n_cercle][n_srad], oldmpts[n_cercle][n_srad+1], oldmpts[n_cercle_1][n_srad+1], oldmpts[n_cercle_1][n_srad]])
65         id_vol_cercle.append(idv)
66       id_volumes.append(id_vol_cercle)
67
68     mFaces.append(id_faces)
69     mVols.append(id_volumes)
70
71   return