X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2FmaterielCasTests%2FfissureGauche2.py;h=aa3f3300bbd8afb45c573ab4949712c882dab179;hb=d7ce9e283f7e6671e4b9d65f89b6320d6f57774b;hp=c2fcbb0c45bfb5a42899f01e3bd9d74985d9e503;hpb=bd7477efc255f965c479d88d1be1ee3dbf4aa760;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py index c2fcbb0c4..aa3f3300b 100644 --- a/src/Tools/blocFissure/materielCasTests/fissureGauche2.py +++ b/src/Tools/blocFissure/materielCasTests/fissureGauche2.py @@ -1,4 +1,24 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2014-2021 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import logging import sys import salome @@ -35,7 +55,7 @@ Extrusion_2 = geompy.MakePrismVecH(Circle_3, OZ, 1000) Partition_1 = geompy.MakePartition([Extrusion_1], [Extrusion_2], [], [], geompy.ShapeType["FACE"], 0, [], 0) [Face_1,Face_2] = geompy.SubShapes(Partition_1, [18, 13]) FaceFissExt = geompy.MakeFuse(Face_2, Face_1) -geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2Fiss.brep")) +geompy.ExportBREP(FaceFissExt, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2Fiss.brep")) Vertex_2 = geompy.MakeVertex(0, -500, 0) Vertex_3 = geompy.MakeVertex(400, 500, 800) objetSain = geompy.MakeBoxTwoPnt(Vertex_3, Vertex_2) @@ -46,7 +66,7 @@ geompy.addToStudy( Partition_2, 'Partition_2' ) geompy.addToStudyInFather( Partition_2, FaceFissExtSimple, 'FaceFissExtSimple' ) Plane_1 = geompy.MakePlaneLCS(None, 2000, 3) FaceFissExtCoupe = geompy.MakePartition([FaceFissExtSimple], [Plane_1], [], [], geompy.ShapeType["FACE"], 0, [], 0) -geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests/faceGauche2FissCoupe.brep")) +geompy.ExportBREP(FaceFissExtCoupe, os.path.join(gmu.pathBloc, "materielCasTests", "faceGauche2FissCoupe.brep")) geompy.addToStudy( O, 'O' ) geompy.addToStudy( OX, 'OX' ) geompy.addToStudy( OY, 'OY' ) @@ -77,14 +97,23 @@ from salome.smesh import smeshBuilder smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder Mesh_1 = smesh.Mesh(objetSain) +smesh.SetName(Mesh_1, 'Mesh_1') Regular_1D = Mesh_1.Segment() Nb_Segments_1 = Regular_1D.NumberOfSegments(15,[],[ ]) Nb_Segments_1.SetDistrType( 0 ) Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE) Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa) -isDone = Mesh_1.Compute() -smesh.SetName(Mesh_1, 'Mesh_1') -Mesh_1.ExportMED( os.path.join(gmu.pathBloc, "materielCasTests/boiteSaine.med"), 0, SMESH.MED_V2_2, 1 ) + +is_done = Mesh_1.Compute() +text = "Mesh_1.Compute" +if is_done: + logging.info(text+" OK") +else: + text = "Erreur au calcul du maillage.\n" + text + logging.info(text) + raise Exception(text) + +Mesh_1.ExportMED(os.path.join(gmu.pathBloc, "materielCasTests", "boiteSaine.med")) ## set object names smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')