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 selon le rayon de courbure du fond de fissure"""
25 from .geomsmesh import geompy
26 from .geomsmesh import smesh
28 from .putName import putName
30 def calculePointsAxiauxPipe_a(facesDefaut, centreFondFiss, wireFondFiss, \
33 """Maillage selon le rayon de courbure du fond de fissure"""
37 # Rayon de courbure maximal
39 for filling in facesDefaut:
40 disfond.append(geompy.MinDistance(centreFondFiss, filling))
43 texte = "rcourb: {}, lenSegPipe: {}".format(disfond[0], lenSegPipe)
47 lgmin = lenSegPipe*0.25
48 lgmax = lenSegPipe*1.5
49 # la déflexion ets la distance maximale entre une arête du maillage et la courbe support
50 nbSegQuart = 5 # on veut 5 segments min sur un quart de cercle
51 alpha = math.pi/(4*nbSegQuart)
52 deflexion = disfond[0]*(1.0 -math.cos(alpha))
53 texte = "==> lgmin: {}, lgmax: {}, deflexion: {}".format(deflexion, lgmin, lgmax)
56 meshFondFiss = smesh.Mesh(wireFondFiss)
57 putName(meshFondFiss, "wireFondFiss", i_pref=nro_cas)
58 algo1d = meshFondFiss.Segment()
59 putName(algo1d.GetSubMesh(), "wireFondFiss", i_pref=nro_cas)
60 hypo1d = algo1d.Adaptive(lgmin, lgmax, deflexion) # a ajuster selon la profondeur de la fissure
61 putName(hypo1d, "Adaptive_wireFondFiss", i_pref=nro_cas)
63 is_done = meshFondFiss.Compute()
64 text = "calculePointsAxiauxPipe meshFondFiss.Compute"
68 text = "Erreur au calcul du maillage.\n" + text