Salome HOME
Copyright update 2022
[modules/smesh.git] / src / Tools / blocFissure / CasTests / cylindre_2.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2022  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 plane sur cylindre hexa, fond de fissure complexe : polyline"""
22
23 import os
24 import logging
25
26 from blocFissure import gmu
27 from blocFissure.gmu.geomsmesh import geompy
28
29 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
30
31 from .cylindre import cylindre
32
33 class cylindre_2(cylindre):
34   """problème de fissure plane sur cylindre hexa, fond de fissure complexe : polyline"""
35
36   nomProbleme = "cylindre_2"
37
38   # ---------------------------------------------------------------------------
39   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
40                                 mailleur="MeshGems"):
41     logging.info("genereShapeFissure %s", self.nomCas)
42
43     lgInfluence = shapeFissureParams['lgInfluence']
44
45     shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "FissInCylindre.brep"))
46     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
47     geompy.UnionIDs(fondFiss, [6])
48     geompy.addToStudy( shellFiss, 'shellFiss' )
49     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
50
51     mailleur = self.mailleur2d3d()
52     coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,15, mailleur, self.numeroCas)
53
54     centre = None
55     return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
56
57   # ---------------------------------------------------------------------------
58   def setReferencesMaillageFissure(self):
59     self.referencesMaillageFissure = dict( \
60                                           Entity_Quad_Quadrangle = 7028, \
61                                           Entity_Quad_Hexa = 18366, \
62                                           Entity_Node = 102327, \
63                                           Entity_Quad_Edge = 735, \
64                                           Entity_Quad_Triangle = 1056, \
65                                           Entity_Quad_Tetra = 14255, \
66                                           Entity_Quad_Pyramid = 1158, \
67                                           Entity_Quad_Penta = 384 \
68                                           )