Salome HOME
Merge branch 'master' into gni/evolution
[modules/smesh.git] / src / Tools / blocFissure / CasTests / ellipse_2.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2020  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
21 """problème de fissure non plane, débouchante non normale"""
22
23 import os
24 import logging
25
26 from blocFissure import gmu
27 from blocFissure.gmu.geomsmesh import geompy, smesh
28 from blocFissure.gmu.fissureGenerique import fissureGenerique
29 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
30 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
31 from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
32
33 import GEOM
34 import SALOMEDS
35 import SMESH
36
37 from .ellipse_1 import ellipse_1
38
39 class ellipse_2(ellipse_1):
40   """problème de fissure non plane, débouchante non normale"""
41
42   nomProbleme = "ellipse2"
43
44   # ---------------------------------------------------------------------------
45   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
46     """Importe la géométrie de la fissure"""
47     texte = "genereShapeFissure pour '{}'".format(self.nomCas)
48     logging.info(texte)
49
50     lgInfluence = shapeFissureParams['lgInfluence']
51
52     shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "ellipse1_pb.brep"))
53     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
54     geompy.UnionIDs(fondFiss, [3])
55     geompy.addToStudy( shellFiss, 'shellFiss' )
56     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
57
58     coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
59
60     centre = None
61
62     return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
63
64   # ---------------------------------------------------------------------------
65   def setReferencesMaillageFissure(self):
66     self.referencesMaillageFissure = dict( \
67                                           Entity_Quad_Quadrangle = 1748, \
68                                           Entity_Quad_Hexa = 3795, \
69                                           Entity_Node = 22219, \
70                                           Entity_Quad_Edge = 258, \
71                                           Entity_Quad_Triangle = 434, \
72                                           Entity_Quad_Tetra = 2574, \
73                                           Entity_Quad_Pyramid = 199, \
74                                           Entity_Quad_Penta = 120 \
75                                          )