X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FgenereMeshCalculZoneDefaut.py;h=90942514a20be717179206532c0789b3c23f9463;hp=8e296f2cf4e0c5d4c21cb6022a4aa045395fb0d3;hb=0068dfdcb1ee619cb96d637e7384d6e341e71cff;hpb=442fd64c19a6e27a339ca36264c15ec91732cf32 diff --git a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py index 8e296f2cf..90942514a 100644 --- a/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py +++ b/src/Tools/blocFissure/gmu/genereMeshCalculZoneDefaut.py @@ -1,4 +1,22 @@ # -*- coding: utf-8 -*- +# Copyright (C) 2014-2020 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 from .geomsmesh import smesh @@ -21,8 +39,10 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): -SetQuadAllowed = permission quadrangle dans maillage triangle -On récupère les coordonnées de chaque noeud de la fissure qu'on stocke dans une liste sous la forme : [X0, Y0, Z0, ..., Xn, Yn, Zn]""" - + logging.info('start') + text = "Maillage de '{}'".format(facefiss.GetName()) + logging.info(text) meshFissure = smesh.Mesh(facefiss) algo2d = meshFissure.Triangle(algo=smeshBuilder.NETGEN_1D2D) @@ -33,15 +53,26 @@ def genereMeshCalculZoneDefaut(facefiss, minSize, maxSize): hypo2d.SetFineness( 2 ) hypo2d.SetMinSize( minSize ) hypo2d.SetQuadAllowed( 0 ) - isDone = meshFissure.Compute() smesh.SetName(algo2d, "algo2d_zoneFiss") smesh.SetName(hypo2d, "hypo1d_zoneFiss") - coordsNoeudsFissure = [] + is_done = meshFissure.Compute() + text = "meshFissure.Compute" + if is_done: + logging.info(text+" OK") + else: + text = "Erreur au calcul du maillage.\n" + text + logging.info(text) + raise Exception(text) + + coordsNoeudsFissure = list() nodeIds = meshFissure.GetNodesId() for id in nodeIds: coords = meshFissure.GetNodeXYZ(id) coordsNoeudsFissure.append(coords[0]) coordsNoeudsFissure.append(coords[1]) coordsNoeudsFissure.append(coords[2]) + + logging.info('end') + return coordsNoeudsFissure