Salome HOME
[bos #23982] EDF 22984 - aspect ratio of hexa
[modules/smesh.git] / src / Tools / blocFissure / CasTests / ellipse_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
21 import os
22 from blocFissure import gmu
23 from blocFissure.gmu.geomsmesh import geompy, smesh
24
25 import math
26 import GEOM
27 import SALOMEDS
28 import SMESH
29 #import StdMeshers
30 #import GHS3DPlugin
31 #import NETGENPlugin
32 import logging
33
34 from .ellipse_1 import ellipse_1
35
36 from blocFissure.gmu.triedreBase import triedreBase
37 from blocFissure.gmu.genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut
38 from blocFissure.gmu.creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain
39 from blocFissure.gmu.construitFissureGenerale import construitFissureGenerale
40
41 O, OX, OY, OZ = triedreBase()
42
43 class ellipse_2(ellipse_1):
44   """
45   problème de fissure non plane, dĂ©bouchante non normale
46   """
47
48   nomProbleme = "ellipse2"
49
50   # ---------------------------------------------------------------------------
51   def genereShapeFissure( self, geometriesSaines, geomParams, shapeFissureParams):
52     logging.info("genereShapeFissure %s", self.nomCas)
53
54     lgInfluence = shapeFissureParams['lgInfluence']
55
56     shellFiss = geompy.ImportBREP(os.path.join(gmu.pathBloc, "materielCasTests/ellipse1_pb.brep"))
57     fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"])
58     geompy.UnionIDs(fondFiss, [3])
59     geompy.addToStudy( shellFiss, 'shellFiss' )
60     geompy.addToStudyInFather( shellFiss, fondFiss, 'fondFiss' )
61
62
63     coordsNoeudsFissure = genereMeshCalculZoneDefaut(shellFiss, 5 ,25)
64
65     centre = None
66     return [shellFiss, centre, lgInfluence, coordsNoeudsFissure, fondFiss]
67
68   # ---------------------------------------------------------------------------
69   def setReferencesMaillageFissure(self):
70     self.referencesMaillageFissure = dict(Entity_Quad_Pyramid    = 159,
71                                           Entity_Quad_Triangle   = 438,
72                                           Entity_Quad_Edge       = 249,
73                                           Entity_Quad_Penta      = 80,
74                                           Entity_Quad_Hexa       = 3635,
75                                           Entity_Node            = 20519,
76                                           Entity_Quad_Tetra      = 1973,
77                                           Entity_Quad_Quadrangle = 1658)