1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2020 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 """Insertion de fissure longue - maillage meshBoiteDefaut"""
24 from .geomsmesh import smesh
25 from salome.smesh import smeshBuilder
28 from .putName import putName
30 def insereFissureLongue_d (internalBoundary, meshFondFiss, meshFacePeau, meshFaceFiss, \
32 """maillage meshBoiteDefaut"""
35 meshBoiteDefaut = smesh.Concatenate( [internalBoundary.GetMesh(), \
36 meshFondFiss.GetMesh(), \
37 meshFacePeau.GetMesh(), \
38 meshFaceFiss.GetMesh()], \
40 # pour aider l'algo hexa-tetra a ne pas mettre de pyramides a l'exterieur des volumes replies sur eux-memes
41 # on designe les faces de peau en quadrangles par le groupe "skinFaces"
42 group_faceFissOutPipe = None
43 group_faceFissInPipe = None
44 groups = meshBoiteDefaut.GetGroups()
46 if grp.GetType() == SMESH.FACE:
47 #if "internalBoundary" in grp.GetName():
48 # grp.SetName("skinFaces")
49 if grp.GetName() == "fisOutPi":
50 group_faceFissOutPipe = grp
51 elif grp.GetName() == "fisInPi":
52 group_faceFissInPipe = grp
54 # le maillage NETGEN ne passe pas toujours ==> utiliser GHS3D
56 algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.GHS3D)
58 algo3d = meshBoiteDefaut.Tetrahedron(algo=smeshBuilder.NETGEN)
59 hypo3d = algo3d.MaxElementVolume(1000.0)
60 putName(algo3d.GetSubMesh(), "boiteDefaut")
61 putName(algo3d, "algo3d_boiteDefaut")
62 putName(meshBoiteDefaut, "boiteDefaut")
64 is_done = meshBoiteDefaut.Compute()
65 text = "meshBoiteDefaut.Compute"
67 logging.info(text+" OK")
69 text = "Erreur au calcul du maillage.\n" + text
73 return meshBoiteDefaut, group_faceFissInPipe, group_faceFissOutPipe