X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FcasStandard.py;h=9c542cbfdefc901489f7d3da7da640d86a49aab5;hp=b0bca4ec19438462f0f59fa302076e36fce89500;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=5482b99d07dd144fd5be299e722f39a81de3b5be diff --git a/src/Tools/blocFissure/gmu/casStandard.py b/src/Tools/blocFissure/gmu/casStandard.py index b0bca4ec1..9c542cbfd 100644 --- a/src/Tools/blocFissure/gmu/casStandard.py +++ b/src/Tools/blocFissure/gmu/casStandard.py @@ -1,10 +1,28 @@ # -*- 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 os -from geomsmesh import geompy, smesh -from geomsmesh import geomPublish -from geomsmesh import geomPublishInFather -import initLog +from .geomsmesh import geompy, smesh +from .geomsmesh import geomPublish +from .geomsmesh import geomPublishInFather +from . import initLog import math import GEOM @@ -15,13 +33,13 @@ import SMESH #import NETGENPlugin import logging -from fissureGenerique import fissureGenerique +from .fissureGenerique import fissureGenerique -from initEtude import initEtude -from triedreBase import triedreBase -from genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut -from creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain -from construitFissureGenerale import construitFissureGenerale +from .initEtude import initEtude +from .triedreBase import triedreBase +from .genereMeshCalculZoneDefaut import genereMeshCalculZoneDefaut +from .creeZoneDefautDansObjetSain import creeZoneDefautDansObjetSain +from .construitFissureGenerale import construitFissureGenerale O, OX, OY, OZ = triedreBase() @@ -39,23 +57,31 @@ class casStandard(fissureGenerique): initEtude() self.references = references self.dicoParams = dicoParams - if self.dicoParams.has_key('nomCas'): + if 'nomCas' in self.dicoParams: self.nomCas = self.dicoParams['nomCas'] + elif 'nomres' in self.dicoParams: + self.nomCas = os.path.splitext(os.path.split(self.dicoParams['nomres'])[1])[0] else: - self.nomCas = 'casStandard' + self.nomCas = 'casStandard' + if 'reptrav' in self.dicoParams: + self.reptrav = self.dicoParams['reptrav'] + else: + self.reptrav = '.' self.numeroCas = numeroCas if self.numeroCas != 0: self.nomCas = self.nomProbleme +"_%d"%(self.numeroCas) else: self.nomProbleme = self.nomCas - if self.dicoParams.has_key('lenSegPipe'): + if 'lenSegPipe' in self.dicoParams: self.lenSegPipe = self.dicoParams['lenSegPipe'] else: self.lenSegPipe =self.dicoParams['rayonPipe'] - if self.dicoParams.has_key('step'): + if 'step' in self.dicoParams: step = self.dicoParams['step'] else: step = -1 # exécuter toutes les étapes + if 'aretesVives' not in self.dicoParams: + self.dicoParams['aretesVives'] = 0 if self.numeroCas == 0: # valeur par défaut : exécution immédiate, sinon execution différée dans le cas d'une liste de problèmes self.executeProbleme(step) @@ -78,7 +104,7 @@ class casStandard(fissureGenerique): pointIn_x : optionnel : coordonnée x d'un point dans le solide sain (pour orienter la face - idem avec y,z) """ logging.info("setParamShapeFissure %s", self.nomCas) - if self.dicoParams.has_key('pointInterieur'): + if 'pointInterieur' in self.dicoParams: self.shapeFissureParams = dict(lgInfluence = self.dicoParams['lgInfluence'], rayonPipe = self.dicoParams['rayonPipe'], lenSegPipe = self.lenSegPipe, @@ -96,7 +122,7 @@ class casStandard(fissureGenerique): lgInfluence = shapeFissureParams['lgInfluence'] - shellFiss = geompy.ImportFile( self.dicoParams['brepFaceFissure'], "BREP") + shellFiss = geompy.ImportBREP( self.dicoParams['brepFaceFissure']) fondFiss = geompy.CreateGroup(shellFiss, geompy.ShapeType["EDGE"]) geompy.UnionIDs(fondFiss, self.dicoParams['edgeFissIds'] ) geomPublish(initLog.debug, shellFiss, 'shellFiss' ) @@ -110,12 +136,13 @@ class casStandard(fissureGenerique): # --------------------------------------------------------------------------- def setParamMaillageFissure(self): - self.maillageFissureParams = dict(nomRep = '.', - nomFicSain = self.nomCas, - nomFicFissure = 'fissure_' + self.nomCas, + self.maillageFissureParams = dict(nomRep = self.reptrav, + nomFicSain = self.nomCas +'_sain', + nomFicFissure = self.nomCas, nbsegRad = self.dicoParams['nbSegRad'], nbsegCercle = self.dicoParams['nbSegCercle'], - areteFaceFissure = self.dicoParams['areteFaceFissure']) + areteFaceFissure = self.dicoParams['areteFaceFissure'], + aretesVives = self.dicoParams['aretesVives']) # --------------------------------------------------------------------------- def genereZoneDefaut(self, geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams):