Salome HOME
Correction du cas-test faceGauche2
[modules/smesh.git] / src / Tools / blocFissure / CasTests / eprouvetteDroite_2.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 """problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan"""
21
22 import os
23 from blocFissure import gmu
24 from blocFissure.gmu.geomsmesh import geompy, smesh
25
26 import GEOM
27 import SALOMEDS
28 import SMESH
29 import logging
30
31 from .eprouvetteDroite import eprouvetteDroite
32
33 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
34
35 class eprouvetteDroite_2(eprouvetteDroite):
36   """problème de fissure plane coupant 3 faces (éprouvette), débouches non normaux, objet plan"""
37
38   nomProbleme = "eprouvetteDroite_2"
39
40   # ---------------------------------------------------------------------------
41   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams, \
42                                 mailleur="MeshGems"):
43     logging.info("genereShapeFissure %s", self.nomCas)
44
45     lgInfluence = shapeFissureParams['lgInfluence']
46
47     shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests", "EprouvetteDroiteFiss_2.brep"))
48     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
49     geompy.UnionIDs(fondFiss, [10])
50     geompy.addToStudy( shellFiss, 'shellFiss' )
51     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
52
53     mailleur = self.mailleur2d3d()
54     coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,10, mailleur, self.numeroCas)
55
56     centre = None
57     return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
58
59   # ---------------------------------------------------------------------------
60   def setReferencesMaillageFissure(self):
61     self.referencesMaillageFissure = dict( \
62                                           Entity_Quad_Quadrangle = 3724, \
63                                           Entity_Quad_Hexa = 9504, \
64                                           Entity_Node = 54049, \
65                                           Entity_Quad_Edge = 478, \
66                                           Entity_Quad_Triangle = 724, \
67                                           Entity_Quad_Tetra = 6766, \
68                                           Entity_Quad_Pyramid = 396, \
69                                           Entity_Quad_Penta = 96 \
70                                          )