From: PASCALE NOYRET Date: Thu, 25 Nov 2021 14:58:27 +0000 (+0100) Subject: Traducteur devient Traducteur2 ( python 2) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a9550690021ad4845f2241cb5e917a61f1d7febd;p=tools%2Feficas.git Traducteur devient Traducteur2 ( python 2) --- diff --git a/Extensions/pluginloader.py b/Extensions/pluginloader.py index 6dbd8342..ff6cf249 100644 --- a/Extensions/pluginloader.py +++ b/Extensions/pluginloader.py @@ -24,9 +24,9 @@ from __future__ import absolute_import import glob,os,sys,traceback try: - from UserDict import UserDict -except ImportError: from collections import UserDict +except ImportError: + from UserDict import UserDict class PluginLoader(UserDict): diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index 95f75811..fbbcf3ed 100755 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -57,6 +57,7 @@ def lanceEficas(code=None, multi=False, langue='en', labelCode=None): from InterfaceQT4.qtEficas import Appli app = QApplication(sys.argv) + app.setStyleSheet("QWidget { font: 19px}") Eficas=Appli(code=code,salome=0,multi=multi,langue=langue,labelCode=labelCode) Eficas.show() diff --git a/InterfaceQT4/monWidgetMatrice.py b/InterfaceQT4/monWidgetMatrice.py index 02fb9311..bf32798e 100644 --- a/InterfaceQT4/monWidgetMatrice.py +++ b/InterfaceQT4/monWidgetMatrice.py @@ -51,6 +51,7 @@ class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille): self.nbLigs=0 self.nbCols=0 self.creeColonnes() + self.createListePossibles() self.connecterSignaux() self.initialValeur() @@ -66,6 +67,9 @@ class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille): QTableWidget.focusOutEvent(self.TBMatrice,event) + def createListePossibles(self) : + print (dir(self.monType)) + def itemChanged(self): monItem=self.TBMatrice.currentItem() if monItem==None : return @@ -97,7 +101,7 @@ class MonWidgetMatrice (Ui_desWidgetMatrice,Feuille): try: MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille](*(self,)) except : - QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille ) + QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + self.monType.methodeCalculTaille ) return else : self.nbLigs=self.monType.nbLigs @@ -208,7 +212,7 @@ class MonWidgetMatriceOT (MonWidgetMatrice): try: MonWidgetMatrice.__dict__[self.monType.methodeCalculTaille](*(self,)) except : - QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + monType.methodeCalculTaille ) + QMessageBox.critical( self, tr("Mauvaise execution "),tr( "impossible d executer la methode ") + self.monType.methodeCalculTaille ) return else : self.nbLigs=self.monType.nbLigs @@ -244,6 +248,20 @@ class MonWidgetMatriceOT (MonWidgetMatrice): self.TBMatrice.setVerticalHeaderLabels(header) self.TBMatrice.setHorizontalHeaderLabels(header) + def nbDeVariables(self): + # uniquement pour OT + jdc=self.node.item.object.jdc + etape=self.node.item.object.etape + self.listeVariables=jdc.getVariables(etape) + if self.listeVariables == [] : + QMessageBox.critical( self, tr("Mauvaise Commande "),tr( "Aucune variable connue. Entrez les variables avant la matrice")) + return + self.TBMatrice.setColumnCount(len(self.listeVariables)) + self.TBMatrice.setRowCount(len(self.listeVariables)) + self.nbLigs=len(self.listeVariables) + self.nbCols=len(self.listeVariables) + + def initialValeur(self): # uniquement pour OT liste=self.node.item.getValeur() diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index 32896393..b6d04c95 100755 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -29,7 +29,7 @@ import os, sys from PyQt5.QtWidgets import QApplication, QMainWindow, QGridLayout, QBoxLayout, QMenu, QAction, QMessageBox -from PyQt5.QtGui import QIcon +from PyQt5.QtGui import QIcon, QFont from PyQt5.QtCore import Qt, QSize @@ -60,6 +60,9 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow): QMainWindow.__init__(self,parent) Ui_Eficas.__init__(self) + maPolice= QFont("Times", 52) + self.setFont(maPolice) + self.ssIhm=False self.multi=multi self.demande=multi # voir PSEN diff --git a/Noyau/.context.py.swp b/Noyau/.context.py.swp new file mode 100644 index 00000000..1a3e2cfc Binary files /dev/null and b/Noyau/.context.py.swp differ diff --git a/Noyau/N_MCLIST.py b/Noyau/N_MCLIST.py index 45b096df..6d181537 100644 --- a/Noyau/N_MCLIST.py +++ b/Noyau/N_MCLIST.py @@ -34,9 +34,9 @@ from copy import copy import types try: - from UserList import UserList -except ImportError: from collections import UserList +except ImportError: + from UserList import UserList diff --git a/Noyau/N_MCSIMP.py b/Noyau/N_MCSIMP.py index ee7a0989..f7ebfc7b 100644 --- a/Noyau/N_MCSIMP.py +++ b/Noyau/N_MCSIMP.py @@ -1,3 +1,4 @@ +# coding=utf-8 # Copyright (C) 2007-2021 EDF R&D # # This library is free software; you can redistribute it and/or @@ -86,10 +87,8 @@ class MCSIMP(N_OBJECT.OBJECT): else : #PNPN --> chgt pour Vimmp for v in self.valeur : - print (v, type(v)) - v.ajoutUtilisePar(self) - #try : v.ajoutUtilisePar(self) - #except : print ('il y a un souci ici', self.nom, self.valeur) + try : v.ajoutUtilisePar(self) + except : print ('il y a un souci ici', self.nom, self.valeur) self.buildObjPyxb() self.listeNomsObjsCrees = [] diff --git a/Noyau/N_MCSIMP.py.pn b/Noyau/N_MCSIMP.py.pn new file mode 100644 index 00000000..3e2c24bb --- /dev/null +++ b/Noyau/N_MCSIMP.py.pn @@ -0,0 +1,350 @@ +# coding=utf-8 +# Copyright (C) 2007-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. +# +# 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 + + +""" + Ce module contient la classe MCSIMP qui sert à controler la valeur + d'un mot-clé simple par rapport à sa définition portée par un objet + de type ENTITE +""" + +from __future__ import absolute_import +from copy import copy + +from Noyau.N_ASSD import ASSD +from Noyau.N_UserASSDMultiple import UserASSDMultiple +from Noyau.N_CO import CO +from . import N_OBJECT +from .N_CONVERT import ConversionFactory +from .N_types import forceList, isSequence + + +class MCSIMP(N_OBJECT.OBJECT): + + """ + """ + nature = 'MCSIMP' + + def __init__(self, val, definition, nom, parent,objPyxbDeConstruction): + """ + Attributs : + + - val : valeur du mot clé simple + - definition + - nom + - parent + + Autres attributs : + + - valeur : valeur du mot-clé simple en tenant compte de la valeur par défaut + + """ + self.definition = definition + self.nom = nom + self.val = val + self.parent = parent + self.objPyxbDeConstruction = objPyxbDeConstruction + if parent: + self.jdc = self.parent.jdc + if self.jdc : self.cata = self.jdc.cata + else : self.cata = None + self.niveau = self.parent.niveau + self.etape = self.parent.etape + else: + # Le mot cle simple a été créé sans parent + # est-ce possible ? + self.jdc = None + self.cata = None + self.niveau = None + self.etape = None + if self.definition.creeDesObjets : + if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) : + self.convProto = ConversionFactory('UserASSDMultiple', self.definition.creeDesObjetsDeType) + else : + self.convProto = ConversionFactory('UserASSD', self.definition.creeDesObjetsDeType) + else : + self.convProto = ConversionFactory('type', typ=self.definition.type) + self.valeur = self.getValeurEffective(self.val) + if self.definition.utiliseUneReference : + if self.valeur != None: + if not type(self.valeur) in (list, tuple): self.valeur.ajoutUtilisePar(self) + else : + #PNPN --> chgt pour Vimmp + for v in self.valeur : + try : v.ajoutUtilisePar(self) + except : print ('il y a un souci ici', self.nom, self.valeur) + self.buildObjPyxb() + self.listeNomsObjsCrees = [] + + def getValeurEffective(self, val): + """ + Retourne la valeur effective du mot-clé en fonction + de la valeur donnée. Defaut si val == None + Attention aux UserASSD et aux into (exple Wall gp de maille et 'Wall') + """ + #print ('getValeurEffective ________________', val) + if (val is None and hasattr(self.definition, 'defaut')): val = self.definition.defaut + if self.definition.type[0] == 'TXM' and isinstance(val,str) : return val + if self.definition.creeDesObjets : + # isinstance(val, self.definition.creeDesObjetsDeType) ne fonctionne pas car il y a un avec cata devant et l autre non + if val == None : return val + if not isinstance(val,(list,tuple)) : valATraiter=[val,] + else : valATraiter=val + listeRetour=[] + for v in valATraiter: + #print (v.__class__.__name__, self.definition.creeDesObjetsDeType.__name__) + if (not(v.__class__.__name__ == self.definition.creeDesObjetsDeType.__name__)) : + if self.jdc != None and v in list(self.jdc.sdsDict.keys()): v=self.jdc.sdsDict[v] + else : v=self.convProto.convert(v) + if v.parent== None : v.initialiseParent(self) + if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) : + v.ajouteUnPere(self) + else : + if v.nom=='sansNom' : + for leNom,laVariable in self.jdc.g_context.items(): + if id(laVariable)== id(v) and (leNom != 'sansNom'): + v.initialiseNom(leNom) + if v.parent== None : v.initialiseParent(self) + if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) : + v.ajouteUnPere(self) + listeRetour.append(v) + if isinstance(val,(list,tuple)) :newVal=listeRetour + else : newVal=listeRetour[0] + return newVal + if self.convProto: + val = self.convProto.convert(val) + return val + + def creeUserASSDetSetValeur(self, val): + self.state='changed' + nomVal=val + if nomVal in self.jdc.sdsDict.keys(): + if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType): + if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) : + p=self.parent + while p in self.parent : + if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(self.jdc.sdsDict[nomVal]) + else : p.listeDesReferencesCrees=[self.jdc.sdsDict[nomVal],] + p=p.parent + self.jdc.sdsDict[nomVal].ajouteUnPere(self) + #return (1, 'reference ajoutee') + else : + return (0, 'concept non multiple deja reference') + else : return (0, 'concept d un autre type existe deja') + if self.convProto: + objVal = self.convProto.convert(nomVal) + objVal.initialiseNom(nomVal) + if objVal.parent== None : objVal.initialiseParent(self) + objVal.ajouteUnPere(self) + p=self.parent + while p in self.parent : + if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objVal) + else : p.listeDesReferencesCrees=[objVal,] + p=p.parent + return (self.setValeur(objVal), 'reference creee') + + def creeUserASSD(self, val): + self.state='changed' + nomVal=val + if nomVal in self.jdc.sdsDict.keys(): + if isinstance(self.jdc.sdsDict[nomVal],self.definition.creeDesObjetsDeType): + if issubclass(self.definition.creeDesObjetsDeType, UserASSDMultiple) : + p=self.parent + while p in self.parent : + if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(self.jdc.sdsDict[nomVal]) + else : p.listeDesReferencesCrees=[self.jdc.sdsDict[nomVal],] + p=p.parent + self.jdc.sdsDict[nomVal].ajouteUnPere(self) + return (1,self.jdc.sdsDict[nomVal], 'reference ajoutee') + else : return (0, None, 'concept d un autre type existe deja') + else : return (0, None, 'concept d un autre type existe deja') + if self.convProto: + objVal = self.convProto.convert(nomVal) + objVal.initialiseNom(nomVal) + objVal.ajouteUnPere(self) + return (1, objVal, 'reference creee') + + def rattacheUserASSD(self, objASSD): + if objASSD.parent== None : objASSD.initialiseParent(self) + p=self.parent + while p in self.parent : + if hasattr(p, 'listeDesReferencesCrees') : p.listeDesReferencesCrees.append(objASSD) + else : p.listeDesReferencesCrees=[objASSD,] + p=p.parent + + + def getValeur(self): + """ + Retourne la "valeur" d'un mot-clé simple. + Cette valeur est utilisée lors de la création d'un contexte + d'évaluation d'expressions à l'aide d'un interpréteur Python + """ + v = self.valeur + # Si singleton et max=1, on retourne la valeur. + # Si une valeur simple et max='**', on retourne un singleton. + # (si liste de longueur > 1 et max=1, on sera arrêté plus tard) + # Pour accepter les numpy.array, on remplace : "type(v) not in (list, tuple)" + # par "not has_attr(v, '__iter__')". + if v is None: + pass + elif isSequence(v) and len(v) == 1 and self.definition.max == 1: + v = v[0] + elif not isSequence(v) and self.definition.max != 1: + v = (v, ) + # traitement particulier pour les complexes ('RI', r, i) + if 'C' in self.definition.type and self.definition.max != 1 and v != None and v[0] in ('RI', 'MP'): + v = (v, ) + return v + + def getVal(self): + """ + Une autre méthode qui retourne une "autre" valeur du mot clé simple. + Elle est utilisée par la méthode getMocle + """ + return self.valeur + + def accept(self, visitor): + """ + Cette methode permet de parcourir l'arborescence des objets + en utilisant le pattern VISITEUR + """ + visitor.visitMCSIMP(self) + + def copy(self): + """ Retourne une copie de self """ + objet = self.makeobjet() + # il faut copier les listes et les tuples mais pas les autres valeurs + # possibles (réel,SD,...) + if type(self.valeur) in (list, tuple): + objet.valeur = copy(self.valeur) + else: + objet.valeur = self.valeur + objet.val = objet.valeur + return objet + + def makeobjet(self): + return self.definition(val=None, nom=self.nom, parent=self.parent) + + def reparent(self, parent): + """ + Cette methode sert a reinitialiser la parente de l'objet + """ + self.parent = parent + self.jdc = parent.jdc + self.etape = parent.etape + + def getSd_utilisees(self): + """ + Retourne une liste qui contient la ou les SD utilisée par self si c'est le cas + ou alors une liste vide + """ + l = [] + if isinstance(self.valeur, ASSD): + l.append(self.valeur) + elif type(self.valeur) in (list, tuple): + for val in self.valeur: + if isinstance(val, ASSD): + l.append(val) + return l + + def getSd_mcs_utilisees(self): + """ + Retourne la ou les SD utilisée par self sous forme d'un dictionnaire : + - Si aucune sd n'est utilisée, le dictionnaire est vide. + - Sinon, la clé du dictionnaire est le mot-clé simple ; la valeur est + la liste des sd attenante. + + Exemple :: + { 'VALE_F': [ , + ] } + """ + l = self.getSd_utilisees() + dico = {} + if len(l) > 0: + dico[self.nom] = l + return dico + + + def getMcsWithCo(self, co): + """ + Cette methode retourne l'objet MCSIMP self s'il a le concept co + comme valeur. + """ + if co in forceList(self.valeur): + return [self, ] + return [] + + def getAllCo(self): + """ + Cette methode retourne la liste de tous les concepts co + associés au mot cle simple + """ + return [co for co in forceList(self.valeur) + if isinstance(co, CO) and co.isTypCO()] + + def supprime(self): + if not type(self.valeur) in (list, tuple): lesValeurs=(self.valeur,) + else : lesValeurs=self.valeur + if self.valeur == None or self.valeur == [] : lesValeurs=[] + for val in lesValeurs: + if self.definition.creeDesObjets : val.deleteReference(self) + else : + if (hasattr (val, 'enleveUtilisePar')) : val.enleveUtilisePar(self) + N_OBJECT.OBJECT.supprime(self) + + def getUserAssdPossible(self): + classeAChercher = self.definition.type + l=[] + dicoValeurs={} + d={} + if self.definition.filtreVariables != None : + for (nomMC, Xpath) in self.definition.filtreVariables : + # print (nomMC, Xpath) + if Xpath == None : dicoValeurs[nomMC] = getattr(self,nomMC) + else : + try: #if 1 : + pereMC=eval(Xpath) + if pereMC : + exp=Xpath+'.getChild("'+nomMC+'")' + leMotCle=eval(exp) + else : leMotCle=None + if leMotCle : + if leMotCle.val : dicoValeurs[nomMC]=leMotCle.val + elif leMotCle.definition.max != 1 : dicoValeurs[nomMC] = [] + else : dicoValeurs[nomMC] = None + else : + #PN PN est-ce sur ? sinon quoi None ou [] + # je pense que les 2 valeurs doivent être renseignees si le filtre depend de 2 valeurs + return l + except: + return l + + + for k,v in self.parent.jdc.sdsDict.items(): + if (isinstance(v, classeAChercher)) : + if self.definition.filtreExpression : + try : + if v.executeExpression(self.definition.filtreExpression ,dicoValeurs) : l.append(v) + except : + print ('il faut comprendre except pour', self.nom) + #print (self.nom) + #print (self.parent.nom) + #print (k,v) + else : l.append(v) + return l diff --git a/Noyau/N_TUPLE.py b/Noyau/N_TUPLE.py index d4f9ccbc..a5b656cf 100644 --- a/Noyau/N_TUPLE.py +++ b/Noyau/N_TUPLE.py @@ -20,7 +20,8 @@ class N_Matrice: def __init__(self, nbLigs=None, nbCols=None, methodeCalculTaille=None, formatSortie="ligne", valSup=None, valMin=None, structure=None, typElt='R', - typEltInto=None, listeHeaders=None, coloree=False): + typEltInto=None, listeHeaders=None, coloree=False, + defaut=None): self.nbLigs = nbLigs self.nbCols = nbCols self.methodeCalculTaille = methodeCalculTaille @@ -33,6 +34,7 @@ class N_Matrice: self.typEltInto = typEltInto self.jdc=None self.coloree=coloree + self.defaut=defaut if self.coloree : self.activeCouleur() def __convert__(self, valeur): @@ -85,3 +87,5 @@ class N_Matrice: __repr__ = info __str__ = info +class N_Matrice_Correlation(N_Matrice): + pass diff --git a/Noyau/N_UserASSDMultiple.py b/Noyau/N_UserASSDMultiple.py index d2dc5603..d9471952 100644 --- a/Noyau/N_UserASSDMultiple.py +++ b/Noyau/N_UserASSDMultiple.py @@ -32,7 +32,11 @@ import sys from .N_UserASSD import UserASSD from .N_ASSD import ASSD -from collections import UserList +try: + from collections import UserList +except ImportError: + from UserList import UserList + class UserASSDMultiple(UserASSD): """ Classe de base pour definir des types de structures de donnees definie par diff --git a/Noyau/N__F.py b/Noyau/N__F.py index 07a405d9..57124770 100644 --- a/Noyau/N__F.py +++ b/Noyau/N__F.py @@ -24,9 +24,9 @@ try : except : pass try: - from UserDict import UserDict -except ImportError: from collections import UserDict +except ImportError: + from UserDict import UserDict class _F(UserDict): diff --git a/ReacteurNumerique/cata_RN_EDG_PN.py b/ReacteurNumerique/cata_RN_EDG_PN.py new file mode 100755 index 00000000..fe1126a1 --- /dev/null +++ b/ReacteurNumerique/cata_RN_EDG_PN.py @@ -0,0 +1,385 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2008-2018 EDF R&D +# +# This file is part of SALOME ADAO module +# +# 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. +# +# 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 Accas import OPER, BLOC, FACT, SIMP, ASSD, JDC_CATA, VerifTypeTuple, Matrice +from Extensions.i18n import tr +import types +monFichier = os.path.abspath(__file__) + +JdC = JDC_CATA( + code='RN_EDG' +) +VERSION_CATALOGUE = 'V_0' + + +NMIN_ASSEMBLY = 1 +NMAX_ASSEMBLY = 18 + + +class Tuple: + def __init__(self, ntuple): + self.ntuple = ntuple + + def __convert__(self, valeur): + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + + +class VerifPostTreatment(VerifTypeTuple): + + def __init__(self): + super(VerifPostTreatment, self).__init__(('TXM', 'TXM')) + self.cata_info = "" + self.physValeurs = ('Neutronics', 'Thermalhydraulics') + self.typeValeurs = ('MED', 'SUM', 'MIN', 'MAX', 'MEAN') + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + if ok < 0: + raise ValueError( + tr("%s devrait etre dans %s ") % (valeur[1], self.typeValeurs)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + for v in valeur: + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + if valeur[1] in self.typeValeurs: # and valeur[1] in self.physValeurs: + return 1 + return -1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class VerifNeutLib(VerifTypeTuple): + + def __init__(self): + super(VerifNeutLib, self).__init__((myAssembly, 'TXM')) + self.cata_info = "" + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + a, v = valeur + if isinstance(a, myAssembly): + ok += 1 + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + return 1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class myAssembly(ASSD): + pass + + +class myTechnoData(ASSD): + pass + + +class myRodBank(ASSD): + pass + + +class myModelData(ASSD): + pass + + +class myScenarioData(ASSD): + pass + + +Assembly = OPER(nom='Assembly', sd_prod=myAssembly, + #assembly_name=SIMP(statut='o', typ='TXM'), + assembly_type=SIMP(statut='o', typ='TXM', into=("UOX", "MOX", "REF")), + description=BLOC(condition='assembly_type != "REF"', + assembly_width=SIMP(statut='o', typ='R'), + fuel_density=SIMP(statut='o', typ='R', defaut=0.95), + radial_description=FACT(statut='o', + clad_outer_radius=SIMP(statut='o', typ='R'), + guide_tube_outer_radius=SIMP(statut='o', typ='R'), + fuel_rod_pitch=SIMP(statut='o', typ='R'), + nfuel_rods=SIMP(statut='o', typ='I')), + axial_description=FACT(statut='o', + active_length_start=SIMP(statut='o', typ='R'), + active_length_end=SIMP(statut='o', typ='R')), + grids=FACT(statut='o', + mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max="**"), + size=SIMP(statut='o', typ='R')), + non_mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max='**'), + size=SIMP(statut='o', typ='R')), + ) + ) + ) + + +RodBank = OPER(nom="RodBank", sd_prod=myRodBank, + #rodbank_name=SIMP(statut='o', typ='TXM'), + rod_type=SIMP(statut='o', typ='TXM', into=("homogeneous", "heterogeneous")), + description_HOM=BLOC(condition='rod_type == "homogeneous"', + rod_composition=SIMP(statut='o', typ='TXM')), + description_HET=BLOC(condition='rod_type == "heterogeneous"', + bottom_composition=SIMP(statut='o', typ='TXM'), + splitting_heigh=SIMP(statut='o', typ='R'), + upper_composition=SIMP(statut='o', typ='TXM')), + step_height=SIMP(statut='o', typ='R'), + nsteps=SIMP(statut='o', typ='I')) + + +def add_lr_refl(ass_list): + return ["RW"] + ass_list + ["RE"] + + +def add_tb_refl(ass_list): + return ["RS"] + ass_list + ["RN"] + + +def generate_ass_map(nass_list): + xsym_list = [a for a in 'ABCDEFGHJKLNPRSTUVWXYZ'] + xsym_list.reverse() + ysym_list = ["%02d" % i for i in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1)] + ysym_list.reverse() + def_xaxis = {} + def_yaxis = {} + for n in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1): + def_xaxis[n] = add_lr_refl(xsym_list[-n:]) + def_yaxis[n] = add_tb_refl(ysym_list[-n:]) + + dico = {} + for n in nass_list: + dico['assembly_map_%d' % n] = BLOC(condition="nb_assembly==%d" % n, + xaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_xaxis[n]), + yaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_yaxis[n]), + assembly_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + typElt=myAssembly, # ici c'est le nom de l'assemblage + listeHeaders=(('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',),('RS','15','14','13','12','11','10','09','08','07','06','05','04','03','02','01','RN',)), + defaut=(n+2)*[(n+2)*['.']], coloree=True), + ), + rod_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=1, + valMin=-1, + #typElt=myAssembly, # ici c'est le nom de l'assemblage + typElt='TXM', # ici c'est le nom de l'assemblage + listeHeaders=None), + defaut=(n+2)*[(n+2)*['.']]), + BU_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=90000., + valMin=0., + typElt='R', # ici c'est le BU + listeHeaders=None, + coloree=True), + defaut=(n+2)*[(n+2)*['.']])) + + return dico + + +Techno_data = OPER(nom='Techno_data', sd_prod=myTechnoData, + assembly_list=SIMP(statut='o', typ=myAssembly, min=1, max="**"), # à resorber quand on mettra dans la Matrice + rodbank_list=SIMP(statut='o', typ=myRodBank, min=0, max="**"), # idem + radial_description=FACT(statut='o', + nb_assembly=SIMP(statut='o', typ='I', into=list(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))), + **(generate_ass_map(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))) + ), # Radial_Description + axial_description=FACT(statut='o', + lower_refl_size=SIMP(statut='o', typ='R'), + upper_refl_size=SIMP(statut='o', typ='R'), + ), + nominal_power=SIMP(statut='o', typ='R'), + Fuel_power_fraction=SIMP(statut='o', typ='R', defaut=0.974), + by_pass=SIMP(statut='o', typ='R', defaut=0.07), + core_volumic_flowrate=SIMP(statut='o', typ='R'), + ) # Techno data + +Model_data = OPER(nom='Model_data', sd_prod=myModelData, + physics=SIMP(statut='o', typ='TXM', into=( + 'Neutronics', 'Thermalhydraulics')), + scale=SIMP(statut='o', typ='TXM', into=( + 'system', 'component', 'local')), + b_neutro_compo=BLOC(condition='physics=="Neutronics" and scale=="component"', + library_map=SIMP(statut='f', typ=Tuple(2), + validators=VerifNeutLib(), + max='**'), + code=SIMP(statut='o', typ='TXM', into=('COCAGNE', 'APOLLO3')), + radial_meshing=FACT(statut='o', + flux_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_flux_subdivision=BLOC(condition='flux_solver=="subdivision"', + flux_subdivision=SIMP(statut='o', typ='I')), + feedback_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_feedback_subdivision=BLOC(condition='feedback_solver=="subdivision"', + feedback_subdivision=SIMP(statut='o', typ='I')))), + b_thermo_compo=BLOC(condition='physics=="Thermalhydraulics" and scale=="component"', + code=SIMP(statut='o', typ='TXM', into=('THYC', 'CATHARE3', 'FLICA4')), + radial_meshing=FACT(statut='o', + fluid=SIMP(statut='o', typ='TXM', into=('subdivision', 'subchannel')), + b_fluid_subdivision=BLOC(condition='fluid=="subdivision"', + fluid_subdivision=SIMP(statut='o', typ='I')), + pellet=SIMP(statut='o', typ='I'), + clad=SIMP(statut='o', typ='I')), + ), + b_scale_compo=BLOC(condition='scale=="component"', + axial_meshing=FACT(statut='o', + lower_refl=SIMP(statut='o', typ='I'), + fuel=SIMP(statut='o', typ='I'), + upper_refl=SIMP(statut='o', typ='I'))), + b_scale_local=BLOC(condition='scale=="local"', + mesh_file=SIMP(statut='o', typ='Fichier')), + ) + + +Scenario_data = OPER(nom='Scenario_data', sd_prod=myScenarioData, + initial_power=SIMP(statut='o', typ='R', val_min=0., + defaut=100.), + initial_power_unit=SIMP(statut='o', typ='TXM', + into=('% Nominal power', 'W'), + defaut='% Nominal power'), + initial_core_inlet_temperature=SIMP(statut='o', typ='R', val_min=0., + defaut=280.), + initial_boron_concentration=SIMP(statut='o', typ='R', val_min=0., + defaut=1300.), + initial_inlet_pressure=SIMP(statut='o', typ='R', defaut=160.2), + initial_outlet_pressure=SIMP(statut='o', typ='R', defaut=157.2), + initial_rod_positions=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['TXM', 'I']), + ang="Type@label, position (e.g. RodBank@RB, 0)", + max='**'), + scenario_type=SIMP(statut='o', + typ='TXM', + into=['RIA']), + b_ria=BLOC(condition='scenario_type=="RIA"', + ejected_rod=SIMP(statut='o', + typ='TXM'), + rod_position_program=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['R', 'I']), + max='**'), + SCRAM=SIMP(statut='o', typ='TXM', into=("YES", "NO")), + SCRAM_option=BLOC(condition='SCRAM == "YES"', + SCRAM_power=SIMP(statut='o', typ='R'), + complete_SCRAM_time=SIMP(statut='o', typ='R'), + ), + ), + post_processing=SIMP(statut='f', + typ=Tuple(2), + validators=VerifPostTreatment(), + max='**'), + ) diff --git a/ReacteurNumerique/cata_RN_EDG_PN_TraductionV0.py b/ReacteurNumerique/cata_RN_EDG_PN_TraductionV0.py new file mode 100755 index 00000000..24f7bcaa --- /dev/null +++ b/ReacteurNumerique/cata_RN_EDG_PN_TraductionV0.py @@ -0,0 +1,377 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2008-2018 EDF R&D +# +# This file is part of SALOME ADAO module +# +# 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. +# +# 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 Accas import OPER, BLOC, FACT, SIMP, ASSD, JDC_CATA, VerifTypeTuple, Matrice, PROC, Tuple +from Extensions.i18n import tr +import types +monFichier = os.path.abspath(__file__) + +JdC = JDC_CATA( + code='RN_EDG' +) +VERSION_CATALOGUE = 'V_0' + + +NMIN_ASSEMBLY = 1 +NMAX_ASSEMBLY = 18 + + + +class VerifPostTreatment(VerifTypeTuple): + + def __init__(self): + super(VerifPostTreatment, self).__init__(('TXM', 'TXM')) + self.cata_info = "" + self.physValeurs = ('Neutronics', 'Thermalhydraulics') + self.typeValeurs = ('MED', 'SUM', 'MIN', 'MAX', 'MEAN') + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + if ok < 0: + raise ValueError( + tr("%s devrait etre dans %s ") % (valeur[1], self.typeValeurs)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + for v in valeur: + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + if valeur[1] in self.typeValeurs: # and valeur[1] in self.physValeurs: + return 1 + return -1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class VerifNeutLib(VerifTypeTuple): + + def __init__(self): + super(VerifNeutLib, self).__init__((myAssembly, 'TXM')) + self.cata_info = "" + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + a, v = valeur + if isinstance(a, myAssembly): + ok += 1 + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + return 1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class myAssembly(ASSD): + pass + + +class myTechnoData(ASSD): + pass + + +class myRodBank(ASSD): + pass + + +class myModelData(ASSD): + pass + + +class myScenarioData(ASSD): + pass + + +Assembly = OPER(nom='Assembly', sd_prod=myAssembly, + #assembly_name=SIMP(statut='o', typ='TXM'), + assembly_type=SIMP(statut='o', typ='TXM', into=("UOX", "MOX", "REF")), + description=BLOC(condition='assembly_type != "REF"', + assembly_width=SIMP(statut='o', typ='R'), + fuel_density=SIMP(statut='o', typ='R', defaut=0.95), + radial_description=FACT(statut='o', + clad_outer_radius=SIMP(statut='o', typ='R'), + guide_tube_outer_radius=SIMP(statut='o', typ='R'), + fuel_rod_pitch=SIMP(statut='o', typ='R'), + nfuel_rods=SIMP(statut='o', typ='I')), + axial_description=FACT(statut='o', + active_length_start=SIMP(statut='o', typ='R'), + active_length_end=SIMP(statut='o', typ='R')), + grids=FACT(statut='o', + mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max="**"), + size=SIMP(statut='o', typ='R')), + non_mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max='**'), + size=SIMP(statut='o', typ='R')), + ) + ) + ) + + +RodBank = OPER(nom="RodBank", sd_prod=myRodBank, + #rodbank_name=SIMP(statut='o', typ='TXM'), + rod_type=SIMP(statut='o', typ='TXM', into=("homogeneous", "heterogeneous")), + description_HOM=BLOC(condition='rod_type == "homogeneous"', + rod_composition=SIMP(statut='o', typ='TXM')), + description_HET=BLOC(condition='rod_type == "heterogeneous"', + bottom_composition=SIMP(statut='o', typ='TXM'), + splitting_heigh=SIMP(statut='o', typ='R'), + upper_composition=SIMP(statut='o', typ='TXM')), + step_height=SIMP(statut='o', typ='R'), + nsteps=SIMP(statut='o', typ='I')) + + +def add_lr_refl(ass_list): + return ["RW"] + ass_list + ["RE"] + + +def add_tb_refl(ass_list): + return ["RS"] + ass_list + ["RN"] + + +def generate_ass_map(nass_list): + xsym_list = [a for a in 'ABCDEFGHJKLNPRSTUVWXYZ'] + xsym_list.reverse() + ysym_list = ["%02d" % i for i in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1)] + ysym_list.reverse() + def_xaxis = {} + def_yaxis = {} + for n in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1): + def_xaxis[n] = add_lr_refl(xsym_list[-n:]) + def_yaxis[n] = add_tb_refl(ysym_list[-n:]) + + dico = {} + for n in nass_list: + dico['assembly_map_%d' % n] = BLOC(condition="nb_assembly==%d" % n, + xaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_xaxis[n]), + yaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_yaxis[n]), + assembly_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + typElt=myAssembly, # ici c'est le nom de l'assemblage + listeHeaders=(('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',),('RS','15','14','13','12','11','10','09','08','07','06','05','04','03','02','01','RN',)), + defaut=(n+2)*[(n+2)*['.']], coloree=True), + ), + rod_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=1, + valMin=-1, + #typElt=myAssembly, # ici c'est le nom de l'assemblage + typElt='TXM', # ici c'est le nom de l'assemblage + listeHeaders=None), + defaut=(n+2)*[(n+2)*['.']]), + BU_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=90000., + valMin=0., + typElt='R', # ici c'est le BU + listeHeaders=None, + coloree=True), + defaut=(n+2)*[(n+2)*['.']])) + + return dico + + +Techno_data = OPER(nom='Techno_data', sd_prod=myTechnoData, + assembly_list=SIMP(statut='o', typ=myAssembly, min=1, max="**"), # à resorber quand on mettra dans la Matrice + rodbank_list=SIMP(statut='o', typ=myRodBank, min=0, max="**"), # idem + radial_description=FACT(statut='o', + nb_assembly=SIMP(statut='o', typ='I', into=list(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))), + **(generate_ass_map(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))) + ), # Radial_Description + axial_description=FACT(statut='o', + lower_refl_size=SIMP(statut='o', typ='R'), + upper_refl_size=SIMP(statut='o', typ='R'), + ), + nominal_power=SIMP(statut='o', typ='R'), + Fuel_power_fraction=SIMP(statut='o', typ='R', defaut=0.974), + by_pass=SIMP(statut='o', typ='R', defaut=0.07), + core_volumic_flowrate=SIMP(statut='o', typ='R'), + ) # Techno data + +Model_data = OPER(nom='Model_data', sd_prod=myModelData, + physics=SIMP(statut='o', typ='TXM', into=( + 'Neutronics', 'Thermalhydraulics')), + scale=SIMP(statut='o', typ='TXM', into=( + 'system', 'component', 'local')), + b_neutro_compo=BLOC(condition='physics=="Neutronics" and scale=="component"', + library_map=SIMP(statut='f', typ=Tuple(2), + validators=VerifNeutLib(), + max='**'), + code=SIMP(statut='o', typ='TXM', into=('COCAGNE', 'APOLLO3')), + radial_meshing=FACT(statut='o', + flux_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_flux_subdivision=BLOC(condition='flux_solver=="subdivision"', + flux_subdivision=SIMP(statut='o', typ='I')), + feedback_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_feedback_subdivision=BLOC(condition='feedback_solver=="subdivision"', + feedback_subdivision=SIMP(statut='o', typ='I')))), + b_thermo_compo=BLOC(condition='physics=="Thermalhydraulics" and scale=="component"', + code=SIMP(statut='o', typ='TXM', into=('THYC', 'CATHARE3', 'FLICA4')), + radial_meshing=FACT(statut='o', + fluid=SIMP(statut='o', typ='TXM', into=('subdivision', 'subchannel')), + b_fluid_subdivision=BLOC(condition='fluid=="subdivision"', + fluid_subdivision=SIMP(statut='o', typ='I')), + pellet=SIMP(statut='o', typ='I'), + clad=SIMP(statut='o', typ='I')), + ), + b_scale_compo=BLOC(condition='scale=="component"', + axial_meshing=FACT(statut='o', + lower_refl=SIMP(statut='o', typ='I'), + fuel=SIMP(statut='o', typ='I'), + upper_refl=SIMP(statut='o', typ='I'))), + b_scale_local=BLOC(condition='scale=="local"', + mesh_file=SIMP(statut='o', typ='Fichier')), + ) + + +Scenario_data = OPER(nom='Scenario_data', sd_prod=myScenarioData, + initial_power=SIMP(statut='o', typ='R', val_min=0., + defaut=100.), + initial_power_unit=SIMP(statut='o', typ='TXM', + into=('% Nominal power', 'W'), + defaut='% Nominal power'), + initial_core_inlet_temperature=SIMP(statut='o', typ='R', val_min=0., + defaut=280.), + initial_boron_concentration=SIMP(statut='o', typ='R', val_min=0., + defaut=1300.), + initial_inlet_pressure=SIMP(statut='o', typ='R', defaut=160.2), + initial_outlet_pressure=SIMP(statut='o', typ='R', defaut=157.2), + initial_rod_positions=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['TXM', 'I']), + ang="Type@label, position (e.g. RodBank@RB, 0)", + max='**'), + scenario_type=SIMP(statut='o', + typ='TXM', + into=['RIA']), + b_ria=BLOC(condition='scenario_type=="RIA"', + ejected_rod=SIMP(statut='o', + typ='TXM'), + rod_position_program=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['R', 'I']), + max='**'), + SCRAM=SIMP(statut='o', typ='TXM', into=("YES", "NO")), + SCRAM_option=BLOC(condition='SCRAM == "YES"', + SCRAM_power=SIMP(statut='o', typ='R'), + complete_SCRAM_time=SIMP(statut='o', typ='R'), + ), + ), + post_processing=SIMP(statut='f', + typ=Tuple(2), + validators=VerifPostTreatment(), + max='**'), + ) +Genere_Une_Erreur_Traduction = PROC(nom='Genere_Une_Erreur_Traduction', + essai=SIMP(statut='o', typ='TXM'), +) + diff --git a/ReacteurNumerique/cata_RN_EDG_PN_UQ.py b/ReacteurNumerique/cata_RN_EDG_PN_UQ.py new file mode 100755 index 00000000..fe1126a1 --- /dev/null +++ b/ReacteurNumerique/cata_RN_EDG_PN_UQ.py @@ -0,0 +1,385 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2008-2018 EDF R&D +# +# This file is part of SALOME ADAO module +# +# 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. +# +# 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 Accas import OPER, BLOC, FACT, SIMP, ASSD, JDC_CATA, VerifTypeTuple, Matrice +from Extensions.i18n import tr +import types +monFichier = os.path.abspath(__file__) + +JdC = JDC_CATA( + code='RN_EDG' +) +VERSION_CATALOGUE = 'V_0' + + +NMIN_ASSEMBLY = 1 +NMAX_ASSEMBLY = 18 + + +class Tuple: + def __init__(self, ntuple): + self.ntuple = ntuple + + def __convert__(self, valeur): + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + + +class VerifPostTreatment(VerifTypeTuple): + + def __init__(self): + super(VerifPostTreatment, self).__init__(('TXM', 'TXM')) + self.cata_info = "" + self.physValeurs = ('Neutronics', 'Thermalhydraulics') + self.typeValeurs = ('MED', 'SUM', 'MIN', 'MAX', 'MEAN') + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + if ok < 0: + raise ValueError( + tr("%s devrait etre dans %s ") % (valeur[1], self.typeValeurs)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + for v in valeur: + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + if valeur[1] in self.typeValeurs: # and valeur[1] in self.physValeurs: + return 1 + return -1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class VerifNeutLib(VerifTypeTuple): + + def __init__(self): + super(VerifNeutLib, self).__init__((myAssembly, 'TXM')) + self.cata_info = "" + + def info(self): + return tr(": verifie les \ntypes dans un tuple") + + def infoErreurListe(self): + return tr("Les types entres ne sont pas permis") + + def default(self, valeur): + return valeur + + def isList(self): + return 1 + + def convertItem(self, valeur): + if len(valeur) != len(self.typeDesTuples): + raise ValueError( + tr("%s devrait etre de type %s ") % (valeur, self.typeDesTuples)) + ok = self.verifType(valeur) + if ok == 0: + raise ValueError( + tr("%s devrait etre de type %s (%d)") % (valeur, self.typeDesTuples, ok)) + return valeur + + def verifItem(self, valeur): + try: + if len(valeur) != len(self.typeDesTuples): + return 0 + ok = self.verifType(valeur) + if ok != 1: + return 0 + except: + return 0 + return 1 + + def verifType(self, valeur): + ok = 0 + a, v = valeur + if isinstance(a, myAssembly): + ok += 1 + if type(v) == bytes or type(v) == str: + ok += 1 + if ok == len(self.typeDesTuples): + return 1 + return 0 + + def verif(self, valeur): + if type(valeur) in (list, tuple): + liste = list(valeur) + for val in liste: + if self.verifItem(val) != 1: + return 0 + return 1 + return 0 + + +class myAssembly(ASSD): + pass + + +class myTechnoData(ASSD): + pass + + +class myRodBank(ASSD): + pass + + +class myModelData(ASSD): + pass + + +class myScenarioData(ASSD): + pass + + +Assembly = OPER(nom='Assembly', sd_prod=myAssembly, + #assembly_name=SIMP(statut='o', typ='TXM'), + assembly_type=SIMP(statut='o', typ='TXM', into=("UOX", "MOX", "REF")), + description=BLOC(condition='assembly_type != "REF"', + assembly_width=SIMP(statut='o', typ='R'), + fuel_density=SIMP(statut='o', typ='R', defaut=0.95), + radial_description=FACT(statut='o', + clad_outer_radius=SIMP(statut='o', typ='R'), + guide_tube_outer_radius=SIMP(statut='o', typ='R'), + fuel_rod_pitch=SIMP(statut='o', typ='R'), + nfuel_rods=SIMP(statut='o', typ='I')), + axial_description=FACT(statut='o', + active_length_start=SIMP(statut='o', typ='R'), + active_length_end=SIMP(statut='o', typ='R')), + grids=FACT(statut='o', + mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max="**"), + size=SIMP(statut='o', typ='R')), + non_mixing=FACT(statut='o', + positions=SIMP( + statut='f', typ='R', max='**'), + size=SIMP(statut='o', typ='R')), + ) + ) + ) + + +RodBank = OPER(nom="RodBank", sd_prod=myRodBank, + #rodbank_name=SIMP(statut='o', typ='TXM'), + rod_type=SIMP(statut='o', typ='TXM', into=("homogeneous", "heterogeneous")), + description_HOM=BLOC(condition='rod_type == "homogeneous"', + rod_composition=SIMP(statut='o', typ='TXM')), + description_HET=BLOC(condition='rod_type == "heterogeneous"', + bottom_composition=SIMP(statut='o', typ='TXM'), + splitting_heigh=SIMP(statut='o', typ='R'), + upper_composition=SIMP(statut='o', typ='TXM')), + step_height=SIMP(statut='o', typ='R'), + nsteps=SIMP(statut='o', typ='I')) + + +def add_lr_refl(ass_list): + return ["RW"] + ass_list + ["RE"] + + +def add_tb_refl(ass_list): + return ["RS"] + ass_list + ["RN"] + + +def generate_ass_map(nass_list): + xsym_list = [a for a in 'ABCDEFGHJKLNPRSTUVWXYZ'] + xsym_list.reverse() + ysym_list = ["%02d" % i for i in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1)] + ysym_list.reverse() + def_xaxis = {} + def_yaxis = {} + for n in range(NMIN_ASSEMBLY, NMAX_ASSEMBLY+1): + def_xaxis[n] = add_lr_refl(xsym_list[-n:]) + def_yaxis[n] = add_tb_refl(ysym_list[-n:]) + + dico = {} + for n in nass_list: + dico['assembly_map_%d' % n] = BLOC(condition="nb_assembly==%d" % n, + xaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_xaxis[n]), + yaxis=SIMP(statut='o', + typ='TXM', + min=n+2, max=n+2, + defaut=def_yaxis[n]), + assembly_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + typElt=myAssembly, # ici c'est le nom de l'assemblage + listeHeaders=(('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',),('RS','15','14','13','12','11','10','09','08','07','06','05','04','03','02','01','RN',)), + defaut=(n+2)*[(n+2)*['.']], coloree=True), + ), + rod_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=1, + valMin=-1, + #typElt=myAssembly, # ici c'est le nom de l'assemblage + typElt='TXM', # ici c'est le nom de l'assemblage + listeHeaders=None), + defaut=(n+2)*[(n+2)*['.']]), + BU_map=SIMP(statut="o", + typ=Matrice(nbLigs=n+2, + nbCols=n+2, + valSup=90000., + valMin=0., + typElt='R', # ici c'est le BU + listeHeaders=None, + coloree=True), + defaut=(n+2)*[(n+2)*['.']])) + + return dico + + +Techno_data = OPER(nom='Techno_data', sd_prod=myTechnoData, + assembly_list=SIMP(statut='o', typ=myAssembly, min=1, max="**"), # à resorber quand on mettra dans la Matrice + rodbank_list=SIMP(statut='o', typ=myRodBank, min=0, max="**"), # idem + radial_description=FACT(statut='o', + nb_assembly=SIMP(statut='o', typ='I', into=list(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))), + **(generate_ass_map(range(NMIN_ASSEMBLY, NMAX_ASSEMBLY))) + ), # Radial_Description + axial_description=FACT(statut='o', + lower_refl_size=SIMP(statut='o', typ='R'), + upper_refl_size=SIMP(statut='o', typ='R'), + ), + nominal_power=SIMP(statut='o', typ='R'), + Fuel_power_fraction=SIMP(statut='o', typ='R', defaut=0.974), + by_pass=SIMP(statut='o', typ='R', defaut=0.07), + core_volumic_flowrate=SIMP(statut='o', typ='R'), + ) # Techno data + +Model_data = OPER(nom='Model_data', sd_prod=myModelData, + physics=SIMP(statut='o', typ='TXM', into=( + 'Neutronics', 'Thermalhydraulics')), + scale=SIMP(statut='o', typ='TXM', into=( + 'system', 'component', 'local')), + b_neutro_compo=BLOC(condition='physics=="Neutronics" and scale=="component"', + library_map=SIMP(statut='f', typ=Tuple(2), + validators=VerifNeutLib(), + max='**'), + code=SIMP(statut='o', typ='TXM', into=('COCAGNE', 'APOLLO3')), + radial_meshing=FACT(statut='o', + flux_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_flux_subdivision=BLOC(condition='flux_solver=="subdivision"', + flux_subdivision=SIMP(statut='o', typ='I')), + feedback_solver=SIMP(statut='o', typ='TXM', into=('subdivision', 'pin-by-pin')), + b_feedback_subdivision=BLOC(condition='feedback_solver=="subdivision"', + feedback_subdivision=SIMP(statut='o', typ='I')))), + b_thermo_compo=BLOC(condition='physics=="Thermalhydraulics" and scale=="component"', + code=SIMP(statut='o', typ='TXM', into=('THYC', 'CATHARE3', 'FLICA4')), + radial_meshing=FACT(statut='o', + fluid=SIMP(statut='o', typ='TXM', into=('subdivision', 'subchannel')), + b_fluid_subdivision=BLOC(condition='fluid=="subdivision"', + fluid_subdivision=SIMP(statut='o', typ='I')), + pellet=SIMP(statut='o', typ='I'), + clad=SIMP(statut='o', typ='I')), + ), + b_scale_compo=BLOC(condition='scale=="component"', + axial_meshing=FACT(statut='o', + lower_refl=SIMP(statut='o', typ='I'), + fuel=SIMP(statut='o', typ='I'), + upper_refl=SIMP(statut='o', typ='I'))), + b_scale_local=BLOC(condition='scale=="local"', + mesh_file=SIMP(statut='o', typ='Fichier')), + ) + + +Scenario_data = OPER(nom='Scenario_data', sd_prod=myScenarioData, + initial_power=SIMP(statut='o', typ='R', val_min=0., + defaut=100.), + initial_power_unit=SIMP(statut='o', typ='TXM', + into=('% Nominal power', 'W'), + defaut='% Nominal power'), + initial_core_inlet_temperature=SIMP(statut='o', typ='R', val_min=0., + defaut=280.), + initial_boron_concentration=SIMP(statut='o', typ='R', val_min=0., + defaut=1300.), + initial_inlet_pressure=SIMP(statut='o', typ='R', defaut=160.2), + initial_outlet_pressure=SIMP(statut='o', typ='R', defaut=157.2), + initial_rod_positions=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['TXM', 'I']), + ang="Type@label, position (e.g. RodBank@RB, 0)", + max='**'), + scenario_type=SIMP(statut='o', + typ='TXM', + into=['RIA']), + b_ria=BLOC(condition='scenario_type=="RIA"', + ejected_rod=SIMP(statut='o', + typ='TXM'), + rod_position_program=SIMP(statut='o', + typ=Tuple(2), + validators=VerifTypeTuple(['R', 'I']), + max='**'), + SCRAM=SIMP(statut='o', typ='TXM', into=("YES", "NO")), + SCRAM_option=BLOC(condition='SCRAM == "YES"', + SCRAM_power=SIMP(statut='o', typ='R'), + complete_SCRAM_time=SIMP(statut='o', typ='R'), + ), + ), + post_processing=SIMP(statut='f', + typ=Tuple(2), + validators=VerifPostTreatment(), + max='**'), + ) diff --git a/ReacteurNumerique/edg_REP1300_FULL.comm b/ReacteurNumerique/edg_REP1300_FULL.comm new file mode 100755 index 00000000..55be8503 --- /dev/null +++ b/ReacteurNumerique/edg_REP1300_FULL.comm @@ -0,0 +1,201 @@ + +REF=Assembly(assembly_name='REF', + assembly_type='REF',); + +U1=Assembly(assembly_name='U1', + assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_name='UGD', + assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rodbank_name='RB', + rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rodbank_name='N1', + rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rodbank_name='N2', + rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rodbank_name='G1', + rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rodbank_name='G2', + rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map= + (['REF','REF','REF','REF', + 'REF','REF','REF','REF','REF','REF','REF','REF','REF', + 'REF','REF','REF','REF'],['REF','REF','REF','REF','REF', + 'U1','U1','U1','U1','U1','U1','U1','REF','REF','REF', + 'REF','REF'],['REF','REF','REF','UGD','U1','UGD','UGD', + 'U1','U1','U1','UGD','UGD','U1','UGD','REF','REF','REF'], + ['REF','REF','UGD','U1','U1','U1','U1','UGD','U1','UGD', + 'U1','U1','U1','U1','UGD','REF','REF'],['REF','REF','U1', + 'U1','U1','UGD','U1','UGD','U1','UGD','U1','UGD','U1', + 'U1','U1','REF','REF'],['REF','U1','UGD','U1','UGD','U1', + 'U1','UGD','U1','UGD','U1','U1','UGD','U1','UGD','U1', + 'REF'],['REF','U1','UGD','U1','U1','U1','UGD','UGD','U1', + 'UGD','UGD','U1','U1','U1','UGD','U1','REF'],['REF','U1', + 'U1','UGD','UGD','UGD','UGD','U1','UGD','U1','UGD','UGD', + 'UGD','UGD','U1','U1','REF'],['REF','U1','U1','U1','U1', + 'U1','U1','UGD','UGD','UGD','U1','U1','U1','U1','U1','U1', + 'REF'],['REF','U1','U1','UGD','UGD','UGD','UGD','U1', + 'UGD','U1','UGD','UGD','UGD','UGD','U1','U1','REF'], + ['REF','U1','UGD','U1','U1','U1','UGD','UGD','U1','UGD', + 'UGD','U1','U1','U1','UGD','U1','REF'],['REF','U1','UGD', + 'U1','UGD','U1','U1','UGD','U1','UGD','U1','U1','UGD', + 'U1','UGD','U1','REF'],['REF','REF','U1','U1','U1','UGD', + 'U1','UGD','U1','UGD','U1','UGD','U1','U1','U1','REF', + 'REF'],['REF','REF','UGD','U1','U1','U1','U1','UGD','U1', + 'UGD','U1','U1','U1','U1','UGD','REF','REF'],['REF','REF', + 'REF','UGD','U1','UGD','UGD','U1','U1','U1','UGD','UGD', + 'U1','UGD','REF','REF','REF'],['REF','REF','REF','REF', + 'REF','U1','U1','U1','U1','U1','U1','U1','REF','REF', + 'REF','REF','REF'],['REF','REF','REF','REF','REF','REF', + 'REF','REF','REF','REF','REF','REF','REF','REF','REF', + 'REF','REF'],), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + (['0.','0.','0.','0.','0.','0.', + '0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.'],['0.','0.', + '0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.', + '0.'],['0.','0.','0.','40.','0.','0.','40.','40.','20.','40.','40.', + '0.','0.','40.','0.','0.','0.'],['0.','0.','40.','0.','40.','20.', + '40.','0.','40.','0.','40.','20.','40.','0.','40.','0.','0.'],['0.', + '0.','0.','40.','20.','20.','20.','40.','20.','40.','20.','20.','20.', + '40.','0.','0.','0.'],['0.','0.','0.','20.','20.','20.','40.','0.', + '40.','0.','40.','20.','20.','20.','0.','0.','0.'],['0.','0.','40.', + '40.','20.','40.','20.','40.','20.','40.','20.','40.','20.','40.', + '40.','0.','0.'],['0.','0.','40.','0.','40.','0.','40.','20.','20.', + '20.','40.','0.','40.','0.','40.','0.','0.'],['0.','0.','20.','40.', + '20.','40.','20.','20.','60.','20.','20.','40.','20.','40.','20.', + '0.','0.'],['0.','0.','40.','0.','40.','0.','40.','20.','20.','20.', + '40.','0.','40.','0.','40.','0.','0.'],['0.','0.','40.','40.','20.', + '40.','20.','40.','20.','40.','20.','40.','20.','40.','40.','0.', + '0.'],['0.','0.','0.','20.','20.','20.','40.','0.','40.','0.','40.', + '20.','20.','20.','0.','0.','0.'],['0.','0.','0.','40.','20.','20.', + '20.','40.','20.','40.','20.','20.','20.','40.','0.','0.','0.'],['0.', + '0.','40.','0.','40.','20.','40.','0.','40.','0.','40.','20.','40.', + '0.','40.','0.','0.'],['0.','0.','0.','40.','0.','0.','40.','40.', + '20.','40.','40.','0.','0.','40.','0.','0.','0.'],['0.','0.','0.', + '0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.', + '0.'],['0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.','0.', + '0.','0.','0.','0.','0.'],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + inlet_pressure=160.2, + outlet_pressure=157.2, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:6732ab23879f88de0b8f989f9a2dbc9d -:FIN CHECKSUM diff --git a/ReacteurNumerique/edg_REP1300_FULL_PN.comm b/ReacteurNumerique/edg_REP1300_FULL_PN.comm new file mode 100755 index 00000000..38b5d3da --- /dev/null +++ b/ReacteurNumerique/edg_REP1300_FULL_PN.comm @@ -0,0 +1,177 @@ + +REF=Assembly(assembly_type='REF',); + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map= + ([REF,REF,REF,REF,REF,REF, + REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,],[REF,REF, + REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,], + [REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF, + REF,REF,],[REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1, + UGD,REF,REF,],[REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD, + U1,U1,U1,REF,REF,],[REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1, + U1,UGD,U1,UGD,U1,REF,],[REF,U1,UGD,U1,U1,U1,UGD,UGD,U1, + UGD,UGD,U1,U1,U1,UGD,U1,REF,],[REF,U1,U1,UGD,UGD,UGD,UGD, + U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,],[REF,U1,U1,U1,U1,U1, + U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,],[REF,U1,U1,UGD,UGD, + UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,],[REF,U1,UGD, + U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,],[REF,U1, + UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,], + [REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF, + REF,],[REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD, + REF,REF,],[REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1, + UGD,REF,REF,REF,],[REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1, + U1,REF,REF,REF,REF,REF,],[REF,REF,REF,REF,REF,REF,REF,REF, + REF,REF,REF,REF,REF,REF,REF,REF,REF,],), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:25881dd6462363b8aeb1384fa470b79e:FIN CHECKSUM \ No newline at end of file diff --git a/ReacteurNumerique/prefs.py b/ReacteurNumerique/prefs.py new file mode 100644 index 00000000..e4ed9a42 --- /dev/null +++ b/ReacteurNumerique/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 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. +# +# 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 +# +code="ReacteurNumerique" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/ReacteurNumerique/prefs_ReacteurNumerique.py b/ReacteurNumerique/prefs_ReacteurNumerique.py new file mode 100644 index 00000000..14d878cf --- /dev/null +++ b/ReacteurNumerique/prefs_ReacteurNumerique.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# maConfiguration MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM 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 +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os,sys +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='fr' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +# +#typeDeCata='XML' +catalogues=( + ('ReacteurNumerique','Version Beta',os.path.join(repIni,'cata_RN_EDG_PN.py'),'python','python'), +) +#nombreDeBoutonParLigne=4 +simpleClic=True +#closeFrameRechercheCommande=True +boutonDsMenuBar=False +#closeArbre=True +afficheListesPliees=False +#withXSD=True +afficheCommandesPliees = False +#dumpXSD=True +#afficheIhm=False diff --git a/ReacteurNumerique/qtEficasReacteurNumerique.py b/ReacteurNumerique/qtEficasReacteurNumerique.py new file mode 100755 index 00000000..4fcb6536 --- /dev/null +++ b/ReacteurNumerique/qtEficasReacteurNumerique.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-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. +# +# 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 +# +""" + Ce module sert a lancer EFICAS configure pour MAP +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import os, sys +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +import prefs +from InterfaceQT4 import eficas_go +print (prefs.code) +eficas_go.lanceEficas(code=prefs.code) diff --git a/ReacteurNumerique/test.comm b/ReacteurNumerique/test.comm new file mode 100755 index 00000000..38b5d3da --- /dev/null +++ b/ReacteurNumerique/test.comm @@ -0,0 +1,177 @@ + +REF=Assembly(assembly_type='REF',); + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map= + ([REF,REF,REF,REF,REF,REF, + REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,],[REF,REF, + REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,], + [REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF, + REF,REF,],[REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1, + UGD,REF,REF,],[REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD, + U1,U1,U1,REF,REF,],[REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1, + U1,UGD,U1,UGD,U1,REF,],[REF,U1,UGD,U1,U1,U1,UGD,UGD,U1, + UGD,UGD,U1,U1,U1,UGD,U1,REF,],[REF,U1,U1,UGD,UGD,UGD,UGD, + U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,],[REF,U1,U1,U1,U1,U1, + U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,],[REF,U1,U1,UGD,UGD, + UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,],[REF,U1,UGD, + U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,],[REF,U1, + UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,], + [REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF, + REF,],[REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD, + REF,REF,],[REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1, + UGD,REF,REF,REF,],[REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1, + U1,REF,REF,REF,REF,REF,],[REF,REF,REF,REF,REF,REF,REF,REF, + REF,REF,REF,REF,REF,REF,REF,REF,REF,],), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:25881dd6462363b8aeb1384fa470b79e:FIN CHECKSUM \ No newline at end of file diff --git a/Traducteur/CMakeLists.txt b/Traducteur/CMakeLists.txt deleted file mode 100644 index d1c51c80..00000000 --- a/Traducteur/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM 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 -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# -# -# ====================================================================== - -# Installation de tous les fichiers Python, texte et images du repertoire et des sous-repertoires (sauf CVS) -install ( - FILES - calcG.py changeValeur.py dictErreurs.py __init__.py inseremocle.py - load.py log.py mocles.py movemocle.py parseur.py regles.py removemocle.py - renamemocle.py traduitV7V8.py traduitV8V9.py traduitV9V10.py utils.py - visiteur.py - DESTINATION ${CMAKE_INSTALL_PREFIX}/Traducteur - ) - -### Local Variables: -### mode: cmake -### End: diff --git a/Traducteur/__init__.py b/Traducteur/__init__.py deleted file mode 100644 index e4044aec..00000000 --- a/Traducteur/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# diff --git a/Traducteur/calcG.py b/Traducteur/calcG.py deleted file mode 100644 index 2549826d..00000000 --- a/Traducteur/calcG.py +++ /dev/null @@ -1,155 +0,0 @@ -#### -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -from Traducteur.parseur import FactNode -from Traducteur.load import jdcSet -import logging - -dict_commande={} -dict_contexte={} -dict_contexte_option={} - -import sys -#-------------------------------------------------------------------------- -def traitementRayon(jdc): -#-------------------------------------------------------------------------- - - if "DEFI_FONCTION" not in jdcSet : return - for c in jdc.root.childNodes: - if c.name != "DEFI_FONCTION" : continue - monTexte=jdc.getLines()[c.lineno-1] - monNomVariable=monTexte.split("=")[0] - aExecuter=monNomVariable+'=0' - dict_commande[monNomVariable]=c - exec aExecuter in dict_contexte - liste_MC=(("CALC_G","R_INF_FO"),("CALC_G","R_SUP_FO"),("CALC_G","MODULE_FO")) - liste_achanger = chercheValeurSelonGenea2 (jdc,liste_MC) - liste_MC=(("CALC_THETA","THETA_3D","R_INF_FO"),("CALC_THETA","THETA_3D","R_SUP_FO"),("CALC_THETA","THETA_3D","MODULE_FO")) - liste_achanger2 = chercheValeurSelonGenea3 (jdc,liste_MC) - liste_achanger=liste_achanger+liste_achanger2 - for item in liste_achanger : - commande=dict_commande[item] - changeValeurABSCNiveau1(commande,jdc) - -#---------------------------------- -def changeValeurABSCNiveau1(c,jdc): -#---------------------------------- - for child in c.childNodes: - if child.name != "NOM_PARA":continue - MonTexte=child.getText(jdc) - if len(MonTexte.splitlines()) > 1 : - print "Le Traducteur ne sait pas gerer" - assert(0) - MonTexte=jdc.getLines()[child.lineno-1] - debut=MonTexte.find("NOM_PARA") - debChaine=MonTexte[0:debut+8] - ancien=MonTexte[debut+8:] - egal,nomval,fin=ancien.split("'",2) - nouvelleLigne=debChaine+egal+"'ABSC'"+fin - jdc.getLines()[child.lineno-1]=nouvelleLigne - logging.info("renommage parametre ABSC ligne %d",child.lineno-1) - return - -#-------------------------------------------------------------------------- -def chercheValeurSelonGenea2(jdc,liste_cherche_valeur): -# -#-------------------------------------------------------------------------- - liste_valeurs=[] - for genea in liste_cherche_valeur: - profondeur=len(genea) - if profondeur > 2 : - print "la methode chercheValeurSelonGenea ne convient" - print "pas pour cette genealogie" - assert(0) - command=genea[0] - fact=genea[1] - - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - MonTexte=mc.getText(jdc) - try : - #if ( 1) : - exec MonTexte in dict_contexte - monNomVar=MonTexte.split("=")[1] - monNomVarOk=monNomVar - i=-1 - while (monNomVar[i] == "," or monNomVar[i] == " ") : - monNomVarOk=monNomVar[0:i] - i=i-1 - monNomVar=monNomVarOk - i=0 - while (monNomVar[i] == " ") : - monNomVarOk=monNomVar[1:] - i=i+1 - monNomVar=monNomVarOk - if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar) - except : - #else : - logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg") - pass - return liste_valeurs - - -#-------------------------------------------------------------------------- -def chercheValeurSelonGenea3(jdc,liste_cherche_valeur): -#-------------------------------------------------------------------------- - liste_valeurs=[] - for genea in liste_cherche_valeur: - profondeur=len(genea) - if profondeur > 3 : - print "la methode chercheValeurSelonGenea ne convient" - print "pas pour cette genealogie" - assert(0) - command=genea[0] - fact=genea[1] - mc=genea[2] - - for c in jdc.root.childNodes: - if c.name != command : continue - for mcf in c.childNodes: - if mcf.name != fact : continue - l=mcf.childNodes[:] - for ll in l: - for lc in ll.childNodes: - if lc.name !=mc : continue - MonTexte=lc.getText(jdc) - try : - #if ( 1) : - exec MonTexte in dict_contexte - #monNomVar=MonTexte.split("=")[1][0:-1] - monNomVar=MonTexte.split("=")[1] - monNomVarOk=monNomVar - i=-1 - while (monNomVar[i] == "," or monNomVar[i] == " ") : - monNomVarOk=monNomVar[0:i] - i=i-1 - monNomVar=monNomVarOk - i=0 - while (monNomVar[i] == " ") : - monNomVarOk=monNomVar[1:] - i=i+1 - monNomVar=monNomVarOk - if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar) - except : - #else : - logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg") - pass - return liste_valeurs diff --git a/Traducteur/changeValeur.py b/Traducteur/changeValeur.py deleted file mode 100644 index 50b0c9c9..00000000 --- a/Traducteur/changeValeur.py +++ /dev/null @@ -1,317 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -from Traducteur.utils import lineToDict -import logging -from Traducteur.dictErreurs import ecritErreur -from Traducteur.load import jdcSet -from Traducteur.renamemocle import decaleLignesdeNBlancs -from Traducteur.removemocle import removeMotCleInFact -from Traducteur import regles - - -#-------------------------------------------------------------------------- -def changementValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): -#-------------------------------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command : continue - trouveUnMC=0 - for mc in c.childNodes: - if mc.name != motcle : continue - trouveUnMC=1 - TexteMC=mc.getText(jdc) - liste_ligne_MC=TexteMC.splitlines() - indexLigneGlob=mc.lineno-1 - indexTexteMC=0 - while indexLigneGlob < mc.endline : - if indexTexteMC > len(liste_ligne_MC)-1 : break - MaLigneGlob=jdc.getLines()[indexLigneGlob] - MaLigneTexte=liste_ligne_MC[indexTexteMC] - for Valeur in DictNouvVal : - MaLigneTexteDict=lineToDict(MaLigneTexte) - trouvecol=MaLigneTexte.find(Valeur) - if trouvecol > -1: - trouve=(Valeur==MaLigneTexteDict[trouvecol]) - else: - trouve=False - if trouve: - debut=MaLigneGlob.find(motcle) - if debut==-1 : debut=0 - Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) - Nouveau=MaLigneGlob[0:debut]+Nouveau - jdc.getLines()[indexLigneGlob]=Nouveau - MaLigneTexte=Nouveau # raccourci honteux mais ... - MaLigneGlob=Nouveau - if Valeur in liste : - ecritErreur((command,motcle,Valeur),indexLigneGlob) - else : - logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) - boolChange=1 - indexLigneGlob=indexLigneGlob+1 - indexTexteMC=indexTexteMC+1 - if (trouveUnMC == 0) and ( defaut == 1): - ecritErreur((command,motcle,"DEFAUT"),c.lineno) - if boolChange : jdc.reset(jdc.getSource()) - -#-------------------------------------------------------------------------------- -def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=regles.SansRegle,defaut=0): -#-------------------------------------------------------------------------------- - - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command : continue - for mcF in c.childNodes: - if mcF.name != fact : continue - l=mcF.childNodes[:] - l.reverse() - for ll in l: - trouveUnMC=0 - for mc in ll.childNodes: - if mc.name != motcle:continue - if ensemble.verif(c) == 0 : continue - trouveUnMC=1 - TexteMC=mc.getText(jdc) - liste_ligne_MC=TexteMC.splitlines() - indexLigneGlob=mc.lineno-1 - indexTexteMC=0 - while indexLigneGlob < mc.endline : - if indexTexteMC > len(liste_ligne_MC)-1 : break - MaLigneGlob=jdc.getLines()[indexLigneGlob] - MaLigneTexte=liste_ligne_MC[indexTexteMC] - for Valeur in DictNouvVal : - MaLigneTexteDict=lineToDict(MaLigneTexte) - trouvecol=MaLigneTexte.find(Valeur) - if trouvecol > -1: - trouve=(Valeur==MaLigneTexteDict[trouvecol]) - else: - trouve=False - if trouve: - debut=MaLigneGlob.find(motcle) - if debut==-1 : debut=0 - Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) - Nouveau=MaLigneGlob[0:debut]+Nouveau - jdc.getLines()[indexLigneGlob]=Nouveau - MaLigneTexte=Nouveau # raccourci honteux mais ... - MaLigneGlob=Nouveau - if Valeur in liste : - ecritErreur((command,fact,motcle,Valeur),indexLigneGlob) - else : - logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) - boolChange=1 - indexLigneGlob=indexLigneGlob+1 - indexTexteMC=indexTexteMC+1 - if (trouveUnMC == 0) and ( defaut == 1): - logging.warning("OPTION (defaut) de CALCG a verifier ligne %s" ,c.lineno ) - ecritErreur((command,fact,motcle,"DEFAUT"),c.lineno) - if boolChange : jdc.reset(jdc.getSource()) - -#-------------------------------------------------------------------------------- -def changementValeurDsMCFSiRegle(jdc,command,fact,motcle,DictNouvVal,liste_regles,defaut=0): -#-------------------------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - liste=() - changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,mesRegles,defaut) - -#--------------------------------------------------------------------------------------- -def changementValeurDsMCFAvecAvertissement(jdc, command, fact,motcle,DictNouvVal,liste): -#--------------------------------------------------------------------------------------- - if command not in jdcSet : return - defaut=0 - if liste[-1] == "defaut" : - defaut=1 - changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,defaut) - -#-------------------------------------------------------------------------- -def changementValeurAvecAvertissement(jdc, command,motcle,DictNouvVal,liste): -#-------------------------------------------------------------------------- - if command not in jdcSet : return - defaut=0 - if liste[-1] == "defaut" : - defaut=1 - changementValeur(jdc,command,motcle,DictNouvVal,liste,defaut) - -#-------------------------------------------------------------------------- -def suppressionValeurs(jdc, command,motcle,liste): -#-------------------------------------------------------------------------- - - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command : continue - for mc in c.childNodes: - if mc.name != motcle : continue - indexLigneGlob=mc.lineno-1 - while indexLigneGlob < mc.endline-1 : - MaLigneTexte = jdc.getLines()[indexLigneGlob] - MaLigne=MaLigneTexte - for Valeur in liste : - debutMC =MaLigne.find(motcle) - if debutMC ==-1 : debutMC=0 - debut1=MaLigne[0:debutMC] - chercheLigne=MaLigne[debutMC:] - trouve=chercheLigne.find(Valeur) - premier=0 - if trouve > 1 : #on a au moins une quote - debut=debut1 + chercheLigne[0:trouve-1] - index = -1 - while (-1 * index) < len(debut) : - if (debut[index] == "(") : - premier = 1 - if index == -1 : - index=len(debut) - else : - index=index+1 - break - if (debut[index] == "," ) : - break - if (debut[index] != " " ) : - assert(0) - index = index -1 - debLigne = debut[0:index] - fin=trouve+len(Valeur)+1 - if premier == 1 and chercheLigne[fin] == ',': fin = fin + 1 # on supprime la , - finLigne = chercheLigne[fin:] - MaLigne_tmp=debLigne+finLigne - # traitement ligne commancant par , - if len(MaLigne_tmp.strip()) > 0 : - if MaLigne_tmp.strip()[0]==',' : - MaLigne=MaLigne_tmp.strip()[1:] - else : - MaLigne=MaLigne_tmp[0:] - else : - MaLigne=MaLigne_tmp[0:] - boolChange=1 - jdc.getLines()[indexLigneGlob]=MaLigne - indexLigneGlob=indexLigneGlob+1 - if boolChange : jdc.reset(jdc.getSource()) - -#---------------------------------------------- -def appelleMacroSelonValeurConcept(jdc,macro,genea): -#---------------------------------------------- - if macro not in jdcSet : return - boolChange=0 - fact=genea[0] - motcle=genea[1] - chaine="CO" - for c in jdc.root.childNodes: - if c.name != macro : continue - for mcF in c.childNodes: - if mcF.name != fact : continue - l=mcF.childNodes[:] - l.reverse() - for ll in l: - trouveValeur=0 - for mc in ll.childNodes: - if mc.name != motcle:continue - TexteMC=mc.getText(jdc) - liste_ligne_MC=TexteMC.splitlines() - indexLigneGlob=mc.lineno-2 - trouveTexteMC=0 - trouveegal=0 - trouvechaine=0 - trouveparent=0 - trouvequote=0 - while indexLigneGlob < mc.endline : - indexLigneGlob=indexLigneGlob+1 - MaLigneTexte=jdc.getLines()[indexLigneGlob] - - # on commence par chercher TABLE par exemple - # si on ne trouve pas on passe a la ligne suivante - if ( trouveTexteMC == 0 ) : - indice=MaLigneTexte.find(motcle) - if indice < 0 : continue - trouveTexteMC=1 - else : - indice=0 - - # on cherche = - aChercher=MaLigneTexte[indice:] - if (trouveegal == 0 ): - indice=aChercher.find("=") - if indice < 0 : continue - trouveegal = 1 - else : - indice = 0 - - # on cherche CO - aChercher2=aChercher[indice:] - if (trouvechaine == 0 ): - indice=aChercher2.find(chaine) - if indice < 0 : continue - trouvechaine = 1 - else : - indice = 0 - - #on cherche ( - aChercher3=aChercher2[indice:] - if (trouveparent == 0 ): - indice=aChercher3.find('(') - if indice < 0 : continue - trouveparent = 1 - else : - indice = 0 - - #on cherche la ' - aChercher4=aChercher3[indice:] - if (trouvequote == 0 ): - indice=aChercher4.find("'") - indice2=aChercher4.find('"') - if (indice < 0) and (indice2 < 0): continue - if (indice < 0) : indice=indice2 - trouvequote = 1 - else : - indice = 0 - - trouveValeur=1 - aChercher5=aChercher4[indice+1:] - indice=aChercher5.find("'") - if indice < 0 : indice=aChercher5.find('"') - valeur=aChercher5[:indice] - break - - if trouveValeur==0 : - logging.error("Pb de traduction pour MACR_LIGNE_COUPE : Pas de nom de Concept identifiable") - return - - if boolChange : - jdc.reset(jdc.getSource()) - logging.error("Pb du traduction pour MACR_LIGNE_COUPE : Deux noms de Concept possibles") - return - - boolChange=1 - ligneaTraiter=jdc.getLines()[c.lineno-1] - debut=ligneaTraiter[0:c.colno] - suite=valeur+"=" - fin=ligneaTraiter[c.colno:] - ligne=debut+suite+fin - jdc.getLines()[c.lineno-1]=ligne - nbBlanc=len(valeur)+1 - if c.lineno < c.endline: - decaleLignesdeNBlancs(jdc,c.lineno,c.endline-1,nbBlanc) - if boolChange : jdc.reset(jdc.getSource()) - -#---------------------------------------------- -def changeTouteValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): -#---------------------------------------------- - if macro not in jdcSet : return - boolChange=0 diff --git a/Traducteur/dictErreurs.py b/Traducteur/dictErreurs.py deleted file mode 100644 index 82fc058f..00000000 --- a/Traducteur/dictErreurs.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 Traducteur.load import jdcSet - - -def ecritErreur(listeGena,ligne=None) : - from sys import dict_erreurs - maCle="" - for Mot in listeGena : - maCle=maCle+"_"+Mot - #try : - if ( 1 == 1) : - maClef=maCle[1:] - if maClef in dict_erreurs : - if ligne != None : - logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) - else : - logging.warning("%s",dict_erreurs[maClef]) - else : - maCle="" - for Mot in listeGena[:-1] : - maCle=maCle+"_"+Mot - maClef=maCle[1:] - maClef=maCle+"_"+"VALEUR" - if maClef in dict_erreurs : - if ligne != None : - logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) - else : - logging.warning("%s",dict_erreurs[maClef]) - #except : - # pass - -def genereErreurPourCommande(jdc,listeCommande) : - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if type(listeCommande)==list: - for Mot in listeCommande : - if c.name != Mot :continue - ecritErreur((Mot,),c.lineno) - else: - if c.name != listeCommande :continue - ecritErreur((listeCommande,),c.lineno) - -def genereErreurMotCleInFact(jdc,command,fact,mocle): - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - for ll in l: - for n in ll.childNodes: - if n.name != mocle: - continue - else : - ecritErreur((command,fact,mocle,),c.lineno) - -def genereErreurMCF(jdc,command,fact): - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact: - continue - else : - ecritErreur((command,fact,),c.lineno) - -def genereErreurValeur(jdc,command,fact,list_valeur): - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - texte=mc.getText(jdc) - for valeur in list_valeur: - trouve=texte.find(valeur) - if trouve > -1 : - logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,mc.lineno) - -def genereErreurValeurDsMCF(jdc,command,fact,mocle,list_valeur): - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - for ll in l: - for n in ll.childNodes: - if n.name != mocle:continue - texte=n.getText(jdc) - for valeur in list_valeur: - trouve=texte.find(valeur) - if trouve > -1 : - logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,n.lineno) diff --git a/Traducteur/inseremocle.py b/Traducteur/inseremocle.py deleted file mode 100644 index 19dc1ceb..00000000 --- a/Traducteur/inseremocle.py +++ /dev/null @@ -1,289 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 Traducteur.parseur import FactNode -from Traducteur.load import jdcSet -from Traducteur.dictErreurs import ecritErreur -from Traducteur import regles -debug=0 - - -#----------------------------------- -def insereMotCle(jdc,recepteur,texte): -#----------------------------------- -# appelle la methode selon la classe -# du recepteur - - if recepteur.name not in jdcSet : return - if recepteur.__class__.__name__ == "Command" : - if debug : print (" Ajout de ", texte, "dans la commande : " ,recepteur.name ) - insereMotCleDansCommande(jdc,recepteur,texte) - return - - -#-------------------------------------------- -def insereMotCleDansCommande(jdc,command,texte): -#--------------------------------------------- -# insere le texte comme 1er mot cle -# de la commande - if command.name not in jdcSet : return - if debug : print ("insereMotCle ", texte , " dans ", command.name) - numcol=chercheDebut1Mot(jdc,command) - if numcol > 0 : - jdc.splitLine(command.lineno,numcol) - indice = -1 - while texte[indice] == " " or texte[indice] == "\n": - indice = indice -1 - if texte[indice] != "," : texte=texte+"," - texteinfo=texte - texte=texte+'\n' - jdc.addLine(texte,command.lineno) - logging.info("Insertion de : %s ligne %d", texteinfo,command.lineno) - if numcol > 0 : # Les mots clefs etaient sur la meme ligne - jdc.joinLineandNext(command.lineno) - -#------------------------------------------------------------- -def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True): -#---------------------------------------------------------------- - if debug : print ("insereMotCle ", texte , " dans ", facteur.name) - - if texte[-1] == "\n" : texte=texte[0:-1] - ancien=jdc.getLine(facteur.lineno) - - # On va chercher la derniere ) pour ajouter avant - # on va verifier s il il y a un , avant - # si le texte ne finit pas par une "," - # on en met une - - indice = -1 - while texte[indice] == " " : - indice = indice -1 - if texte[indice] != "," : - texte=texte+"," - if (texte.find("#") > -1) and (texte.find("#") < texte.find(",")) : - texte=texte+"\n," - - texteinfo=texte - texte=texte+"\n" - - ligneaCouper=facteur.lineno - while ligneaCouper < facteur.endline + 1 : - trouve=0 - trouveF=0 - trouveP=0 - indiceDeCoupe=0 - while ancien.find("_F") > 0 : - longueur=len(ancien) - indice=ancien.find("_F") - indiceParcours=0 - # pour ne pas tenir compte des autres noms - # Attention si 2 MCF sur la meme ligne (la 1ere) - if trouveF == 0 : - if ((ligneaCouper!=facteur.lineno) or ((ancien.find(facteur.name) < indice ) or (ancien.find(facteur.name) < 0))) : - trouveF=1 - indiceParcours=indice + 2 - # attention pour regler DEFI_FONCTION .. - else : - indiceDeCoupe=indiceDeCoupe+indice+2 - ancien=ancien[indice +2:] - continue - if trouveF == 1 : - indiceDeCoupe=indiceDeCoupe+indice - # print "indice de Parcours" ,indiceParcours - # print ancien[indiceParcours] - # print ancien[indiceParcours+1] - # print ancien[indiceParcours+2] - while indiceParcours < longueur : - if ancien[indiceParcours] == "(" : - trouveP=1 - # print ("trouve". - break - if ancien[indiceParcours] != " " : - trouveP=0 - # print ("mouv") - break - indiceParcours = indiceParcours+1 - trouve = trouveP * trouveF - if trouve : break - ancien=ancien[indice+1:] - if trouve : - debut=indiceDeCoupe + 3 - if(jdc.getLine(ligneaCouper)[debut:]!="\n"): - jdc.splitLine(ligneaCouper,debut) - jdc.addLine(texte,ligneaCouper) - jdc.joinLineandNext(ligneaCouper) - logging.info("Insertion de %s ligne %d", texteinfo,ligneaCouper) - - # Gestion du cas particulier du mot clef facteur vide - if facteur.childNodes == []: - jdc.joinLineandNext(facteur.lineno) - - ligneaCouper=ligneaCouper+1 - ancien=jdc.getLine(ligneaCouper) - if not plusieursFois and trouve : break - - -#----------------------------------- -def chercheDebut1Mot(jdc,command): -#----------------------------------- -# Retourne le numero de colonne si le 1er mot clef est -# sur la meme ligne que le mot clef facteur -# -1 sinon - assert (command.childNodes != []) - debut=-1 - node1=command.childNodes[0] - if hasattr(node1,"lineno"): - if node1.lineno == command.lineno : - debut=node1.colno - else: - debut=chercheDebutFacteur(jdc,command) - if debut == -1 and debug : print ("attention!!! pb pour trouver le debut dans ", command) - return debut - -#----------------------------------- -def chercheDebutFacteur(jdc,facteur): -#----------------------------------- - debut=-1 - ligne=jdc.getLines()[facteur.lineno] - debut=ligne.find("_F") - if debut > -1 : debut=debut + 3 - return debut - - -#----------------------------------- -def chercheAlignement(jdc,command): -#----------------------------------- -# Retourne le nb de blanc -# pour aligner sur le 1er mot clef fils - assert (command.childNodes != []) - node1=command.childNodes[0] - nbBlanc=node1.colno - return " "*nbBlanc - -#--------------------------------------------------------------------------------------------------------- -def chercheOperInsereFacteur(jdc,nomcommande,nouveau,ensemble=regles.SansRegle, estunFacteur=1, erreur=0): -#-------------------------------------------------------------------------------------------------------- -# Cherche l oper -# cree le texte -# appelle insereMotCle pour ajouter le texte -# - boolChange=0 - if estunFacteur : - texte=nouveau+"=_F()," - else : - texte=nouveau - if nomcommande not in jdcSet : return - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != nomcommande:continue - if ensemble.verif(c) == 0 : continue - if erreur : ecritErreur((nomcommande,nouveau),c.lineno) - boolChange=1 - insereMotCle(jdc,c,texte) - if boolChange : jdc.reset(jdc.getSource()) - -#---------------------------------------------------------------------------------------- -def chercheOperInsereFacteurSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): -#---------------------------------------------------------------------------------------- -# Cherche l oper -# cree le texte -# appelle insereMotCle pour ajouter le texte -# - if nomcommande not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) - -#---------------------------------------------------------------------------------------- -def chercheOperInsereMotCleSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=0): -#---------------------------------------------------------------------------------------- - if nomcommande not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) - - -#--------------------------------------------------------------------------------------------------------- -def chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): -#--------------------------------------------------------------------------------------------------------- - if nomcommande not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur,erreur=1) - -#------------------------------------------------------------------------------------------------- -def ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,ensemble=regles.SansRegle, estunFacteur=0): -#------------------------------------------------------------------------------------------------- -# Cherche la commande -# Cherche le MCF -# cree le texte -# appelle insereMotCle pour ajouter le texte -# - if commande not in jdcSet : return - if estunFacteur : - texte=nouveau+"=_F()," - else : - texte=nouveau - commands= jdc.root.childNodes[:] - commands.reverse() - boolChange=0 - for c in commands: - if c.name != commande : continue - for mcF in c.childNodes: - if mcF.name != fact : continue - if ensemble.verif(c) == 0 : continue - boolChange=1 - insereMotCleDansFacteur(jdc,mcF,texte) - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------------------------------------------------------- -def ajouteMotClefDansFacteurSiRegle(jdc,commande,fact,nouveau,liste_regles,estunFacteur=0): -#------------------------------------------------------------------------------------------- -# - if commande not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,mesRegles,estunFacteur) - -#------------------------------------------------------------------------------------------- -def ajouteMotClefDansFacteurCourantSiRegle(jdc,commande,fact,nouveau,liste_regles): -#------------------------------------------------------------------------------------------- -# - if commande not in jdcSet : return - ensemble=regles.ensembleRegles(liste_regles) - commands= jdc.root.childNodes[:] - commands.reverse() - boolChange=0 - for c in commands: - if c.name != commande : continue - for mcF in c.childNodes: - if mcF.name != fact : continue - l=mcF.childNodes[:] - l.reverse() - for ll in l: - if ensemble.verif(ll) == 0 : continue - boolChange=1 - n=ll.childNodes[0] - ligneaCouper=n.lineno-1 - numcol=n.colno - jdc.splitLine(ligneaCouper+1,numcol) - texte=nouveau+",\n" - jdc.addLine(texte,ligneaCouper+1) - logging.info("Insertion de %s dans %s : ligne %d", nouveau,c.name,ligneaCouper+1) - if numcol > 0 : - jdc.joinLineandNext(ligneaCouper+1) - if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur/load.py b/Traducteur/load.py deleted file mode 100644 index 97128e83..00000000 --- a/Traducteur/load.py +++ /dev/null @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -import re -from Traducteur import parseur -from Traducteur.mocles import parseKeywords - -import sets -jdcSet=sets.Set() - - -class JDCTrad: - """Cet objet conserve toutes les informations relatives a un fichier de commandes .comm""" - - def __init__(self,src,atraiter): - #---------------------------------------- - self.atraiter=atraiter - self.init(src,atraiter) - commands= self.root.childNodes[:] - commands.reverse() - for c in commands: - jdcSet.add(c.name) - - def init(self,src,atraiter): - #--------------------------- - # construction de self.lines - self.root=parseur.parser(src,atraiter) - self.lines=src.splitlines(1) - - def parseKeywords(self): - #----------------------- - # construction de fils (cf mocles.py) - parseKeywords(self.root) - - def reset(self,src): - #----------------------- - # reconstruction - self.init(src,self.atraiter) - self.parseKeywords() - - def getSource(self): - #----------------------- - # retourne la concatenation de - # toutes les lignes - return "".join(self.getLines()) - - def getLine(self,linenum): - #----------------------- - # retourne la linenumieme ligne - return self.getLines()[linenum-1] - - def getLines(self): - #---------------------------- - # retourne toutes les lignes - return self.lines - - def addLine(self,ligne,numero) : - #---------------------------- - # insere le texte contenu dans ligne - # dans la liste self.lines au rang numero - Ldebut=self.lines[0:numero] - Lmilieu=[ligne,] - Lfin=self.lines[numero:] - self.lines=Ldebut+Lmilieu+Lfin - - - def splitLine(self,numeroLigne,numeroColonne) : - #---------------------------------------------- - # coupe la ligne numeroLigne en 2 a numeroColonne - # ajoute des blancs en debut de 2nde Ligne pour - # aligner - numeroLigne = numeroLigne -1 - Ldebut=self.lines[0:numeroLigne] - if len(self.lines) > numeroLigne : - Lfin=self.lines[numeroLigne+1:] - else : - Lfin=[] - Lsplit=self.lines[numeroLigne] - LigneSplitDebut=Lsplit[0:numeroColonne]+"\n" - LigneSplitFin=" "*numeroColonne+Lsplit[numeroColonne:] - Lmilieu=[LigneSplitDebut,LigneSplitFin] - - self.lines=Ldebut+Lmilieu+Lfin - - def joinLineandNext(self,numeroLigne) : - #-------------------------------------- - # concatene les lignes numeroLigne et numeroLigne +1 - # enleve les blancs de debut de la ligne (numeroLigne +1) - Ldebut=self.lines[0:numeroLigne-1] - if len(self.lines) > numeroLigne : - Lfin=self.lines[numeroLigne+1:] - else : - Lfin=[] - - ligneMilieuDeb=self.lines[numeroLigne - 1 ] - ligneMilieuDeb=ligneMilieuDeb[0:-1] - ligneMilieuFin=self.lines[numeroLigne] - for i in range(len(ligneMilieuFin)): - if ligneMilieuFin[i] != " " : - ligneMilieuFin=ligneMilieuFin[i:] - break - Lmilieu=[ligneMilieuDeb+ligneMilieuFin,] - - self.lines=Ldebut+Lmilieu+Lfin - - def supLignes(self,debut,fin): - #------------------------ - Ldebut=self.lines[0:debut-1] - Lfin=self.lines[fin:] - self.lines=Ldebut+Lfin - - def remplaceLine(self,numeroLigne,nouveauTexte) : - #------------------------------------------------ - self.lines[numeroLigne]=nouveauTexte - -def getJDC(filename,atraiter): -#---------------------------- -# lit le JDC - f=open(filename) - src=f.read() - f.close() - jdc=JDCTrad(src,atraiter) - return jdc - -def getJDCFromTexte(texte,atraiter): -#----------------------------------- -# lit le JDC - jdc=JDCTrad(texte,atraiter) - return jdc diff --git a/Traducteur/log.py b/Traducteur/log.py deleted file mode 100644 index 21c4ab61..00000000 --- a/Traducteur/log.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 os -logger=logging.getLogger() - -def initialise(flog=None): - if flog == None : - MonHome=os.environ['HOME'] - MaDir=MonHome+"/Eficas_install" - try : - os.mkdir(MaDir) - except : - pass - try : - os.listdir(MaDir) - flog=MaDir+"/convert.log" - except : - flog='/tmp/convert.log' - - hdlr=logging.FileHandler(flog,'w') - formatter = logging.Formatter('%(levelname)s: %(message)s') - hdlr.setFormatter(formatter) - logger.addHandler(hdlr) - logger.setLevel(logging.INFO) - return hdlr - - -def ferme (hdlr) : - logger.removeHandler(hdlr) diff --git a/Traducteur/mocles.py b/Traducteur/mocles.py deleted file mode 100644 index ad5d9bd4..00000000 --- a/Traducteur/mocles.py +++ /dev/null @@ -1,163 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 compiler -import types -from Traducteur.parseur import Keyword, FactNode, lastParen, lastParen2,maskStringsAndComments -from Traducteur.visiteur import KeywordFinder, visitor -from Traducteur.utils import indexToCoordinates, lineToDict, dictToLine - -debug=0 - -#------------------------ -def parseFact(match,c,kw): -#------------------------ - submatch=match[2] - lastpar=match[0]+lastParen(c.src[match[0]:]) - if type(submatch[0][0]) ==types.IntType: - #mot cle facteur isole - no=FactNode() - kw.addChild(no) - for ii in range(len(submatch)-1): - e=submatch[ii] - x,y=indexToCoordinates(c.src,e[0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,submatch[ii+1][0]) - endline=y+c.lineno - endcol=x - no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) - #last one - e=submatch[-1] - x,y=indexToCoordinates(c.src,e[0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,lastpar-1) - endline=y+c.lineno - endcol=x - no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) - else: - #mot cle facteur multiple - ii=0 - for l in submatch: - lastpar=l[0][0]+lastParen2(c.src[l[0][0]:]) - ii=ii+1 - no=FactNode() - kw.addChild(no) - for j in range(len(l)-1): - e=l[j] - x,y=indexToCoordinates(c.src,e[0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,l[j+1][0]) - endline=y+c.lineno - endcol=x - no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) - #last one - e=l[-1] - x,y=indexToCoordinates(c.src,e[0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,lastpar-1) - endline=y+c.lineno - endcol=x - no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) - - -#----------------------- -def parseKeywords(root): -#----------------------- - """A partir d'un arbre contenant des commandes, ajoute les noeuds - fils correspondant aux mocles de la commande - """ - #print "parseKeywords" - #traceback.print_stack(limit=5) - - matchFinder=KeywordFinder() - - for c in root.childNodes: - maskedsrc=maskStringsAndComments(c.src) - #on supprime seulement les blancs du debut pour pouvoir compiler - #meme si la commande est sur plusieurs lignes seul le debut compte - ast=compiler.parse(c.src.lstrip()) - #print ast - #Ne pas supprimer les blancs du debut pour avoir les bons numeros de colonne - matchFinder.reset(maskedsrc) - visitor.walk(ast, matchFinder) - #print matchFinder.matches - if len(matchFinder.matches) > 1: - # plusieurs mocles trouves : - # un mocle commence au debut du keyword (matchFinder.matches[i][0]) - # et finit juste avant le keyword suivant - # (matchFinder.matches[i+1][0]]) - for i in range(len(matchFinder.matches)-1): - if debug:print "texte:",c.src[matchFinder.matches[i][0]:matchFinder.matches[i+1][0]] - x,y=indexToCoordinates(c.src,matchFinder.matches[i][0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) - endline=y+c.lineno - endcol=x - if debug:print matchFinder.matches[i][0],matchFinder.matches[i][1],lineno,colno,endline,endcol - kw=Keyword(matchFinder.matches[i][1],lineno,colno,endline,endcol) - c.addChild(kw) - submatch= matchFinder.matches[i][2] - if submatch: - parseFact(matchFinder.matches[i],c,kw) - - # dernier mocle : - # il commence au debut du dernier keyword - # (matchFinder.matches[i+1][0]) et - # finit avant la parenthese fermante de la commande (c.lastParen) - - if debug:print "texte:",c.src[matchFinder.matches[i+1][0]:c.lastParen] - x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,c.lastParen) - endline=y+c.lineno - endcol=x - if debug:print matchFinder.matches[i+1][0],matchFinder.matches[i+1][1],lineno,colno,endline,endcol - kw=Keyword(matchFinder.matches[i+1][1],lineno,colno,endline,endcol) - c.addChild(kw) - submatch= matchFinder.matches[i+1][2] - if submatch: - parseFact(matchFinder.matches[i+1],c,kw) - - elif len(matchFinder.matches) == 1: - #un seul mocle trouve : - # il commence au debut du keyword (matchFinder.matches[0][0]) et - # finit juste avant la parenthese fermante de la - # commande (c.lastParen) - if debug:print "texte:",c.src[matchFinder.matches[0][0]:c.lastParen] - x,y=indexToCoordinates(c.src,matchFinder.matches[0][0]) - lineno=y+c.lineno - colno=x - x,y=indexToCoordinates(c.src,c.lastParen) - endline=y+c.lineno - endcol=x - if debug:print matchFinder.matches[0][0],matchFinder.matches[0][1],lineno,colno,endline,endcol - kw=Keyword(matchFinder.matches[0][1],lineno,colno,endline,endcol) - c.addChild(kw) - submatch= matchFinder.matches[0][2] - if submatch: - parseFact(matchFinder.matches[0],c,kw) - else: - pass diff --git a/Traducteur/movemocle.py b/Traducteur/movemocle.py deleted file mode 100644 index b6b8d919..00000000 --- a/Traducteur/movemocle.py +++ /dev/null @@ -1,346 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2017 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. -# -# 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 Traducteur import removemocle -from Traducteur import inseremocle -from Traducteur.parseur import lastParen -from Traducteur.load import jdcSet -debug=0 - -#----------------------------------------------------- -def moveMotCleFromFactToFather(jdc,command,fact,mocle): -#----------------------------------------------------- -# exemple type : IMPR_GENE - - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command:continue - boolchange_c=0 - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - for ll in l: - for n in ll.childNodes: - if n.name != mocle:continue - # test boolchange_c :il faut le faire une seule fois par commande sinon duplication du mot clé - if boolchange_c != 0 :continue - if debug : print "Changement de place :", n.name, n.lineno, n.colno - MonTexte=n.getText(jdc); - boolChange=1 - boolchange_c=1 - inseremocle.insereMotCle(jdc,c,MonTexte) - logging.info("Changement de place %s ligne %s ",n.name, n.lineno) - - if boolChange : jdc.reset(jdc.getSource()) - removemocle.removeMotCleInFact(jdc,command,fact,mocle) - - -#---------------------------------------------------------------------------- -def moveMotCleFromFactToFactMulti(jdc,oper,factsource,mocle,liste_factcible): -#---------------------------------------------------------------------------- -# exemple type STAT_NON_LINE et RESI_INTER_RELA - for factcible in liste_factcible : - moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible) - removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) - - -#---------------------------------------------------------------------------- -def moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible): -#---------------------------------------------------------------------------- - if oper not in jdcSet : return - if debug : print "moveMotCleFromFactToFact pour " ,oper,factsource,mocle,factcible - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != oper : continue - cible=None - for mc in c.childNodes: - if mc.name != factcible : - continue - else : - cible=mc - break - if cible==None : - if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "cible non trouvée" - continue - - for mc in c.childNodes: - source=None - if mc.name != factsource: - continue - else : - source=mc - break - if source==None : - if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "source non trouvée" - continue - - if debug : print "Changement pour ", oper, " ", factsource, " ",mocle, "cible et source trouvées" - l=source.childNodes[:] - for ll in l: - for n in ll.childNodes: - if n.name != mocle:continue - MonTexte=n.getText(jdc); - inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) - boolChange=1 - logging.info("Changement de place %s ligne %s vers %s",n.name, n.lineno, cible.name) - if boolChange : jdc.reset(jdc.getSource()) - removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) - - - - -#----------------------------------------------------------------------- -def moveMotClefInOperToFact(jdc,oper,mocle,factcible,plusieursFois=True): -#----------------------------------------------------------------------- -# Attention le cas type est THETA_OLD dans calc_G - - if oper not in jdcSet : return - if debug : print "movemocleinoper pour " ,oper,mocle,factcible - boolChange=9 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != oper : continue - cible=None - for mc in c.childNodes: - if mc.name != factcible : - continue - else : - cible=mc - break - if cible==None : - if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée" - continue - - source=None - for mc in c.childNodes: - if mc.name != mocle: - continue - else : - source=mc - break - if source==None : - if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée" - continue - MonTexte=source.getText(jdc); - boolChange=1 - inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte,plusieursFois) - if boolChange : jdc.reset(jdc.getSource()) - removemocle.removeMotCle(jdc,oper,mocle) - -#------------------------------------------------------ -def copyMotClefInOperToFact(jdc,oper,mocle,factcible): -#------------------------------------------------------ - - if oper not in jdcSet : return - if debug : print "movemocleinoper pour " ,oper,mocle,factcible - boolChange=9 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != oper : continue - cible=None - for mc in c.childNodes: - if mc.name != factcible : - continue - else : - cible=mc - break - if cible==None : - if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée" - continue - - source=None - for mc in c.childNodes: - if mc.name != mocle: - continue - else : - source=mc - break - if source==None : - if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée" - continue - MonTexte=source.getText(jdc); - boolChange=1 - inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) - if boolChange : jdc.reset(jdc.getSource()) - -#---------------------------------------------------------------------- -def moveMCFToCommand(jdc,command,factsource,commandcible,factcible): -#---------------------------------------------------------------------- -# exemple CONTACT en 10 -# CONTACT devient commande DEFI_CONTACT/ZONE -# - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command : continue - for mcF in c.childNodes: - if mcF.name != factsource : continue - l=mcF.getText(jdc) - texte=l.replace(factsource,factcible) - texte='xxxx='+commandcible+'('+texte+')\n' - jdc.splitLine(c.lineno,0) - jdc.addLine(texte,c.lineno) - logging.info("Deplacement de %s dans %s ligne %s",factsource,commandcible,c.lineno) - boolChange=1 - if boolChange : - jdc.reset(jdc.getSource()) - jdcSet.add(commandcible) - -#----------------------------------------------------- -def fusionMotCleToFact(jdc,command,listeMc,factcible,defaut=0): -#----------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command : continue - list_val=[] - trouveUnMC=0 - for mc in c.childNodes: - if mc.name not in listeMc : continue - val=mc.getText(jdc).split("=")[1].split(",")[0] - list_val.append(val) - trouveUnMC=1 - if trouveUnMC : - TexteMC=factcible+"=(" - for val in list_val : TexteMC=TexteMC+val+"," - TexteMC=TexteMC[:-1]+")," - inseremocle.insereMotCle(jdc,c,TexteMC) - jdc.reset(jdc.getSource()) - boolChange=1 - if boolChange : - jdc.reset(jdc.getSource()) - for mc in listeMc : - removemocle.removeMotCle(jdc,command,mc) - jdc.reset(jdc.getSource()) - -#----------------------------------------------------- -def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0): -#----------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command : continue - list_val=[] - trouveUnMC=0 - for mcF in c.childNodes: - if mcF.name != fact: continue - for ll in mcF.childNodes[:]: - for mc in ll.childNodes: - if mc.name not in listeMc : continue - val=mc.getText(jdc).split("=")[1].split(",")[0] - list_val.append(val) - trouveUnMC=1 - if trouveUnMC : - TexteMC=new_name+"=("+",".join(list_val)+")," - inseremocle.insereMotCleDansFacteur(jdc,mcF,TexteMC) - jdc.reset(jdc.getSource()) - boolChange=1 - if boolChange : - jdc.reset(jdc.getSource()) - for mc in listeMc : - removemocle.removeMotCleInFact(jdc,command,fact,mc) - jdc.reset(jdc.getSource()) - -#----------------------------------------------------- -def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0): -#----------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command : continue - list_val=[] - trouveUnMC=0 - TexteMC=factcible+'=(' - esp1=' '*len(TexteMC) - pp=0 - for mcF in c.childNodes: - if mcF.name not in listeMcF : continue - trouveUnMC=1 - val=mcF.getText(jdc) - # esp=esp1+(inseremocle.chercheDebutFacteur(jdc,mcF)-len(mcF.name))*' ' - esp=esp1+inseremocle.chercheAlignement(jdc,c) - # print len(esp) - for ll in mcF.childNodes[:]: - # if(pp>0): TexteMC+=esp - TexteMC+='_F(' - for mc in ll.childNodes: - val=mc.getText(jdc) - TexteMC+=val+'\n '+esp - # if('#' in val.split('\n')[-1]): TexteMC+='\n'+esp+' ' - lastkey = ''.join(val.split('=')[-1].split(' ')) - if((len(lastkey.split('(')) - len(lastkey.split(')'))) >= 0): - TexteMC += '),\n'+esp - # TexteMC+='),' - TexteMC+='),' - # print TexteMC - if(trouveUnMC): - inseremocle.insereMotCle(jdc,c,TexteMC) - jdc.reset(jdc.getSource()) - boolChange=1 - if boolChange : - jdc.reset(jdc.getSource()) - for mcF in listeMcF : - removemocle.removeMotCle(jdc,command,mcF) - jdc.reset(jdc.getSource()) - - - -#-------------------------------------------------------------------- -def eclaMotCleToFact(jdc,command,motcle,mot1,mot2,defaut=0): -#-------------------------------------------------------------------------- -# exemple STA10 pesanteur devient MCF avec eclatement des valeurs dans les MC -# On suppose que le MC est sur une seule ligne - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command : continue - trouveUnMC=0 - for mc in c.childNodes: - if mc.name != motcle : continue - trouveUnMC=1 - TexteMC=mc.getText(jdc) - indexLigneGlob=mc.lineno-1 - MaLigneGlob=jdc.getLines()[indexLigneGlob] - Ligne=TexteMC.split('(')[1].split(')')[0].split(',') - motcle1=mot1+"="+Ligne[0] - motcle2=mot2+"=("+Ligne[1]+','+Ligne[2]+','+Ligne[3]+')' - texte=motcle+'=_F('+motcle1+','+motcle2+')' - num=lastParen(TexteMC) - Nouveau=MaLigneGlob.replace(TexteMC[0:num],texte) - jdc.getLines()[indexLigneGlob]=Nouveau - logging.info("Transformation de %s dans %s ligne %s",motcle,command,c.lineno) - boolChange=1 - if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur/parseur.py b/Traducteur/parseur.py deleted file mode 100644 index 3a525a2f..00000000 --- a/Traducteur/parseur.py +++ /dev/null @@ -1,273 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 re,string -import compiler - -debug=0 - -escapedQuotesRE = re.compile(r"(\\\\|\\\"|\\\')") -stringsAndCommentsRE = \ - re.compile("(\"\"\".*?\"\"\"|'''.*?'''|\"[^\"]*\"|\'[^\']*\'|#.*?\n)", re.DOTALL) -allchars = string.maketrans("", "") -allcharsExceptNewline = allchars[: allchars.index('\n')]+allchars[allchars.index('\n')+1:] -allcharsExceptNewlineTranstable = string.maketrans(allcharsExceptNewline, '*'*len(allcharsExceptNewline)) - -#------------------------------ -def maskStringsAndComments(src): -#------------------------------ - """Remplace tous les caracteres dans commentaires et strings par des * """ - - src = escapedQuotesRE.sub("**", src) - allstrings = stringsAndCommentsRE.split(src) - # every odd element is a string or comment - for i in xrange(1, len(allstrings), 2): - if allstrings[i].startswith("'''")or allstrings[i].startswith('"""'): - allstrings[i] = allstrings[i][:3]+ \ - allstrings[i][3:-3].translate(allcharsExceptNewlineTranstable)+ \ - allstrings[i][-3:] - else: - allstrings[i] = allstrings[i][0]+ \ - allstrings[i][1:-1].translate(allcharsExceptNewlineTranstable)+ \ - allstrings[i][-1] - - return "".join(allstrings) - -#un nombre queconque de blancs,un nom,des blancs -pattern_oper = re.compile(r"^\s*(.*?=\s*)?([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) -pattern_proc = re.compile(r"^\s*([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) - -implicitContinuationChars = (('(', ')'), ('[', ']'), ('{', '}')) -linecontinueRE = re.compile(r"\\\s*(#.*)?$") -emptyHangingBraces = [0,0,0,0,0] - -#-------------------------------------- -class UnbalancedBracesException: pass -#-------------------------------------- - -#----------- -class Node: -#----------- - def __init__(self): - self.childNodes=[] - - def addChild(self,node): - self.childNodes.append(node) - - -#------------------- -class FactNode(Node): -#------------------- - pass - - -#------------------- -class JDCNode(Node): -#------------------- - def __init__(self,src): - Node.__init__(self) - self.src=src - -#------------------- -class Command(Node): -#------------------- - def __init__(self,name,lineno,colno,firstparen): - Node.__init__(self) - self.name=name - self.lineno=lineno - self.colno=colno - self.firstparen=firstparen - -#------------------- -class Keyword(Node): -#------------------- - def __init__(self,name,lineno,colno,endline,endcol): - Node.__init__(self) - self.name=name - self.lineno=lineno - self.colno=colno - self.endline=endline - self.endcol=endcol - - def getText(self,jdc): - if self.endline > self.lineno: - debut=jdc.getLines()[self.lineno-1][self.colno:] - fin = jdc.getLines()[self.endline-1][:self.endcol] - texte=debut - lignecourante=self.lineno - while lignecourante < self.endline -1 : - texte = texte + jdc.getLines()[lignecourante] - lignecourante = lignecourante + 1 - if chaineBlanche(fin) == 0 : - texte=texte + fin - if texte[-1] == "\n" : - texte=texte[0:-1] - else: - texte = jdc.getLines()[self.lineno-1][self.colno:self.endcol] - return texte - -#------------------------- -def chaineBlanche(texte) : -#------------------------- -# retourne 1 si la chaine est composee de " " -# retourne 0 sinon - bool = 1 ; - for i in range(len(texte)) : - if texte[i] != " " : bool = 0 - return bool - -#------------------- -def printNode(node): -#------------------- - if hasattr(node,'name'): - print node.name - else: - print "pas de nom pour:",node - for c in node.childNodes: - printNode(c) - -#------------------------ -def parser(src,atraiter): -#------------------------ - """Parse le texte src et retourne un arbre syntaxique (root). - - Cet arbre syntaxique a comme noeuds (childNodes) les commandes a traiter (liste atraiter) - """ - lines=src.splitlines(1) - maskedSrc=maskStringsAndComments(src) - maskedLines=maskedSrc.splitlines(1) - - root=JDCNode(src) - - # (a) dans un premier temps on extrait les commandes et on les insere - # dans un arbre (root) les noeuds fils sont stockes dans - # root.childNodes (liste) - lineno=0 - for line in maskedLines: - lineno=lineno+1 - if debug:print "line",lineno,":",line - m=pattern_proc.match(line) - if m and (m.group(1) in atraiter): - if debug:print m.start(3),m.end(3),m.start(4) - root.addChild(Command(m.group(1),lineno,m.start(1),m.end(3))) - else: - m=pattern_oper.match(line) - if m and (m.group(2) in atraiter): - root.addChild(Command(m.group(2),lineno,m.start(2),m.end(4))) - - #(b) dans un deuxieme temps , on recupere le texte complet de la commande - # jusqu'a la derniere parenthese fermante - - # iterateur sur les lignes physiques masquees - iterlines=iter(maskedLines) - - linenum=0 - for c in root.childNodes: - lineno=c.lineno - colno=c.colno # debut de la commande - while linenum < lineno: - line=iterlines.next() - linenum=linenum+1 - if linenum != lineno: - if debug:print "line %s:"%linenum, line - tmp = [] - hangingBraces = list(emptyHangingBraces) - hangingComments = 0 - while 1: - # update hanging braces - for i in range(len(implicitContinuationChars)): - contchar = implicitContinuationChars[i] - numHanging = hangingBraces[i] - - hangingBraces[i] = numHanging+line.count(contchar[0]) - \ - line.count(contchar[1]) - - hangingComments ^= line.count('"""') % 2 - hangingComments ^= line.count("'''") % 2 - - if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0: - raise UnbalancedBracesException() - - if linecontinueRE.search(line): - tmp.append(lines[linenum-1]) - elif hangingBraces != emptyHangingBraces: - tmp.append(lines[linenum-1]) - elif hangingComments: - tmp.append(lines[linenum-1]) - else: - tmp.append(lines[linenum-1]) - src="".join(tmp) - c.src=src - c.endline=linenum - decal=len(line)-line.rindex(')') - c.lastParen=len(src)-decal - if debug:print "logical line %s %s:" % (c.lineno,c.endline),src - break - line=iterlines.next() - linenum=linenum+1 - - return root - - -#----------------- -def lastParen(src): -#----------------- - """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string - - La string doit contenir la premiere parenthese ouvrante - """ - - src=maskStringsAndComments(src) - level=0 - i,n=0,len(src) - while i < n: - ch=src[i] - i=i+1 - if ch in ('(','['): - level=level+1 - if ch in (')',']'): - if level == 0: - raise UnbalancedBracesException() - level=level-1 - if level == 0: - #derniere parenthese fermante - return i - -#------------------- -def lastParen2(src): -#------------------- - """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string - - La string ne contient pas la premiere parenthese ouvrante - """ - src=maskStringsAndComments(src) - level=1 - i,n=0,len(src) - while i < n: - ch=src[i] - i=i+1 - if ch in ('(','['): - level=level+1 - if ch in (')',']'): - if level == 0: - raise UnbalancedBracesException() - level=level-1 - if level == 0: - #derniere parenthese fermante - return i diff --git a/Traducteur/regles.py b/Traducteur/regles.py deleted file mode 100644 index 034844f7..00000000 --- a/Traducteur/regles.py +++ /dev/null @@ -1,524 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -Définition des règles -""" - -debug = 0 - -#-------------------- -class ensembleRegles : -#-------------------- - """ - Ensemble des règles - """ - def __init__(self, liste_regles): - self.liste = [] - for item in liste_regles : - args, clefRegle = item - r = regle(clefRegle, args) - self.liste.append(r) - - def verif(self, commande) : - """ - Vérification - """ - bool = 1 - for regle in self.liste : - result = regle.verif(commande) - bool = bool*result - return bool - -#-------------------------------- -class pasDeRegle(ensembleRegles): -#-------------------------------- - """ - Pas de règle - """ - def __init__(self) : - pass - - def verif (self, commande) : - """ - Vérification - """ - return 1 - - -#------------ -class regle : -#------------ - """ - Règle - """ - def __init__(self, clef_regle, args): - self.fonction = dictionnaire_regle[clef_regle] - self.list_args = args - self.bool = 0 - - def verif(self, commande): - """ - Vérification - """ - f = self.fonction(self.list_args) - return f.verif(commande) - -#--------------------- -class existeMCFParmi : -#--------------------- - """ - Existance du mot-clé facteur parmi la liste - """ - def __init__(self, list_arg): - self.listeMCF = list_arg - - def verif(self, commande) : - """ - Vérification - """ - bool = 0 - for c in commande.childNodes : - if c.name in self.listeMCF : - bool = 1 - break - return bool - -#--------------------- -class nexistepasMCFParmi(existeMCFParmi) : -#--------------------- - """ - Existance du mot-clé facteur parmi la liste - """ - def __init__(self, list_arg): - self.listeMCF = list_arg - - def verif(self, commande) : - """ - Vérification - """ - bool = existeMCFParmi.verif(self, commande) - if bool : return 0 - return 1 - -#---------------------- -class existeMCsousMCF : -#---------------------- - """ - Existance du mot-clé simple sous le mot-clé facteur - """ - def __init__(self, list_arg): - self.liste = list_arg - self.MCF = self.liste[0] - self.MC = self.liste[1] - - def verif(self, commande): - """ - Vérification - """ - bool = 0 - for mcf in commande.childNodes : - if mcf.name != self.MCF : continue - l = mcf.childNodes[:] - l.reverse() - for ll in l: - for mc in ll.childNodes: - if mc.name != self.MC : continue - bool = 1 - return bool - -#---------------------- -class existeMCsousMCFcourant : -#---------------------- - """ - Existance du mot-clé simple sous le mot-clé facteur courant - """ - def __init__(self, list_arg): - self.liste = list_arg - self.MC = self.liste[0] - - def verif(self, mcf): - """ - Vérification - """ - bool = 0 - l = mcf.childNodes[:] - l.reverse() - for mc in l: - if mc.name != self.MC : continue - bool = 1 - return bool - -#----------------------------------------- -class nexistepasMCsousMCF(existeMCsousMCF): -#----------------------------------------- - """ - Absence du mot-clé simple sous le mot-clé facteur - """ - def __init__(self, list_arg): - existeMCsousMCF.__init__(self, list_arg) - - - def verif(self, commande): - """ - Vérification - """ - bool = existeMCsousMCF.verif(self, commande) - if bool : return 0 - return 1 - -#----------------------------------------- -class nexistepasMCsousMCFcourant(existeMCsousMCFcourant): -#----------------------------------------- - """ - Absence du mot-clé simple sous le mot-clé facteur courant - """ - def __init__(self, list_arg): - existeMCsousMCFcourant.__init__(self, list_arg) - - - def verif(self, commande): - """ - Vérification - """ - bool = existeMCsousMCFcourant.verif(self, commande) - if bool : return 0 - return 1 - -#------------- -class existe : -#-------------- - """ - Existance du mot-clé simple - """ - def __init__(self, list_arg): - self.genea = list_arg - - def chercheMot(self, niveau, commande): - """ - Recherche du mot - """ - if commande == None : return 0 - if niveau == len(self.genea) : return 1 - texte = self.genea[niveau] - for c in commande.childNodes : - if c.name == texte : - niveau = niveau+1 - return self.chercheMot(niveau, c) - return None - - def verif(self, commande): - """ - Vérification - """ - bool = self.chercheMot(0, commande) - if bool == None : bool = 0 - return bool - -#------------- -class nexistepas : -#-------------- - """ - Absence du mot-clé simple - """ - def __init__(self, list_arg): - self.genea = list_arg - - def chercheMot(self, niveau, commande): - """ - Recherche du mot - """ - if commande == None : return 0 - if niveau == len(self.genea) : return 1 - texte = self.genea[niveau] - for c in commande.childNodes : - if c.name == texte : - niveau = niveau+1 - return self.chercheMot(niveau, c) - return None - - def verif(self, commande): - """ - Vérification - """ - bool = self.chercheMot(0, commande) - if bool : return 0 - return 1 - -#------------------------------- -class MCsousMCFaPourValeur : -#------------------------------ - """ - Égalité du mot-clé simple à une valeur sous le mot-clé facteur - """ - def __init__(self, list_arg): - assert (len(list_arg)==4) - self.genea = list_arg[0:-2] - self.MCF = list_arg[0] - self.MC = list_arg[1] - self.Val = list_arg[2] - self.Jdc = list_arg[3] - - def verif(self, commande): - """ - Vérification - """ - bool = 0 - for mcf in commande.childNodes : - if mcf.name != self.MCF : continue - l = mcf.childNodes[:] - l.reverse() - for ll in l: - for mc in ll.childNodes: - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - if (TexteMC.find(self.Val) < 0 ): continue - bool = 1 - return bool - -#------------------------------- -class MCsousMCFcourantaPourValeur : -#------------------------------ - """ - Égalité du mot-clé simple à une valeur sous le mot-clé facteur courant - """ - def __init__(self, list_arg): - assert (len(list_arg)==3) - self.genea = list_arg[0:-1] - self.MC = list_arg[0] - self.Val = list_arg[1] - self.Jdc = list_arg[2] - - def verif(self, mcf): - """ - Vérification - """ - bool = 0 - l = mcf.childNodes[:] - l.reverse() - for mc in l: - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - if (TexteMC.find(self.Val) < 0 ): continue - bool = 1 - return bool - - -#----------------------------- -class MCsousMCFaPourValeurDansListe : -#---------------------------- - """ - Égalité du mot-clé simple à une valeur dans une liste - sous le mot-clé facteur - """ - def __init__(self, list_arg): - assert (len(list_arg)==4) - self.genea = list_arg[0:-2] - self.MCF = list_arg[0] - self.MC = list_arg[1] - self.LVal = list_arg[2] - self.Jdc = list_arg[3] - - def verif(self, commande): - """ - Vérification - """ - bool = 0 - for mcf in commande.childNodes : - if mcf.name != self.MCF : continue - l = mcf.childNodes[:] - l.reverse() - for ll in l: - for mc in ll.childNodes: - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - for Val in self.LVal: - if (TexteMC.find(Val) < 0 ): continue - bool = 1 - return bool - -#----------------------------- -class MCsousMCFcourantaPourValeurDansListe : -#---------------------------- - """ - Égalité du mot-clé simple à une valeur dans une liste - sous le mot-clé facteur - """ - def __init__(self, list_arg): - assert (len(list_arg)==3) - self.genea = list_arg[0:-1] - self.MC = list_arg[0] - self.LVal = list_arg[1] - self.Jdc = list_arg[2] - - def verif(self, mcf): - """ - Vérification - """ - bool = 0 - l = mcf.childNodes[:] - l.reverse() - for mc in l: - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - for Val in self.LVal: - if (TexteMC.find(Val) < 0 ): continue - bool = 1 - return bool - -#----------------------------------------- -class MCsousMCFcourantnaPasPourValeurDansListe(MCsousMCFcourantaPourValeurDansListe) : -#----------------------------------------- - """ - Non égalité du mot-clé simple à une valeur dans une liste - sous le mot-clé facteur - """ - def __init__(self, list_arg): - MCsousMCFcourantaPourValeurDansListe.__init__(self, list_arg) - - - def verif(self, commande): - bool = MCsousMCFcourantaPourValeurDansListe.verif(self, commande) - if bool : return 0 - return 1 - -#----------------------------------------- -class MCsousMCFnaPasPourValeurDansListe(MCsousMCFaPourValeurDansListe) : -#----------------------------------------- - """ - Non égalité du mot-clé simple à une valeur dans une liste - sous le mot-clé facteur - """ - def __init__(self, list_arg): - MCsousMCFaPourValeurDansListe.__init__(self, list_arg) - - - def verif(self, commande): - bool = MCsousMCFaPourValeurDansListe.verif(self, commande) - if bool : return 0 - return 1 - -#------------------------------ -class MCaPourValeur : -#------------------------------ - """ - Égalité du mot-clé à une valeur - """ - def __init__(self, list_arg): - assert (len(list_arg)==3) - self.MC = list_arg[0] - self.Val = list_arg[1] - self.Jdc = list_arg[2] - - def verif(self, commande): - """ - Vérification - """ - bool = 0 - for mc in commande.childNodes : - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - if (TexteMC.find(self.Val) < 0 ): continue - bool = 1 - return bool - -#----------------------------------------- -class MCnaPasPourValeur(MCaPourValeur) : -#----------------------------------------- - """ - Non égalité du mot-clé à une valeur - """ - def __init__(self, list_arg): - MCaPourValeur.__init__(self, list_arg) - - def verif(self, commande): - """ - Vérification - """ - bool = MCaPourValeur.verif(self, commande) - if bool : return 0 - return 1 - -#------------------------------ -class MCaPourValeurDansListe : -#------------------------------ - """ - Égalité du mot-clé à une valeur dans une liste - """ - def __init__(self, list_arg): - assert (len(list_arg)==3) - self.MC = list_arg[0] - self.LVal = list_arg[1] - self.Jdc = list_arg[2] - - def verif(self, commande): - """ - Vérification - """ - bool = 0 - for mc in commande.childNodes : - if mc.name != self.MC : continue - TexteMC = mc.getText(self.Jdc) - #print "TexteMC=",type(TexteMC),TexteMC - #print "LVal=",type(self.LVal),self.LVal - for Val in self.LVal: - #print "Val=",type(Val),Val - #print "Find",TexteMC.find(Val) - if (TexteMC.find(Val) < 0 ): continue - bool = 1 - return bool - -#----------------------------------------- -class MCnaPasPourValeurDansListe(MCaPourValeurDansListe) : -#----------------------------------------- - """ - Non égalité du mot-clé à une valeur dans une liste - """ - def __init__(self, list_arg): - MCaPourValeurDansListe.__init__(self, list_arg) - - def verif(self, commande): - """ - Vérification - """ - bool = MCaPourValeurDansListe.verif(self, commande) - if bool : return 0 - return 1 - -dictionnaire_regle = {"existe":existe, - "nexistepas":nexistepas, - "existeMCFParmi":existeMCFParmi, - "nexistepasMCFParmi":nexistepasMCFParmi, - "existeMCsousMCF":existeMCsousMCF, - "nexistepasMCsousMCF":nexistepasMCsousMCF, - "MCsousMCFaPourValeur":MCsousMCFaPourValeur, - "MCsousMCFaPourValeurDansListe":MCsousMCFaPourValeurDansListe, - "MCaPourValeur":MCaPourValeur, - "MCnaPasPourValeur":MCnaPasPourValeur, - "existeMCsousMCFcourant":existeMCsousMCFcourant, - "nexistepasMCsousMCFcourant":nexistepasMCsousMCFcourant, - "MCsousMCFcourantaPourValeur":MCsousMCFcourantaPourValeur, - "MCsousMCFcourantaPourValeurDansListe":MCsousMCFcourantaPourValeurDansListe, - "MCsousMCFcourantnaPasPourValeurDansListe":MCsousMCFcourantnaPasPourValeurDansListe, - "MCsousMCFnaPasPourValeurDansListe":MCsousMCFnaPasPourValeurDansListe, - "MCaPourValeurDansListe":MCaPourValeurDansListe, - "MCnaPasPourValeurDansListe":MCnaPasPourValeurDansListe} - - -SansRegle = pasDeRegle() diff --git a/Traducteur/removemocle.py b/Traducteur/removemocle.py deleted file mode 100644 index 6694cc1d..00000000 --- a/Traducteur/removemocle.py +++ /dev/null @@ -1,215 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 Traducteur import regles -from Traducteur.parseur import FactNode -from Traducteur.dictErreurs import ecritErreur -from Traducteur.load import jdcSet - -debug=0 -#debug=1 -#on n'a qu'un mocle par commande. On peut donc supprimer le mocle sans trop de precautions (a part iterer a l'envers sur les commandes) -#avant de supprimer un autre mocle, on remet a jour l'arbre syntaxique (lineno,colno,etc.) - - -#----------------------------------------------------------------------- -def removeMotCle(jdc,command,mocle,ensemble=regles.SansRegle,erreur = 0): -#----------------------------------------------------------------------- - #on itere sur les commandes a l'envers pour ne pas polluer les numeros de ligne avec les modifications - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != mocle:continue - if ensemble.verif(c) == 0 : continue - if erreur : ecritErreur((command,mocle),c.lineno) - boolChange=1 - removeMC(jdc,c,mc) - - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------------------- -def removeMotCleSiRegle(jdc,command,mocle,liste_regles) : -#------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - removeMotCle(jdc,command,mocle,mesRegles,erreur=0) - -#---------------------------------------------------------------- -def removeMotCleSiRegleAvecErreur(jdc,command,mocle,liste_regles) : -#-------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - removeMotCle(jdc,command,mocle,mesRegles,erreur=1) - -#---------------------------------------------------------------- -def removeMotCleAvecErreur(jdc,command,mocle) : -#-------------------------------------------------------------- - if command not in jdcSet : return - removeMotCle(jdc,command,mocle,erreur=1) - - -#-------------------------------------------------------------------- -def removeCommande(jdc,command,ensemble=regles.SansRegle,erreur=0): -#-------------------------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - commands= jdc.root.childNodes[:] - commands.reverse() - for c in commands: - if c.name != command:continue - if ensemble.verif(c) == 0 : continue - boolChange=1 - if erreur : ecritErreur((command,),c.lineno) - jdc.supLignes(c.lineno,c.endline) - logging.warning("Suppression de %s ligne %s",c.name,c.lineno) - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------------------------- -def removeCommandeSiRegle(jdc,command,liste_regles): -#------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - removeCommande(jdc,command,mesRegles,0) - -#------------------------------------------------------------- -def removeCommandeSiRegleAvecErreur(jdc,command,liste_regles): -#------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - removeCommande(jdc,command,mesRegles,1) - -#--------------------------------- -def removeMC(jdc,c,mc): -#--------------------------------- - if debug : print "Suppression de:",c.name,mc.name,mc.lineno,mc.colno,mc.endline,mc.endcol - logging.info("Suppression de %s dans %s ligne %d",mc.name,c.name,mc.lineno) - - if mc.endline > mc.lineno: - if debug:print "mocle sur plusieurs lignes--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:] - jdc.getLines()[mc.lineno-1]=jdc.getLines()[mc.lineno-1][:mc.colno] - jdc.getLines()[mc.endline-1]=jdc.getLines()[mc.endline-1][mc.endcol:] - - #attention : supprimer les lignes a la fin - jdc.getLines()[mc.lineno:mc.endline-1]=[] - else: - if debug:print "mocle sur une ligne--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:mc.endcol] - s=jdc.getLines()[mc.lineno-1] - jdc.getLines()[mc.lineno-1]=s[:mc.colno]+s[mc.endcol:] - fusionne(jdc,mc.lineno-1) - -#--------------------------------------------------------------------------------- -def removeMotCleInFact(jdc,command,fact,mocle,ensemble=regles.SansRegle,erreur=0): -#---------------------------------------------------------------------------------- - # on itere sur les commandes a l'envers pour ne pas polluer - # les numeros de ligne avec les modifications - if command not in jdcSet : return - commands= jdc.root.childNodes[:] - commands.reverse() - boolChange=0 - for c in commands: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - l.reverse() - for ll in l: - for n in ll.childNodes: - if n.name != mocle:continue - if ensemble.verif(c) == 0 : continue - if erreur : ecritErreur((command,fact,mocle),c.lineno) - boolChange=1 - removeMC(jdc,c,n) - - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------------------------------ -def removeMotCleInFactSiRegle(jdc,command,fact,mocle,liste_regles): -#------------------------------------------------------------------ - if command not in jdcSet : return - erreur=0 - mesRegles=regles.ensembleRegles(liste_regles) - removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) - -#---------------------------------------------------------------------- -def removeMotCleInFactSiRegleAvecErreur(jdc,command,fact,mocle,liste_regles): -#---------------------------------------------------------------------- - if command not in jdcSet : return - erreur=1 - mesRegles=regles.ensembleRegles(liste_regles) - removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) - - -#---------------------------------------------------------------------- -def removeMotCleInFactCourantSiRegle(jdc,command,fact,mocle,liste_regles,erreur=0): -#---------------------------------------------------------------------- - if command not in jdcSet : return - ensemble=regles.ensembleRegles(liste_regles) - commands= jdc.root.childNodes[:] - commands.reverse() - boolChange=0 - for c in commands: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - l.reverse() - for ll in l: - if ensemble.verif(ll) == 0 : continue - for n in ll.childNodes: - if n.name != mocle:continue - if erreur : ecritErreur((command,fact,mocle),c.lineno) - boolChange=1 - removeMC(jdc,c,n) - - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------ -def fusionne(jdc,numLigne): -#------------------------------------------ -# fusionne la ligne numLigne et numLigne+1 -# si la ligne numLigne+1 ne contient que des parentheses -# fermantes -# et si la ligne numLigne ne contient pas par un "#" -# Attention a la difference de numerotation -# jdc.getLines()[numLigne] donne la ligne numLigne + 1 -# alors que joinLineandNext(numLigne) travaille sur le tableau - index=0 - texte=jdc.getLines()[numLigne] - fusion=1 - while (index < len(texte)) : - if texte[index] not in (" ",",",")",";","\n") : - fusion=0 - break - index=index+1 - - if fusion == 0 : return; - - texte=jdc.getLines()[numLigne -1] - if texte.find("#") < 0 : - fusion=1 - else : - fusion=0 - - if fusion : - jdc.joinLineandNext(numLigne) diff --git a/Traducteur/renamemocle.py b/Traducteur/renamemocle.py deleted file mode 100644 index 2372bf41..00000000 --- a/Traducteur/renamemocle.py +++ /dev/null @@ -1,188 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -from Traducteur.parseur import FactNode -from Traducteur.load import jdcSet -from Traducteur import regles -from Traducteur.dictErreurs import ecritErreur -#debug=1 -debug=0 - -#on n'a qu'un mocle par commande. -#en fin de traitement, on remet a jour l'arbre syntaxique (lineno,colno,etc.) - -#-------------------------------------------------------------------------------- -def renameMotCle(jdc,command,mocle,new_name, erreur=0,ensemble=regles.SansRegle): -#-------------------------------------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != mocle:continue - if ensemble.verif(c) == 0 : continue - boolChange=1 - if debug:print "Renommage de:",c.name,mc.name,mc.lineno,mc.colno - if erreur : - ecritErreur((command,mocle),c.lineno) - else : - logging.info("Renommage de: %s %s ligne %d en %s",c.name,mc.name,mc.lineno,new_name) - s=jdc.getLines()[mc.lineno-1] - jdc.getLines()[mc.lineno-1]=s[:mc.colno]+new_name+s[mc.colno+len(mocle):] - diff=len(new_name) - len(mocle) - decaleLignesdeNBlancs(jdc,mc.lineno,mc.endline-1,diff) - - if boolChange : jdc.reset(jdc.getSource()) - -#------------------------------------------------------ -def renameMotCleAvecErreur(jdc,command,mocle,new_name): -#------------------------------------------------------ - if command not in jdcSet : return - renameMotCle(jdc,command,mocle,new_name,1,regles.SansRegle) - -#-------------------------------------------------------------------------- -def renameMotCleSiRegle(jdc,command,mocle,new_name,liste_regles, erreur=0): -#-------------------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - renameMotCle(jdc,command,mocle,new_name, erreur,mesRegles) - -#------------------------------------------- -def renameOper(jdc,command,new_name): -#------------------------------------------- - if command not in jdcSet : return - jdcSet.add(new_name) - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command:continue - if debug:print "Renommage de:",c.name,c.lineno,c.colno - logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) - boolChange=1 - s=jdc.getLines()[c.lineno-1] - jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] - diff=len(new_name) - len(command) - decaleLignesdeNBlancs(jdc,c.lineno,c.endline,diff) - if boolChange : jdc.reset(jdc.getSource()) - -#---------------------------------------------------------- -def decaleLignesdeNBlancs(jdc,premiere,derniere,nbBlanc): -#---------------------------------------------------------- - ligne = premiere + 1 - while ligne < derniere : - s=jdc.getLines()[ligne] - if nbBlanc > 0 : - jdc.getLines()[ligne] = nbBlanc*" " + s - else : - toutblancs=-1*nbBlanc*" " - if jdc.getLines()[ligne][0:-1*nbBlanc] == toutblancs: - jdc.getLines()[ligne] = s[-1*nbBlanc:] - ligne=ligne+1 - -#--------------------------------------------------------------------------------------------- -def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegle, erreur=0): -#--------------------------------------------------------------------------------------------- - if command not in jdcSet : return - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - #on itere a l'envers - l.reverse() - for ll in l: - for n in ll.childNodes: - if n.name != mocle:continue - if ensemble.verif(c) == 0 : continue - s=jdc.getLines()[n.lineno-1] - jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] - boolChange=1 - if erreur : - ecritErreur((command,fact,mocle),c.lineno) - else : - logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) - - if boolChange : jdc.reset(jdc.getSource()) - -#-------------------------------------------------------------------------- -def renameMotCleInFactSiRegle(jdc,command,fact,mocle,new_name,liste_regles): -#-------------------------------------------------------------------------- - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - renameMotCleInFact(jdc,command,fact,mocle,new_name,mesRegles) - -def renameMotCleInFactCourantSiRegle(jdc,command,fact,mocle,new_name,liste_regles,erreur=0): -#-------------------------------------------------------------------------- - if command not in jdcSet : return - ensemble=regles.ensembleRegles(liste_regles) - boolChange=0 - for c in jdc.root.childNodes: - if c.name != command:continue - for mc in c.childNodes: - if mc.name != fact:continue - l=mc.childNodes[:] - #on itere a l'envers - l.reverse() - for ll in l: - if ensemble.verif(ll) == 0 : continue - for n in ll.childNodes: - if n.name != mocle:continue - s=jdc.getLines()[n.lineno-1] - jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] - boolChange=1 - if erreur : - ecritErreur((command,fact,mocle),c.lineno) - else : - logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) - - if boolChange : jdc.reset(jdc.getSource()) - - -#----------------------------------------------------------------- -def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle): -#----------------------------------------------------------------- -# nom de la commande "ancien format" , nom de la commande " nouveau format " - if command not in jdcSet : return - jdcSet.add(new_name) - boolChange=0 - if debug : - if ensemble != regles.SansRegle : - logging.info("traitement de %s renomme en %s sous conditions", command, new_name) - else : - logging.info("traitement de %s renomme en %s ", command, new_name) - for c in jdc.root.childNodes: - if c.name != command:continue - if ensemble.verif(c) == 0 : continue - boolChange=1 - if debug:print "Renommage de:",c.name,new_name ,c.lineno,c.colno - logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) - s=jdc.getLines()[c.lineno-1] - jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] - - if boolChange : jdc.reset(jdc.getSource()) - -#----------------------------------------------------------- -def renameCommandeSiRegle(jdc,command,new_name,liste_regles): -#----------------------------------------------------------- - - if command not in jdcSet : return - mesRegles=regles.ensembleRegles(liste_regles) - renameCommande(jdc,command,new_name,mesRegles) diff --git a/Traducteur/toto.comm b/Traducteur/toto.comm deleted file mode 100644 index a2f211ed..00000000 --- a/Traducteur/toto.comm +++ /dev/null @@ -1,10 +0,0 @@ -DEBUT(); - -CALC_NONO(reuse=MSLIN, - RESULTAT=MSLIN, - OPTION=('EPSI_NOEU','SIEQ_NOEU','EPEQ_NOEU','SIGM_NOEU',),); - -CALC_NONO(reuse=MSLIN, - RESULTAT=MSLIN, - OPTION=('AA','EPSI_NOEU','SIEQ_NOEU','EPEQ_NOEU','SIGM_NOEU',),); -FIN(); diff --git a/Traducteur/traduitV10V11.py b/Traducteur/traduitV10V11.py deleted file mode 100755 index f15f7b13..00000000 --- a/Traducteur/traduitV10V11.py +++ /dev/null @@ -1,1631 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -""" -usage="""usage: %prog [options] -Typical use is: - python traduitV10V11.py --infile=xxxx --outfile=yyyy -""" - -import log -import optparse -import sys - -from Traducteur.load import getJDC -from Traducteur.mocles import parseKeywords -from Traducteur.removemocle import * -from Traducteur.renamemocle import * -from Traducteur.renamemocle import * -from Traducteur.inseremocle import * -from Traducteur.changeValeur import * -from Traducteur.movemocle import * -from Traducteur.dictErreurs import * -from Traducteur.regles import pasDeRegle - -atraiter=( - "AFFE_CARA_ELEM", - "AFFE_CHAR_MECA", - "AFFE_CHAR_MECA_F", - "AFFE_CHAR_OPS011", - "AFFE_CHAR_THER", - "AFFE_CHAR_THER_F", - "AFFE_MATERIAU", - "AFFE_MODELE", - "ASSE_ELEM_SSD", - "ASSEMBLAGE", - "CALC_CHAM_ELEM", - "CALC_CHAMP", - "CALC_ECREVISSE", - "CALC_ELEM", - "CALC_ERREUR", - "CALC_ESSAI", - "CALC_EUROPLEXUS", - "CALC_FATIGUE", - "CALC_FERRAILLAGE", - "CALC_FONC_INTERP", - "CALC_FONCTION", - "CALC_FORC_AJOU", - "CALC_G", - "CALC_IFS_DNL", - "CALC_INTE_SPEC", - "CALC_MAC3COEUR", - "CALC_MATR_AJOU", - "CALC_MATR_ELEM", - "CALC_META", - "CALC_MISS", - "CALC_MODAL", - "CALC_MODE_ROTATION", - "CALC_NO", - "CALC_POINT_MAT", - "CALC_PRECONT", - "CALC_SENSI", - "CALC_SPEC", - "CALC_TABLE", - "CALC_THETA", - "COMB_FOURIER", - "COMB_SISM_MODAL", - "COPIER", - "CREA_CHAMP", - "CREA_ELEM_SSD", - "CREA_MAILLAGE", - "CREA_RESU", - "CREA_TABLE", - "DEBUT", - "DEFI_BASE_MODALE", - "DEFI_CABLE_BP", - "DEFI_COMPOR", - "DEFI_CONTACT", - "DEFI_COQU_MULT", - "DEFI_FICHIER", - "DEFI_FISS_XFEM", - "DEFI_FONC_ELEC", - "DEFI_FOND_FISS", - "DEFI_GLRC", - "DEFI_GROUP", - "DEFI_INTE_SPEC", - "DEFI_LIST_INST", - "DEFI_MATER_GC", - "DEFI_MATERIAU", - "DEFI_NAPPE", - "DEFI_PARA_SENSI", - "DEFI_PART_FETI", - "DEFI_SOL_MISS", - "DEFI_SPEC_TURB", - "DETRUIRE", - "DYNA_ALEA_MODAL", - "DYNA_ISS_VARI", - "DYNA_LINE_HARM", - "DYNA_LINE_TRAN", - "DYNA_NON_LINE", - "DYNA_SPEC_MODAL", - "DYNA_TRAN_MODAL", - "DYNA_VIBRA", - "EXEC_LOGICIEL", - "EXTR_RESU", - "EXTR_TABLE", - "FACTORISER", - "FORMULE", - "GENE_ACCE_SEISME", - "GENE_FONC_ALEA", - "GENE_VARI_ALEA", - "IMPR_CO", - "IMPR_DIAG_CAMPBELL", - "IMPR_FONCTION", - "IMPR_GENE", - "IMPR_OAR", - "IMPR_RESU", - "IMPR_STURM", - "IMPR_TABLE", - "INCLUDE", - "INCLUDE_MATERIAU", - "INFO_EXEC_ASTER", - "INFO_FONCTION", - "INFO_MODE", - "LIRE_CHAMP", - "LIRE_FONCTION", - "LIRE_IMPE_MISS", - "LIRE_INTE_SPEC", - "LIRE_MAILLAGE", - "LIRE_RESU", - "LIRE_TABLE", - "MACR_ADAP_MAIL", - "MACR_ASCOUF_CALC", - "MACR_ASCOUF_MAIL", - "MACR_ASPIC_CALC", - "MACR_ASPIC_MAIL", - "MACR_CARA_POUTRE", - "MACR_ECLA_PG", - "MACR_ECRE_CALC", - "MACR_ECREVISSE", - "MACR_ELEM_DYNA", - "MACR_FIABILITE", - "MACR_FIAB_IMPR", - "MACR_INFO_MAIL", - "MACR_LIGN_COUPE", - "MACRO_ELAS_MULT", - "MACRO_EXPANS", - "MACRO_MATR_AJOU", - "MACRO_MATR_ASSE", - "MACRO_MISS_3D", - "MACRO_MODE_MECA", - "MACRO_PROJ_BASE", - "MACR_RECAL", - "MACR_SPECTRE", - "MECA_STATIQUE", - "MODE_ITER_INV", - "MODE_ITER_SIMULT", - "MODE_STATIQUE", - "MODI_MODELE_XFEM", - "MODI_REPERE", - "NORM_MODE", - "NUME_DDL", - "NUME_DDL_GENE", - "OBSERVATION", - "POST_BORDET", - "POST_CHAMP", - "POST_CHAM_XFEM", - "POST_COQUE", - "POST_DECOLLEMENT", - "POST_DYNA_ALEA", - "POST_ELEM", - "POST_ENDO_FISS", - "POST_FATIGUE", - "POST_GP", - "POST_K1_K2_K3", - "POST_K_TRANS", - "POST_MAC3COEUR", - "POST_MAIL_XFEM", - "POST_RCCM", - "POST_RELEVE_T", - "POST_RUPTURE", - "POST_USURE", - "POURSUITE", - "PROJ_BASE", - "PROJ_CHAMP", - "PROJ_RESU_BASE", - "PROJ_SPEC_BASE", - "PROPA_FISS", - "PROPA_XFEM", - "RAFF_XFEM", - "RECU_FONCTION", - "RECU_GENE", - "RESOUDRE", - "REST_SPEC_PHYS", - "SIMU_POINT_MAT", - "STANLEY", - "STAT_NON_LINE", - "TEST_COMPOR", - "TEST_FICHIER", - "TEST_FONCTION", - "TEST_RESU", - "TEST_TABLE", - "TEST_TEMPS", - "THER_LINEAIRE", - "THER_NON_LINE", - "THER_NON_LINE_MO", - - "CALC_CHAMPNO", - "CALC_METANO", - "CALC_ERREURNO", - - ) - -dict_erreurs={ - - "CALC_G_THETA_DTAN_ORIG":"La valeur de DTAN_ORIG est maintenant calculée automatiquement", - "CALC_G_THETA_DTAN_EXTR":"La valeur de DTAN_EXTR est maintenant calculée automatiquement", - "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la définition du CONTACT : nommer DEFI_CONTACT,verifier les paramètres globaux et le mettre dans le calcul", - "DEFI_COMPOR_MONOCRISTAL_FAMI_SYST_GLIS":"Famille de système de glissement supprimée : choisir une autre famille", - "DEFI_COMPOR_MULTIFIBRE_DEFORMATION":"Il faut maintenant renseigner le mot-clé DEFORMATION dans STAT_NON_LINE ou DYNA_NON_LINE.", - "DEFI_MATERIAU_ECRO_FLEJOU":"Le comportement ECRO_FLEJOU a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi d'écrouissage'.", - "DEFI_MATERIAU_VMIS_POUTRE":"Le comportement VMIS_POUTRE a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi plastique.", - "DEFI_MATERIAU_VMIS_POUTRE_FO":"Le comportement VMIS_POUTRE_FO a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi plastique.", - "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_LMARC_IRRA_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_LMARC_IRRA_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_LMARC_IRRA_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", - "DEFI_MATERIAU_ENDO_SCALAIRE":"Les paramètres définissant la loi ENDO_SCALAIRE ont changé. Il faut renseigner les nouveaux paramètres.", - "DEFI_MATERIAU_MAZARS":"Le paramètres BETA définissant la loi MAZARS a été supprimé. Il faut renseigner le nouveau paramètre K.", - "DEFI_MATERIAU_MONO_VISC3":"Le comportement MONO_VISC3 a été supprimé.", - "DEFI_MATERIAU_MONO_DD_CC":"Le comportement MONO_DD_CC a été supprimé.", - "DYNA_LINE_TRAN_INCREMENT_FONC_INST":"Le mot-clé FONC_INST a été supprimé. Il faut maintenant utiliser ", - "LIRE_RESU_TYPE_RESU":"Il n'est plus possible de lire un résultat de type HARM_GENE. Il faut choisir un autre type.", - "MACRO_ELAS_MULT_CAS_CHARGE_OPTION":"Seule l'option SIEF_ELGA est permise pour MACRO_ELAS_MULT. Il faut calculer les autres options avec CALC_CHAMP.", - "MODI_MODELE_XFEM_CONTACT":"La formulation du contact aux arêtes P1P1A a été supprimée. Il faut choisir une autre formulation.", - "POST_GP":"La commande POST_GP a été supprimée. Il faut maintenant utiliser la commande CALC_GP.", - "AFFE_CARA_ELEM_COQUE_EPAIS_F":"Il n'est plus possible de faire d'analyse de sensibilité.", - "AFFE_CARA_ELEM_DISCRET_VALE_F":"Il n'est plus possible de faire d'analyse de sensibilité.", - "AFFE_CARA_ELEM_DISCRET_2D_VALE_F":"Il n'est plus possible de faire d'analyse de sensibilité.", - "CALC_CHAMP_REPE_COQUE":"Pour les éléments de structures, les résultats sont calculés sur tous les sous-points. Pour extraire un champ sur un seul sous-point, il faut utiliser POST_CHAMP.", - "CALC_THETA_THETA_BANDE":"L'option THETA_BANDE n'existe plus, il faut choisir entre THETA_2D ou THETA_3D." - } - -sys.dict_erreurs=dict_erreurs - -def traduc(infile,outfile,flog=None): - - hdlr=log.initialise(flog) - jdc=getJDC(infile,atraiter) - root=jdc.root - - #Parse les mocles des commandes - parseKeywords(root) - - genereErreurPourCommande(jdc,("CALC_SENSI",)) - - - #### traitement des cas particuliers ############################## - # On ne traite pas les commandes TEST* - removeCommande(jdc,"TEST_COMPOR") - removeCommande(jdc,"TEST_FICHIER") - removeCommande(jdc,"TEST_FONCTION") - removeCommande(jdc,"TEST_RESU") - removeCommande(jdc,"TEST_TABLE") - removeCommande(jdc,"TEST_TEMPS") - - #### traitement de AFFE_CARA_ELEM ############################## - # Déplacement de PREC_AIRE et PREC_INERTIE dans MULTIFIBRE - moveMotCleFromFactToFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_AIRE","MULTIFIBRE") - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_AIRE",pasDeRegle(),0) - moveMotCleFromFactToFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_INERTIE","MULTIFIBRE") - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_INERTIE",pasDeRegle(),0) - # Résorption de la sensibilité - genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","COQUE","EPAIS_F") - genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET","VALE_F") - genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET_2D","VALE_F") - # Suppression de GRILLE_NCOU - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","GRILLE","GRILLE_NCOU",pasDeRegle(),0) - # Suppression de ORIG_AXE - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","GRILLE","ORIG_AXE",pasDeRegle(),0) - - #### traitement de AFFE_CHAR_MECA/_F ############################## - renameMotCle(jdc,"AFFE_CHAR_MECA","SIGM_INTERNE","PRE_SIGM") - renameMotCle(jdc,"AFFE_CHAR_MECA","EPSI_INIT","PRE_EPSI") - renameMotCle(jdc,"AFFE_CHAR_MECA_F","SIGM_INTERNE","PRE_SIGM") - renameMotCle(jdc,"AFFE_CHAR_MECA_F","EPSI_INIT","PRE_EPSI") - - #### traitement de AFFE_CHAR_OPS011 ############################## - genereErreurPourCommande(jdc,("AFFE_CHAR_OPS011",)) - - #### traitement de AFFE_CHAR_THER/_F ############################## - renameMotCle(jdc,"AFFE_CHAR_THER","GRAD_TEMP_INIT","PRE_GRAD_TEMP") - renameMotCle(jdc,"AFFE_CHAR_THER_F","GRAD_TEMP_INIT","PRE_GRAD_TEMP") - - #### traitement de AFFE_MATERIAU ############################## - # VALE_REF obligatoire si NOM_VARC in ('TEMP', 'SECH') - lNOMVARC=["CORR","IRRA","HYDR","EPSA","M_ACIER","M_ZIRC","NEUT1","NEUT2"] - removeMotCleInFactSiRegle(jdc,"AFFE_MATERIAU","AFFE_VARC","VALE_REF",((("NOM_VARC",lNOMVARC,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) - # renommage CHAMP_GD en CHAM_GD - renameMotCleInFact(jdc,"AFFE_MATERIAU","AFFE_VARC","CHAMP_GD","CHAM_GD",pasDeRegle(),0) - - #### traitement de AFFE_MODELE ############################## - dXFEMCONT={"3D_XFEM_CONT":"3D","C_PLAN_XFEM_CONT":"C_PLAN","D_PLAN_XFEM_CONT":"D_PLAN"} - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dXFEMCONT) - - #### traitement de ASSE_ELEM_SSD ############################## - # Rien à faire - - #### traitement de ASSEMBLAGE ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de C_COMP_INCR ############################## - # Suppression de ALGO_C_PLAN et ALGO_1D - lCOMMANDE=["CALC_FORC_NONL","CALC_IFS_DNL","CALC_POINT_MAT", - "CALC_PRECONT","CALCUL","DYNA_NON_LINE","LIRE_RESU", - "MACR_ECREVISSE","SIMU_POINT_MAT","STAT_NON_LINE", - "TEST_COMPOR",] - for com in lCOMMANDE : - removeMotCleInFact(jdc,com,"COMP_INCR","ALGO_C_PLAN",pasDeRegle(),0) - removeMotCleInFact(jdc,com,"COMP_INCR","ALGO_1D",pasDeRegle(),0) - renameMotCleInFact(jdc,com,"COMP_INCR","RESI_DEBO_MAXI","RESI_CPLAN_MAXI",pasDeRegle(),0) - renameMotCleInFact(jdc,com,"COMP_INCR","RESI_DEBO_RELA","RESI_CPLAN_RELA",pasDeRegle(),0) - renameMotCleInFact(jdc,com,"COMP_INCR","ITER_MAXI_DEBORST","ITER_CPLAN_MAXI",pasDeRegle(),0) - - #### traitement de C_NEWTON ############################## - # Renommage de EXTRAPOL en EXTRAPOLE - lCOMMANDE=["CALC_IFS_DNL","CALC_POINT_MAT","CALC_PRECONT", - "DYNA_NON_LINE","MACR_ASCOUF_CALC","MACR_ASPIC_CALC", - "SIMU_POINT_MAT","STAT_NON_LINE","TEST_COMPOR",] - dPRED={"EXTRAPOL":"EXTRAPOLE"} - for com in lCOMMANDE : - changementValeurDsMCF(jdc,com,"NEWTON","PREDICTION",dPRED) - - #### traitement de C_SOLVEUR ############################## - # Renommage de EXTRAPOL en EXTRAPOLE - lCOMMANDE=["CALC_ELEM","CALC_FORC_AJOU","CALC_IFS_DNL", - "CALC_MATR_AJOU","CALC_PRECONT","CREA_ELEM_SSD", - "DEFI_BASE_MODALE","DYNA_LINE_HARM","DYNA_LINE_HARM", - "DYNA_LINE_TRAN","DYNA_NON_LINE","DYNA_TRAN_MODAL", - "IMPR_STURM","MACR_ASCOUF_CALC","MACR_ASPIC_CALC", - "MACRO_ELAS_MULT","MACRO_MATR_AJOU","MACRO_MATR_ASSE", - "MECA_STATIQUE","MODE_ITER_INV","MODE_ITER_INV", - "MODE_ITER_SIMULT","MODE_ITER_SIMULT","MODE_STATIQUE", - "STAT_NON_LINE","THER_LINEAIRE","THER_NON_LINE","THER_NON_LINE_MO",] - dPRED={"EXTRAPOL":"EXTRAPOLE"} - for com in lCOMMANDE : - removeMotCleInFact(jdc,com,"SOLVEUR","OUT_OF_CORE",pasDeRegle(),0) - removeMotCleInFact(jdc,com,"SOLVEUR","LIBERE_MEMOIRE",pasDeRegle(),0) - - #### traitement de CALC_CHAMP ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de CALC_ECREVISSE ############################## - # Rien à faire - - #### traitement de CALC_ELEM ############################## - # renommage de la commande - renameCommande(jdc,"CALC_ELEM","CALC_CHAMP", ) - # Suppression des types de charges - removeMotCleInFact(jdc,"CALC_CHAMP","EXCIT","TYPE_CHARGE",pasDeRegle(),0) - # Suppression des types d'option' - removeMotCle(jdc,"CALC_CHAMP","TYPE_OPTION",pasDeRegle(),0) - # Redistribution des options de calcul - ## dictionnaire contenant les options - lTOUT=["SIEF_ELNO","SIGM_ELNO","SIEF_ELGA", - "SIPO_ELNO","EFGE_ELNO","EFCA_ELNO","SICA_ELNO", - "SIRO_ELEM","SIPM_ELNO","SIRO_ELEM", - "EFCA_ELNO","SIPO_ELNO","SIPM_ELNO", - "EPTU_ELNO","SITU_ELNO","SICO_ELNO", - "EPSI_ELNO","EPSI_ELGA","EPSG_ELNO","EPSG_ELGA", - "EPME_ELNO","EPME_ELGA","EPMG_ELNO","EPMG_ELGA", - "DEGE_ELNO","EPTU_ELNO", - "EPSP_ELNO","EPSP_ELGA", - "EPFD_ELNO","EPFD_ELGA","EPVC_ELNO","EPVC_ELGA", - "EPFP_ELNO","EPFP_ELGA", - "EPOT_ELEM","ECIN_ELEM","ENEL_ELGA","ENEL_ELNO", - "ETOT_ELGA","ETOT_ELNO","ETOT_ELEM","DISS_ELGA","DISS_ELNO", - "SIEQ_ELNO","SIEQ_ELGA","CRIT_ELNO","EPEQ_ELNO","EPEQ_ELGA","EPMQ_ELNO","EPMQ_ELGA", - "ENDO_ELGA","ENDO_ELNO","SITQ_ELNO","EPTQ_ELNO","INDL_ELGA","DERA_ELNO","DERA_ELGA", - "SITQ_ELNO","EPTQ_ELNO", - "VARI_ELNO","VATU_ELNO","VACO_ELNO","VARC_ELGA", - "VAEX_ELGA","VAEX_ELNO", - "FLHN_ELGA", - "FLUX_ELGA","FLUX_ELNO","SOUR_ELGA", - "INTE_ELNO","PRAC_ELNO", - "SIZ1_NOEU","ERZ1_ELEM","SIZ2_NOEU","ERZ2_ELEM", - "ERME_ELEM","ERME_ELNO","ERTH_ELEM","ERTH_ELNO", - "QIRE_ELEM","QIRE_ELNO","QIZ1_ELEM","QIZ2_ELEM", - "SING_ELEM","SING_ELNO", - "DURT_ELNO"] - lCONTRAINTE=["SIEF_ELNO","SIGM_ELNO","SIEF_ELGA", - "SIPO_ELNO","EFGE_ELNO","EFCA_ELNO","SICA_ELNO", - "SIRO_ELEM","SIPM_ELNO","SIRO_ELEM", - "EFCA_ELNO","SIPO_ELNO","SIPM_ELNO", - "EPTU_ELNO","SITU_ELNO","SICO_ELNO",] - lDEFORMATION=["EPSI_ELNO","EPSI_ELGA","EPSG_ELNO","EPSG_ELGA", - "EPME_ELNO","EPME_ELGA","EPMG_ELNO","EPMG_ELGA", - "DEGE_ELNO","EPTU_ELNO", - "EPSP_ELNO","EPSP_ELGA", - "EPFD_ELNO","EPFD_ELGA","EPVC_ELNO","EPVC_ELGA", - "EPFP_ELNO","EPFP_ELGA",] - lENERGIE=["EPOT_ELEM","ECIN_ELEM","ENEL_ELGA","ENEL_ELNO", - "ETOT_ELGA","ETOT_ELNO","ETOT_ELEM","DISS_ELGA","DISS_ELNO",] - lCRITERES=["SIEQ_ELNO","SIEQ_ELGA","CRIT_ELNO","EPEQ_ELNO","EPEQ_ELGA","EPMQ_ELNO","EPMQ_ELGA", - "ENDO_ELGA","ENDO_ELNO","SITQ_ELNO","EPTQ_ELNO","INDL_ELGA","DERA_ELNO","DERA_ELGA", - "SITQ_ELNO","EPTQ_ELNO"] - lVARI_INTERNE=["VARI_ELNO","VATU_ELNO","VACO_ELNO","VARC_ELGA", - "VAEX_ELGA","VAEX_ELNO",] - lHYDRAULIQUE=["FLHN_ELGA",] - lTHERMIQUE=["FLUX_ELGA","FLUX_ELNO","SOUR_ELGA",] - lACOUSTIQUE=["INTE_ELNO","PRAC_ELNO"] - lERREUR=["SIZ1_NOEU","ERZ1_ELEM","SIZ2_NOEU","ERZ2_ELEM", - "ERME_ELEM","ERME_ELNO","ERTH_ELEM","ERTH_ELNO", - "QIRE_ELEM","QIRE_ELNO","QIZ1_ELEM","QIZ2_ELEM", - "SING_ELEM","SING_ELNO",] - lMETA=["DURT_ELNO"] - #SPMX_ELGA / NOM_CHAM / NOM_CMP - ## Erreur pour les options supprimées - genereErreurValeur(jdc,"CALC_ELEM","OPTION",("'SICA_ELNO'","'EFCA_ELNO'","'PMPB_ELNO'","'PMPB_ELGA'",)) - lCHANOPT={"SICO_ELNO":"SIGM_ELNO","EPTU_ELNO":"EPSI_ELNO","SITU_ELNO":"SIGM_ELNO","SITQ_ELNO":"SIGM_ELNO","EPTQ_ELNO":"EPSI_ELNO"} - changementValeur(jdc,"CALC_ELEM","OPTION",lCHANOPT) - ## copie de OPTION dans MCF TEMPORAIRE pour chaque type - chercheOperInsereFacteur(jdc,"CALC_CHAMP","TEMPORAIRE") - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","CONTRAINTE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","DEFORMATION",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ENERGIE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","CRITERES",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","VARI_INTERNE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","HYDRAULIQUE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","THERMIQUE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ACOUSTIQUE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ERREUR",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","META",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMP","OPTION",pasDeRegle(),0) - ## déplacement au premier niveau de mot-clés - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","CONTRAINTE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","DEFORMATION") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ENERGIE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","CRITERES") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","VARI_INTERNE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","HYDRAULIQUE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","THERMIQUE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ACOUSTIQUE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ERREUR") - moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","META") - ## suppression des mot-clés s'ils ne contiennent pas d'options à traiter - removeMotCleSiRegle(jdc,"CALC_CHAMP","CONTRAINTE",((("CONTRAINTE",lCONTRAINTE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","DEFORMATION",((("DEFORMATION",lDEFORMATION,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","ENERGIE",((("ENERGIE",lENERGIE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","CRITERES",((("CRITERES",lCRITERES,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","VARI_INTERNE",((("VARI_INTERNE",lVARI_INTERNE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","HYDRAULIQUE",((("HYDRAULIQUE",lHYDRAULIQUE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","THERMIQUE",((("THERMIQUE",lTHERMIQUE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","ACOUSTIQUE",((("ACOUSTIQUE",lACOUSTIQUE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","ERREUR",((("ERREUR",lERREUR,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMP","META",((("META",lMETA,jdc),"MCnaPasPourValeurDansListe"),)) - ## suppression des valeurs non-licites - suppressionValeurs(jdc,"CALC_CHAMP","CONTRAINTE",list(set(lTOUT)-set(lCONTRAINTE))) - suppressionValeurs(jdc,"CALC_CHAMP","DEFORMATION",list(set(lTOUT)-set(lDEFORMATION))) - suppressionValeurs(jdc,"CALC_CHAMP","ENERGIE",list(set(lTOUT)-set(lENERGIE))) - suppressionValeurs(jdc,"CALC_CHAMP","CRITERES",list(set(lTOUT)-set(lCRITERES))) - suppressionValeurs(jdc,"CALC_CHAMP","VARI_INTERNE",list(set(lTOUT)-set(lVARI_INTERNE))) - suppressionValeurs(jdc,"CALC_CHAMP","HYDRAULIQUE",list(set(lTOUT)-set(lHYDRAULIQUE))) - suppressionValeurs(jdc,"CALC_CHAMP","THERMIQUE",list(set(lTOUT)-set(lTHERMIQUE))) - suppressionValeurs(jdc,"CALC_CHAMP","ACOUSTIQUE",list(set(lTOUT)-set(lACOUSTIQUE))) - suppressionValeurs(jdc,"CALC_CHAMP","ERREUR",list(set(lTOUT)-set(lERREUR))) - suppressionValeurs(jdc,"CALC_CHAMP","META",list(set(lTOUT)-set(lMETA))) - ## ajout CALC_META ou CALC_ERREUR - lMOTCLE=[] - lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS", - "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"] - ### traitement métallurgie - llistMETA=[] - llistMETA=list(lMOTCLE) - llistMETA.extend(["META",]) - for mc in llistMETA : - copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE") - moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_META","TEMPORAIRE") - for mc in llistMETA : - moveMotCleFromFactToFather(jdc,"CALC_META","TEMPORAIRE",mc) - removeCommandeSiRegle(jdc,"CALC_META",((("META","COMP_INCR","ETAT_INIT"),"nexistepasMCFParmi"),)) - renameMotCle(jdc,"CALC_META","META","OPTION") - removeMotCle(jdc,"CALC_META","TEMPORAIRE",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMP","TEMPORAIRE",pasDeRegle(),0) - ### traitement calcul d'erreur - llistERREUR=[] - llistERREUR=list(lMOTCLE) - llistERREUR.extend(["ERREUR","SOLVEUR","RESU_DUAL","PREC_ESTI","TYPE_ESTI"]) - for mc in llistERREUR : - copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE") - moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_ERREUR","TEMPORAIRE") - for mc in llistERREUR : - moveMotCleFromFactToFather(jdc,"CALC_ERREUR","TEMPORAIRE",mc) - removeCommandeSiRegle(jdc,"CALC_ERREUR",((("ERREUR"),"nexistepasMCFParmi"),)) - renameMotCle(jdc,"CALC_ERREUR","ERREUR","OPTION") - removeMotCle(jdc,"CALC_ERREUR","TEMPORAIRE",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMP","TEMPORAIRE",pasDeRegle(),0) - ### traitement de REPE_COQUE - removeMotCle(jdc,"CALC_CHAMP","REPE_COQUE",pasDeRegle(),1) - ## ménage final - removeCommandeSiRegle(jdc,"CALC_CHAMP",((("CONTRAINTE","DEFORMATION","ENERGIE","CRITERES","VARI_INTERNE","HYDRAULIQUE","THERMIQUE","ACOUSTIQUE"),"nexistepasMCFParmi"),)) - removeMotCle(jdc,"CALC_CHAMP","META",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMP","ERREUR",pasDeRegle(),0) - - #### traitement de CALC_ERREUR ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de CALC_ESSAI ############################## - # Rien à faire - - #### traitement de CALC_EUROPLEXUS ############################## - # Rien à faire - - #### traitement de CALC_FATIGUE ############################## - # Rien à faire - - #### traitement de CALC_FERRAILLAGE ############################## - # Rien à faire - - #### traitement de CALC_FONCTION ############################## - # Rien à faire - - #### traitement de CALC_FORC_AJOU ############################## - # Rien à faire - - #### traitement de CALC_G ############################## - # Suppression SYME_CHAR - removeMotCle(jdc,"CALC_G","SYME_CHAR",pasDeRegle(),0) - # Règle sur DEGRE - removeMotCleInFactSiRegle(jdc,"CALC_G","LISSAGE","DEGRE",((("LISSAGE_THETA","LEGENDRE",jdc),"MCnaPasPourValeur")or(("LISSAGE_G","LEGENDRE",jdc),"MCnaPasPourValeur"),)) - # Suppression de DTAN_ORIG et DTAN_EXTR pour calcul automatique - removeMotCleInFact(jdc,"CALC_G","THETA","DTAN_ORIG",pasDeRegle(),1) - removeMotCleInFact(jdc,"CALC_G","THETA","DTAN_EXTR",pasDeRegle(),1) - # Résorption de la sensibilité - removeMotCle(jdc,"CALC_G","SENSIBILITE",pasDeRegle(),0) - # Restriction de ETAT_INIT à SIGM_INIT sous COMP_INCR - moveMotCleFromFactToFact(jdc,"CALC_G","ETAT_INIT","SIGM","COMP_INCR") - renameMotCleInFact(jdc,"CALC_G","COMP_INCR","SIGM","SIGM_INIT",pasDeRegle(),0) - removeMotCleInFactSiRegle(jdc,"CALC_G","COMP_INCR","SIGM_INIT",((("RELATION","ELAS",jdc),"MCnaPasPourValeur"),)) - removeMotCle(jdc,"CALC_G","ETAT_INIT",pasDeRegle(),0) - # Renommage de l'option K_G_MODA en CALC_K_G - changementValeur(jdc,"CALC_G","OPTION",{"K_G_MODA":"CALC_K_G",}) - # Suppression de EXCIT dans le cas elas_mult - removeMotCleSiRegle(jdc,"CALC_G","EXCIT",((("NOM_CAS",),"existe"),)) - # Ajout règle UN_PARMI('THETA','FOND_FISS','FISSURE') - removeMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA",((("THETA","FOND_FISS",),"existeMCsousMCF"),)) - removeMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA",((("THETA","FISSURE",),"existeMCsousMCF"),)) - - #### traitement de CALC_IFS_DNL ############################## - # Renommage CRIT_FLAMB en CRIT_STAB - renameMotCle(jdc,"CALC_IFS_DNL","CRIT_FLAMB","CRIT_STAB") - removeMotCleInFact(jdc,"CALC_IFS_DNL","CRIT_FLAMB","INST_CALCUL",pasDeRegle(),1) - # Résorption de la sensibilité - removeMotCle(jdc,"CALC_IFS_DNL","SENSIBILITE",pasDeRegle(),0) - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"CALC_IFS_DNL","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de CALC_INTE_SPEC ############################## - # Rien à faire - - #### traitement de CALC_MAC3COEUR ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de CALC_MATR_AJOU ############################## - # Suppression d'algo pour PETSc - removeMotCleSiRegle(jdc,"RESOUDRE","ALGORITHME",((("BCGS","BICG","TFQMR",),"MCaPourValeur"),)) - - #### traitement de CALC_MATR_ELEM ############################## - # Rien à faire - - #### traitement de CALC_META ############################## - # OPTION est obligatoire - chercheOperInsereFacteurSiRegle(jdc,"CALC_META","OPTION='META_ELNO'",((("OPTION",),"nexistepas"),),0) - - #### traitement de CALC_MISS ############################## - # Suppression de TYPE_CHARGE - removeMotCle(jdc,"CALC_MISS","TYPE_CHARGE",pasDeRegle(),0) - - #### traitement de CALC_MODAL ############################## - # renommage de STOP_FREQ_VIDE - renameMotCle(jdc,"CALC_MODAL","STOP_FREQ_VIDE","STOP_BANDE_VIDE") - - #### traitement de CALC_MODE_ROTATION ############################## - # renommage de MATR_A et MATR_B - renameMotCle(jdc,"CALC_MODE_ROTATION","MATR_A","MATR_RIGI") - renameMotCle(jdc,"CALC_MODE_ROTATION","MATR_B","MATR_MASS") - - #### traitement de CALC_NO ############################## - # renommage de la commande - renameCommande(jdc,"CALC_NO","CALC_CHAMPNO", ) - # Suppression des types de charges - removeMotCleInFact(jdc,"CALC_CHAMPNO","EXCIT","TYPE_CHARGE",pasDeRegle(),0) - # Redistribution des options de calcul - ## dictionnaire contenant les options - lTOUT=["FORC_NODA","REAC_NODA","DERA_NOEU","DURT_NOEU","EFCA_NOEU", - "EFGE_NOEU","ENDO_NOEU","ENEL_NOEU","EPMG_NOEU","EPSG_NOEU", - "EPSI_NOEU","EPSP_NOEU","EPVC_NOEU","EPFD_NOEU","EPFP_NOEU", - "EPMQ_NOEU","EPEQ_NOEU","SIEQ_NOEU","ERME_NOEU","ERTH_NOEU", - "QIRE_NOEU","FLUX_NOEU","HYDR_NOEU","INTE_NOEU","META_NOEU", - "PMPB_NOEU","PRAC_NOEU","SIEF_NOEU","SICA_NOEU","SICO_NOEU", - "SIGM_NOEU","SIPO_NOEU","VAEX_NOEU","VARI_NOEU","DISS_NOEU"] - lCONTRAINTE=["EFCA_NOEU","EFGE_NOEU","SIEF_NOEU","SICA_NOEU", - "SICO_NOEU","SIGM_NOEU","SIPO_NOEU",] - lDEFORMATION=["EPMG_NOEU","EPSG_NOEU","EPSI_NOEU","EPSP_NOEU", - "EPVC_NOEU","EPFD_NOEU","EPFP_NOEU",] - lENERGIE=["ENEL_NOEU","DISS_NOEU",] - lCRITERES=["DERA_NOEU","ENDO_NOEU","EPEQ_NOEU","EPMQ_NOEU", - "SIEQ_NOEU","PMPB_NOEU",] - lVARI_INTERNE=["VAEX_NOEU","VARI_NOEU",] - lTHERMIQUE=["FLUX_NOEU","HYDR_NOEU",] - lACOUSTIQUE=["INTE_NOEU","PRAC_NOEU",] - lFORCE=["FORC_NODA","REAC_NODA",] - lERREUR=["ERME_NOEU","ERTH_NOEU","QIRE_NOEU",] - lMETA=["DURT_NOEU","META_NOEU",] - ## Erreur pour les options supprimées - genereErreurValeur(jdc,"CALC_CHAMPNO","OPTION",("'SICA_NOEU'","'EFCA_NOEU'","'PMPB_NOEU'",)) - changementValeur(jdc,"CALC_CHAMPNO","OPTION",{"SICO_NOEU":"SIGM_NOEU",}) - ## copie de OPTION dans MCF TEMPORAIRE pour chaque type - chercheOperInsereFacteur(jdc,"CALC_CHAMPNO","TEMPORAIRE") - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","CONTRAINTE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","DEFORMATION",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ENERGIE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","CRITERES",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","VARI_INTERNE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","THERMIQUE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ACOUSTIQUE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","FORCE",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ERREUR",pasDeRegle(),0) - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") - renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","META",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMPNO","OPTION",pasDeRegle(),0) - ## déplacement au premier niveau de mot-clés - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","CONTRAINTE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","DEFORMATION") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ENERGIE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","CRITERES") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","VARI_INTERNE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","THERMIQUE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ACOUSTIQUE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","FORCE") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ERREUR") - moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","META") - ## suppression des mot-clés s'ils ne contiennent pas d'options à traiter - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","CONTRAINTE",((("CONTRAINTE",lCONTRAINTE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","DEFORMATION",((("DEFORMATION",lDEFORMATION,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ENERGIE",((("ENERGIE",lENERGIE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","CRITERES",((("CRITERES",lCRITERES,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","VARI_INTERNE",((("VARI_INTERNE",lVARI_INTERNE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","THERMIQUE",((("THERMIQUE",lTHERMIQUE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ACOUSTIQUE",((("ACOUSTIQUE",lACOUSTIQUE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","FORCE",((("FORCE",lFORCE,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ERREUR",((("ERREUR",lERREUR,jdc),"MCnaPasPourValeurDansListe"),)) - removeMotCleSiRegle(jdc,"CALC_CHAMPNO","META",((("META",lMETA,jdc),"MCnaPasPourValeurDansListe"),)) - ## suppression des valeurs non-licites - suppressionValeurs(jdc,"CALC_CHAMPNO","CONTRAINTE",list(set(lTOUT)-set(lCONTRAINTE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","DEFORMATION",list(set(lTOUT)-set(lDEFORMATION))) - suppressionValeurs(jdc,"CALC_CHAMPNO","ENERGIE",list(set(lTOUT)-set(lENERGIE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","CRITERES",list(set(lTOUT)-set(lCRITERES))) - suppressionValeurs(jdc,"CALC_CHAMPNO","VARI_INTERNE",list(set(lTOUT)-set(lVARI_INTERNE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","THERMIQUE",list(set(lTOUT)-set(lTHERMIQUE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","ACOUSTIQUE",list(set(lTOUT)-set(lACOUSTIQUE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","FORCE",list(set(lTOUT)-set(lFORCE))) - suppressionValeurs(jdc,"CALC_CHAMPNO","ERREUR",list(set(lTOUT)-set(lERREUR))) - suppressionValeurs(jdc,"CALC_CHAMPNO","META",list(set(lTOUT)-set(lMETA))) - ## ajout CALC_METANO ou CALC_ERREURNO - lMOTCLE=[] - lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS", - "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"] - ### traitement métallurgie - llistMETA=[] - llistMETA=list(lMOTCLE) - llistMETA.append("META") - for mc in llistMETA : - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE") - moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_METANO","TEMPORAIRE") - for mc in llistMETA : - moveMotCleFromFactToFather(jdc,"CALC_METANO","TEMPORAIRE",mc) - removeCommandeSiRegle(jdc,"CALC_METANO",((("META"),"nexistepasMCFParmi"),)) - renameMotCle(jdc,"CALC_METANO","META","OPTION") - removeMotCle(jdc,"CALC_METANO","TEMPORAIRE",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMPNO","TEMPORAIRE",pasDeRegle(),0) - ### traitement calcul d'erreur - llistERREUR=[] - llistERREUR=list(lMOTCLE) - llistERREUR.append("ERREUR") - for mc in llistERREUR : - copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE") - moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_ERREURNO","TEMPORAIRE") - for mc in llistERREUR : - moveMotCleFromFactToFather(jdc,"CALC_ERREURNO","TEMPORAIRE",mc) - removeCommandeSiRegle(jdc,"CALC_ERREURNO",((("ERREUR"),"nexistepasMCFParmi"),)) - renameMotCle(jdc,"CALC_ERREURNO","ERREUR","OPTION") - removeMotCle(jdc,"CALC_ERREURNO","TEMPORAIRE",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMPNO","TEMPORAIRE",pasDeRegle(),0) - ## ménage final - removeCommandeSiRegle(jdc,"CALC_CHAMPNO",((("CONTRAINTE","DEFORMATION","ENERGIE","CRITERES","VARI_INTERNE","THERMIQUE","ACOUSTIQUE","FORCE"),"nexistepasMCFParmi"),)) - renameCommande(jdc,"CALC_CHAMPNO","CALC_CHAMP") - renameCommande(jdc,"CALC_METANO","CALC_META") - renameCommande(jdc,"CALC_ERREURNO","CALC_ERREUR") - removeMotCle(jdc,"CALC_CHAMP","METANO",pasDeRegle(),0) - removeMotCle(jdc,"CALC_CHAMP","ERREURNO",pasDeRegle(),0) - - #### traitement de CALC_POINT_MAT ############################## - # Rien à faire - - #### traitement de CALC_PRECONT ############################## - # Renommage de IMPLEX - changementValeur(jdc,"CALC_PRECONT","METHODE",{"IMPL_EX":"IMPLEX"}) - removeMotCle(jdc,"CALC_PRECONT","IMPL_EX",pasDeRegle(),0) - - #### traitement de CALC_SENSI ############################## - # Résorption de la sensibilité - removeCommande(jdc,"CALC_SENSI") - #genereErreurPourCommande(jdc,("CALC_SENSI",)) - - #### traitement de CALC_SPEC ############################## - # Déplacement d'un mot-clé facteur facteur - moveMotCleFromFactToFather(jdc,"CALC_SPEC","TAB_ECHANT","LONGUEUR_ECH") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","DUREE") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","POURCENT") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","NB_PTS") - removeMotCle(jdc,"CALC_SPEC","LONGUEUR_ECH",pasDeRegle(),0) - renameMotCle(jdc,"CALC_SPEC","DUREE","LONGUEUR_DUREE") - renameMotCle(jdc,"CALC_SPEC","POURCENT","LONGUEUR_POURCENT") - renameMotCle(jdc,"CALC_SPEC","NB_PTS","LONGUEUR_NB_PTS") - moveMotClefInOperToFact(jdc,"CALC_SPEC","LONGUEUR_DUREE","TAB_ECHANT") - moveMotClefInOperToFact(jdc,"CALC_SPEC","POURCENT_DUREE","TAB_ECHANT") - moveMotClefInOperToFact(jdc,"CALC_SPEC","LONGUEUR_NB_PTS","TAB_ECHANT") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","TAB_ECHANT","RECOUVREMENT") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","DUREE") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","POURCENT") - moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","NB_PTS") - removeMotCle(jdc,"CALC_SPEC","RECOUVREMENT",pasDeRegle(),0) - renameMotCle(jdc,"CALC_SPEC","DUREE","RECOUVREMENT_DUREE") - renameMotCle(jdc,"CALC_SPEC","POURCENT","RECOUVREMENT_POURCENT") - renameMotCle(jdc,"CALC_SPEC","NB_PTS","RECOUVREMENT_NB_PTS") - moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_DUREE","TAB_ECHANT") - moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_POURCENT","TAB_ECHANT") - moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_NB_PTS","TAB_ECHANT") - - #### traitement de CALC_TABLE ############################## - # Renommage de AJOUT en AJOUT_LIGNE - dOPE={"AJOUT":"AJOUT_LIGNE",} - changementValeurDsMCF(jdc,"CALC_TABLE","ACTION","OPERATION",dOPE) - # Résorption de la sensibilité - removeMotCle(jdc,"CALC_TABLE","SENSIBILITE",pasDeRegle(),0) - # Renommage critere table - dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} - changementValeurDsMCF(jdc,"CALC_TABLE","FILTRE","CRIT_COMP",dCRIT) - - #### traitement de CALC_THETA ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"CALC_THETA","OPTION",pasDeRegle(),0) - removeMotCle(jdc,"CALC_THETA","THETA_BANDE",pasDeRegle(),1) - removeMotCle(jdc,"CALC_THETA","GRAD_NOEU_THETA",pasDeRegle(),0) - - #### traitement de COMB_FOURIER ############################## - # Homogénéisation de ANGLE - renameMotCle(jdc,"COMB_FOURIER","ANGL","ANGLE") - - #### traitement de COMB_SISM_MODAL ############################## - genereErreurValeur(jdc,"COMB_SISM_MODAL","OPTION",("'EFCA_ELNO'",)) - - #### traitement de CREA_CHAMP ############################## - removeMotCle(jdc,"CREA_CHAMP","SENSIBILITE",pasDeRegle(),0) - removeMotCle(jdc,"CREA_CHAMP","PROL_ZERO",pasDeRegle(),0) - - #### traitement de CREA_ELEM_SSD ############################## - # Rien à faire - - #### traitement de CREA_MAILLAGE ############################## - # Suppression de la possibilité de copier un maillage - lFACTEUR=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1', - 'DETR_GROUP_MA', 'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE', - 'QUAD_LINE', 'REPERE','RESTREINT','PENTA15_18','GEOM_FIBRE'] - renameCommandeSiRegle(jdc,"CREA_MAILLAGE","COPIER",(((lFACTEUR),"nexistepasMCFParmi"),)) - renameMotCle(jdc,"COPIER","MAILLAGE","CONCEPT") - - #### traitement de CREA_RESU ############################## - # Rien à faire - - #### traitement de CREA_TABLE ############################## - removeMotCle(jdc,"CREA_TABLE","SENSIBILITE",pasDeRegle(),0) - - #### traitement de DEBUT ############################## - # Suppression du mot-clé TITRE - removeMotCleInFact(jdc,"DEBUT","CATALOGUE","TITRE",pasDeRegle(),0) - # Suppression du mot-clé IMPRESSION - removeMotCle(jdc,"DEBUT","IMPRESSION",pasDeRegle(),0) - # Suppression des mots-clés mémoire dynamique - removeMotCleInFact(jdc,"DEBUT","MEMOIRE","GESTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEBUT","MEMOIRE","TYPE_ALLOCATION",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEBUT","MEMOIRE","TAILLE",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEBUT","MEMOIRE","PARTITION",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEBUT","MEMOIRE","DYNAMIQUE",pasDeRegle(),0) - - #### traitement de DEFI_BASE_MODALE ############################## - # Rien à faire - - #### traitement de DEFI_CABLE_BP ############################## - # Rien à faire - - #### traitement de DEFI_COMPOR ############################## - # Suppression famille de sytèmes de glissement - lFAMGLIS=["'BASAL'", "'PRISMATIQUE'","'PYRAMIDAL1'","'PYRAMIDAL2'","'MACLAGE'",] - genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","FAMI_SYST_GLIS",lFAMGLIS) - # Suppression famille de sytèmes de glissement - genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECOULEMENT",("'MONO_VISC3'",)) - # Suppression de ALGO_1D - removeMotCleInFact(jdc,"DEFI_COMPOR","MULTIFIBRE","ALGO_1D",pasDeRegle(),0) - # Suppression de DEFORMATION - genereErreurMotCleInFact(jdc,"DEFI_COMPOR","MULTIFIBRE","DEFORMATION") - - #### traitement de DEFI_CONTACT ############################## - genereErreurValeurDsMCF(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT",("'AVANCE'",)) - genereErreurValeurDsMCF(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT",("'AVANCE'",)) - # résorption de RACCORD_LINE_QUAD et éléments de Barsoum - genereErreurMCF(jdc,"DEFI_CONTACT","FOND_FISSURE") - genereErreurMCF(jdc,"DEFI_CONTACT","NOEUD_FOND") - genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_NO_FOND") - genereErreurMCF(jdc,"DEFI_CONTACT","MAILLE_FOND") - genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_MA_FOND") - genereErreurMCF(jdc,"DEFI_CONTACT","RACCORD_LINE_QUAD") - genereErreurMCF(jdc,"DEFI_CONTACT","NOEUD_RACC") - genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_NO_RACC") - genereErreurMCF(jdc,"DEFI_CONTACT","EXCLUSION_PIV_NUL") - genereErreurMCF(jdc,"DEFI_CONTACT","COEF_ECHELLE") - # résorption de COMPLIANCE - genereErreurMCF(jdc,"DEFI_CONTACT","COMPLIANCE") - genereErreurMCF(jdc,"DEFI_CONTACT","ASPERITE") - genereErreurMCF(jdc,"DEFI_CONTACT","E_N") - genereErreurMCF(jdc,"DEFI_CONTACT","E_V") - # résorption de l'usure - genereErreurMCF(jdc,"DEFI_CONTACT","USURE") - genereErreurMCF(jdc,"DEFI_CONTACT","K") - genereErreurMCF(jdc,"DEFI_CONTACT","H") - # Suppression de schémas d'inégration pour XFEM - lSCHEMA=["FPG2","FPG3","FPG4","FPG6","FPG7","SIMPSON1","NCOTES1","NCOTES2"] - removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","INTEGRATION",((("FORMULATION","XFEM",jdc),"MCaPourValeur")and(("ZONE","INTEGRATION",lSCHEMA,jdc),"MCsousMCFaPourValeurDansListe"),),) - # règles sur relation - removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","RELATION",((("ZONE","RELATION","NON",jdc),"MCsousMCFaPourValeur"),),) - # Suppression de schémas d'inégration pour méthode CONTINUE - lSCHEMA=["NOEUD","SIMPSON1","SIMPSON2","NCOTES1","NCOTES2"] - removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","INTEGRATION",((("FORMULATION","CONTINUE",jdc),"MCaPourValeur")and(("ZONE","INTEGRATION",lSCHEMA,jdc),"MCsousMCFaPourValeurDansListe"),),) - # Ajout règle sur REAC_GEOM - removeMotCleSiRegle(jdc,"DEFI_CONTACT","REAC_GEOM",((("ALGO_RESO_GEOM","NEWTON",jdc),"MCaPourValeur"),)) - - #### traitement de DEFI_COQU_MULT ############################## - renameCommande(jdc,"DEFI_COQU_MULT","DEFI_COMPOSITE", ) - - #### traitement de DEFI_FICHIER ############################## - # Rien à faire - - #### traitement de DEFI_FISS_XFEM ############################## - # Suppression de ORIE_FOND - removeMotCle(jdc,"DEFI_FISS_XFEM","ORIE_FOND",pasDeRegle(),0) - # Fusion FORM_FISS='ELLIPSE' et FORM_FISS='INCLUSION' - dFORME={"INCLUSION":"ELLIPSE",} - changementValeurDsMCF(jdc,"DEFI_FISS_XFEM","DEFI_FISS","FORM_FISS",dOPE) - - #### traitement de DEFI_FONC_ELEC ############################## - # Rien à faire - - #### traitement de DEFI_FOND_FISS ############################## - renameMotCle(jdc,"DEFI_FOND_FISS","FOND_FISS","FONDFISS") - # Cas FOND OUVERT - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_FOND_FISS","FONDFISS","TYPE_FOND='OUVERT'",((("FONDFISS",),"existe"),)) - # Cas FOND FERME - chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='FERME'",((("FOND_FERME",),"existe"),),0) - renameMotCle(jdc,"DEFI_FOND_FISS","FOND_FERME","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") - # Cas FOND INF - chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='INF'",((("FOND_INF",),"existe"),),0) - renameMotCle(jdc,"DEFI_FOND_FISS","FOND_SUP","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") - # Cas FOND SUP - chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='SUP'",((("FOND_SUP",),"existe"),),0) - renameMotCle(jdc,"DEFI_FOND_FISS","FOND_SUP","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") - # Autres mots-clés - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","DTAN_ORIG","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","DTAN_EXTR","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","VECT_GRNO_ORIG","FONDFISS") - moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","VECT_GRNO_EXTR","FONDFISS") - removeMotCle(jdc,"DEFI_FOND_FISS","NORMALE",pasDeRegle(),0) - # - renameMotCle(jdc,"DEFI_FOND_FISS","FONDFISS","FOND_FISS") - - #### traitement de DEFI_GLRC ############################## - # Renommage de mot-clés - renameMotCle(jdc,"DEFI_GLRC","GC","GAMMA_C") - renameMotCle(jdc,"DEFI_GLRC","SYC","NYC") - renameMotCle(jdc,"DEFI_GLRC","EPSI_FLEX","KAPPA_FLEX") - - #### traitement de DEFI_GROUPE ############################## - # Rien à faire - - #### traitement de DEFI_INTE_SPEC ############################## - # Rien à faire - - #### traitement de DEFI_LIST_INST ############################## - dMETHODE={"UNIFORME":"MANUEL","EXTRAPOLE":"MANUEL","AUCUNE":"AUTO"} - changementValeurDsMCF(jdc,"DEFI_LIST_INST","ECHEC","SUBD_METHODE",dMETHODE) - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","SUBD_COEF_PAS_1",pasDeRegle(),0) - - #### traitement de DEFI_MATER_GC ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de DEFI_MATERIAU ############################## - # Suppression des critères pour les poutres - genereErreurMCF(jdc,"DEFI_MATERIAU","ECRO_FLEJOU") - genereErreurMCF(jdc,"DEFI_MATERIAU","VMIS_POUTRE") - genereErreurMCF(jdc,"DEFI_MATERIAU","VMIS_POUTRE_FO") - # Modification de la loi de grandissement - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_A") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_B") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_S") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_A") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_B") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_S") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_A") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_B") - genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_S") - # Modification des paramètres de la loi ENDO_SCALAIRE - genereErreurMCF(jdc,"DEFI_MATERIAU","ENDO_SCALAIRE") - # Modification des paramètres de la loi MAZARS - genereErreurMCF(jdc,"DEFI_MATERIAU","MAZARS") - genereErreurMCF(jdc,"DEFI_MATERIAU","MAZARS_FO") - # Modification des paramètres de la loi GLRC_DM - renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYT","NYT",pasDeRegle(),0) - renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYC","NYC",pasDeRegle(),0) - renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYF","NYF",pasDeRegle(),0) - # Suppression de la loi MONO_VISC3 - genereErreurMCF(jdc,"DEFI_MATERIAU","MONO_VISC3") - # Suppression de la loi MONO_DD_CC - genereErreurMCF(jdc,"DEFI_MATERIAU","MONO_DD_CC") - - #### traitement de DEFI_NAPPE ############################## - # Rien à faire - - #### traitement de DEFI_PARA_SENSI ############################## - # Résorption de la sensibilité - removeCommande(jdc,"DEFI_PARA_SENSI") - #genereErreurPourCommande(jdc,("DEFI_PARA_SENSI",)) - - #### traitement de DEFI_PART_FETI ############################## - # Rien à faire - - #### traitement de DEFI_SOL_MISS ############################## - # Rien à faire - - #### traitement de DEFI_SPEC_TURB ############################## - # Homogénéisation de ANGLE - renameMotCleInFact(jdc,"DEFI_SPEC_TURB","SPEC_EXCI_POINT","ANGL","ANGLE",pasDeRegle(),0) - - #### traitement de DETRUIRE ############################## - # Résorption de la sensibilité - removeMotCleInFact(jdc,"DETRUIRE","CONCEPT","SENSIBILITE",pasDeRegle(),0) - # Suppression mot-clé ALARME - removeMotCle(jdc,"DETRUIRE","ALARME",pasDeRegle(),0) - - #### traitement de DYNA_ALEA_MODAL ############################## - # Rien à faire - - #### traitement de DYNA_ISS_VARI ############################## - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DYNA_ISS_VARI","MATR_COHE","TYPE='MITA_LUCO'",((("MATR_COHE",),"existe"),)) - - #### traitement de DYNA_LINE_HARM ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"DYNA_LINE_HARM","SENSIBILITE",pasDeRegle(),0) - # Suppression mot-clé TYPE_CHARGE - removeMotCleInFact(jdc,"DYNA_LINE_HARM","EXCIT","TYPE_CHARGE",pasDeRegle(),0) - # Ajout AMOR_MODAL - chercheOperInsereFacteurSiRegle(jdc,"DYNA_LINE_HARM","AMOR_MODAL",((("AMOR_REDUIT","LIST_AMOR",),"existeMCFParmi"),),1) - moveMotClefInOperToFact(jdc,"DYNA_LINE_HARM","AMOR_REDUIT","AMOR_MODAL") - moveMotClefInOperToFact(jdc,"DYNA_LINE_HARM","LIST_AMOR","AMOR_MODAL") - - #### traitement de DYNA_LINE_TRAN ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"DYNA_LINE_TRAN","SENSIBILITE",pasDeRegle(),0) - # Ajout SCHEMA_TEMPS - chercheOperInsereFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS",((("NEWMARK","WILSON","DIFF_CENTRE","ADAPT",),"existeMCFParmi"),),1) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='NEWMARK'",((("NEWMARK",),"existeMCFParmi"),)) - moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","NEWMARK","ALPHA","SCHEMA_TEMPS") - moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","NEWMARK","DELTA","SCHEMA_TEMPS") - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","ALPHA","BETA",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","DELTA","GAMMA",pasDeRegle(),0) - removeMotCle(jdc,"DYNA_LINE_TRAN","NEWMARK",pasDeRegle(),0) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='WILSON'",((("WILSON",),"existeMCFParmi"),)) - moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","WILSON","THETA","SCHEMA_TEMPS") - removeMotCle(jdc,"DYNA_LINE_TRAN","WILSON",pasDeRegle(),0) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='DIFF_CENTRE'",((("DIFF_CENTRE",),"existeMCFParmi"),)) - removeMotCle(jdc,"DYNA_LINE_TRAN","DIFF_CENTRE",pasDeRegle(),0) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='ADAPT_ORDRE2'",((("ADAPT",),"existeMCFParmi"),)) - removeMotCle(jdc,"DYNA_LINE_TRAN","ADAPT",pasDeRegle(),0) - # Renommage dans ETAT_INIT - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","DYNA_TRANS","RESULTAT",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","DEPL_INIT","DEPL",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","ACCE_INIT","ACCE",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","VITE_INIT","VITE",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","NUME_INIT","NUME_ORDRE",pasDeRegle(),0) - # Suppression mot-clé TYPE_CHARGE - removeMotCleInFact(jdc,"DYNA_LINE_TRAN","EXCIT","TYPE_CHARGE",pasDeRegle(),0) - # Suppression mot-clé FONC_INST - genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","INCREMENT","FONC_INST") - # Suppression mot-clé PAS_CALCUL - removeMotCleInFact(jdc,"DYNA_LINE_TRAN","INCREMENT","PAS_CALCUL",pasDeRegle(),0) - # Renommage dans ARCHIVAGE - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ARCHIVAGE","LIST_ARCH","LIST_INST",pasDeRegle(),0) - - #### traitement de DYNA_NON_LINE ############################## - # Renommage CRIT_FLAMB en CRIT_STAB - renameMotCle(jdc,"DYNA_NON_LINE","CRIT_FLAMB","CRIT_STAB") - # Résorption de la sensibilité - removeMotCle(jdc,"DYNA_NON_LINE","SENSIBILITE",pasDeRegle(),0) - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"DYNA_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de DYNA_SPEC_MODAL ############################## - # Rien à faire - - #### traitement de DYNA_TRAN_MODAL ############################## - # Ajout SCHEMA_TEMPS - chercheOperInsereFacteur(jdc,"DYNA_TRAN_MODAL","SCHEMA_TEMPS") - chercheOperInsereMotCleSiRegle(jdc,"DYNA_TRAN_MODAL","METHODE='EULER'",((("METHODE",),"nexistepas"),),) - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","METHODE","SCHEMA_TEMPS") - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","SCHEMA_TEMPS","METHODE","SCHEMA",pasDeRegle(),0) - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","BASE_ELAS_FLUI","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NUME_VITE_FLUI","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","ETAT_STAT","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","PREC_DUREE","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","CHOC_FLUI","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NB_MODE","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NB_MODE_FLUI","SCHEMA_TEMPS") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","TS_REG_ETAB","SCHEMA_TEMPS") - # Renommage des matrices - renameMotCle(jdc,"DYNA_TRAN_MODAL","MASS_GENE","MATR_MASS") - renameMotCle(jdc,"DYNA_TRAN_MODAL","RIGI_GENE","MATR_RIGI") - renameMotCle(jdc,"DYNA_TRAN_MODAL","AMOR_GENE","MATR_AMOR") - # Ajout AMOR_MODAL - chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","AMOR_MODAL",((("AMOR_REDUIT","LIST_AMOR",),"existeMCFParmi"),),1) - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","AMOR_REDUIT","AMOR_MODAL") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","LIST_AMOR","AMOR_MODAL") - # couplage - chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","VITESSE_VARIABLE='NON'",((("COUPLAGE_EDYOS"),"existe"),),1) - moveMotCleFromFactToFather(jdc,"DYNA_TRAN_MODAL","COUPLAGE_EDYOS","VITE_ROTA") - # Renommage dans ETAT_INIT - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","RESU_GENE","RESULTAT",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","INIT_GENE","DEPL",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","DEPL_INIT_GENE","DEPL",pasDeRegle(),0) - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","VITE_INIT_GENE","VITE",pasDeRegle(),0) - # Renommage dans ARCHIVAGE - renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ARCHIVAGE","LIST_ARCH","LIST_INST",pasDeRegle(),0) - # Paramètres LAME_FLUIDE - chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","PARA_LAMEFLUI",((("NMAX_ITER","RESI_RELA","LAMBDA"),"existeMCFParmi"),),1) - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NMAX_ITER","PARA_LAMEFLUI") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","RESI_RELA","PARA_LAMEFLUI") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","LAMBDA","PARA_LAMEFLUI") - renameMotCle(jdc,"DYNA_TRAN_MODAL","PARA_LAMEFLUI","PARA_LAME_FLUI") - - #### traitement de DYNA_VIBRA ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de EXEC_LOGICIEL ############################## - # Rien à faire - - #### traitement de EXTR_RESU ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"EXTR_RESU","SENSIBILITE",pasDeRegle(),0) - - #### traitement de EXTR_TABLE ############################## - # Renommage critere table - dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} - changementValeurDsMCF(jdc,"RECU_TABLE","FILTRE","CRIT_COMP",dCRIT) - - #### traitement de FACTORISER ############################## - # Suppression de RENUM - removeMotCleSiRegle(jdc,"FACTORISER","RENUM",((("PRE_COND","LDLT_INC",jdc),"MCaPourValeur"),)) - removeMotCleSiRegle(jdc,"FACTORISER","RENUM",((("PRE_COND","LDLT_SP",jdc),"MCaPourValeur"),)) - # Modification mot-clés liés à la mémoire - removeMotCle(jdc,"FACTORISER","LIBERE_MEMOIRE",pasDeRegle(),0) - renameMotCle(jdc,"FACTORISER","OUT_OF_CORE","GESTION_MEMOIRE") - dMEM={"OUI":"OUT_OF_CORE","NON":"IN_CORE"} - changementValeur(jdc,"FACTORISER","GESTION_MEMOIRE",dCRIT) - - #### traitement de FORMULE ############################## - # Rien à faire - - #### traitement de GENE_ACCE_SEISME ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de GENE_FONC_ALEA ############################## - # Rien à faire - - #### traitement de GENE_VARI_ALEA ############################## - # Rien à faire - - #### traitement de IMPR_CO ############################## - # Résorption de la sensibilité - removeMotCleInFact(jdc,"IMPR_CO","CONCEPT","SENSIBILITE",pasDeRegle(),0) - - #### traitement de IMPR_DIAG_CAMPBELL ############################## - # Rien à faire - - #### traitement de IMPR_FONCTION ############################## - # Rien à faire - - #### traitement de IMPR_GENE ############################## - # Rien à faire - - #### traitement de IMPR_OAR ############################## - # Rien à faire - - #### traitement de IMPR_RESU ############################## - # Résorption de la sensibilité - removeMotCleInFact(jdc,"IMPR_RESU","RESU","SENSIBILITE",pasDeRegle(),0) - # Suppression de l'écriture au format ENSIGHT - genereErreurValeur(jdc,"IMPR_RESU","FORMAT",("'ENSIGHT'",)) - # Homogénéisation de ANGLE - renameMotCleInFact(jdc,"IMPR_RESU","FORMAT","ANGL","ANGLE",pasDeRegle(),0) - # Suppression mot-clé MODELE - removeMotCle(jdc,"IMPR_RESU","MODELE",pasDeRegle(),0) - - #### traitement de IMPR_STURM ############################## - renameMotCle(jdc,"IMPR_STURM","TYPE_RESU","TYPE_MODE") - # renommage de MATR_A, MATR_B et MATR_C - renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI",((("TYPE_MODE","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_B","MATR_MASS",((("TYPE_MODE","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_B","MATR_RIGI_GEOM",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI") - renameMotCle(jdc,"IMPR_STURM","MATR_B","MATR_MASS") - # - chercheOperInsereMotCleSiRegle(jdc,"IMPR_STURM","FREQ_MIN=0.",((("FREQ_MIN",),"nexistepas")and(("FREQ_MAX",),"existeMCFParmi"),),) - fusionMotCleToFact(jdc,"IMPR_STURM",("FREQ_MIN","FREQ_MAX"),"FREQ") - fusionMotCleToFact(jdc,"IMPR_STURM",("CHAR_CRIT_MIN","CHAR_CRIT_MAX"),"CHAR_CRIT") - # Ajout COMPTAGE - chercheOperInsereFacteurSiRegle(jdc,"IMPR_STURM","COMPTAGE",((("NMAX_ITER_SHIFT","PREC_SHIFT","SEUIL_FREQ"),"existeMCFParmi"),),1) - moveMotClefInOperToFact(jdc,"IMPR_STURM","NMAX_ITER_SHIFT","COMPTAGE") - moveMotClefInOperToFact(jdc,"IMPR_STURM","PREC_SHIFT","COMPTAGE") - moveMotClefInOperToFact(jdc,"IMPR_STURM","SEUIL_FREQ","COMPTAGE") - renameMotCleInFactSiRegle(jdc,"IMPR_STURM","COMPTAGE","SEUIL_FREQ","SEUIL_CHAR_CRIT",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),) - # Suppression UNITE - removeMotCle(jdc,"IMPR_STURM","UNITE",pasDeRegle(),0) - # Renommage de la commande - renameCommande(jdc,"IMPR_STURM","INFO_MODE", ) - - #### traitement de IMPR_TABLE ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"IMPR_TABLE","SENSIBILITE",pasDeRegle(),0) - # Renommage critere table - dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} - changementValeurDsMCF(jdc,"IMPR_TABLE","FILTRE","CRIT_COMP",dCRIT) - # Suppression de FORMAT_C - genereErreurMCF(jdc,"IMPR_TABLE","FORMAT_C") - - #### traitement de INCLUDE ############################## - # Rien à faire - - #### traitement de INCLUDE_MATERIAU ############################## - # Rien à faire - - #### traitement de INFO_EXEC_ASTER ############################## - # Rien à faire - - #### traitement de INFO_FONCTION ############################## - # Rien à faire - - #### traitement de INFO_MODE ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de LIRE_CHAMP ############################## - # Rien à faire - - #### traitement de LIRE_FONCTION ############################## - # Rien à faire - - #### traitement de LIRE_IMPE_MISS ############################## - # Rien à faire - - #### traitement de LIRE_INTE_SPEC ############################## - # Rien à faire - - #### traitement de LIRE_MAILLAGE ############################## - # Rien à faire - - #### traitement de LIRE_RESU ############################## - # Suppression du type HARM_GENE - genereErreurValeur(jdc,"LIRE_RESU","TYPE_RESU",("'HARM_GENE'",)) - # renommage de MATR_A et MATR_B - renameMotCle(jdc,"LIRE_RESU","MATR_A","MATR_RIGI") - renameMotCle(jdc,"LIRE_RESU","MATR_B","MATR_MASS") - removeMotCle(jdc,"LIRE_RESU","NUME_DDL",pasDeRegle(),0) - # Suppression de certains champ - lSUPCHAMPS=["'EFCA_ELNO'","'EFCA_NOEU'","'EPTQ_ELNO'","'EPTU_ELNO'", - "'PMPB_ELNO'","'PMPB_NOEU'","'SITQ_ELNO'","'SICA_ELNO'", - "'SICO_ELNO'","'SITU_ELNO'","'SICA_NOEU'","'SICO_NOEU'", - "'SPMX_ELGA'","'VACO_ELNO'","'VATU_ELNO'",] - genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",lSUPCHAMPS) - genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",lSUPCHAMPS) - genereErreurValeur(jdc,"LIRE_RESU","NOM_CHAM",lSUPCHAMPS) - - #### traitement de LIRE_TABLE ############################## - # Rien à faire - - #### traitement de MACR_ADAP_MAIL ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"MACR_ADAP_MAIL","SENSIBILITE",pasDeRegle(),0) - # Changement de version - changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V10_1":"V10_6"}) - # Changement d'adaptation - changementValeur(jdc,"MACR_ADAP_MAIL","ADAPTATION",{"RAFFINEMENT_ZONE":"RAFF_DERA_ZONE"}) - # Renommage du mot-clé ELEMENTS_NON_HOMARD - renameMotCle(jdc,"MACR_ADAP_MAIL","ELEMENTS_NON_HOMARD","ELEMENTS_ACCEPTES") - changementValeur(jdc,"MACR_ADAP_MAIL","ELEMENTS_ACCEPTES",{"REFUSER":"HOMARD","IGNORER":"IGNORE_PYRA"}) - - #### traitement de MACR_ASCOUF_CALC ############################## - # Rien à faire - - #### traitement de MACR_ASCOUF_MAIL ############################## - # Rien à faire - - #### traitement de MACR_ASPIC_CALC ############################## - # Rien à faire - - #### traitement de MACR_ASPIC_MAIL ############################## - # Rien à faire - - #### traitement de MACR_CARA_POUTRE ############################## - renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_Y","SYME_ZZ") - renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_X","SYME_Y") - renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_ZZ","SYME_Z") - - #### traitement de MACR_ECLA_PG ############################## - # Rien à faire - - #### traitement de MACR_ECRE_CALC ############################## - # Changement de version - changementValeur(jdc,"MACR_ECRE_CALC","VERSION",{"3.1.1":"3.2.1","3.1.2":"3.2.1","3.2":"3.2.1"}) - - #### traitement de MACR_ECREVISSE ############################## - # Changement de version - changementValeur(jdc,"MACR_ECRE_CALC","VERSION",{"3.1.1":"3.2.1","3.1.2":"3.2.1","3.2":"3.2.1"}) - - #### traitement de MACR_ELEM_DYNA ############################## - # Rien à faire - - #### traitement de MACR_FIABILITE ############################## - genereErreurPourCommande(jdc,("MACR_FIABILITE",)) - - #### traitement de MACR_FIAB_IMPR ############################## - genereErreurPourCommande(jdc,("MACR_FIAB_IMPR",)) - - #### traitement de MACR_INFO_MAIL ############################## - # Changement de version - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_1":"V10_6"}) - # Renommage du mot-clé ELEMENTS_NON_HOMARD - renameMotCle(jdc,"MACR_INFO_MAIL","ELEMENTS_NON_HOMARD","ELEMENTS_ACCEPTES") - changementValeur(jdc,"MACR_INFO_MAIL","ELEMENTS_ACCEPTES",{"REFUSER":"HOMARD","IGNORER":"IGNORE_PYRA"}) - - #### traitement de MACR_LIGN_COUPE ############################## - # Rien à faire - - #### traitement de MACRO_ELAS_MULT ############################## - # Résorption de NUME_COUCHE NIVE_COUCHE - removeMotCleInFact(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","NUME_COUCHE",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","NIVE_COUCHE",pasDeRegle(),0) - # Réduction de la liste des options calculables - lOPT=["'EFGE_ELNO'","'EPOT_ELEM'","'SIGM_ELNO'","'SICA_ELNO'","'EFCA_ELNO'", - "'DEGE_ELNO'","'EPSI_ELNO'","'EPSI_ELGA'","'EPSG_ELNO'","'EPSG_ELGA'", - "'EPSP_ELNO'","'EPSP_ELGA'","'ECIN_ELEM'","'FLUX_ELGA'","'FLUX_ELNO'", - "'SOUR_ELGA'","'PRAC_ELNO'","'INTE_ELNO'","'SIZ1_NOEU'","'ERZ1_ELEM'", - "'SIZ2_NOEU'","'ERZ2_ELEM'","'VNOR_ELEM_DEPL'","'ERME_ELNO'", - "'ERME_ELEM'","'SIEQ_ELNO'","'SIEQ_ELGA'","'EPEQ_ELNO'","'QIRE_ELEM'", - "'QIRE_ELNO'","'QIZ1_ELEM'","'QIZ2_ELEM'","'EPEQ_ELGA'","'FORC_NODA'", - "'REAC_NODA'","'EPSI_NOEU'","'SIGM_NOEU'","'EFGE_NOEU'","'SIEQ_NOEU'", - "'EPEQ_NOEU'","'FLUX_NOEU'",] - genereErreurValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",lOPT) - - #### traitement de MACRO_EXPANS ############################## - # Rien à faire - - #### traitement de MACRO_MATR_AJOU ############################## - # Rien à faire - - #### traitement de MACRO_MATR_ASSE ############################## - # Suppression de paramètres mémoire - removeMotCleInFact(jdc,"MACRO_MATR_ASSE","SOLVEUR","OUT_OF_CORE",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACRO_MATR_ASSE","SOLVEUR","LIBERE_MEMOIRE",pasDeRegle(),0) - # Suppression de RIGI_MECA_LAGR - genereErreurValeurDsMCF(jdc,"MACRO_MATR_ASSE","MATR_ASSE","OPTION",("'RIGI_MECA_LAGR'",)) - genereErreurMotCleInFact(jdc,"MACRO_MATR_ASSE","MATR_ASSE","THETA") - genereErreurMotCleInFact(jdc,"MACRO_MATR_ASSE","MATR_ASSE","PROPAGATION") - # Renommage de la commande - renameCommande(jdc,"MACRO_MATR_ASSE","ASSEMBLAGE", ) - - #### traitement de MACRO_MISS_3D ############################## - # Rien à faire - - #### traitement de MACRO_MODE_MECA ############################## - # renommage de MATR_A et MATR_B - renameMotCle(jdc,"MACRO_MODE_MECA","MATR_A","MATR_RIGI") - renameMotCle(jdc,"MACRO_MODE_MECA","MATR_B","MATR_MASS") - # Suppression des mot-clés FREQ_* - renameMotCle(jdc,"MACRO_MODE_MECA","CALC_FREQ","CALCFREQ") - moveMotCleFromFactToFather(jdc,"MACRO_MODE_MECA","CALCFREQ","FREQ_MIN") - moveMotCleFromFactToFather(jdc,"MACRO_MODE_MECA","CALCFREQ","FREQ_MAX") - fusionMotCleToFact(jdc,"MACRO_MODE_MECA",("FREQ_MIN","FREQ_MAX"),"FREQ") - moveMotClefInOperToFact(jdc,"MACRO_MODE_MECA","FREQ","CALCFREQ",) - renameMotCle(jdc,"MACRO_MODE_MECA","CALCFREQ","CALC_FREQ") - removeMotCleInFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","NB_BLOC_FREQ",pasDeRegle(),0) - renameMotCleInFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","STOP_FREQ_VIDE","STOP_BANDE_VIDE",pasDeRegle(),0) - # Renommage critere de Sturm - changementValeurDsMCF(jdc,"MACRO_MODE_MECA","VERI_MODE","STURM",{"OUI":"GLOBAL",}) - - #### traitement de MACRO_PROJ_BASE ############################## - renameMotCle(jdc,"MACRO_PROJ_BASE","PROFIL","STOCKAGE") - # Renommage de la commande - renameCommande(jdc,"MACRO_PROJ_BASE","PROJ_BASE", ) - - #### traitement de MACR_RECAL ############################## - renameMotCle(jdc,"MACR_RECAL","POIDS","LIST_POIDS") - - #### traitement de MACR_SPECTRE ############################## - # Rien à faire - - #### traitement de MECA_STATIQUE ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"MECA_STATIQUE","SENSIBILITE",pasDeRegle(),0) - - #### traitement de MODE_ITER_INV ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"MODE_ITER_INV","SENSIBILITE",pasDeRegle(),0) - # renommage de MATR_A, MATR_B et MATR_C - renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_B","MATR_MASS",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCle(jdc,"MODE_ITER_INV","MATR_C","MATR_AMOR") - renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_B","MATR_RIGI_GEOM",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_INV","CALC_FREQ","CALC_CHAR_CRIT",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur")or(("TYPE_RESU","GENERAL",jdc),"MCaPourValeur"),),1) - renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","NMAX_FREQ","NMAX_CHAR_CRIT",pasDeRegle(),0) - renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","SEUIL_FREQ","SEUIL_CHAR_CRIT",pasDeRegle(),0) - renameMotCle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI") - renameMotCle(jdc,"MODE_ITER_INV","MATR_B","MATR_MASS") - - #### traitement de MODE_ITER_SIMULT ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"MODE_ITER_SIMULT","SENSIBILITE",pasDeRegle(),0) - # renommage de MATR_A, MATR_B et MATR_C - renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_MASS",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) - renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_C","MATR_AMOR") - renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_RIGI_GEOM",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) - renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","CALC_CHAR_CRIT",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur")or(("TYPE_RESU","GENERAL",jdc),"MCaPourValeur"),),1) - renameMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","NMAX_FREQ","NMAX_CHAR_CRIT",pasDeRegle(),0) - renameMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","SEUIL_FREQ","SEUIL_CHAR_CRIT",pasDeRegle(),0) - renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI") - renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_MASS") - # renommage STOP_FREQ_VIDE - renameMotCle(jdc,"MODE_ITER_SIMULT","STOP_FREQ_VIDE","STOP_BANDE_VIDE") - - #### traitement de MODE_STATIQUE ############################## - # renommage du mot-clé FREQ - renameMotCleInFact(jdc,"MODE_STATIQUE","MODE_INTERF","FREQ","SHIFT",pasDeRegle(),0) - - #### traitement de MODI_MODELE_XFEM ############################## - genereErreurValeur(jdc,"MODI_MODELE_XFEM","CONTACT",("'P1P1A'",)) - - #### traitement de MODI_REPERE ############################## - # renommage de DEFI_REPERE - renameMotCle(jdc,"MODI_REPERE","DEFI_REPERE","AFFE") - moveMotCleFromFactToFather(jdc,"MODI_REPERE","AFFE","REPERE") - # localisation dans AFFE - moveMotClefInOperToFact(jdc,"MODI_REPERE","GROUP_MA","AFFE",) - moveMotClefInOperToFact(jdc,"MODI_REPERE","GROUP_NO","AFFE",) - moveMotClefInOperToFact(jdc,"MODI_REPERE","MAILLE","AFFE",) - moveMotClefInOperToFact(jdc,"MODI_REPERE","NOEUD","AFFE",) - - #### traitement de NORM_MODE ############################## - removeMotCle(jdc,"NORM_MODE","SENSIBILITE",pasDeRegle(),0) - - #### traitement de NUME_DDL ############################## - # Rien à faire - - #### traitement de NUME_DDL_GENE ############################## - # Rien à faire - - #### traitement de OBSERVATION ############################## - # renommage de MATR_A et MATR_B - renameMotCle(jdc,"OBSERVATION","MATR_A","MATR_RIGI") - renameMotCle(jdc,"OBSERVATION","MATR_B","MATR_MASS") - - #### traitement de POST_BORDET ############################## - # Rien à faire - - #### traitement de POST_CHAMP ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de POST_CHAM_XFEM ############################## - # Suppression mot-clé MAILLAGE_SAIN - removeMotCle(jdc,"POST_CHAM_XFEM","MAILLAGE_SAIN",pasDeRegle(),0) - - #### traitement de POST_COQUE ############################## - # Rien à faire - - #### traitement de POST_DECOLLEMENT ############################## - # Rien à faire - - #### traitement de POST_DYNA_ALEA ############################## - # Suppression du mot-clé NUME_VITE_FLUI - removeMotCle(jdc,"POST_DYNA_ALEA","NUME_VITE_FLUI",pasDeRegle(),0) - - #### traitement de POST_ELEM ############################## - # Rien à faire - - #### traitement de POST_ENDO_FISS ############################## - # Suppression du mot-clé MODELE - removeMotCle(jdc,"POST_ENDO_FISS","MODELE",pasDeRegle(),0) - # Renommage de SEUIL - renameMotCleInFact(jdc,"POST_ENDO_FISS","RECHERCHE","SEUIL","BORNE_MIN",pasDeRegle(),0) - - #### traitement de POST_FATIGUE ############################## - # Suppression du chargement periodique - genereErreurValeur(jdc,"POST_FATIGUE","CHARGEMENT",("'PERIODIQUE'",)) - - #### traitement de POST_GP ############################## - # Suppression de POST_GP au profit de CALC_GP - genereErreurPourCommande(jdc,("POST_GP",)) - - #### traitement de POST_K1_K2_K3 ############################## - # Suppression de VECT_K1 - removeMotCle(jdc,"POST_K1_K2_K3","VECT_K1",pasDeRegle(),0) - # Suppression de SYME_CHAR - removeMotCle(jdc,"POST_K1_K2_K3","SYME_CHAR",pasDeRegle(),0) - # Suppression de TABL_DEPL - removeMotCle(jdc,"POST_K1_K2_K3","TABL_DEPL_SUP",pasDeRegle(),0) - removeMotCle(jdc,"POST_K1_K2_K3","TABL_DEPL_INF",pasDeRegle(),0) - # Suppression de MAILLAGE - removeMotCle(jdc,"POST_K1_K2_K3","MAILLAGE",pasDeRegle(),0) - # Suppression de DTAN - removeMotCle(jdc,"POST_K1_K2_K3","DTAN_ORIG",pasDeRegle(),0) - removeMotCle(jdc,"POST_K1_K2_K3","DTAN_EXTR",pasDeRegle(),0) - - #### traitement de POST_K_TRANS ############################## - # Suppression de la possibilité de donner un mode_meca - genereErreurMotCleInFact(jdc,"POST_K_TRANS","K_MODAL","RESU_MODA") - - #### traitement de POST_MAC3COEUR ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de POST_MAIL_XFEM ############################## - # Suppression du mot-clé MAILLAGE_SAIN - removeMotCle(jdc,"POST_MAIL_XFEM","MAILLAGE_SAIN",pasDeRegle(),0) - - #### traitement de POST_RCCM ############################## - # Rien à faire - - #### traitement de POST_RELEVE_T ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"POST_RELEVE_T","SENSIBILITE",pasDeRegle(),0) - - #### traitement de POST_RUPTURE ############################## - # Rien à faire, n'existe pas en 10 - - #### traitement de POST_USURE ############################## - # Rien à faire - - #### traitement de POURSUITE ############################## - # Suppression du mot-clé TITRE - removeMotCleInFact(jdc,"POURSUITE","CATALOGUE","TITRE",pasDeRegle(),0) - removeMotCle(jdc,"POURSUITE","IMPRESSION",pasDeRegle(),0) - # Suppression des mots-clés mémoire dynamique - removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","GESTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","TYPE_ALLOCATION",pasDeRegle(),0) - removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","TAILLE",pasDeRegle(),0) - removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","PARTITION",pasDeRegle(),0) - removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","DYNAMIQUE",pasDeRegle(),0) - - #### traitement de PROJ_BASE ############################## - # Suppression de RESU_GENE pour défaut de validation - genereErreurMCF(jdc,"PROJ_BASE","RESU_GENE") - - #### traitement de PROJ_CHAMP ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"PROJ_CHAMP","SENSIBILITE",pasDeRegle(),0) - - #### traitement de PROJ_RESU_BASE ############################## - # Suppression de RESU_GENE pour défaut de validation - genereErreurMCF(jdc,"PROJ_RESU_BASE","RESU_GENE") - - #### traitement de PROJ_SPEC_BASE ############################## - # Rien à faire - - #### traitement de PROPA_FISS ############################## - # Suppression de DTAN_ORIG et DTAN_EXTR pour calcul automatique - removeMotCleInFact(jdc,"PROPA_FISS","FISSURE","DTAN_ORIG",pasDeRegle(),0) - removeMotCleInFact(jdc,"PROPA_FISS","FISSURE","DTAN_EXTR",pasDeRegle(),0) - - #### traitement de PROPA_XFEM ############################## - # Suppression paramètres Loi de Paris - removeMotCle(jdc,"PROPA_XFEM","NB_POINT_FOND",pasDeRegle(),0) - removeMotCle(jdc,"PROPA_XFEM","TABLE",pasDeRegle(),0) - removeMotCle(jdc,"PROPA_XFEM","LOI_PROPA",pasDeRegle(),0) - removeMotCle(jdc,"PROPA_XFEM","COMP_LINE",pasDeRegle(),0) - - #### traitement de RAFF_XFEM ############################## - # Rien à faire - - #### traitement de RECU_FONCTION ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"RECU_FONCTION","SENSIBILITE",pasDeRegle(),0) - # Renommage critere table - dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} - changementValeurDsMCF(jdc,"RECU_FONCTION","FILTRE","CRIT_COMP",dCRIT) - - #### traitement de RECU_GENE ############################## - # Rien à faire - - #### traitement de RESOUDRE ############################## - # Suppression d'algo pour PETSc - removeMotCleSiRegle(jdc,"RESOUDRE","ALGORITHME",((("BCGS","BICG","TFQMR",),"MCaPourValeur"),)) - - #### traitement de REST_SPEC_PHYS ############################## - # Rien à faire - - #### traitement de SIMU_POINT_MAT ############################## - # VALE_REF obligatoire si NOM_VARC in ('TEMP', 'SECH') - lNOMVARC=["CORR","IRRA","HYDR","EPSA","M_ACIER","M_ZIRC","NEUT1","NEUT2"] - removeMotCleInFactSiRegle(jdc,"SIMU_POINT_MAT","AFFE_VARC","VALE_REF",((("NOM_VARC",lNOMVARC,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"SIMU_POINT_MAT","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de STANLEY ############################## - # Rien à faire - - #### traitement de STAT_NON_LINE ############################## - # Renommage de IMPLEX - changementValeur(jdc,"STAT_NON_LINE","METHODE",{"IMPL_EX":"IMPLEX"}) - removeMotCle(jdc,"STAT_NON_LINE","IMPL_EX",pasDeRegle(),0) - # Renommage CRIT_FLAMB en CRIT_STAB - renameMotCle(jdc,"STAT_NON_LINE","CRIT_FLAMB","CRIT_STAB") - # Résorption de la sensibilité - removeMotCle(jdc,"STAT_NON_LINE","SENSIBILITE",pasDeRegle(),0) - # Déplacement du calcul d'erreur en temps ERRE_TEMPS - chercheOperInsereFacteurSiRegle(jdc,"STAT_NON_LINE","CRIT_QUALITE",((("INCREMENT","ERRE_TEMPS"),"existeMCsousMCF"),),1) - moveMotCleFromFactToFact(jdc,"STAT_NON_LINE","INCREMENT","ERRE_TEMPS","CRIT_QUALITE") - renameMotCleInFact(jdc,"STAT_NON_LINE","CRIT_QUALITE","ERRE_TEMPS","ERRE_TEMPS_THM",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","ERRE_TEMPS",pasDeRegle(),0) - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"STAT_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de THER_LINEAIRE ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"THER_LINEAIRE","SENSIBILITE",pasDeRegle(),0) - removeMotCle(jdc,"THER_LINEAIRE","SENS_INIT",pasDeRegle(),0) - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"THER_LINEAIRE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de THER_NON_LINE ############################## - # Résorption de la sensibilité - removeMotCle(jdc,"THER_NON_LINE","SENSIBILITE",pasDeRegle(),0) - # Suppression du mot clé OPTION ###################################### - moveMCFToCommand(jdc,"THER_NON_LINE","OPTION","CALC_CHAMP","THERMIQUE") - # Suppression de ARCHIVAGE/DETR_NUME_SUIV - removeMotCleInFact(jdc,"THER_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) - - #### traitement de THER_NON_LINE_MO ############################## - # Rien à faire - - ################################################################# - f=open(outfile,'w') - f.write(jdc.getSource()) - f.close() - - log.ferme(hdlr) - -def main(): - parser = optparse.Optionparser(usage=usage) - - parser.add_option('-i','--infile', dest="infile", default='toto.comm', - help="Le fichier à traduire") - parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', - help="Le fichier traduit") - - options, args = parser.parse_args() - traduc(options.infile,options.outfile) - -if __name__ == '__main__': - main() diff --git a/Traducteur/traduitV11V12.py b/Traducteur/traduitV11V12.py deleted file mode 100755 index e64fad7c..00000000 --- a/Traducteur/traduitV11V12.py +++ /dev/null @@ -1,619 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -""" -usage="""usage: %prog [options] -Typical use is: - python traduitV11V12.py --infile=xxxx --outfile=yyyy -""" - -import log -import optparse -import sys - -from Traducteur.load import getJDC -from Traducteur.mocles import parseKeywords -from Traducteur.removemocle import * -from Traducteur.renamemocle import * -from Traducteur.renamemocle import * -from Traducteur.inseremocle import * -from Traducteur.changeValeur import * -from Traducteur.movemocle import * -from Traducteur.dictErreurs import * -from Traducteur.regles import pasDeRegle - -atraiter=( - "AFFE_CARA_ELEM", - "AFFE_CHAR_MECA", - "AFFE_CHAR_MECA_C", - "AFFE_CHAR_MECA_F", - "AFFE_CHAR_THER", - "AFFE_MODELE", - "ASSEMBLAGE", - "CALC_ESSAI_GEOMECA", - "CALC_EUROPLEXUS", - "CALC_FATIGUE", - "CALC_FERRAILLAGE", - "CALC_FONCTION", - "CALC_FORC_NONL", - "CALC_G", - "CALC_IFS_DNL", - "CALC_MAC3COEUR", - "CALC_MATR_ELEM", - "CALC_META", - "CALC_MISS", - "CALC_MODAL", - "CALC_PRECONT", - "CALCUL", - "CALC_VECT_ELEM", - "CREA_MAILLAGE", - "DEBUT", - "DEFI_COMPOR", - "DEFI_FISS_XFEM", - "DEFI_LIST_INST", - "DEFI_MATER_GC", - "DEFI_MATERIAU", - "DEFI_OBSTACLE", - "DEFI_PART_PA_OPS", - "DYNA_NON_LINE", - "DYNA_TRAN_MODAL", - "DYNA_VIBRA", - "EXTR_TABLE", - "FACTORISER", - "GENE_ACCE_SEISME", - "IMPR_MISS_3D", - "IMPR_RESU", - "INFO_FONCTION", - "LIRE_MAILLAGE", - "LIRE_MISS_3D", - "LIRE_RESU", - "MACR_ASCOUF_CALC", - "MACR_ASCOUF_MAIL", - "MACR_ASPIC_CALC", - "MACR_ECREVISSE", - "MACR_INFO_MAIL", - "MACRO_BASCULE_SCHEMA", - "MACRO_MISS_3D", - "MACRO_MODE_MECA", - "MECA_STATIQUE", - "MODE_ITER_INV", - "MODE_ITER_SIMULT", - "MODI_MAILLAGE", - "MODI_MODELE_XFEM", - "POST_DYNA_ALEA", - "POST_ELEM", - "POST_FATIGUE", - "POURSUITE", - "RECU_FONCTION", - "STAT_NON_LINE", - "SIMU_POINT_MAT", - "TEST_COMPOR", - "THER_NON_LINE", - "DEFI_PART_FETI" - ) - -dict_erreurs={ - "AFFE_CHAR_MECA_F_ONDE_PLANE_DIRECTION":"Trois valeurs sont nécessaire pour définir la DIRECTION", - "CREA_MAILLAGE_ECLA_PG":"Le mot-clé NOM_CHAM est obligatoire", - "CALC_EUROPLEXUS_FONC_PARASOL":"Le mot-clé GROUP_MA est obligatoire dans le mot-clé facteur FONC_PARASOL "+ - "pour l'opérateur CALC_EUROPLEXUS", - "CALC_FERRAILLAGE":"Certains mots clés de CALC_FERRAILLAGE / AFFE sont obligatoires. "+ - "Pour TYPE_COMB='ELU' : PIVA et PIVB et ES, ES doit être supérieur à 0. "+ - "Pour TYPE_COMB='ELS' : CEQUI.", - "CALC_FONCTION_DSP_FREQ":"Le mot-clé FREQ n'est plus disponible remplacer par LIST_FREQ. La liste de réel \ - doit être obtenu avec DEFI_LIST_REEL", - "CALC_MODAL":"La commande CALC_MODAL a été supprimé et remplacer par CALC_MODES", - "CREA_MAILLAGE_DETR_GROUP_MA":"Le mot-clé DETR_GROUP_MA n'est plus disponible dans CREA_MAILLAGE. Utiliser la commande "+ - "DEFI_GROUP a la place, attention celle-ci est réentrante.", - "DEFI_COMPOR_POLYCRISTAL":"Le mot-clé MU_LOCA est obligatoire.", - "DEFI_FISS_XFEM":"Le mot-clé MAILLAGE est obligatoire", - "DEFI_MATER_GC_MAZARS":"Les mot-clés EIJ, EPSI_C, FTJ du mot-clé facteur MAZARS sont obligatoire", - "DEFI_MATERIAU_THER_FO":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_THER_ORTH":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_THER_NL":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_THER_HYDR":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_THER_COQUE":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_THER_COQUE_FO":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ - "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", - "DEFI_MATERIAU_DIS_VISC":"Les mot-clés C et PUIS_ALPHA du mot-clé facteur DIS_VISC sont obligatoire.", - "GENE_ACCE_SEISME_MODULATION":"Le mot-clé DUREE_PHASE_FORTE est obligatoire.", - "IMPR_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ - " CALC_MISS", - "INFO_FONCTION_NOCI_SEISME":"Le mot-clé FREQ_FOND est obligatoire.", - "LIRE_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ - " CALC_MISS", - "MACRO_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ - " CALC_MISS", - "RECU_FONCTION_TABLE":"Si la valeur de TABLE est obtenu par GENE_FONC_ALEA remplacer par le mot-clé " - "INTE_SPEC", - "TEST_COMPOR":"La commande TEST_COMPOR produit une table de sortie dans tous les cas.", - } - -sys.dict_erreurs=dict_erreurs - -def traduc(infile,outfile,flog=None): - - hdlr=log.initialise(flog) - jdc=getJDC(infile,atraiter) - root=jdc.root - - #Parse les mocles des commandes - parseKeywords(root) - - #### traitement de DEFI_PART_PA_OPS ############################## - genereErreurPourCommande(jdc,"DEFI_PART_PA_OPS") - - #### traitement de AFFE_CARA_ELEM ############################## - changementValeurDsMCFSiRegle(jdc,"AFFE_CARA_ELEM","POUTRE","CARA",{"R1":"R_DEBUT","R2":"R_FIN", - "EP1":"EP_DEBUT","EP2":"EP_FIN"}, - ((("POUTRE","MAILLE",),"nexistepasMCsousMCF"), - (("POUTRE","SECTION","CERCLE",jdc),"MCsousMCFaPourValeur"), - (("POUTRE","VARI_SECT","HOMOTHETIQUE",jdc),"MCsousMCFaPourValeur"), - ), - ) - - #### traitement de AFFE_CHAR_MECA ############################## - # Suppression du mot-clé METHODE - removeMotCle(jdc,"AFFE_CHAR_MECA","METHODE",pasDeRegle(),0) - # Suppression des mot-clés LIAISON_XFEM - removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_XFEM",pasDeRegle(),0) - removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT_XFEM",pasDeRegle(),0) - # Modification des parametres du mot-clé DDL_POUTRE - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","GROUP_MA","GROUP_MA_REPE",pasDeRegle(),0) - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","MAILLE","MAILLE_REPE",pasDeRegle(),0) - - # Résorption des mot-clés ANGLE_NAUT et CENTRE - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) - - #### traitement de AFFE_CHAR_MECA_F ############################## - # Suppression du mot-clé METHODE - removeMotCle(jdc,"AFFE_CHAR_MECA_F","METHODE",pasDeRegle(),0) - # Résorption des mot-clés ANGLE_NAUT et CENTRE - removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) - removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) - - genereErreurMotCleInFact(jdc,"AFFE_CHAR_MECA_F","ONDE_PLANE","DIRECTION") - - #### traitement de AFFE_CHAR_THER ############################## - # Suppression du mot-clé METHODE - removeMotCle(jdc,"AFFE_CHAR_THER","METHODE",pasDeRegle(),0) - - #### traitement de AFFE_MODELE ############################## - # Suppression des mot-clés GRILLE et VERIF - removeMotCle(jdc,"AFFE_MODELE","GRILLE",pasDeRegle(),0) - removeMotCle(jdc,"AFFE_MODELE","VERIF",pasDeRegle(),0) - - d3DINCO={"3D_INCO":"3D_INCO_UP","3D_INCO_OSGS":"3D_INCO_UPO", - "3D_INCO_GD":"3D_INCO_UPG","3D_INCO_LOG":"3D_INCO_UPG", - "3D_INCO_LUP":"3D_INCO_UP",} - dAXIS={"AXIS_INCO":"AXIS_INCO_UP","AXIS_INCO_OSGS":"AXIS_INCO_UPO", - "AXIS_INCO_GD":"AXIS_INCO_UPG","AXIS_INCO_LOG":"AXIS_INCO_UPG", - "AXIS_INCO_LUP":"AXIS_INCO_UP",} - dDPLAN={"D_PLAN_INCO":"D_PLAN_INCO_UP","D_PLAN_INCO_OSGS":"D_PLAN_INCO_UPO", - "D_PLAN_INCO_GD":"D_PLAN_INCO_UPG","D_PLAN_INCO_LOG":"D_PLAN_INCO_UPG", - "D_PLAN_INCO_LUP":"D_PLAN_INCO_UP",} - dINCO={} - dINCO.update(d3DINCO) - dINCO.update(dAXIS) - dINCO.update(dDPLAN) - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dINCO) - - #### traitement de ASSEMBLAGE ############################## - genereErreurValeurDsMCF(jdc,"ASSEMBLAGE","MATR_ASSE","OPTION",("'MASS_THER'",)) - - #### traitement de CALC_ESSAI_GEOMECA ############################## - renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_IMPOSE","GAMMA_IMPOSE",pasDeRegle(),0) - renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_ELAS","GAMMA_ELAS",pasDeRegle(),0) - - #### traitement de CALC_EUROPLEXUS ############################## - removeMotCle(jdc,"CALC_EUROPLEXUS","DIME",pasDeRegle(),0) - genereErreurMCF(jdc,"CALC_EUROPLEXUS","FONC_PARASOL") - removeMotCleInFact(jdc,"CALC_EUROPLEXUS","ARCHIVAGE","CONT_GENER") - - #### traitement de CALC_FERRAILLAGE ############################## - genereErreurPourCommande(jdc,"CALC_FERRAILLAGE") - - #### traitement de CALC_FONCTION ############################## - ajouteMotClefDansFacteur(jdc,"CALC_FONCTION","CORR_ACCE","METHODE='POLYNOME'",pasDeRegle(),0) - genereErreurMotCleInFact(jdc,"CALC_FONCTION","DSP","FREQ") - - #### traitement de CALC_G ############################## - removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","RESI_INTE_RELA",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","ITER_INTE_MAXI",pasDeRegle(),0) - - #### traitement de CALC_FATIGUE ############################## - changementValeur(jdc,"CALC_FATIGUE","COURBE_GRD_VIE",{"MANSON_C":"MANSON_COFFIN",}) - - #### traitement de CALC_IFS_DNL ############################## - removeMotCle(jdc,"CALC_IFS_DNL","ENERGIE",pasDeRegle(),0) - - #### traitement de CALC_MAC3COEUR ############################## - ajouteMotClefDansFacteur(jdc,"CALC_MAC3COEUR","DEFORMATION","ARCHIMEDE = 'OUI'",pasDeRegle()) - - #### traitement de CALC_MATR_ELEM ############################## - genereErreurValeur(jdc,"CALC_MATR_ELEM","OPTION",("'MASS_THER'",)) - - #### traitement de CALC_MISS ############################## - genereErreurValeurDsMCF(jdc,"CALC_MISS","PARAMETRE","ISSF",("'OUI'",)) - - #### traitement de CALC_MODAL ############################## - # renameCommande(jdc,"CALC_MODAL","CALC_MODES", ) - genereErreurPourCommande(jdc,"CALC_MODAL") - - #### traitement de CALC_VECT_ELEM ############################## - genereErreurValeur(jdc,"CALC_VECT_ELEM","OPTION",("'FORC_NODA'",)) - - #### traitement de CREA_MAILLAGE ############################## - renameMotCle(jdc,"CREA_MAILLAGE","CREA_GROUP_MA","CREA_MAILLE") - genereErreurMCF(jdc,"CREA_MAILLAGE","ECLA_PG") - - lMCLEF=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1', - 'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE','QUAD_LINE', - 'REPERE','RESTREINT','PENTA15_18'] - genereErreurMCF(jdc,"CREA_MAILLAGE","DETR_GROUP_MA") - removeMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","NB_MAILLE",((lMCLEF,"nexistepasMCFParmi"),)) - renameMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","GROUP_MA","NOM",((lMCLEF,"nexistepasMCFParmi"),)) - renameCommandeSiRegle(jdc,"CREA_MAILLAGE","DEFI_GROUP",((lMCLEF,"nexistepasMCFParmi"),)) - - #### traitement de DEBUT ############################## - # genereErreurPourCommande(jdc,("DEBUT",)) - removeMotCleInFact(jdc,"DEBUT","CODE","NOM",pasDeRegle(),0) - - #### traitement de DEFI_COMPOR ############################## - genereErreurValeur(jdc,"DEFI_COMPOR","LOCALISATION",["'RL'",]) - genereErreurValeur(jdc,"DEFI_COMPOR","RELATION_KIT",["'RVMIS_ISOT_CINE'",]) - genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","RELATION",["'LABORD_1D'"]) - genereErreurMCF(jdc,"DEFI_COMPOR","POLYCRISTAL") - - #### traitement de DEFI_FISS_XFEM ############################## - genereErreurPourCommande(jdc,("DEFI_FISS_XFEM",)) - removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE",pasDeRegle(),0) - removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE_GRILLE",pasDeRegle(),0) - - #### traitement de DEFI_LIST_INST ############################## - changementValeurDsMCF(jdc,"DEFI_LIST_INST","ECHEC","ACTION",{"REAC_PRECOND":"DECOUPE"}) - - #### traitement de DEFI_MATER_GC ############################## - ajouteMotClefDansFacteur(jdc,"DEFI_MATER_GC","MAZARS","CODIFICATION='ESSAI'",pasDeRegle(),0) - - removeMotCleInFactSiRegle(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR", - ((("MAZARS","CODIFICATION",["ESSAI"],jdc),"MCsousMCFaPourValeurDansListe"),),) - renameMotCleInFact(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR","UNITE_CONTRAINTE") - changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"MM":"MPa"}) - changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"M":"Pa"}) - - genereErreurMCF(jdc,"DEFI_MATER_GC","MAZARS") - - #### traitement de DEFI_MATERIAU ############################## - lMLA=["F_MRR_RR", "C_MRR_RR", "F_MTT_TT", "C_MTT_TT", "F_MZZ_ZZ", - "C_MZZ_ZZ", "F_MRT_RT", "C_MRT_RT", "F_MRZ_RZ", "C_MRZ_RZ", - "F_MTZ_TZ", "C_MTZ_TZ",] - for param in lMLA: - removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI",param,pasDeRegle(),0) - removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI_FO",param,pasDeRegle(),0) - - lMDC=["BETA","DELTA1", "DELTA2", "DEPDT",] - for mcle in lMDC: - removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",mcle,pasDeRegle(),0) - removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",mcle,pasDeRegle(),0) - - removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT","NB_VALE",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO","NB_VALE",pasDeRegle(),0) - listeMc=["C"+str(i) for i in range(1,198)] - fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",listeMc,"LISTE_COEF") - fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",listeMc,"LISTE_COEF") - - removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0) - - genereErreurMCF(jdc,"DEFI_MATERIAU","DIS_VISC") - lDISC=["PUIS_DX", "PUIS_DY", "PUIS_DZ", "PUIS_RX", "PUIS_RY", "PUIS_RZ", - "COEF_DX", "COEF_DY", "COEF_DZ", "COEF_RX", "COEF_RY", "COEF_RZ"] - for param in lDISC: - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_VISC",param,pasDeRegle(),0) - - lTHMD=["PERMIN_X", "PERMIN_Y", "PERMIN_Z", "PERMINXY", "PERMINYZ", "PERMINZX",] - for param in lTHMD: - removeMotCleInFact(jdc,"DEFI_MATERIAU","THM_DIFFU",param,pasDeRegle(),0) - - # lMONODD=["DELTA1", "DELTA2"] - # for param in lMONODD: - # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",param,pasDeRegle(),0) - # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",param,pasDeRegle(),0) - - removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","EF",pasDeRegle(),0) - removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","NUF",pasDeRegle(),0) - - genereErreurMCF(jdc,"DEFI_MATERIAU","THER_FO") - genereErreurMCF(jdc,"DEFI_MATERIAU","THER_NL") - genereErreurMCF(jdc,"DEFI_MATERIAU","THER_HYDR") - genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE") - genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE_FO") - - - #### traitement de DEFI_OBSTACLE ############################## - lMCLE=("CRAYON_900","CRAYON_1300","GUID_A_CARTE_900", - "GUID_B_CARTE_900","GUID_C_CARTE_900","GUID_D_CARTE_900","GUID_E_CARTE_900", - "GUID_F_CARTE_900","GUID_A_CARTE_1300","GUID_B_CARTE_1300","GUID_C_CARTE_1300", - "GUID_D_CARTE_1300","GUID_E_CARTE_1300","GUID_F_CARTE_1300","GUID_A_CARSP_900", - "GUID_B_CARSP_900","GUID_C_CARSP_900","GUID_D_CARSP_900","GUID_E_CARSP_900", - "GUID_F_CARSP_900","GUID_A_CARSP_1300","GUID_B_CARSP_1300","GUID_C_CARSP_1300", - "GUID_D_CARSP_1300","GUID_E_CARSP_1300","GUID_F_CARSP_1300","GUID_A_GCONT_900", - "GUID_B_GCONT_900","GUID_C_GCONT_900","GUID_D_GCONT_900","GUID_E_GCONT_900", - "GUID_F_GCONT_900","GUID_A_GCONT_1300","GUID_B_GCONT_1300","GUID_C_GCONT_1300", - "GUID_D_GCONT_1300","GUID_E_GCONT_1300","GUID_F_GCONT_1300","GUID_A_GCOMB_900", - "GUID_B_GCOMB_900","GUID_C_GCOMB_900","GUID_D_GCOMB_900","GUID_E_GCOMB_900", - "GUID_F_GCOMB_900","GUID_A_GCOMB_1300","GUID_B_GCOMB_1300","GUID_C_GCOMB_1300", - "GUID_D_GCOMB_1300","GUID_E_GCOMB_1300","GUID_F_GCOMB_1300",) - genereErreurValeur(jdc,"DEFI_OBSTACLE","TYPE",lMCLE) - - #### traitement de DYNA_TRAN_MODAL ############################## - removeMotCle(jdc,"DYNA_TRAN_MODAL","LAME_FLUIDE",pasDeRegle(),0) - removeMotCle(jdc,"DYNA_TRAN_MODAL","PARA_LAME_FLUI",pasDeRegle(),0) - removeMotCle(jdc,"DYNA_TRAN_MODAL","RELA_TRANSIS",pasDeRegle(),0) - - #### traitement de DYNA_VIBRA ############################## - removeMotCle(jdc,"DYNA_VIBRA","LAME_FLUIDE",pasDeRegle(),0) - removeMotCle(jdc,"DYNA_VIBRA","PARA_LAME_FLUI",pasDeRegle(),0) - removeMotCle(jdc,"DYNA_VIBRA","RELA_TRANSIS",pasDeRegle(),0) - - #### traitement de EXTR_TABLE ############################## - changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"MATR_ELEM":"MATR_TANG_ELEM"}) - changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"CODE_RETOUR":"CODE_RETOUR_INTE"}) - - #### traitement de FACTORISER ############################## - renameMotCle(jdc,"FACTORISER","ELIM_LAGR2","ELIM_LAGR") - changementValeur(jdc,"FACTORISER","ELIM_LAGR",{"OUI":"LAGR2",}) - - #### traitement de GENE_ACCE_SEISME ############################## - genereErreurMCF(jdc,"GENE_ACCE_SEISME","MODULATION") - moveMotCleFromFactToFather(jdc,"GENE_ACCE_SEISME","MODULATION","DUREE_PHASE_FORTE") - - - removeMotCleInFact(jdc,"GENE_ACCE_SEISME","MODULATION","PARA") - removeMotCleInFactSiRegle(jdc,"GENE_ACCE_SEISME","MODULATION","INST_INI",((("MODULATION","TYPE",["GAMMA"],jdc),"MCsousMCFnaPasPourValeurDansListe"),)) - - removeMotCleInFact(jdc,"GENE_ACCE_SEISME","DSP","FREQ_PENTE") - - #### traitement de IMPR_MISS_3D ############################## - genereErreurPourCommande(jdc,"IMPR_MISS_3D") - # removeCommande(jdc,"IMPR_MISS_3D") - - #### traitement de IMPR_RESU ############################## - removeMotCle(jdc,"IMPR_RESU","RESTREINT",pasDeRegle(),0) - - #### traitement de INFO_FONCTION ############################## - genereErreurMCF(jdc,"INFO_FONCTION","NOCI_SEISME") - - #### traitement de LIRE_MAILLAGE ############################## - removeMotCle(jdc,"LIRE_MAILLAGE","ABSC_CURV",pasDeRegle(),0) - - #### traitement de LIRE_MISS_3D ############################## - genereErreurPourCommande(jdc,"LIRE_MISS_3D") - - #### traitement de MACR_ASCOUF_CALC ############################## - removeMotCle(jdc,"MACR_ASCOUF_CALC","CL_BOL_P2_GV",pasDeRegle(),0) - # genereErreurMCF(jdc,"MACR_ASCOUF_CALC","COMP_ELAS") - - #### traitement de MACR_ASCOUF_MAIL ############################## - genereErreurValeurDsMCF(jdc,"MACR_ASCOUF_MAIL","COUDE","BOL_P2",("'GV'",)) - - #### traitement de MACR_ASPIC_CALC ############################## - # genereErreurMCF(jdc,"MACR_ASPIC_CALC","COMP_ELAS") - - #### traitement de MACR_ECREVISSE ############################## - genereErreurMCF(jdc,"MACR_ECREVISSE","COMP_INCR") - - #### traitement de MACR_INFO_MAIL ############################## - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_6":"V11_2"}) - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N":"V11_N"}) - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N_PERSO":"V11_N_PERSO"}) - - #### traitement de MACRO_BASCULE_SCHEMA ############################## - renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_IMPL","COMPORTEMENT_IMPL",pasDeRegle()) - renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_EXPL","COMPORTEMENT_EXPL",pasDeRegle()) - - #### traitement de MACRO_MISS_3D ############################## - genereErreurPourCommande(jdc,"MACRO_MISS_3D") - - #### traitement de MACRO_MODE_MECA ############################## - # insereMotCleDansCommande(jdc,"MACRO_MODE_MECA","TYPE_RESU='DYNAMIQUE'") - chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","SOLVEUR_MODAL",) - chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","OPTION='BANDE'",pasDeRegle(),0) - chercheOperInsereFacteurSiRegle(jdc,"MACRO_MODE_MECA","NORM_MODE",((("NORM_MODE",),"nexistepas"),),1) - - lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] - for mcle in lMCLE: - moveMotClefInOperToFact(jdc,"MACRO_MODE_MECA",mcle,"SOLVEUR_MODAL") - - moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") - renameCommande(jdc,"MACRO_MODE_MECA","CALC_MODES", ) - - #### traitement de MODE_ITER_INV ############################## - chercheOperInsereFacteur(jdc,"MODE_ITER_INV","SOLVEUR_MODAL",) - moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_FREQ","OPTION") - moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","OPTION") - - lINV=["OPTION", "PREC", "NMAX_ITER",] - for mcle in lINV: - renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle,mcle+"_INV",pasDeRegle(),0) - moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle+"_INV","SOLVEUR_MODAL") - - lMCLE=["NMAX_ITER_AJUSTE","PREC_AJUSTE",] - for mcle in lMCLE: - moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_FREQ",mcle,"SOLVEUR_MODAL") - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_JACOBI","SOLVEUR_MODAL") - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_BATHE","SOLVEUR_MODAL") - - removeMotCle(jdc,"MODE_ITER_INV","CALC_MODE",pasDeRegle(),0) - - chercheOperInsereMotCleSiRegle(jdc,"MODE_ITER_INV","OPTION='AJUSTE'",((("OPTION",),"nexistepas"),),0) - - renameCommande(jdc,"MODE_ITER_INV","CALC_MODES", ) - - #### traitement de MODE_ITER_SIMULT ############################## - chercheOperInsereFacteur(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",) - removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("METHODE","TRI_DIAG",jdc),"MCnaPasPourValeur"),),) - removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("OPTION","SANS",jdc),"MCaPourValeur"),),) - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","OPTION","SOLVEUR_MODAL") - changementValeurDsMCF(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION",{"MODE_RIGIDE":"OUI"}) - renameMotCleInFact(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION","MODE_RIGIDE") - moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_FREQ","OPTION") - moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","OPTION") - - # chercheOperInsereFacteurSiRegle(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",((("METHODE",),"existe"),),1) - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","METHODE","SOLVEUR_MODAL") - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","TYPE_QZ","SOLVEUR_MODAL") - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","NMAX_ITER_BATHE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","COEF_DIM_ESPACE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","DIM_SOUS_ESPACE","SOLVEUR_MODAL") - - removeMotCleInFactSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE", - ((("SOLVEUR_MODAL","METHODE",["QZ"],jdc),"MCsousMCFnaPasPourValeurDansListe")or - (("SOLVEUR_MODAL","METHODE",),"nexistepasMCsousMCF"), - ) - ) - - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE","SOLVEUR_MODAL") - moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","APPROCHE","SOLVEUR_MODAL") - - lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] - for mcle in lMCLE: - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") - - lMCLE=["NMAX_ITER_QR", "PREC_ORTHO", "NMAX_ITER_ORTHO", "PREC_LANCZOS"] - for mcle in lMCLE: - moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") - - - renameCommande(jdc,"MODE_ITER_SIMULT","CALC_MODES", ) - - #### traitement de MODI_MAILLAGE ############################## - genereErreurValeurDsMCF(jdc,"MODI_MAILLAGE","DEFORME","OPTION",("'TRAN_APPUI'",)) - removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_APPUI"],pasDeRegle(),0) - removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_STRU"],pasDeRegle(),0) - - #### traitement de MODI_MODELE_XFEM ############################## - changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P1P1":"STANDARD",}) - changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P2P1":"STANDARD",}) - - - #### traitement de POST_DYNA_ALEA ############################## - chercheOperInsereFacteurSiRegle(jdc,"POST_DYNA_ALEA","INTERSPECTRE",((("INTE_SPEC",),"existe"),),1) - lPDA=["INTE_SPEC", "NUME_ORDRE_I", "NOEUD_I", "OPTION", "NUME_ORDRE_J", - "NOEUD_J", "NOM_CMP_I", "NOM_CMP_J", "MOMENT", "DUREE"] - for mcle in lPDA: - moveMotClefInOperToFact(jdc,"POST_DYNA_ALEA",mcle,"INTERSPECTRE") - removeMotCle(jdc,"POST_DYNA_ALEA","TOUT_ORDRE",pasDeRegle(),0) - - ajouteMotClefDansFacteur(jdc,"POST_DYNA_ALEA","FRAGILITE","METHODE = 'EMV'",pasDeRegle()) - - #### traitement de POST_ELEM ############################## - ajouteMotClefDansFacteurSiRegle(jdc,"POST_ELEM","VOLUMOGRAMME","NB_INTERV=5", - ((("VOLUMOGRAMME","NB_INTERV",),"nexistepasMCsousMCF"),),) - - #### traitement de POST_FATIGUE ############################## - changementValeur(jdc,"POST_FATIGUE","DOMMAGE",{"MANSON_C":"MANSON_COFFIN",}) - - #### traitement de POURSUITE ############################## - removeMotCle(jdc,"POURSUITE","CODE",)#"NOM",pasDeRegle(),0) - - #### traitement de RECU_FONCTION ############################## - genereErreurMCF(jdc,"RECU_FONCTION","TABLE") - - #### traitement de C_COMP_INCR et C_COMP_ELAS ############################## - lCOM=["CALCUL","STAT_NON_LINE","CALC_G", "CALC_PRECONT","DYNA_NON_LINE","CALC_META", - "TEST_COMPOR","SIMU_POINT_MAT","CALC_ESSAI_GEOMECA","CALC_FORC_NONL","LIRE_RESU", - "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_EUROPLEXUS","MACR_ECREVISSE",] - for com in lCOM: - # chercheOperInsereFacteurSiRegle(jdc,com,"COMPORTEMENT",(((["COMPORTEMENT"],),"nexistepasMCFParmi"),),1) - fusionMCFToMCF(jdc,com,["COMP_ELAS","COMP_INCR"],"COMPORTEMENT") - # renameMotCle(jdc,com,"COMP_ELAS","COMPORTEMENT") - # renameMotCle(jdc,com,"COMP_INCR","COMPORTEMENT") - chercheOperInsereFacteurSiRegle(jdc,com,"ETAT_INIT",((("COMPORTEMENT","SIGM_INIT",),"existeMCsousMCF"),),1) - moveMotCleFromFactToFact(jdc,com,"COMPORTEMENT","SIGM_INIT","ETAT_INIT") - renameMotCleInFact(jdc,com,"ETAT_INIT","SIGM_INIT","SIGM",pasDeRegle(),0) - removeMotCleInFact(jdc,com,"COMPORTEMENT","SIGM_INIT",pasDeRegle(),0) - - changementValeur(jdc,com,"OPTION",{"FORC_INT_ELEM":"FORC_INTE_ELEM"}) - - removeMotCleInFactSiRegle(jdc,com,"COMPORTEMENT","NB_VARI",((("COMPORTEMENT","RELATION","'MFRONT'",jdc),"MCsousMCFaPourValeur"),)) - - - #### traitement de TEST_COMPOR ############################## - genereErreurPourCommande(jdc,"TEST_COMPOR") - - #### traitement de THER_NON_LINE ############################## - renameMotCle(jdc,"THER_NON_LINE","COMP_THER_NL","COMPORTEMENT") - - #### traitement de C_SOLVEUR ############################## - lCOM=['CALC_ERREUR', 'CALC_FORC_AJOU', 'CALC_IFS_DNL', 'CALC_MATR_AJOU', 'CALC_PRECONT', - 'CREA_ELEM_SSD', 'DEFI_BASE_MODALE', 'DYNA_LINE_HARM', 'DYNA_LINE_TRAN', 'DYNA_NON_LINE', - 'DYNA_TRAN_MODAL', 'INFO_MODE', 'MACR_ASCOUF_CALC', 'MACR_ASPIC_CALC', 'MACRO_BASCULE_SCHEMA', - 'MACRO_MATR_AJOU', 'MECA_STATIQUE', 'MODE_ITER_SIMULT', 'MODE_ITER_INV', 'MODE_STATIQUE', - 'STAT_NON_LINE', 'THER_LINEAIRE', 'THER_NON_LINE', 'THER_NON_LINE_MO', 'CALC_ERC_DYN','CALC_MODES',] - for com in lCOM: - # Suppression de ELIM_LAGR2 - changementValeurDsMCF(jdc,com,"SOLVEUR","ELIM_LAGR2",{"OUI":"LAGR2"}) - removeMotCleInFactSiRegle(jdc,com,"SOLVEUR","ELIM_LAGR2",((("SOLVEUR","ELIM_LAGR2","NON",jdc),"MCsousMCFaPourValeur"),)) - renameMotCleInFact(jdc,com,"SOLVEUR","ELIM_LAGR2","ELIM_LAGR") - - # Suppression de la méthode FETI - genereErreurValeurDsMCF(jdc,com,"SOLVEUR","METHODE",["FETI"]) - lMCLE=["NB_REORTHO_DD","NMAX_ITER","INFO_FETI","RESI_RELA","PARTITION"] - for mocle in lMCLE: - genereErreurMotCleInFact(jdc,com,"SOLVEUR",mocle) - - #### traitement de DEFI_PART_FETI ############################## - genereErreurMCF(jdc,"DEFI_PART_FETI","EXCIT") - removeMotCle(jdc,"DEFI_PART_FETI","EXCIT",pasDeRegle(),0) - removeMotCle(jdc,"DEFI_PART_FETI","CORRECTION_CONNEX",pasDeRegle(),0) - genereErreurPourCommande(jdc,"DEFI_PART_FETI") - renameCommande(jdc,"DEFI_PART_FETI","DEFI_PARTITION", ) - - ################################################################# - f=open(outfile,'w') - f.write(jdc.getSource()) - f.close() - - log.ferme(hdlr) - -def main(): - parser = optparse.Optionparser(usage=usage) - - parser.add_option('-i','--infile', dest="infile", default='toto.comm', - help="Le fichier à traduire") - parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', - help="Le fichier traduit") - - options, args = parser.parse_args() - traduc(options.infile,options.outfile) - -if __name__ == '__main__': - main() diff --git a/Traducteur/traduitV7V8.py b/Traducteur/traduitV7V8.py deleted file mode 100644 index d0a79658..00000000 --- a/Traducteur/traduitV7V8.py +++ /dev/null @@ -1,519 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -""" -usage="""usage: %prog [options] -Typical use is: - python traduitV7V8.py --infile=xxxx --outfile=yyyy -""" - -import sys -import log -import optparse - -from load import getJDC -from mocles import parseKeywords -from removemocle import * -from renamemocle import * -from renamemocle import * -from inseremocle import * -from changeValeur import * -from movemocle import * -from dictErreurs import genereErreurPourCommande,genereErreurMotCleInFact - -import calcG - -atraiter=( "IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE", - "CALC_G_LOCAL_T","CALC_G_THETA_T","CALC_G","AFFE_CHAR_MECA", - "AFFE_CHAR_THER_F","IMPR_CO","DEFI_SQUELETTE","DEFI_FONCTION", - "CALC_THETA","AFFE_MODELE","DYNA_NON_LINE","CALC_ELEM", - "CALC_NO","EXTR_MODE","CALC_META","IMPR_RESU","TEST_RESU", - "DEFI_THER_JOULE","DYNA_TRAN_EXPLI","DEBUT","CALC_CHAM_ELEM", - "AFFE_CHAR_THER", "MACR_LIGN_COUPE","POST_RCCM","PROJ_MESU_MODAL", - "CREA_RESU","CREA_CHAMP","DIST_LIGN_3D","MODI_MAILLAGE","LIRE_TABLE", - "POST_SIMPLIFIE","AFFE_MATERIAU","DEFI_MAILLAGE","DEPL_INTERNE", - "POST_DYNA_ALEA","RECU_FONCTION","DYNA_TRAN_MODAL","DEFI_INTERF_DYNA", - "CALC_PRECONT","DEFI_TEXTURE","TEST_RESU","COMB_CHAM_NO","COMB_CHAM_ELEM", - "CALC_FATIGUE","IMPR_OAR", "AFFE_CHAR_MECA_F", - "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_CABRI_CALC", - "MACR_ADAP_MAIL","IMPR_FICO_HOMARD","DEFI_PART_FETI" - ) - -dict_erreurs={ -#STA8 - "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", - "DEFI_THER_JOULE": "la commande DIST_LIGN_3D a ete supprimee", - "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", - "AFFE_MODELE_AFFE": "Les modelisations APPUI_REP, ASSE_GRIL et 3D_JOINT_CT ont ete supprimees", - "AFFE_CHAR_MECA_CONTACT_FROTTEMENT": "Suppression d un mot clef FROTTEMENT", - "AFFE_CHAR_MECA_SECH_CALCULEE": "le sechage est maintenant une variable de commande", - "AFFE_CHAR_MECA_HYDR_CALCULEE": "l'hydratation est maintenant une variable de commande", - "AFFE_CHAR_MECA_EPSA_CALCULEE":"EPSA est maintenant une variable de commande", - "AFFE_CHAR_MECA_PRESSION_CALCULEE":"PRESSION_CALCULEE est remplace par EVOL_CHAR", - "MACR_LIGN_COUPE" : "MACR_LIGN_COUPE demande un traitement manuel", - "POST_RCCM" : "POST_RCCM demande un traitement manuel", - "DEFI_MATERIAU_CHABOCHE" : "remplacer la valeur CINx_CHAB", - "DEFI_MATERIAU_POLY_CFC" : "le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", - "DEFI_MATERIAU_ECOU_PLAS1" : "le materiau ECOU_PLAS1 est supprime", - "DEFI_MATERIAU_COMP_THM_ELAS_THM" : "le materiau ELAS_THM a ete supprime", - "DEFI_MATERIAU_COMP_THM_SURF_ETAT_SATU" : "le materiau SURF_ETAT_SATU a ete supprime", - "DEFI_MATERIAU_COMP_THM_SURF_ETAT_NSAT" : "le materiau SURF_ETAT_NSAT a ete supprime", - "DEFI_MATERIAU_COMP_THM_CAM_CLAY_THM" : "le materiau CAM_CLAY_THM a ete supprime", - "DEFI_MATERIAU_COMP_THM_LIQU_SATU_GAT" : "le materiau LIQU_SATU_GAT a ete supprime", - "DEFI_MATERIAU_COMP_THM_LIQU_NSAT_GAT" : "le materiau LIQU_NSAT_GAT a ete supprime", - "DEFI_MATERIAU_GLRC" : "le materiau GLRC a ete remplace par GLRC_DAMAGE", - "DEFI_MATERIAU_GLRC_FO" : "le materiau GLRC_FO a ete remplace par GLRC_DAMAGE", - "DEFI_MATERIAU_OHNO" : "le materiau OHNO a ete remplace par TAHERI", - "DEFI_MATERIAU_OHNO_FO" : "le materiau OHNO a ete remplace par TAHERI", - "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC", - "CALC_G_THETA_T_OPTION_VALEUR":"verifier la valeur d OPTION", - "CALC_G_THETA_T_OPTION_DEFAUT":"verifier la valeur d OPTION donnee a la place du defaut", - "CALC_G_MODELE":"Mot Clef MODELE supprime sous CALC_G", - "CALC_G_DEPL":"Mot Clef DEPL supprime sous CALC_G", - "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprime sous CALC_G", - "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprime sous CALC_G", - "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT a completer sous CALC_G", - "AFFE_MODELE_AFFE_MODELISATION_VALEUR":"verifier la valeur de MODELISATION", - "STAT_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", - "STAT_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", - "STAT_NON_LINE_VARI_COMM":"suppression des variables de commande", - "STAT_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du STAT_NON_LINE", - "DYNA_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", - "DYNA_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", - "DYNA_NON_LINE_VARI_COMM":"suppression des variables de commande", - "DYNA_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du DYNA_NON_LINE", - "CALC_PRECONT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du CALC_PRECONT", - "TEST_RESU_UNITE":"suppression du mot clef UNITE dans TEST_RESU", - "POST_SIMPLIFIE":"commande POST_SIMPLIFIE supprimee", - "POST_DYNA_ALEA_GAUSS":"la methode GAUSS a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_VANMARCKE":"la methode VANMARCKE a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_DEPASSEMENT":"la methode DEPASSEMENT a ete supprimee de POST_DYNA_ALEA", - "POST_DYNA_ALEA_RAYLEIGH":"la methode RAYLEIGH a ete supprimee de POST_DYNA_ALEA", - "DYNA_TRAN_MODAL_EXCIT_NUME_MODE":"le numero du mode utilise pour EXCIT DYNA_TRAN_MODAL est le numero d'ORDRE", - "DEFI_INTERF_DYNA_INTERFACE_DDL_ACTIF":"DDL_ACTIF supprime de DEFI_INTERF_DYNA; utiliser MASQUE", - "DEFI_TEXTURE":"le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", - "CREA_RESU_NOM_CHAM_VALEUR":"HYDR_ELGA est remplace par HYDR_ELNO_ELGA et HYDR_NOEU_ELGA", - "COMB_CHAM_NO":"COMB_CHAM_NO est remplace par CREA_CHAMP", - "COMB_CHAM_ELEM":"COMB_CHAM_ELEM est remplace par CREA_CHAMP", - "IMPR_OAR":"IMPR_OAR demande un traitement manuel", - "IMPR_FICO_HOMARD":"IMPR_FICO_HOMARD a ete integre dans MACR_ADPA_MAIL", - } - -sys.dict_erreurs=dict_erreurs - -#atraiter=( "MACR_ADAP_MAIL",) - -def traduc(infile,outfile,flog=None): - - hdlr=log.initialise(flog) - jdc=getJDC(infile,atraiter) - root=jdc.root - - #Parse les mocles des commandes - parseKeywords(root) - - ####################### traitement erreurs ######################## - genereErreurPourCommande(jdc,("DEBUT","POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM")) - - ####################### traitement CALC_META ####################### - renameMotCleInFact(jdc,"CALC_META","ETAT_INIT","META_INIT","META_INIT_ELNO") - - ####################### traitement CALC_FONCTION ####################### - removeMotCleSiRegle(jdc,"CALC_FONCTION","NOM_PARA",((("MAX"),"existeMCFParmi"),)) - renameCommandeSiRegle(jdc,"CALC_FONCTION","INFO_FONCTION", ((("RMS","MAX","NOCI_SEISME","NORME","ECART-TYPE"),"existeMCFParmi"),)) - renameMotCleInFact(jdc,"CALC_FONCTION","LISS_ENVELOP","FONCTION","NAPPE") - - ####################### traitement IMPR_GENE ####################### - moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","UNITE") - moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","FORMAT") - - ####################### traitement STAT/DYNA_NON_LINE ####################### - moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) - removeMotCleAvecErreur(jdc,"STAT_NON_LINE","VARI_COMM") - moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) - removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","VARI_COMM") - - dStatNonLine={"ELAS":"ELAS_THER"} - lavertit=("ELAS") - changementValeurDsMCFAvecAvertissement(jdc,"STAT_NON_LINE","COMP_INCR","RELATION_KIT",dStatNonLine,lavertit) - - lavertit=("CHABOCHE","ASSE_COMBU","OHNO","GLRC") - dchaboche={"CHABOCHE":"VMIS_CIN1_CHAB","ASSE_COMBU":"XXX_IRA","OHNO":"VISC_TAHERI","GLRC":"GLRC_DAMAGE"} - changementValeurDsMCFAvecAvertissement(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dchaboche,lavertit) - changementValeurDsMCFAvecAvertissement(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dchaboche,lavertit) - - removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegleAvecErreur(jdc,"STAT_NON_LINE","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"STAT_NON_LINE","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - renameMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegleAvecErreur(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - renameMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - - moveMotClefInOperToFact(jdc,"STAT_NON_LINE","PARM_THETA","COMP_INCR") - moveMotClefInOperToFact(jdc,"DYNA_NON_LINE","PARM_THETA","COMP_INCR") - moveMotClefInOperToFact(jdc,"DYNA_TRAN_EXPLI","PARM_THETA","COMP_INCR") - - ####################### traitement DEFI_MATERIAU ####################### - renameMotCle(jdc,"DEFI_MATERIAU","LEMAITRE","LEMAITRE_IRRA") - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","QSR_K",("LEMAITRE_IRRA",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","BETA",("LEMAITRE_IRRA",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","PHI_ZERO",("LEMAITRE_IRRA",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","L",("LEMAITRE_IRRA",)) - removeMotCle(jdc,"DEFI_MATERIAU","FLU_IRRA") - renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","CHABOCHE","CINx_CHAB") - renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO","TAHERI") - renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO_FO","TAHERI_FO") - renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC","GLRC_DAMAGE") - renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC_FO","GLRC_DAMAGE") - - renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","A","GRAN_A") - renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","B","GRAN_B") - renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","S","GRAN_S") - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_A",("LEMAITRE_IRRA",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_B",("LEMAITRE_IRRA",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_S",("LEMAITRE_IRRA",)) - removeMotCle(jdc,"DEFI_MATERIAU","GRAN_IRRA") - - chercheOperInsereFacteurSiRegle(jdc,"DEFI_MATERIAU","ELAS",((("CABLE",),"existe"),)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","E", ("ELAS",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","NU", ("ELAS",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","RHO",("ELAS",)) - moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","ALPHA",("ELAS",)) - ajouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","ELAS","NU=0.,",((("ELAS","NU"),"nexistepasMCsousMCF"),)) - - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","POLY_CFC") - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ECOU_PLAS1") - - lavertit=("ELAS_THM","SURF_ETAT_SATU","SURF_ETAT_NSAT","CAM_CLAY_THM","LIQU_SATU_GAT","LIQU_NSAT_GAT") - dTHM={"ELAS_THM":"xxx", "SURF_ETAT_SATU":"xxx", "SURF_ETAT_NSAT":"xxx","CAM_CLAY_THM":"xxx","LIQU_SATU_GAT":"xxx","LIQU_NSAT_GAT":"xxx"} - changementValeurAvecAvertissement(jdc,"DEFI_MATERIAU","COMP_THM",dTHM,lavertit) - - dfatigue={"MATAKE":"MATAKE_MODI_AC", "DOMM_MAXI":"MATAKE_MODI_AV", "FATEMI_SOCIE":"FATESOCI_MODI_AV"} - changementValeurDsMCF(jdc,"DEFI_MATERIAU","CISA_PLAN_CRIT","CRITERE",dfatigue) - - ####################### traitement IMPR_CO ####################### - chercheOperInsereFacteurSiRegle(jdc,"IMPR_CO","CONCEPT",((("CO",),"existe"),)) - moveMotClefInOperToFact(jdc,"IMPR_CO","CO","CONCEPT") - renameMotCleInFact(jdc,"IMPR_CO","CONCEPT","CO","NOM") - - ####################### traitement DEFI_SQUELETTE ####################### - chercheOperInsereFacteurSiRegle(jdc,"DEFI_SQUELETTE","CYCLIQUE",((("MODE_CYCL",),"existe"),)) - moveMotClefInOperToFact(jdc,"DEFI_SQUELETTE","MODE_CYCL","CYCLIQUE") - - ####################### traitement AFFE_CHAR_* ####################### - removeMotCle(jdc,"AFFE_CHAR_MECA","VERI_DDL") - removeMotCle(jdc,"AFFE_CHAR_MECA","SECH_CALCULEE") - removeMotCle(jdc,"AFFE_CHAR_MECA","HYDR_CALCULEE") - removeMotCle(jdc,"AFFE_CHAR_MECA","PRESSION_CALCULEE") - removeMotCleAvecErreur(jdc,"AFFE_CHAR_MECA","EPSA_CALCULEE") - removeMotCle(jdc,"AFFE_CHAR_THER_F","VERI_DDL") - removeMotCle(jdc,"AFFE_CHAR_THER","VERI_DDL") - - ####################### traitement AFFE_CHAR_MECA (CONTACT) ####################### - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","COEF_MULT_ESCL","COEF_MULT") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NOM_CHAM","NOM_CMP") - renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) - renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","APPARIEMENT") - - ####################### traitement AFFE_CHAR_MECA_F (CONTACT) ####################### - renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","COEF_MULT_ESCL","COEF_MULT") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","NOM_CHAM","NOM_CMP") - renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) - renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) - removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","APPARIEMENT") - - ####################### traitement CALC_G ####################### - chercheOperInsereFacteurSiRegle(jdc,"CALC_G_LOCAL_T","LISSAGE",((("LISSAGE_G","LISSAGE_THETA","DEGRE"),"existeMCFParmi"),)) - moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_THETA","LISSAGE") - moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_G","LISSAGE") - moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","DEGRE","LISSAGE") - - dlocal={"CALC_G_LGLO":"G_LAGR", "G_BILINEAIRE":"G_BILI", "CALC_G_MAX":"G_MAX"} - changementValeur(jdc,"CALC_G_LOCAL_T","OPTION",dlocal) - # - dtheta={"CALC_G_LAGR":"G_LAGR_GLOB", "G_BILINEAIRE":"G_BILI_GLOB", "CALC_G_MAX":"G_MAX_GLOB","CALC_G":"CALC_G_GLOB"} - # Attention si le defaut doit generer un avertissement Il faut le mettre comme dernier mot de la liste - lavertit=("CALC_G_LAGR","CALC_G","defaut") - changementValeurAvecAvertissement(jdc,"CALC_G_THETA_T","OPTION",dtheta,lavertit) - renameOper(jdc,"CALC_G_LOCAL_T","CALC_G") - renameOper(jdc,"CALC_G_THETA_T","CALC_G") - - # Attention cela necessite un traitement particulier et ne peut pas etre generalise tel quel - # Attention egalement doit etre fait avant le regroupement dans THETA - calcG.traitementRayon(jdc) - renameMotCle(jdc,"CALC_G","THETA","THETA_OLD") - chercheOperInsereFacteur(jdc,"CALC_G","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","THETA_OLD","THETA") - renameMotCleInFact(jdc,"CALC_G","THETA","THETA_OLD","THETA") - - moveMotClefInOperToFact(jdc,"CALC_G","FOND_FISS","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","R_INF_FO","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","R_SUP_FO","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","R_INF","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","R_SUP","THETA") - moveMotClefInOperToFact(jdc,"CALC_G","FISSURE","THETA") - renameMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA","THETA_LAGR",((("THETA","R_INF"),"existeMCsousMCF"),)) - renameMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA","THETA_LAGR",((("THETA","R_SUP"),"existeMCsousMCF"),)) - moveMotCleFromFactToFather(jdc,"CALC_G","THETA","THETA_LAGR") - removeMotCleAvecErreur(jdc,"CALC_G","MODELE") - removeMotCleAvecErreur(jdc,"CALC_G","DEPL") - removeMotCleAvecErreur(jdc,"CALC_G","CHAM_MATER") - removeMotCleAvecErreur(jdc,"CALC_G","CARA_ELEM") - chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,"CALC_G","RESULTAT=XXX,",((("THETA_LAGR",),"existeMCFParmi"),),0) - - ####################### traitement AFFE_MODELE ####################### - daffeModele={"PLAN_FISSURE":"PLAN_JOINT", "AXIS_FISSURE":"AXIS_JOINT"} - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",daffeModele) - removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","APPUI_REP",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","ASSE_GRIL",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","3D_JOINT_CT",jdc),"MCsousMCFaPourValeur"),)) - renameMotCleInFact(jdc,"AFFE_MODELE","AFFE_SOUS_STRUC","MAILLE","SUPER_MAILLE") - - ####################### traitement PROJ_MESU_MODAL ####################### - removeMotCleInFact(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_PARA") - removeMotCleInFactSiRegleAvecErreur(jdc,"AFFE_CHAR_MECA","CONTACT","FROTTEMENT",((("CONTACT","METHODE","CONTRAINTE",jdc),"MCsousMCFaPourValeur"),)) - - ####################### traitement CALC_ELEM / CALC_NO ####################### - dcalcelemno={"ERRE_ELGA_NORE":"ERRE_ELEM_SIGM","ERRE_ELEM_NOZ1":"ERZ1_ELEM_SIGM","ERRE_ELEM_NOZ2":"ERZ2_ELEM_SIGM","ERRE_ELNO_ELGA":"ERRE_ELNO_ELEM","ERRE_NOEU_ELGA":"ERRE_NOEU_ELEM","ERTH_ELEM_TEMP":"ERRE_ELEM_TEMP","ERTH_ELNO_ELEM":"ERRE_ELNO_ELEM","EPGR_ELNO":"EPFP_ELNO","EPGR_ELGA":"EPFP_ELGA","DURT_ELGA_TEMP":"DURT_ELNO_TEMP"} - changementValeur(jdc,"CALC_ELEM","OPTION",dcalcelemno) - changementValeur(jdc,"CALC_NO","OPTION",dcalcelemno) - changementValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",dcalcelemno) - changementValeur(jdc,"TEST_RESU","RESU",dcalcelemno) - removeMotCleAvecErreur(jdc,"TEST_RESU","UNITE") - - chercheOperInsereFacteurSiRegle(jdc,"CALC_ELEM","REPE_COQUE",((("NUME_COUCHE","NIVE_COUCHE","ANGLE","PLAN"),"existeMCFParmi"),)) - moveMotClefInOperToFact(jdc,"CALC_ELEM","NIVE_COUCHE","REPE_COQUE") - moveMotClefInOperToFact(jdc,"CALC_ELEM","NUME_COUCHE","REPE_COQUE") - moveMotClefInOperToFact(jdc,"CALC_ELEM","ANGLE","REPE_COQUE") - moveMotClefInOperToFact(jdc,"CALC_ELEM","PLAN","REPE_COQUE") - - - ####################### traitement EXTR_MODE ####################### - ajouteMotClefDansFacteurSiRegle(jdc,"EXTR_MODE","FILTRE_MODE","SEUIL=1.E-3", ((("FILTRE_MODE","CRIT_EXTR",),"existeMCsousMCF"),(("FILTRE_MODE","SEUIL",),"nexistepasMCsousMCF"))) - - ####################### traitement DYNA_TRAN_EXPLI ####################### - removeMotCle(jdc,"DYNA_TRAN_EXPLI","NEWMARK") - removeMotCle(jdc,"DYNA_TRAN_EXPLI","HHT") - chercheOperInsereFacteur(jdc,"DYNA_TRAN_EXPLI","DIFF_CENT") - - ####################### traitement CREA_RESU ####################### - dcrearesu={"HYDR_ELGA":"HYDR_NOEU_ELGA"} - lavertit=("HYDR_ELGA",) - changementValeur(jdc,"CREA_RESU","NOM_CHAM",dcrearesu,lavertit) - - ####################### traitement CREA_CHAMP ####################### - dcrearesu={"HYDR_ELGA":"HYDR_ELNO_ELGA"} - lavertit=("HYDR_ELGA",) - changementValeur(jdc,"CREA_CHAMP","NOM_CHAM",dcrearesu,lavertit) - changementValeur(jdc,"CREA_CHAMP","TYPE_CHAM",dcrearesu,lavertit) - - ####################### traitement TEST_RESU ####################### - dcrearesu={"HYDR_ELGA":"HYDR_NOEU_ELGA"} - lavertit=("HYDR_ELGA",) - changementValeurDsMCFAvecAvertissement(jdc,"TEST_RESU","RESU","NOM_CHAM",dcrearesu,lavertit) - - ####################### traitement DEBUT ####################### - removeMotCleSiRegle(jdc,"DEBUT","BASE",((("BASE","FICHIER","LOCALE",jdc),"MCsousMCFaPourValeur"),)) - - ####################### traitement DEFI_THER_JOULE ####################### - removeCommande(jdc,"DEFI_THER_JOULE") - - ####################### traitement CALC_CHAM_ELEM ####################### - removeCommandeSiRegleAvecErreur(jdc,"CALC_CHAM_ELEM",((("OPTION","SOUR_ELGA_ELEC",jdc),"MCaPourValeur"),)) - - ####################### traitement MACR_LIGNE_COUPE ####################### - appelleMacroSelonValeurConcept(jdc,"MACR_LIGN_COUPE",("LIGN_COUPE","TABLE")) - removeMotCleInFact(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TABLE") - - ####################### traitement MODI_MAILLAGE ####################### - removeMotCle(jdc,"MODI_MAILLAGE","MODELE") - - ####################### traitement LIRE_TABLE ####################### - removeMotCle(jdc,"LIRE_TABLE","TYPE_TABLE") - - ####################### traitement POST_SIMPLIFIE ####################### - removeCommande(jdc,"POST_SIMPLIFIE") - - ####################### traitement AFFE_MATERIAU ####################### - removeMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","SECH_REF") - - ####################### traitement DEFI_MAILLAGE ####################### - renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_MAILLE","MAILLE","SUPER_MAILLE") - renameMotCle(jdc,"DEFI_MAILLAGE","DEFI_MAILLE","DEFI_SUPER_MAILLE") - renameMotCleInFact(jdc,"DEFI_MAILLAGE","RECO_GLOBAL","MAILLE","SUPER_MAILLE") - renameMotCleInFact(jdc,"DEFI_MAILLAGE","RECO_MAILLE","MAILLE","SUPER_MAILLE") - renameMotCle(jdc,"DEFI_MAILLAGE","RECO_MAILLE","RECO_SUPER_MAILLE") - renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_NOEUD","MAILLE","SUPER_MAILLE") - renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_GROUP_NO","MAILLE","SUPER_MAILLE") - - ####################### traitement DEPL_INTERNE ####################### - renameMotCle(jdc,"DEPL_INTERNE","MAILLE","SUPER_MAILLE") - - - ####################### traitement POST_DYNA_ALEA ####################### - removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","GAUSS") - removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","RAYLEIGH") - removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","DEPASSEMENT") - removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","VANMARCKE") - - ####################### traitement RECU_FONCTION ####################### -# il faut aussi ajouter la regle suivante : -# s'il existe TYPE_RESU='FONCTION_C', renommer NOM_PARA_TABL='FONCTION_C' - removeMotCleSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL",((("TYPE_RESU","FONCTION_C",jdc),"MCaPourValeur"),)) - chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL='FONCTION_C',",((("TYPE_RESU","FONCTION_C",jdc),"MCaPourValeur"),),estunFacteur=0) - removeMotCle(jdc,"RECU_FONCTION","TYPE_RESU") - chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL='FONCTION',",((("OBSTACLE",),"existe"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE",((("OBSTACLE",),"existe"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE","NOM_PARA='LIEU',",((("OBSTACLE",),"existe"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE","VALE_K='DEFIOBST',",((("OBSTACLE",),"existe"),)) - renameMotCle(jdc,"RECU_FONCTION","OBSTACLE","TABLE") - - ####################### traitement DYNA_TRAN_MODAL ####################### - renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","EXCIT","NUME_MODE","NUME_ORDRE",erreur=1) - - ####################### traitement DEFI_INTERF_DYNA ####################### - removeMotCleInFact(jdc,"DEFI_INTERF_DYNA","INTERFACE","DDL_ACTIF",erreur=1) - - - ####################### traitement CALC_PRECONT ####################### - removeMotCleInFactSiRegle(jdc,"CALC_PRECONT","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegle(jdc,"CALC_PRECONT","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegleAvecErreur(jdc,"CALC_PRECONT","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"CALC_PRECONT","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) - renameMotCleInFact(jdc,"CALC_PRECONT","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - - - ####################### traitement DEFI_TEXTURE ####################### - removeCommande(jdc,"DEFI_TEXTURE") - - - ####################### traitement COMB_CHAM_NO ####################### - renameMotCleInFact(jdc,"COMB_CHAM_NO","COMB_C","CHAM_NO","CHAM_GD") - chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","TYPE_CHAM='xxx',",estunFacteur=0,erreur=1) - chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","MODELE=xxx,",estunFacteur=0,erreur=1) - chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","OPERATION='ASSE',",estunFacteur=0,erreur=1) - renameMotCle(jdc,"COMB_CHAM_NO","COMB_C","ASSE") - ajouteMotClefDansFacteur(jdc,"COMB_CHAM_NO","ASSE","CUMUL='NON',") - ajouteMotClefDansFacteur(jdc,"COMB_CHAM_NO","ASSE","TOUT='OUI',") - renameOper(jdc,"COMB_CHAM_NO","CREA_CHAMP") - - - ####################### traitement MACR_ASCOUF_CALC ####################### - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_ASCOUF_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) - - - ####################### traitement MACR_ASPIC_CALC ####################### - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_ASPIC_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - renameMotCleInFact(jdc,"MACR_ASPIC_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - - - ####################### traitement MACR_CABRI_CALC ####################### - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_CABRI_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) - renameMotCleInFact(jdc,"MACR_CABRI_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") - moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) - moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) - - - ####################### traitement CALC_FATIGUE ####################### - dfatigue={"MATAKE":"MATAKE_MODI_AC", "DOMM_MAXI":"MATAKE_MODI_AV", "FATEMI_SOCIE":"FATESOCI_MODI_AV"} - changementValeur(jdc,"CALC_FATIGUE","CRITERE",dfatigue) - - ####################### traitement DEFI_PART_FETI ####################### - removeMotCleSiRegle(jdc,"DEFI_PART_FETI","MAILLAGE", ((("MODELE",),"existeMCFParmi"),(("MAILLAGE",),"existeMCFParmi"))) - - ####################### traitement MACR_ADAP_MAIL ####################### - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","MAILLAGE_N") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","MAILLAGE_NP1") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","RESULTAT_N") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","INDICATEUR") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","NOM_CMP_INDICA") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_PE") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_ABS") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_REL") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_PE") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_ABS") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_REL") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","NIVE_MAX") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","INST") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","PRECISION") - moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRITERE") - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFFINEMENT',",((("ADAPTATION","LIBRE","RAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='DERAFFINEMENT',",((("ADAPTATION","LIBRE","DERAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFF_DERA',",((("ADAPTATION","LIBRE","RAFF_DERA",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFFINEMENT_UNIFORME',",((("ADAPTATION","UNIFORME","RAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='DERAFFINEMENT_UNIFORME',",((("ADAPTATION","UNIFORME","DERAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RIEN',",((("ADAPTATION","UNIFORME","RIEN",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) - removeMotCle(jdc,"MACR_ADAP_MAIL","ADAPTATION") - renameMotCle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW","ADAPTATION") - dcalcelemno={"ERRE_ELGA_NORE":"ERRE_ELEM_SIGM","ERRE_ELEM_NOZ1":"ERZ1_ELEM_SIGM","ERRE_ELEM_NOZ2":"ERZ2_ELEM_SIGM","ERRE_ELNO_ELGA":"ERRE_ELNO_ELEM","ERRE_NOEU_ELGA":"ERRE_NOEU_ELEM","ERTH_ELEM_TEMP":"ERRE_ELEM_TEMP","ERTH_ELNO_ELEM":"ERRE_ELNO_ELEM","EPGR_ELNO":"EPFP_ELNO","EPGR_ELGA":"EPFP_ELGA","DURT_ELGA_TEMP":"DURT_ELNO_TEMP"} - changementValeur(jdc,"MACR_ADAP_MAIL","ADAPTATION",dcalcelemno) - - - ####################### traitement IMPR_FICO_HOMARD ####################### - removeCommande(jdc,"IMPR_FICO_HOMARD") - - - ######################################################################### - - - f=open(outfile,'w') - f.write(jdc.getSource()) - f.close() - - log.ferme(hdlr) - -def main(): - parser = optparse.Optionparser(usage=usage) - - parser.add_option('-i','--infile', dest="infile", default='toto.comm', - help="Le fichier a traduire") - parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', - help="Le fichier traduit") - - options, args = parser.parse_args() - traduc(options.infile,options.outfile) - -if __name__ == '__main__': - main() diff --git a/Traducteur/traduitV8V9.py b/Traducteur/traduitV8V9.py deleted file mode 100644 index 092e6c19..00000000 --- a/Traducteur/traduitV8V9.py +++ /dev/null @@ -1,436 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -""" -usage="""usage: %prog [options] -Typical use is: - python traduitV7V8.py --infile=xxxx --outfile=yyyy -""" - -import log -import optparse -import sys - -from load import getJDC -from mocles import parseKeywords -from removemocle import * -from renamemocle import * -from renamemocle import * -from inseremocle import * -from changeValeur import * -from movemocle import * -from dictErreurs import genereErreurPourCommande,genereErreurMotCleInFact - -import calcG - - -atraiter=( "DEFI_MAILLAGE","CALC_VECT_ELEM","DYNA_TRAN_EXPLI","DYNA_NON_LINE","STAT_NON_LINE","FACT_LDLT","FACT_GRAD","RESO_LDLT","RESO_GRAD","DYNA_TRAN_MODAL","NORM_MODE","MACRO_MODE_MECA","POST_RCCM","THER_NON_LINE","THER_NON_LINE_MO","THER_LINEAIRE","THER_NON_LINE_MO","DEFI_CABLE_BP","GENE_VARI_ALEA","DEFI_MATERIAU","IMPR_MATRICE","CALC_G","CALC_MATR_ELEM","MACR_ADAP_MAIL","MACR_INFO_MAIL","REST_BASE_PHYS","COMB_SISM_MODAL","TEST_FICHIER","MACR_ELEM_DYNA","CREA_CHAMP","AFFE_CHAR_MECA","AFE_CHAR_MECA_F","MODI_MAILLAGE","DEFI_FISS_XFEM","AFFE_MODELE","POST_MAIL_XFEM","CALC_NO","LIRE_CHAMP","AFFE_MATERIAU","MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_PRECONT","LIRE_INTE_SPEC","MACR_CARA_POUTRE","MACR_LIGN_COUPE") - -dict_erreurs={ -# STA9 - "POST_RCCM_SITUATION_NUME_PASSAGE":"Utilisation de NUME_PASSAGE pour le type TUYAUTERIE impossible en 9.2. On ne traite pour le moment que les chemins de passage simples.", - "POST_RCCM_SITUATION_NB_CYCL_SEISME":"POST_RCCM : maintenant les SITUATIONS sismiques ont leur propre mot clef facteur SEISME, attention, traduction incomplete", - "DEFI_MATERIAU_BAZANT_FD" : "le materiau BAZANT_FD a ete supprime", - "DEFI_MATERIAU_APPUI_ELAS" : "le materiau APPUI_ELAS a ete supprime", - "DEFI_MATERIAU_PORO_JOINT" : "le materiau PORO_JOINT a ete supprime", - "DEFI_MATERIAU_ZIRC_CYRA2" : "le materiau ZIRC_CYRA2 a ete supprime", - "DEFI_MATERIAU_ZIRC_EPRI" : "le materiau ZIRC_EPRI a ete supprime", - "IMPR_MATRICE_MATR_ELEM_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", - "IMPR_MATRICE_MATR_ASSE_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", - "CALC_G_OPTION=G_LAGR" : "l'OPTION G_LAGR de CALC_G a ete supprimee", - "CALC_G_OPTION=G_LAGR_GLOB" : "l'OPTION G_LAGR_GLOB de CALC_G a ete supprimee", - "CALC_MATR_ELEM_THETA" : "l'OPTION RIGI_MECA_LAGR de CALC_MATR_ELEM a ete supprimee", - "TEST_FICHIER_NB_CHIFFRE" : "le fonctionnement de TEST_FICHIER a change entre la V8 et la V9, consultez la doc, en particulier pour entrer la bonne valeur de NB_VALE", - "DYNA_NON_LINE_PILOTAGE" : "le PILOTAGE n'est pas actif dans DYNA_NON_LINE ", - "DYNA_NON_LINE_RECH_LINEAIRE" : "la RECH_LINEAIRE n'est pas active dans DYNA_NON_LINE ", - "DEFI_FISS_XFEM_CONTACT" : "en v9, le contact pour XFEM est defini dans un AFFE_CHAR_MECA(CONTACT=_F) en propre", - "POST_MAIL_XFEM" : "dans POST_MAIL_XFEM il faut entrer le MODELE et le MAILLAGE_SAIN", - "AFFE_MATERIAU_AFFE_TEMP_REF" : "Passage aux variables de commande : definir un materiau dependant de la temperature 'AFFE_MATERIAU(AFFE_VARC=_F(...))' et supprimer TEMP_CALCULEE dans les chargements", - "STAT_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "STAT_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "STAT_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "DYNA_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "DYNA_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "DYNA_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "CALC_PRECONT_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "CALC_PRECONT_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - "CALC_PRECONT_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", - } - -sys.dict_erreurs=dict_erreurs - -def traduc(infile,outfile,flog=None): - - hdlr=log.initialise(flog) - jdc=getJDC(infile,atraiter) - root=jdc.root - - #Parse les mocles des commandes - parseKeywords(root) - - ####################### traitement erreurs ######################## - genereErreurPourCommande(jdc,("POST_RCCM","DEFI_MATERIAU","TEST_FICHIER","DYNA_NON_LINE","DEFI_FISS_XFEM","POST_MAIL_XFEM")) - - ####################### traitement Sous-Structuration ####################### - renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_SUPER_MAILLE","MACR_ELEM_STAT","MACR_ELEM") - renameMotCleInFact(jdc,"DYNA_NON_LINE","SOUS_STRUC","MAILLE","SUPER_MAILLE") - renameMotCleInFact(jdc,"STAT_NON_LINE","SOUS_STRUC","MAILLE","SUPER_MAILLE") - renameMotCleInFact(jdc,"CALC_VECT_ELEM","SOUS_STRUC","MAILLE","SUPER_MAILLE") - ######################################################################### - - ####################### traitement MACR_ELEM_DYNA ####################### - removeMotCle(jdc,"MACR_ELEM_DYNA","OPTION") - ######################################################################### - - ####################### traitement MODI_MAILLAGE ####################### - renameMotCle(jdc,"MODI_MAILLAGE","ORIE_SHB8","ORIE_SHB") - ######################################################################### - - ####################### traitement XFEM ####################### - dXFEM={"3D_XFEM":"3D", "C_PLAN_X":"C_PLAN", "D_PLAN_X":"D_PLAN"} - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dXFEM) - renameMotCleInFact(jdc,"DEFI_FISS_XFEM","ORIE_FOND","PT_ORIGIN","POINT_ORIG") - removeMotCleAvecErreur(jdc,"DEFI_FISS_XFEM","CONTACT") - ######################################################################### - - ####################### traitement Resolution lineaire ##################### - renameMotCle(jdc,"RESO_LDLT","MATR_FACT","MATR") - renameMotCle(jdc,"RESO_GRAD","MATR_ASSE","MATR") - renameMotCle(jdc,"RESO_GRAD","MATR_FACT","MATR_PREC") - renameOper(jdc,"RESO_LDLT","RESOUDRE") - renameOper(jdc,"RESO_GRAD","RESOUDRE") - renameOper(jdc,"FACT_LDLT","FACTORISER") - renameOper(jdc,"FACT_GRAD","FACTORISER") - ######################################################################### - - ####################### traitement DYNA_TRAN_MODAL ###################### - removeMotCle(jdc,"DYNA_TRAN_MODAL","NB_MODE_DIAG") - ######################################################################### - - ############# traitement MASS_INER dans NORM_MODE/MACRO_MODE_MECA ########## - removeMotCle(jdc,"NORM_MODE","MASS_INER") - removeMotCleInFact(jdc,"MACRO_MODE_MECA","NORM_MODE","MASS_INER") - ######################################################################### - - ####################### traitement POST_RCCM ############################ - removeMotCleInFactSiRegleAvecErreur(jdc,"POST_RCCM","SITUATION","NUME_PASSAGE",((("TYPE_RESU_MECA","TUYAUTERIE",jdc),"MCaPourValeur"),)) - chercheOperInsereFacteurSiRegle(jdc,"POST_RCCM","SEISME", ((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) - moveMotCleFromFactToFact(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME","SEISME") -# ajouteMotClefDansFacteurSiRegle(jdc,"POST_RCCM","SITUATION", "transferez_au_bloc_SEISME_CHAR_ETAT_NB_OCCUR,NUME_SITU,NUME_GROUP_et_eventuellement_NOM_SITU_et_NUME_RESU_THER",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"POST_RCCM","SITUATION","supprimez_a_la_main_ce_bloc",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) -# removeMotCleInFactSiRegleAvecErreur(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) - removeMotCleInFactSiRegle(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) - removeMotCleInFact(jdc,"POST_RCCM","CHAR_MECA","TYPE_CHAR",) - removeMotCleInFact(jdc,"POST_RCCM","RESU_MECA","TYPE_CHAR",) - ######################################################################### - - ####################### traitement THER_NON_LINE ############################ - renameMotCleInFact(jdc,"THER_NON_LINE","TEMP_INIT","NUME_INIT","NUME_ORDRE") - renameMotCle(jdc,"THER_NON_LINE","TEMP_INIT","ETAT_INIT",) - renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_INIT","NUME_INST_INIT") - renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_FIN","NUME_INST_FIN") - - renameMotCleInFact(jdc,"THER_NON_LINE_MO","TEMP_INIT","NUME_INIT","NUME_ORDRE") - renameMotCle(jdc,"THER_NON_LINE_MO","TEMP_INIT","ETAT_INIT",) - ######################################################################### - - ####################### traitement THER_LINEAIRE ############################ - renameMotCleInFact(jdc,"THER_LINEAIRE","TEMP_INIT","NUME_INIT","NUME_ORDRE") - renameMotCle(jdc,"THER_LINEAIRE","TEMP_INIT","ETAT_INIT",) - renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_INIT","NUME_INST_INIT") - renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_FIN","NUME_INST_FIN") - renameMotCleInFact(jdc,"THER_LINEAIRE","ARCHIVAGE","LIST_ARCH","LIST_INST") - ######################################################################### - - ####################### traitement THER_NON_LINE ############################ - renameMotCleInFact(jdc,"THER_NON_LINE","TEMP_INIT","NUME_INIT","NUME_ORDRE") - renameMotCle(jdc,"THER_NON_LINE","TEMP_INIT","ETAT_INIT",) - ######################################################################### - - ####################### traitement DEFI_CABLE_BP ###################### - removeMotCle(jdc,"DEFI_CABLE_BP","MAILLAGE") - ######################################################################### - - ####################### traitement GENE_VARI_ALEA ###################### - removeMotCleSiRegle(jdc,"GENE_VARI_ALEA","COEF_VAR",((("TYPE","EXPONENTIELLE",jdc),"MCaPourValeur"),)) - ######################################################################### - - ####################### traitement DEFI_MATERIAU ###################### - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","BAZANT_FD") - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","PORO_JOINT") - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","APPUI_ELAS") - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ZIRC_EPRI") - removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ZIRC_CYRA2") - # BARCELONE - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","MU","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PORO","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","LAMBDA","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","KAPPA","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","M","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PRES_CRIT","BARCELONE") - moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","BARCELONE") - renameMotCleInFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","KCAM") - # CAM_CLAY -# ajouteMotClefDansFacteur(jdc,"DEFI_MATERIAU","CAM_CLAY","MU=xxx",) -# ajouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","CAM_CLAY","PTRAC=XXX",((("CAM_CLAY","KCAM"),"existeMCsousMCF"),)) - # VENDOCHAB - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","S_VP","S") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","N_VP","N") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","M_VP","UN_SUR_M", erreur=1) - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","K_VP","UN_SUR_K") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","SEDVP1","ALPHA_D") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","SEDVP2","BETA_D") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","S_VP","S") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","N_VP","N") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","M_VP","UN_SUR_M", erreur=1) - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","K_VP","UN_SUR_K") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP1","ALPHA_D") - renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP2","BETA_D") - # GLRC - renameCommandeSiRegle(jdc,"DEFI_MATERIAU","DEFI_GLRC", ((("GLRC_DAMAGE","GLRC_ACIER",),"existeMCFParmi"),)) - ######################################################################### - - ####################### traitement IMPR_MATRICE ###################### - removeCommandeSiRegleAvecErreur(jdc,"IMPR_MATRICE",((("MATR_ELEM","FORMAT","RESULTAT",jdc),"MCsousMCFaPourValeur"),)) - removeCommandeSiRegleAvecErreur(jdc,"IMPR_MATRICE",((("MATR_ASSE","FORMAT","RESULTAT",jdc),"MCsousMCFaPourValeur"),)) - ######################################################################### - - ####################### traitement MACR_ADAP/INFO_MAIL ###################### - dadap_mail={ "V8_5":"V9_5", "V8_N":"V9_N", "V8_N_PERSO":"V9_N_PERSO"} - changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",dadap_mail) - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",dadap_mail) - ######################################################################### - - ####################### traitement REST_BASE_PHYS ###################### - renameCommandeSiRegle(jdc,"REST_BASE_PHYS","REST_SOUS_STRUC", ((("RESULTAT","SQUELETTE","SOUS_STRUC","BASE_MODALE","CYCLIQUE","SECTEUR"),"existeMCFParmi"),)) - renameCommandeSiRegle(jdc,"REST_BASE_PHYS","REST_COND_TRAN", ((("MACR_ELEM_DYNA","RESU_PHYS"),"existeMCFParmi"),)) - renameCommande(jdc,"REST_BASE_PHYS","REST_GENE_PHYS", ) - ######################################################################### - - ####################### traitement CALC_G ###################### - removeMotCleSiRegleAvecErreur(jdc,"CALC_G","OPTION",((("OPTION","G_LAGR",jdc),"MCaPourValeur"),)) - removeMotCleSiRegleAvecErreur(jdc,"CALC_G","OPTION",((("OPTION","G_LAGR_GLOB",jdc),"MCaPourValeur"),)) - removeMotCle(jdc,"CALC_G","PROPAGATION") - removeMotCle(jdc,"CALC_G","THETA_LAGR") - removeMotCle(jdc,"CALC_G","DIRE_THETA_LAGR") - ######################################################################### - - ####################### traitement COMB_SISM_MODAL ###################### - ajouteMotClefDansFacteurSiRegle(jdc,"COMB_SISM_MODAL","EXCIT","MULTI_APPUI='DECORRELE'", ((("EXCIT","MONO_APPUI"),"nexistepasMCsousMCF"),)) - ######################################################################### - - ####################### traitement TEST_FICHIER ###################### - renameMotCleAvecErreur(jdc,"TEST_FICHIER","NB_CHIFFRE","NB_VALE") - removeMotCle(jdc,"TEST_FICHIER","EPSILON") - ######################################################################### - - ####################### traitement CALC_MATR_ELEM ###################### - removeMotCleSiRegle(jdc,"CALC_MATR_ELEM","OPTION",((("OPTION","RIGI_MECA_LAGR",jdc),"MCaPourValeur"),)) - removeMotCleAvecErreur(jdc,"CALC_MATR_ELEM","PROPAGATION") - removeMotCle(jdc,"CALC_MATR_ELEM","THETA") - ######################################################################### - - ####################### traitement ITER_INTE_PAS ###################### - removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","COMP_INCR","ITER_INTE_PAS",((("COMP_INCR","DEFORMATION","SIMO_MIEHE",jdc),"MCsousMCFaPourValeur"),)) - removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","COMP_INCR","ITER_INTE_PAS",((("COMP_INCR","DEFORMATION","SIMO_MIEHE",jdc),"MCsousMCFaPourValeur"),)) - ######################################################################### - - ################## traitement RECH_LINEAIRE et PILOTAGE dans DYNA_NON_LINE ################# - removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","RECH_LINEAIRE") - removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","PILOTAGE") - ######################################################################### - - ####################### traitement DYNA_TRAN_EXPLI ###################### - renameOper(jdc,"DYNA_TRAN_EXPLI","DYNA_NON_LINE") - ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","TCHAMWA","FORMULATION='ACCELERATION'") - ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","DIFF_CENT","FORMULATION='ACCELERATION'") - ######################################################################### - - ####################### traitement SCHEMA_TEMPS dans DYNA_NON_LINE ###################### - ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","NEWMARK","FORMULATION='DEPLACEMENT'") - ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","HHT","FORMULATION='DEPLACEMENT'") - ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","TETA_METHODE","FORMULATION='DEPLACEMENT'") - renameMotCleInFact(jdc,"DYNA_NON_LINE","NEWMARK","ALPHA","BETA",) - renameMotCleInFact(jdc,"DYNA_NON_LINE","NEWMARK","DELTA","GAMMA",) - renameMotCleInFact(jdc,"DYNA_NON_LINE","TETA_METHODE","TETA","THETA",) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","NEWMARK","SCHEMA='NEWMARK'",((("NEWMARK",),"existeMCFParmi"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","TETA_METHODE","SCHEMA='THETA_METHODE'",((("TETA_METHODE",),"existeMCFParmi"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","HHT","SCHEMA='HHT'",((("HHT",),"existeMCFParmi"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","TCHAMWA","SCHEMA='TCHAMWA'",((("TCHAMWA",),"existeMCFParmi"),)) - ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","DIFF_CENT","SCHEMA='DIFF_CENT'",((("DIFF_CENT",),"existeMCFParmi"),)) - renameMotCle(jdc,"DYNA_NON_LINE","NEWMARK","SCHEMA_TEMPS") - renameMotCle(jdc,"DYNA_NON_LINE","TETA_METHODE","SCHEMA_TEMPS") - renameMotCle(jdc,"DYNA_NON_LINE","HHT","SCHEMA_TEMPS") - renameMotCle(jdc,"DYNA_NON_LINE","DIFF_CENT","SCHEMA_TEMPS") - renameMotCle(jdc,"DYNA_NON_LINE","TCHAMWA","SCHEMA_TEMPS") - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","EVOLUTION") - moveMotClefInOperToFact(jdc,"DYNA_NON_LINE","STOP_CFL","SCHEMA_TEMPS") - ######################################################################### - - ####################### traitement CONTACT ###################### - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","KT_ULTM") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","EFFO_N_INIT") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_N_IRRA") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_N_FO") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_MZ") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_1") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_2") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_3") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_4") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_1") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_2") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_3") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_4") - removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","C_PRAGER_MZ") - dDis_Choc={"DIS_CONTACT":"DIS_CHOC"} - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dDis_Choc) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dDis_Choc) - renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") - renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") - dGrilles={"GRILLE_CRAYONS":"DIS_GRICRA"} - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dGrilles) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dGrilles) - - renameCommandeSiRegle(jdc,"AFFE_CHAR_MECA_F","AFFE_CHAR_MECA",((("CONTACT",),"existeMCFParmi"),)) - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","RECHERCHE") - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","PROJECTION") - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","VECT_Y") - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","VECT_ORIE_POU") - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","MODL_AXIS") - dAppariement={"MAIT_ESCL_SYME":"MAIT_ESCL"} - changementValeurDsMCF(jdc,"AFFE_CHAR_MECA","CONTACT","APPARIEMENT",dAppariement) - - ajouteMotClefDansFacteurSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","TYPE_APPA='FIXE'",((("CONTACT","DIRE_APPA",),"existeMCsousMCF"),)) - ######################################################################### - - ####################### traitement CREA_CHAMP ###################### - chercheOperInsereFacteurSiRegle(jdc,"CREA_CHAMP","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) - dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} - changementValeur(jdc,"CREA_CHAMP","TYPE_CHAM",dTypeChamp) - ######################################################################### - - ####################### traitement CALC_NO ###################### - chercheOperInsereFacteurSiRegle(jdc,"CALC_NO","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) - ######################################################################### - - ######### traitement variables de commandes TEMP_CALCULEE/TEMP_REF ############## - genereErreurMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","TEMP_REF") - ################################################################################ - - ################# traitement LIRE_CHAMP ####################################### -# dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} - changementValeur(jdc,"LIRE_CHAMP","TYPE_CHAM",dTypeChamp) - ################################################################################ - - - ######### traitement SUIVI_DDL ################################################# -# en pre-traitement il faudrait une methode qui separe tous les mots clefs facteurs en les dupliquant -# par exemple ici mettre autant de mots clefs facteurs SUIVI_DDL qu'il a de _F - ajouteMotClefDansFacteur(jdc,"STAT_NON_LINE","SUIVI_DDL","SUIVI_DDL='OUI'") - renameMotCle(jdc,"STAT_NON_LINE","SUIVI_DDL","OBSERVATION") -# en post-traitement il faudrait une methode qui fusionne tous les mots clefs facteurs en double -# par exemple ici les OBSERVATION - ################################################################################ - - - ######### traitement EVOLUTION in STAT/DYNA_NON_LINE ########################### - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","EVOLUTION") - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","EVOLUTION") - ################################################################################ - - ######### traitement du MODELE GRILLE ############################################## - dGrille={"GRILLE":"GRILLE_EXCENTRE"} - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dGrille) - ################################################################################ - - ######### traitement de MACR_ASPIC/ASCOUF_CALC GRILLE ########################## - removeMotCle(jdc,"MACR_ASCOUF_CALC","CHARGE") - removeMotCle(jdc,"MACR_ASPIC_CALC","CHARGE") - ################################################################################ - - - ############ suppression de NON_LOCAL ########################################## - removeMotCleAvecErreur(jdc,"STAT_NON_LINE","LAGR_NON_LOCAL") - removeMotCleAvecErreur(jdc,"STAT_NON_LINE","SOLV_NON_LOCAL") - removeMotCleInFact(jdc,"STAT_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) - - removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","LAGR_NON_LOCAL") - removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","SOLV_NON_LOCAL") - removeMotCleInFact(jdc,"DYNA_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) - - removeMotCleAvecErreur(jdc,"CALC_PRECONT","LAGR_NON_LOCAL") - removeMotCleAvecErreur(jdc,"CALC_PRECONT","SOLV_NON_LOCAL") - removeMotCleInFact(jdc,"CALC_PRECONT","ETAT_INIT","VARI_NON_LOCAL",erreur=1) - ################################################################################ - - ######### traitement de LIRE_INTE_SPEC ######################################### - renameMotCle(jdc,"LIRE_INTE_SPEC","FORMAT","FORMAT_C") - ################################################################################ - - ######### traitement de MACR_CARA_POUTRE ###################################### - chercheOperInsereFacteurSiRegle(jdc,"MACR_CARA_POUTRE","FORMAT='ASTER'", ((("UNITE_MAILLAGE",),"existe"),),0) - renameMotCle(jdc,"MACR_CARA_POUTRE","UNITE_MAILLAGE","UNITE") - ################################################################################ - - ######### traitement de MACR_LIGN_COUPE ###################################### -# il y a un probleme s'il y a plusieurs mots clefs facteurs LIGN_COUPE : la regle ne marche qu'une fois par commande - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","REPERE='LOCAL'", ((("LIGN_COUPE","VECT_Y",),"existeMCsousMCF"),),0) -# autre probleme : s'il y a plusieurs mots clefs facteurs le traducteur peut, dans l'insertion, se tromper de mot clef facteur - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_NO'", ((("LIGN_COUPE","GROUP_NO",),"existeMCsousMCF"),),0) - ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_MA'", ((("LIGN_COUPE","GROUP_MA",),"existeMCsousMCF"),),0) - ################################################################################ - - ####################### traitement DRUCKER_PRAGER ####################### - dPRAGER={"DRUCKER_PRAGER":"DRUCK_PRAGER",} - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dPRAGER) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dPRAGER) - changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION",dPRAGER) - changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION",dPRAGER) - ######################################################################### - - ####################### traitement RELATION_KIT ####################### - dKIT={"ELAS_THER":"ELAS",} - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) - changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION_KIT",dKIT) - changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION_KIT",dKIT) - ######################################################################### - - - f=open(outfile,'w') - f.write(jdc.getSource()) - f.close() - - log.ferme(hdlr) - -def main(): - parser = optparse.Optionparser(usage=usage) - - parser.add_option('-i','--infile', dest="infile", default='toto.comm', - help="Le fichier a traduire") - parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', - help="Le fichier traduit") - - options, args = parser.parse_args() - traduc(options.infile,options.outfile) - -if __name__ == '__main__': - main() diff --git a/Traducteur/traduitV9V10.py b/Traducteur/traduitV9V10.py deleted file mode 100755 index 11db2ccd..00000000 --- a/Traducteur/traduitV9V10.py +++ /dev/null @@ -1,749 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 -# -""" -""" -usage="""usage: %prog [options] -Typical use is: - python traduitV9V10.py --infile=xxxx --outfile=yyyy -""" - -import log -import optparse -import sys - -from Traducteur.load import getJDC -from Traducteur.mocles import parseKeywords -from Traducteur.removemocle import * -from Traducteur.renamemocle import * -from Traducteur.renamemocle import * -from Traducteur.inseremocle import * -from Traducteur.changeValeur import * -from Traducteur.movemocle import * -from Traducteur.dictErreurs import * -from Traducteur.regles import pasDeRegle - -atraiter=("AFFE_CARA_ELEM","AFFE_CHAR_CINE","AFFE_CHAR_MECA","AFFE_CHAR_MECA_F","AFFE_MATERIAU","AFFE_MODELE", - "CALC_CHAM_ELEM","CALC_ELEM","CALC_G","CALC_META","CALC_MODAL","CALC_PRECONT","CALCUL","CALC_MISS","CALC_NO", - "COMB_FOURIER","COMB_SISM_MODAL","CREA_CHAMP","CREA_RESU", - "DEFI_BASE_MODALE","DEFI_COMPOR","DEFI_CONTACT","DEFI_GLRC","DEFI_LIST_INST","DEFI_MATERIAU", - "DYNA_ISS_VARI","DYNA_LINE_HARM","DYNA_LINE_TRAN","DYNA_NON_LINE","DYNA_TRAN_MODAL", - "EXTR_RESU","IMPR_MACR_ELEM","IMPR_MATRICE","IMPR_RESU","LIRE_RESU", - "MACR_ADAP_MAIL","MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_ECREVISSE", - "MACR_INFO_MAIL","MACR_LIGN_COUPE","MACRO_ELAS_MULT","MACRO_MATR_AJOU","MACRO_MISS_3D", - "MECA_STATIQUE","MODE_ITER_INV","MODE_ITER_SIMULT","MODE_STATIQUE","MODI_REPERE", - "POST_CHAM_XFEM","POST_ELEM","POST_GP","POST_K1_K2_K3","POST_RCCM","POST_RELEVE_T","POST_ZAC", - "PROJ_CHAMP","PROJ_MESU_MODAL","RECU_FONCTION","REST_SOUS_STRUC","REST_GENE_PHYS","REST_SPEC_PHYS", - "STAT_NON_LINE","SIMU_POINT_MAT","TEST_RESU","THER_LINEAIRE","THER_NON_LINE","THER_NON_LINE_MO",) - -dict_erreurs={ -# STA10 -# - "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", - "AFFE_CHAR_MECA_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", - "AFFE_CHAR_MECA_F_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", - "AFFE_CHAR_MECA_GRAPPE_FLUIDE":"Resorption de GRAPPE_FLUIDE en version 10", - "DEFI_MATERIAU_LMARC":"Resorption loi LMARC en version 10", - "DEFI_MATERIAU_LMARC_FO":"Resorption loi LMARC en version 10", - "POST_ZAC":"Resorption POST_ZAC en version 10", - "AFFE_CHAR_MECA_ARLEQUIN":"Resorption ARLEQUIN en version 10", - - "PROJ_CHAMP_CHAM_NO":"Attention, verifier pour PROJ_CHAMP la presence de MODELE1/MAILLAGE1 et MODELE2/MAILLAGE2", - - "COMB_SISM_MODAL_COMB_MULT_APPUI":"Attention, verifier GROUP_APPUI pour COMB_SISM_MODAL car on est dans le cas MULTI_APPUI=DECORRELE", - - "CALC_PRECONT_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "CALC_PRECONT_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_LINE_HARM_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_LINE_HARM_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_LINE_TRAN_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_LINE_TRAN_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_TRAN_MODAL_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_TRAN_MODAL_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACR_ASCOUF_CALC_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACR_ASCOUF_CALC_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACR_ASPIQ_CALC_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACR_ASPIQ_CALC_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACRO_MATR_AJOU_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MACRO_MATR_AJOU_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MECA_STATIQUE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MECA_STATIQUE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MODE_STATIQUE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "MODE_STATIQUE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "STAT_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "STAT_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "THER_LINEAIRE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "THER_LINEAIRE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "THER_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "THER_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - "DYNA_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", - - "STAT_NON_LINE_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans STAT_NON_LINE", - "CALC_PRECONT_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans CALC_PRECONT", - "DYNA_NON_LINE_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans DYNA_NON_LINE", - "MACR_ASCOUF_CALC_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans MACR_ASCOUF_CALC", - "MACR_ASPIQ_CALC_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans MACR_ASPIQ_CALC", - "SIMU_POINT_MAT_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans SIMU_POINT_MAT", - - "CALC_ELEM_SENSIBILITE":"Le post-traitement SENSIBILITE est a supprimer de CALC_ELEM et a faire via CALC_SENSI", - - "CALC_MISS_OPTION":"Attention, transfert MACRO_MISS_3D en CALC_MISS : utiliser un DEFI_SOL_MISS pour obtenir TABLE_SOL", - } - -sys.dict_erreurs=dict_erreurs - -def traduc(infile,outfile,flog=None): - - hdlr=log.initialise(flog) - jdc=getJDC(infile,atraiter) - root=jdc.root - - #Parse les mocles des commandes - parseKeywords(root) - - ####################### initialisation et traitement des erreurs ######################### - - - #####RESORPTION - - genereErreurPourCommande(jdc,("POST_ZAC",)) - genereErreurMCF(jdc,"AFFE_CHAR_MECA","GRAPPE_FLUIDE") - genereErreurMCF(jdc,"DEFI_MATERIAU","LMARC") - genereErreurMCF(jdc,"DEFI_MATERIAU","LMARC_FO") - genereErreurMCF(jdc,"AFFE_CHAR_MECA","ARLEQUIN") - - - #####SOLVEUR - - ####################### traitement MUMPS/PARALELLISME-PARTITION ################## - #commandes concernes en plus : CALC_FORC_AJOU?,CALC_MATR_AJOU? - # */SOLVEUR/CHARGE_PROCO_MA(SD)--> AFFE_MODELE (ou MODI_MODELE)/PARTITION/. - # */SOLVEUR/PARALLELISME =CENTRALISE--> AFFE_MODELE (ou MODI_MODELE)/PARTITION/PARALLELISME = CENTRALISE - # */SOLVEUR/PARALLELISME = "DISTRIBUE_MC/MD/SD"--> AFFE_MODELE/PARTITION/PARALLELISME = "MAIL_CONTIGU/MAIL_DISPERSE/SOUS_DOMAINE" - # */SOLVEUR/PARTITION --> AFFE_MODELE (ou MODI_MODELE)/PARTITION/PARTITION - - - genereErreurMotCleInFact(jdc,"CALC_PRECONT","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"CALC_PRECONT","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"DYNA_LINE_HARM","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"DYNA_LINE_HARM","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"DYNA_TRAN_MODAL","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"DYNA_TRAN_MODAL","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"MACR_ASCOUF_CALC","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"MACR_ASCOUF_CALC","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"MACR_ASPIQ_CALC","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"MACR_ASPIQ_CALC","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"MACRO_MATR_AJOU","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"MACRO_MATR_AJOU","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"MECA_STATIQUE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"MECA_STATIQUE","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"MODE_STATIQUE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"MODE_STATIQUE","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"STAT_NON_LINE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"STAT_NON_LINE","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"THER_LINEAIRE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"THER_LINEAIRE","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"THER_NON_LINE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"THER_NON_LINE","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"THER_NON_LINE_MO","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"THER_NON_LINE_MO","SOLVEUR","PARTITION") - genereErreurMotCleInFact(jdc,"DYNA_NON_LINE","SOLVEUR","PARALLELISME") - genereErreurMotCleInFact(jdc,"DYNA_NON_LINE","SOLVEUR","PARTITION") - - ####################### traitement mot cle INCREMENT redecoupage en temps ####################### - renameMotCleSiRegle(jdc,"STAT_NON_LINE","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"STAT_NON_LINE","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"STAT_NON_LINE","INCREMENT_NEW","INCREMENT") - - renameMotCleSiRegle(jdc,"CALC_PRECONT","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"CALC_PRECONT","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"CALC_PRECONT","INCREMENT_NEW","INCREMENT") - - - renameMotCleSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"DYNA_NON_LINE","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"DYNA_NON_LINE","INCREMENT_NEW","INCREMENT") - - renameMotCleSiRegle(jdc,"MACR_ASCOUF_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","INCREMENT") - - renameMotCleSiRegle(jdc,"MACR_ASPIQ_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","INCREMENT") - - renameMotCleSiRegle(jdc,"SIMU_POINT_MAT","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) - moveMCFToCommand(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) - renameMotCle(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","INCREMENT") - - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","INST_INIT") - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","INST_FIN") - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","NUME_INST_FIN") - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","NUME_INST_INIT") - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","PRECISION") - chercheOperInsereFacteur(jdc,"DEFI_LIST_INST","DEFI_LIST",pasDeRegle(),1) - moveMotCleFromFactToFact(jdc,"DEFI_LIST_INST","ECHEC","LIST_INST","DEFI_LIST") - removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","LIST_INST") - - ###################### traitement de NPREC_SOLVEUR ########## - removeMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) - removeMotCleInFact(jdc,"MODE_ITER_INV","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_MODAL","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) - removeMotCle(jdc,"IMPR_STURM","NPREC_SOLVEUR") - removeMotCleInFact(jdc,"MACRO_MATR_AJOU","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) - - ###################### traitement CALC_MODAL SOLVEUR ############ - removeMotCle(jdc,"CALC_MODAL","SOLVEUR",pasDeRegle()) - - ##################### traitement DYNA_TRAN-MODAL ADAPT ################# - changementValeur(jdc,"DYNA_TRAN_MODAL","METHODE",{"ADAPT":"ADAPT_ORDRE2"}) - - #################### traitement STAT/DYNA_NON_LINE OBSERVATION SUIVI_DDL=NON ########### - removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","OBSERVATION","SUIVI_DDL",((("SUIVI_DDL","NON",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","OBSERVATION","SUIVI_DDL",((("SUIVI_DDL","NON",jdc),"MCsousMCFcourantaPourValeur"),)) - - ################### traitement STAT/DYNA_NON_LINE ARCH_ETAT_INIT ########### - removeMotCleInFact(jdc,"STAT_NON_LINE","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) - removeMotCleInFact(jdc,"SIMU_POINT_MAT","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) - - ################### traitement STAT/DYNA_NON_LINE CRIT_FLAMB ############### - removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","CRIT_FLAMB","INST_CALCUL",((("INST_CALCUL","TOUT_PAS",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","CRIT_FLAMB","INST_CALCUL",((("INST_CALCUL","TOUT_PAS",jdc),"MCsousMCFcourantaPourValeur"),)) - - #####COMPORTEMENT/CARA - - ################### traitement AFFE_MODELE/SHB8 ########################## - changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",{"SHB8":"SHB"}) - - ################### traitement COMP_ELAS et COMP_INCR DEFORMATION = GREEN ##############" - dGREEN={"GREEN_GR":"GROT_GDEP","GREEN":"GROT_GDEP","REAC_GEOM":"GROT_GDEP","EULER_ALMANSI":"GROT_GDEP","COROTATIONNEL":"GDEF_HYPO_ELAS"} - changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"CALCUL","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"POST_GP","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"CALC_G","COMP_ELAS","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"CALCUL","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"CALC_NO","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"LIRE_RESU","COMP_INCR","DEFORMATION",dGREEN) - changementValeurDsMCF(jdc,"MACR_ECREVISSE","COMP_INCR","DEFORMATION",dGREEN) - - ###################### traitement COMP_INCR/COMP_ELAS RESO_INTE ########## - dALGOI={"RUNGE_KUTTA_2":"RUNGE_KUTTA","RUNGE_KUTTA_4":"RUNGE_KUTTA"} - removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"CALCUL","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"CALCUL","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"MACR_ASPIQ_CALC","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"CALC_PRE_CONT","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"CALC_NO","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFactCourantSiRegle(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) - - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"CALCUL","COMP_ELAS","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"CALCUL","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"MACR_ASPIQF_CALC","COMP_ELAS","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"CALC_NO","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE",dALGOI) - changementValeurDsMCF(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE",dALGOI) - - renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"CALCUL","COMP_ELAS","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"CALCUL","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"MACR_ASPIQF_CALC","COMP_ELAS","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"CALC_PRECONT","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"CALC_NO","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE","ALGO_INTE") - renameMotCleInFact(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE","ALGO_INTE") - - ###################### traitement COMP_ELAS/ITER_INTE_PAS ###### - removeMotCleInFact(jdc,"CALCUL","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) - - ###################### traitement CALC_G/COMP_INCR/RELATION ELAS_VMIS_PUIS #### - changementValeurDsMCF(jdc,"CALC_G","COMP_INCR","RELATION",{"ELAS_VMIS_PUIS":"VMIS_ISOT_PUIS"}) - - ########################" traitement DEFI_COMPOR/MULTIFIBRE/DEFORMATION=REAC_GEOM ######### - changementValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","DEFORMATION",dGREEN) - - ####################### traitement DEFI_COMPOR/MONOCRISTAL/ECOULEMENT ############# - dECOULEMENT={"ECOU_VISC1":"MONO_VISC1","ECOU_VISC2":"MONO_VISC2","ECOU_VISC3":"MONO_VISC3","KOCKS_RAUCH":"MONO_DD_KR"} - changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECOULEMENT",dECOULEMENT) - dISOT={"ECRO_ISOT1":"MONO_ISOT1","ECRO_ISOT2":"MONO_ISOT2"} - dCINE={"ECRO_CINE1":"MONO_CINE1","ECRO_CINE2":"MONO_CINE2"} - changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECRO_ISOT",dISOT) - changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECRO_CINE",dCINE) - - ################### traitement DEFI_MATERIAU monocristallin ####### - renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC1","MONO_VISC1") - renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC2","MONO_VISC2") - renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC3","MONO_VISC3") - renameMotCle(jdc,"DEFI_MATERIAU","ECRO_CINE1","MONO_CINE1") - renameMotCle(jdc,"DEFI_MATERIAU","ECRO_CINE2","MONO_CINE2") - renameMotCle(jdc,"DEFI_MATERIAU","ECRO_ISOT1","MONO_ISOT1") - renameMotCle(jdc,"DEFI_MATERIAU","ECRO_ISOT2","MONO_ISOT2") - renameMotCle(jdc,"DEFI_MATERIAU","KOCKS_RAUCH","MONO_DD_KR") - - ################ traitement DEFI_MATERIAU/THER_HYDR ####### - removeMotCleInFact(jdc,"DEFI_MATERIAU","THER_HYDR","QSR_K") - - ##################### traitement AFFE_CARA_ELEM/DISCRET ###############" - dDISCRET={"K_T_N_NS":"K_T_N", "K_T_L_NS":"K_T_L", "K_TR_N_NS":"K_TR_N", "K_TR_L_NS":"K_TR_L", - "M_T_N_NS":"M_T_N", "M_T_L_NS":"M_T_L", "M_TR_N_NS":"M_TR_N", "M_TR_L_NS":"M_TR_L", - "A_T_N_NS":"A_T_N", "A_T_L_NS":"A_T_L", "A_TR_N_NS":"A_TR_N", "A_TR_L_NS":"A_TR_L"} - dlist_DISCRET=["K_T_N_NS","K_T_L_NS", "K_TR_N_NS","K_TR_L_NS","M_T_N_NS","M_T_L_NS","M_TR_N_NS","M_TR_L_NS","A_T_N_NS","A_T_L_NS","A_TR_N_NS","A_TR_L_NS"] - - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET_2D","SYME") - removeMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET","SYME") - ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CARA_ELEM","DISCRET","SYME='NON'",((("CARA",dlist_DISCRET,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CARA_ELEM","DISCRET_2D","SYME='NON'",((("CARA",dlist_DISCRET,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) - changementValeurDsMCF(jdc,"AFFE_CARA_ELEM","DISCRET_2D","CARA",dDISCRET) - changementValeurDsMCF(jdc,"AFFE_CARA_ELEM","DISCRET","CARA",dDISCRET) - - #####CHARGEMENT - - ####################### traitement CONTACT ############################################### - - - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","ITER_MULT_MAXI","ITER_CONT_MULT") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NB_REAC_GEOM","NB_ITER_GEOM") - ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","RESOLUTION='NON'",((("METHODE","VERIF",jdc),"MCsousMCFcourantaPourValeur"),)) - copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","MODELE","CONTACT") - moveMCFToCommand(jdc,"AFFE_CHAR_MECA","CONTACT","DEFI_CONTACT","ZONE") - removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT",pasDeRegle(),1) - - - removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE") - ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle()) - copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","MODELE","LIAISON_UNILATER") - moveMCFToCommand(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","DEFI_CONTACT","ZONE") - removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER",pasDeRegle(),1) - - removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE") - ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle()) - ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","FORMULATION='LIAISON_UNIL'",pasDeRegle()) - copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA_F","MODELE","LIAISON_UNILATER") - moveMCFToCommand(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","DEFI_CONTACT","ZONE") - removeMotCle(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER",pasDeRegle(),1) - - chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='XFEM'",((("ZONE","METHODE","XFEM",jdc),"MCsousMCFaPourValeur"),)) - chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='CONTINUE'",((("ZONE","METHODE","CONTINUE",jdc),"MCsousMCFaPourValeur"),)) - chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='VERIF'",((("ZONE","METHODE","VERIF",jdc),"MCsousMCFaPourValeur"),)) - chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='LIAISON_UNIL'",((("ZONE","METHODE","LIAISON_UNIL",jdc),"MCsousMCFaPourValeur"),)) - liste_meth_ZONE=["GCP","CONTRAINTE","LAGRANGIEN","PENALISATION"] - chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='DISCRETE'",((("ZONE","METHODE",liste_meth_ZONE,jdc),"MCsousMCFaPourValeurDansListe"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='LAGRANGIEN'",((("METHODE","LAGRANGIEN",jdc),"MCsousMCFcourantaPourValeur"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT='LAGRANGIEN'",((("METHODE","LAGRANGIEN",jdc),"MCsousMCFcourantaPourValeur"),(("COULOMB",),"existeMCsousMCFcourant"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='GCP'",((("METHODE","GCP",jdc),"MCsousMCFcourantaPourValeur"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='PENALISATION'",((("METHODE","PENALISATION",jdc),"MCsousMCFcourantaPourValeur"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT='PENALISATION'",((("METHODE","PENALISATION",jdc),"MCsousMCFcourantaPourValeur"),(("COULOMB",),"existeMCsousMCFcourant"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='CONTRAINTE'",((("METHODE","CONTRAINTE",jdc),"MCsousMCFcourantaPourValeur"),)) - removeMotCleInFact(jdc,"DEFI_CONTACT","ZONE","METHODE") - - - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","COEF_RESI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","FROTTEMENT") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_CONT_MAXI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_FROT_MAXI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_GCP_MAXI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_GEOM_MAXI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","LISSAGE") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","NB_RESOL") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","PRE_COND") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","REAC_GEOM") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","REAC_ITER") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","RECH_LINEAIRE") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","STOP_INTERP") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","STOP_SINGULIER") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","RESI_ABSO") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_CONT_MULT") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_PRE_MAXI") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","NB_ITER_GEOM") - moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","MODELE") - - - # FORMULATION = DEPL/VITE - # Si EXCL_FROT_1 - # Si EXCL_FROT_2 - - - ####################### traitement DCX/DCY/DCZ ############################# - dDC={"DCX":"DX","DCY":"DY","DCZ":"DZ"} - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCX","DX") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCY","DY") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCZ","DZ") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCX","DX") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCY","DY") - renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCZ","DZ") - renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCX","DX") - renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCY","DY") - renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCZ","DZ") - # QUESTION Non pris en compte : AFFE_CHAR_MECA/LIAISON_DDL","DDL",Liste de valeurs avec DC*) - # peut_etre avec changeTouteValeur ? - - ######################### traitement COMB_SISM_MODAL APPUI #######################"" - # attention il faut traiter d'abord DECORRELE avant CORRELE sinon CORRELE apparaît dans DECORELLE - moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MONO_APPUI") - moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MULTI_APPUI") - removeMotCleInFactSiRegle(jdc,"COMB_SISM_MODAL","COMB_MULT_APPUI","TYPE_COMBI",((("MULTI_APPUI","DECORRELE",jdc),"MCaPourValeur"),)) - renameMotCleSiRegle(jdc,"COMB_SISM_MODAL","COMB_MULT_APPUI","GROUP_APPUI",((("MULTI_APPUI","DECORRELE",jdc),"MCaPourValeur"),),1) - - ######################## traitement DYNA_TRAN_MODAL ################## - ajouteMotClefDansFacteurCourantSiRegle(jdc,"DYNA_TRAN_MODAL","CHOC","FROTTEMENT='COULOMB'",((("COULOMB",),"existeMCsousMCFcourant"),)) - - ######################### traitement AFFE_CHAR_MECA PESANTEUR ROTATION################# - eclaMotCleToFact(jdc,"AFFE_CHAR_MECA","PESANTEUR","GRAVITE","DIRECTION") - eclaMotCleToFact(jdc,"AFFE_CHAR_MECA","ROTATION","VITESSE","AXE") - moveMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","CENTRE","ROTATION") - - ######################## traitement DEFI_BASE_MODALE ############## - renameMotCleInFact(jdc,"DEFI_BASE_MODALE","RITZ","MODE_STAT","MODE_INTF") - renameMotCleInFact(jdc,"DEFI_BASE_MODALE","RITZ","MULT_ELAS","MODE_INTF") - - ####################### traitement DYNA_ISS_VARI ################# - renameMotCle(jdc,"DYNA_ISS_VARI","PAS","FREQ_PAS") - - - #####IMPRESSION - - #################### traitement IMPR_RESU ####################### - removeMotCleInFact(jdc,"IMPR_RESU","RESU","INFO_RESU") - - ######################### traitement IMPR_MATRICE #################### - removeCommande(jdc,"IMPR_MATRICE") - - ####################### traitement PROJ_CHAMP ##################### - renameMotCle(jdc,"PROJ_CHAMP","CHAM_NO","CHAM_GD",1,pasDeRegle()) - changementValeur(jdc,"PROJ_CHAMP","METHODE",{ "ELEM":"COLLOCATION"}) - - ####################### traitement MACR_ADAP_MAIL ##############" - changementValeur(jdc,"MACR_ADAP_MAIL","TYPE_VALEUR_INDICA",{"V_ABSOLUE":"ABSOLU","V_RELATIVE":"RELATIF"}) - renameMotCle(jdc,"MACR_ADAP_MAIL","INDICATEUR","NOM_CHAM") - renameMotCle(jdc,"MACR_ADAP_MAIL","NOM_CMP_INDICA","NOM_CMP") - renameMotCle(jdc,"MACR_ADAP_MAIL","TYPE_OPER_INDICA","USAGE_CHAMP") - renameMotCle(jdc,"MACR_ADAP_MAIL","TYPE_VALEUR_INDICA","USAGE_CMP") - ajouteMotClefDansFacteurCourantSiRegle(jdc,"MACR_ADAP_MAIL","ZONE","TYPE='BOITE'",((("RAYON",),"nexistepasMCsousMCFcourant"),)) - ajouteMotClefDansFacteurCourantSiRegle(jdc,"MACR_ADAP_MAIL","ZONE","TYPE='SPHERE'",((("RAYON",),"existeMCsousMCFcourant"),)) - changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V9_5":"V10_1"}) - changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V9_N":"V10_1_N"}) - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V9_5":"V10_1"}) - changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V9_N":"V10_1_N"}) - - ###################### traitement de POST_CHAM_XFEM ################# - removeMotCle(jdc,"POST_CHAM_XFEM","MODELE",pasDeRegle(),0) - removeMotCle(jdc,"POST_CHAM_XFEM","MAILLAGE_FISS",pasDeRegle(),0) - removeMotCle(jdc,"POST_CHAM_XFEM","NOM_CHAM",pasDeRegle(),0) - - ##################### traitement de SIMU_POINT_MAT/SUPPORT ############# - chercheOperInsereFacteur(jdc,"SIMU_POINT_MAT","SUPPORT='POINT'",pasDeRegle(),0) - - ###################### traitement AFFE_CARA_ELEM/UNITE_EUROPLEXUS ###### - renameMotCleInFact(jdc,"AFFE_CARA_ELEM","RIGI_PARASOL","UNITE_EUROPLEXUS","UNITE",pasDeRegle(),0) - - #################### traitement DEFI_GLRC/IMPRESSION ############# - removeMotCle(jdc,"DEFI_GLRC","IMPRESSION",pasDeRegle(),0) - - ################### traitement AFFICHAGE ##### - removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","LONG_I",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","LONG_R",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","NOM_COLONNE",pasDeRegle(),0) - removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","PREC_R",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","LONG_I",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","LONG_R",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","NOM_COLONNE",pasDeRegle(),0) - removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","PREC_R",pasDeRegle(),0) - - ################### traitement CALC_NO *RESU ######### - removeMotCle(jdc,"CALC_NO","GROUP_MA_RESU",pasDeRegle(),0) - removeMotCle(jdc,"CALC_NO","MAILLE_RESU",pasDeRegle(),0) - removeMotCle(jdc,"CALC_NO","GROUP_NO_RESU",pasDeRegle(),0) - removeMotCle(jdc,"CALC_NO","NOEUD_RESU",pasDeRegle(),0) - - ################## traitement POST_K1_K2_K3/MAILLAGE ###### - removeMotCleSiRegle(jdc,"POST_K1_K2_K3","MAILLAGE",((("RESULTAT"),"existeMCFParmi"),)) - - ######### traitement CALC_ELEM/TYPE_ESTI #### - dESTI={"ERRE_ELEM_SIGM":"ERME_ELEM","ERZ1_ELEM_SIGM":"ERZ1_ELEM","ERZ2_ELEM_SIGM":"ERZ2_ELEM", - "QIRE_ELEM_SIGM":"QIRE_ELEM","QIZ1_ELEM_SIGM":"QIZ1_ELEM","QIZ2_ELEM_SIGM":"QIZ2_ELEM"} - changementValeur(jdc,"CALC_ELEM","TYPE_ESTI",dESTI) - - ######### suppression CALC_ELEM/NORME ###### - removeMotCle(jdc,"CALC_ELEM","NORME",pasDeRegle(),0) - - ########## traitement CALC_ELEM/CALC_NO OPTION - #dSENSI={"DEDE_ELNO_DLDE":"DEDE_ELNO","DEDE_NOEU_DLDE":"DEDE_NOEU","DESI_ELNO_DLSI":"DESI_ELNO","DESI_NOEU_DLSI":"DESI_NOEU", - # "DETE_ELNO_DLTE":"DETE_ELNO","DETE_NOEU_DLTE":"DETE_NOEU"} - dOPTION={"DEDE_ELNO_DLDE":"DEDE_ELNO","DEDE_NOEU_DLDE":"DEDE_NOEU","DESI_ELNO_DLSI":"DESI_ELNO","DESI_NOEU_DLSI":"DESI_NOEU", - "DETE_ELNO_DLTE":"DETE_ELNO","DETE_NOEU_DLTE":"DETE_NOEU", - "INTE_ELNO_ACTI":"INTE_ELNO","INTE_ELNO_REAC":"INTE_ELNO","INTE_NOEU_ACTI":"INTE_NOEU","INTE_NOEU_REAC":"INTE_NOEU", - "PRES_DBEL_DEPL":"PRME_ELNO","PRES_ELNO_IMAG":"PRAC_ELNO","PRES_ELNO_REEL":"PRAC_ELNO", - "PRES_NOEU_DBEL":"PRAC_NOEU","PRES_NOEU_IMAG":"PRAC_NOEU","PRES_NOEU_REEL":"PRAC_NOEU", - "ARCO_ELNO_SIGM":"SIRO_ELEM","ARCO_NOEU_SIGM":"SIRO_ELEM", - "ENDO_ELNO_ELGA":"ENDO_ELNO","ENDO_ELNO_SIGA":"ENDO_ELNO","ENDO_ELNO_SINO":"ENDO_ELNO","ENDO_NOEU_SINO":"ENDO_NOEU", - "ERRE_ELEM_SIGM":"ERME_ELEM","ERRE_ELEM_TEMP":"ERTH_ELEM", - "CRIT_ELNO_RUPT":"CRIT_ELNO","DEGE_ELNO_DEPL":"DEGE_ELNO","DEGE_NOEU_DEPL":"DEGE_NOEU", - "DURT_ELNO_META":"DURT_ELNO","DURT_NOEU_META":"DURT_NOEU","ECIN_ELEM_DEPL":"ECIN_ELEM","ENEL_ELNO_ELGA":"ENEL_ELNO", - "ENEL_NOEU_ELGA":"ENEL_NOEU","EPEQ_ELNO_TUYO":"EPTQ_ELNO","EPME_ELGA_DEPL":"EPME_ELGA","EPME_ELNO_DEPL":"EPME_ELNO", - "EPMG_ELGA_DEPL":"EPMG_ELGA","EPMG_ELNO_DEPL":"EPMG_ELNO","EPMG_NOEU_DEPL":"EPMG_NOEU","EPOT_ELEM_DEPL":"EPOT_ELEM", - "EPSG_ELGA_DEPL":"EPSG_ELGA","EPSG_ELNO_DEPL":"EPSG_ELNO","EPSG_NOEU_DEPL":"EPSG_NOEU", - "EPSI_ELGA_DEPL":"EPSI_ELGA","EPSI_NOEU_DEPL":"EPSI_NOEU","EPSI_ELNO_DEPL":"EPSI_ELNO","EPSI_ELNO_TUYO":"EPTU_ELNO", - "ERZ1_ELEM_SIGM":"ERZ1_ELEM","ERZ2_ELEM_SIGM":"ERZ2_ELEM", - "ETOT_ELNO_ELGA":"ETOT_ELNO","EXTR_ELGA_VARI":"VAEX_ELGA","EXTR_ELNO_VARI":"VAEX_ELNO","EXTR_NOEU_VARI":"VAEX_NOEU", - "FLUX_ELGA_TEMP":"FLUX_ELGA","FLUX_ELNO_TEMP":"FLUX_ELNO","FLUX_NOEU_TEMP":"FLUX_NOEU", - "HYDR_NOEU_ELGA":"HYDR_NOEU","HYDR_ELNO_ELGA":"HYDR_ELNO", - "META_ELNO_TEMP":"META_ELNO","META_NOEU_TEMP":"META_NOEU", - "PMPB_ELGA_SIEF":"PMPB_ELGA","PMPB_ELNO_SIEF":"PMPB_ELNO","PMPB_NOEU_SIEF":"PMPB_NOEU", - "QIRE_ELEM_SIGM":"QIRE_ELEM","QIRE_ELNO_ELEM":"QIRE_ELNO","QIRE_NOEU_ELEM":"QIRE_NOEU", - "QIZ1_ELEM_SIGM":"QIZ1_ELEM","QIZ2_ELEM_SIGM":"QIZ2_ELEM", - "SIEF_ELGA_DEPL":"SIEF_ELGA","SIEF_ELNO_ELGA":"SIEF_ELNO","SIEF_NOEU_ELGA":"SIEF_NOEU", - "SIEQ_ELNO_TUYO":"SITQ_ELNO","SING_ELNO_ELEM":"SING_ELNO","SIPO_ELNO_DEPL":"SIPO_ELNO","SIPO_NOEU_DEPL":"SIPO_NOEU", - "SOUR_ELGA_ELEC":"SOUR_ELGA", - "DCHA_ELGA_SIGM":"DERA_ELGA","DCHA_ELNO_SIGM":"DERA_ELNO","DCHA_NOEU_SIGM":"DERA_NOEU", - "RADI_ELGA_SIGM":"DERA_ELGA","RADI_ELNO_SIGM":"DERA_ELNO","RADI_NOEU_SIGM":"DERA_NOEU", - "EFGE_ELNO_CART":"EFCA_ELNO","EFGE_NOEU_CART":"EFCA_NOEU","EFGE_ELNO_DEPL":"EFGE_ELNO","EFGE_NOEU_DEPL":"EFGE_NOEU", - "EQUI_ELGA_EPME":"EPMQ_ELGA","EQUI_ELNO_EPME":"EPMQ_ELNO","EQUI_NOEU_EPME":"EPMQ_NOEU", - "EQUI_ELGA_EPSI":"EPEQ_ELGA","EQUI_ELNO_EPSI":"EPEQ_ELNO","EQUI_NOEU_EPSI":"EPEQ_NOEU", - "EQUI_ELGA_SIGM":"SIEQ_ELGA","EQUI_ELNO_SIGM":"SIEQ_ELNO","EQUI_NOEU_SIGM":"SIEQ_NOEU", - "SIGM_ELNO_CART":"SICA_ELNO","SIGM_NOEU_CART":"SICA_NOEU","SIGM_ELNO_COQU":"SICO_ELNO","SIGM_NOEU_COQU":"SICO_ELNO", - "SIGM_ELNO_TUYO":"SITU_ELNO", - "SIGM_ELNO_DEPL":"SIGM_ELNO","SIGM_NOEU_DEPL":"SIGM_NOEU","SIGM_NOZ1_ELGA":"SIZ1_ELGA","SIGM_NOZ2_ELGA":"SIZ2_ELGA", - "VALE_NCOU_MAXI":"SPMX_ELGA","VARI_ELNO_COQU":"VACO_ELNO","VARI_ELNO_TUYO":"VATU_ELNO", - "VARI_NOEU_ELGA":"VARI_NOEU","VARI_ELNO_ELGA":"VARI_ELNO", - "INDI_LOCA_ELGA":"INDL_ELGA"} - #"FORC_NODA":"FORC_NOEU","REAC_NODA":"REAC_NOEU" - changementValeurDsMCF(jdc,"AFFE_MATERIAU","AFFE_VARC","NOM_CHAM",dOPTION) - changementValeur(jdc,"COMB_FOURIER","NOM_CHAM",dOPTION) - changementValeur(jdc,"CREA_CHAMP","NOM_CHAM",dOPTION) - changementValeur(jdc,"CREA_RESU","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"EXTR_RESU","ARCHIVAGE","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",dOPTION) - changementValeur(jdc,"LIRE_RESU","NOM_CHAM",dOPTION) - changementValeur(jdc,"MACR_ADAP_MAIL","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"MACR_ASPIC_CALC","IMPRESSION","NOM_CHAM",dOPTION) - changementValeur(jdc,"MACR_LIGN_COUPE","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"MODI_REPERE","MODI_CHAM","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",dOPTION) - changementValeur(jdc,"PROJ_CHAMP","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",dOPTION) - changementValeur(jdc,"RECU_FONCTION","NOM_CHAM",dOPTION) - changementValeur(jdc,"REST_GENE_PHYS","NOM_CHAM",dOPTION) - changementValeur(jdc,"REST_SOUS_STRUC","NOM_CHAM",dOPTION) - changementValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",dOPTION) - changementValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",dOPTION) - - changementValeur(jdc,"CALC_CHAM_ELEM","OPTION",dOPTION) - changementValeur(jdc,"CALC_ELEM","OPTION",dOPTION) - changementValeur(jdc,"CALC_META","OPTION",dOPTION) - changementValeur(jdc,"CALC_NO","OPTION",dOPTION) - changementValeur(jdc,"COMB_SISM_MODAL","OPTION",dOPTION) - changementValeur(jdc,"MECA_STATIQUE","OPTION",dOPTION) - changementValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",dOPTION) - changementValeur(jdc,"THER_NON_LINE","OPTION",dOPTION) - - ############ Message si suppressionValeurs ou Valeurs ambigue CALC_ELEM/OPTION - rOPTION=("'DEUL_ELGA_DEPL'","'DEUL_ELGA_TEMP'","'DURT_ELGA_META'", - "'ERRE_ELNO_DEPL'", "'ERRE_NOEU_ELEM'", "'ERRE_ELNO_ELEM'","'EPSP_NOEU_ZAC'","'HYDR_ELNO_ELGA'", - "'SIGM_NOEU_ZAC'","'SIGM_ELNO_SIEF'","'SIGM_NOEU_SIEF'","'SIPO_ELNO_SIEF'","'SIPO_NOEU_SIEF'", - "'SIRE_ELNO_DEPL'","'SIRE_NOEU_DEPL'","'SIEF_NOEU'", - "'PRES_ELNO_DBEL'", "'VARI_NOEU'") - # Options ambigue : PRES_ELNO_DBEL --> prac_elno/prme_elno, ERRE* --> ERME_ELNO ou ERTH_ELNO selon PHENOMENE - # En commentaires les commandes non concernees par rOPTION - - genereErreurValeurDsMCF(jdc,"AFFE_MATERIAU","AFFE_VARC","NOM_CHAM",rOPTION) - #genereErreurValeur(jdc,"COMB_FOURIER","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"CREA_CHAMP","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"CREA_RESU","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"EXTR_RESU","ARCHIVAGE","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"LIRE_RESU","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"MACR_ADAP_MAIL","NOM_CHAM",rOPTION) - #genereErreurDsMCF(jdc,"MACR_ASPIC_CALC","IMPRESSION","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"MACR_LIGN_COUPE","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"MODI_REPERE","MODI_CHAM","NOM_CHAM",rOPTION) - #genereErreurValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"PROJ_CHAMP","NOM_CHAM",rOPTION) - #genereErreurValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",rOPTION) - genereErreurValeur(jdc,"RECU_FONCTION","NOM_CHAM",rOPTION) - #genereErreurValeur(jdc,"REST_GENE_PHYS","NOM_CHAM",rOPTION) - #genereErreurValeur(jdc,"REST_SOUS_STRUC","NOM_CHAM",rOPTION) - #genereErreurValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",rOPTION) - genereErreurValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",rOPTION) - - genereErreurValeur(jdc,"CALC_CHAM_ELEM","OPTION",rOPTION) - genereErreurValeur(jdc,"CALC_ELEM","OPTION",rOPTION) - #genereErreurValeur(jdc,"CALC_META","OPTION",rOPTION) - genereErreurValeur(jdc,"CALC_NO","OPTION",rOPTION) - #genereErreurValeur(jdc,"COMB_SISM_MODAL","OPTION",rOPTION) - #genereErreurValeur(jdc,"MECA_STATIQUE","OPTION",rOPTION) - genereErreurValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",rOPTION) - #genereErreurValeur(jdc,"THER_NON_LINE","OPTION",rOPTION) - - ########### Message si CALC_ELEM/SENSIBILITE - genereErreurMCF(jdc,"CALC_ELEM","SENSIBILITE") - - # non fait CALC_NO OPTION=FORC_NODA_NONL - - ########## traitement MACRO_MISS_3D --> CALC_MISS - renameCommandeSiRegle(jdc,"MACRO_MISS_3D","CALC_MISS",((("OPTION","MODULE","MISS_IMPE",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","ISSF"),"nexistepasMCsousMCF"),(("PARAMETRE","DIRE_ONDE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_LISTE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_NB"),"nexistepasMCsousMCF"),)) - renameCommandeSiRegle(jdc,"MACRO_MISS_3D","CALC_MISS",((("OPTION","MODULE","MISS_IMPE",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","ISSF","NON",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","DIRE_ONDE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_LISTE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_NB"),"nexistepasMCsousMCF"),)) - removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_RESU_IMPE",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_RESU_FORC",pasDeRegle(),0) - removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_POST_TRAI",pasDeRegle(),0) - removeMotCle(jdc,"CALC_MISS","UNITE_OPTI_MISS",pasDeRegle()) - removeMotCle(jdc,"CALC_MISS","UNITE_MODELE_SOL",pasDeRegle()) - removeMotCle(jdc,"CALC_MISS","OPTION",pasDeRegle(),1) - changementValeur(jdc,"CALC_MISS","VERSION",{"V1_4":"V6.5"}) - changementValeur(jdc,"CALC_MISS","VERSION",{"V1_5":"V6.6"}) - changementValeur(jdc,"CALC_MISS","VERSION",{"V1_3":"V6.5"}) - - macr="" - interf="" - amor="" - for c in jdc.root.childNodes: - if c.name != "IMPR_MACR_ELEM" : continue - for mc in c.childNodes: - if mc.name == "MACR_ELEM_DYNA" : macr=mc.getText(jdc) - if mc.name == "GROUP_MA_INTERF": interf=mc.getText(jdc) - if mc.name == "AMOR_REDUIT": amor=mc.getText(jdc) - if amor != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",amor,pasDeRegle(),0) - if interf != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",interf,pasDeRegle(),0) - if macr != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",macr,pasDeRegle(),0) - - chercheOperInsereFacteur(jdc,"CALC_MISS","TABLE_SOL=''",pasDeRegle(),0) - chercheOperInsereFacteur(jdc,"CALC_MISS","TYPE_RESU='FICHIER'",pasDeRegle(),0) - - ################################################################# - f=open(outfile,'w') - f.write(jdc.getSource()) - f.close() - - log.ferme(hdlr) - -def main(): - parser = optparse.Optionparser(usage=usage) - - parser.add_option('-i','--infile', dest="infile", default='toto.comm', - help="Le fichier a traduire") - parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', - help="Le fichier traduit") - - options, args = parser.parse_args() - traduc(options.infile,options.outfile) - -if __name__ == '__main__': - main() - diff --git a/Traducteur/utils.py b/Traducteur/utils.py deleted file mode 100644 index 31ab5e87..00000000 --- a/Traducteur/utils.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 re - -def indexToCoordinates(src, index): - """return le numero de la colonne (x) et le numero de la ligne (y) dans src""" - y = src[: index].count("\n") - startOfLineIdx = src.rfind("\n", 0, index)+1 - x = index-startOfLineIdx - return x, y - -def lineToDict(line): - """Transforme une ligne (string) en un dictionnaire de mots - reperes par le numero de la colonne""" - - words = re.split("(\w+)", line) - h = {};i = 0 - for word in words: - h[i] = word - i+=len(word) - return h - -def dictToLine(d): - """Transformation inverse: a partir d'un dictionnaire retourne une ligne""" - cols = d - cols.sort() - return "".join([d[colno]for colno in cols]) diff --git a/Traducteur/visiteur.py b/Traducteur/visiteur.py deleted file mode 100644 index b1e8aa2f..00000000 --- a/Traducteur/visiteur.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2017 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. -# -# 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 re -from compiler import visitor - -class MatchFinder: - """Visiteur de base : gestion des matches """ - def reset(self,line): - self.matches=[] - self._matches = [] - self.words = re.split("(\w+)", line) # every other one is a non word - self.positions = [] - i = 0 - for word in self.words: - self.positions.append(i) - i+=len(word) - self.index = 0 - - def popWordsUpTo(self, word): - if word == "*": - return # won't be able to find this - posInWords = self.words.index(word) - idx = self.positions[posInWords] - self.words = self.words[posInWords+1:] - self.positions = self.positions[posInWords+1:] - - def appendMatch(self,name): - idx = self.getNextIndexOfWord(name) - self._matches.append((idx, name)) - - def getNextIndexOfWord(self,name): - return self.positions[self.words.index(name)] - - -class KeywordFinder(MatchFinder): - """Visiteur pour les keywords d'une commande """ - - def visitKeyword(self,node): - idx = self.getNextIndexOfWord(node.name) - self.popWordsUpTo(node.name) - prevmatches=self._matches - self._matches = [] - for child in node.getChildNodes(): - self.visit(child) - prevmatches.append((idx, node.name,self._matches)) - self._matches=prevmatches - #on ne garde que les matches du niveau Keyword le plus haut - self.matches=self._matches - - def visitTuple(self,node): - matchlist=[] - for child in node.getChildNodes(): - self._matches = [] - self.visit(child) - if self._matches: - # Pour eviter les tuples et listes ordinaires, - # on ne garde que les visites fructueuses - matchlist.append(self._matches) - self._matches=matchlist - - visitList=visitTuple - - def visitName(self,node): - self.popWordsUpTo(node.name) - - def visitAssName(self,node): - self.popWordsUpTo(node.name) diff --git a/Traducteur2/.renamemocle.py.swp b/Traducteur2/.renamemocle.py.swp new file mode 100644 index 00000000..bd31de25 Binary files /dev/null and b/Traducteur2/.renamemocle.py.swp differ diff --git a/Traducteur2/CMakeLists.txt b/Traducteur2/CMakeLists.txt new file mode 100644 index 00000000..d1c51c80 --- /dev/null +++ b/Traducteur2/CMakeLists.txt @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM 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 +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +# Installation de tous les fichiers Python, texte et images du repertoire et des sous-repertoires (sauf CVS) +install ( + FILES + calcG.py changeValeur.py dictErreurs.py __init__.py inseremocle.py + load.py log.py mocles.py movemocle.py parseur.py regles.py removemocle.py + renamemocle.py traduitV7V8.py traduitV8V9.py traduitV9V10.py utils.py + visiteur.py + DESTINATION ${CMAKE_INSTALL_PREFIX}/Traducteur + ) + +### Local Variables: +### mode: cmake +### End: diff --git a/Traducteur2/__init__.py b/Traducteur2/__init__.py new file mode 100644 index 00000000..e4044aec --- /dev/null +++ b/Traducteur2/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# diff --git a/Traducteur2/calcG.py b/Traducteur2/calcG.py new file mode 100644 index 00000000..9dccd459 --- /dev/null +++ b/Traducteur2/calcG.py @@ -0,0 +1,155 @@ +#### -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +from Traducteur.parseur import FactNode +from Traducteur.load import jdcSet +import logging + +dict_commande={} +dict_contexte={} +dict_contexte_option={} + +import sys +#-------------------------------------------------------------------------- +def traitementRayon(jdc): +#-------------------------------------------------------------------------- + + if "DEFI_FONCTION" not in jdcSet : return + for c in jdc.root.childNodes: + if c.name != "DEFI_FONCTION" : continue + monTexte=jdc.getLines()[c.lineno-1] + monNomVariable=monTexte.split("=")[0] + aExecuter=monNomVariable+'=0' + dict_commande[monNomVariable]=c + exec aExecuter in dict_contexte + liste_MC=(("CALC_G","R_INF_FO"),("CALC_G","R_SUP_FO"),("CALC_G","MODULE_FO")) + liste_achanger = chercheValeurSelonGenea2 (jdc,liste_MC) + liste_MC=(("CALC_THETA","THETA_3D","R_INF_FO"),("CALC_THETA","THETA_3D","R_SUP_FO"),("CALC_THETA","THETA_3D","MODULE_FO")) + liste_achanger2 = chercheValeurSelonGenea3 (jdc,liste_MC) + liste_achanger=liste_achanger+liste_achanger2 + for item in liste_achanger : + commande=dict_commande[item] + changeValeurABSCNiveau1(commande,jdc) + +#---------------------------------- +def changeValeurABSCNiveau1(c,jdc): +#---------------------------------- + for child in c.childNodes: + if child.name != "NOM_PARA":continue + MonTexte=child.getText(jdc) + if len(MonTexte.splitlines()) > 1 : + print ("Le Traducteur ne sait pas gerer") + assert(0) + MonTexte=jdc.getLines()[child.lineno-1] + debut=MonTexte.find("NOM_PARA") + debChaine=MonTexte[0:debut+8] + ancien=MonTexte[debut+8:] + egal,nomval,fin=ancien.split("'",2) + nouvelleLigne=debChaine+egal+"'ABSC'"+fin + jdc.getLines()[child.lineno-1]=nouvelleLigne + logging.info("renommage parametre ABSC ligne %d",child.lineno-1) + return + +#-------------------------------------------------------------------------- +def chercheValeurSelonGenea2(jdc,liste_cherche_valeur): +# +#-------------------------------------------------------------------------- + liste_valeurs=[] + for genea in liste_cherche_valeur: + profondeur=len(genea) + if profondeur > 2 : + print ("la methode chercheValeurSelonGenea ne convient") + print ("pas pour cette genealogie") + assert(0) + command=genea[0] + fact=genea[1] + + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + MonTexte=mc.getText(jdc) + try : + #if ( 1) : + exec MonTexte in dict_contexte + monNomVar=MonTexte.split("=")[1] + monNomVarOk=monNomVar + i=-1 + while (monNomVar[i] == "," or monNomVar[i] == " ") : + monNomVarOk=monNomVar[0:i] + i=i-1 + monNomVar=monNomVarOk + i=0 + while (monNomVar[i] == " ") : + monNomVarOk=monNomVar[1:] + i=i+1 + monNomVar=monNomVarOk + if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar) + except : + #else : + logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg") + pass + return liste_valeurs + + +#-------------------------------------------------------------------------- +def chercheValeurSelonGenea3(jdc,liste_cherche_valeur): +#-------------------------------------------------------------------------- + liste_valeurs=[] + for genea in liste_cherche_valeur: + profondeur=len(genea) + if profondeur > 3 : + print ("la methode chercheValeurSelonGenea ne convient") + print ("pas pour cette genealogie") + assert(0) + command=genea[0] + fact=genea[1] + mc=genea[2] + + for c in jdc.root.childNodes: + if c.name != command : continue + for mcf in c.childNodes: + if mcf.name != fact : continue + l=mcf.childNodes[:] + for ll in l: + for lc in ll.childNodes: + if lc.name !=mc : continue + MonTexte=lc.getText(jdc) + try : + #if ( 1) : + exec MonTexte in dict_contexte + #monNomVar=MonTexte.split("=")[1][0:-1] + monNomVar=MonTexte.split("=")[1] + monNomVarOk=monNomVar + i=-1 + while (monNomVar[i] == "," or monNomVar[i] == " ") : + monNomVarOk=monNomVar[0:i] + i=i-1 + monNomVar=monNomVarOk + i=0 + while (monNomVar[i] == " ") : + monNomVarOk=monNomVar[1:] + i=i+1 + monNomVar=monNomVarOk + if monNomVar not in liste_valeurs : liste_valeurs.append(monNomVar) + except : + #else : + logging.error("Pb pour renommer le parametre ABSC dans defi_fonctions selon calcg") + pass + return liste_valeurs diff --git a/Traducteur2/changeValeur.py b/Traducteur2/changeValeur.py new file mode 100644 index 00000000..50b0c9c9 --- /dev/null +++ b/Traducteur2/changeValeur.py @@ -0,0 +1,317 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +from Traducteur.utils import lineToDict +import logging +from Traducteur.dictErreurs import ecritErreur +from Traducteur.load import jdcSet +from Traducteur.renamemocle import decaleLignesdeNBlancs +from Traducteur.removemocle import removeMotCleInFact +from Traducteur import regles + + +#-------------------------------------------------------------------------- +def changementValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + trouveUnMC=0 + for mc in c.childNodes: + if mc.name != motcle : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-1 + indexTexteMC=0 + while indexLigneGlob < mc.endline : + if indexTexteMC > len(liste_ligne_MC)-1 : break + MaLigneGlob=jdc.getLines()[indexLigneGlob] + MaLigneTexte=liste_ligne_MC[indexTexteMC] + for Valeur in DictNouvVal : + MaLigneTexteDict=lineToDict(MaLigneTexte) + trouvecol=MaLigneTexte.find(Valeur) + if trouvecol > -1: + trouve=(Valeur==MaLigneTexteDict[trouvecol]) + else: + trouve=False + if trouve: + debut=MaLigneGlob.find(motcle) + if debut==-1 : debut=0 + Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) + Nouveau=MaLigneGlob[0:debut]+Nouveau + jdc.getLines()[indexLigneGlob]=Nouveau + MaLigneTexte=Nouveau # raccourci honteux mais ... + MaLigneGlob=Nouveau + if Valeur in liste : + ecritErreur((command,motcle,Valeur),indexLigneGlob) + else : + logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) + boolChange=1 + indexLigneGlob=indexLigneGlob+1 + indexTexteMC=indexTexteMC+1 + if (trouveUnMC == 0) and ( defaut == 1): + ecritErreur((command,motcle,"DEFAUT"),c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------------- +def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=regles.SansRegle,defaut=0): +#-------------------------------------------------------------------------------- + + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + trouveUnMC=0 + for mc in ll.childNodes: + if mc.name != motcle:continue + if ensemble.verif(c) == 0 : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-1 + indexTexteMC=0 + while indexLigneGlob < mc.endline : + if indexTexteMC > len(liste_ligne_MC)-1 : break + MaLigneGlob=jdc.getLines()[indexLigneGlob] + MaLigneTexte=liste_ligne_MC[indexTexteMC] + for Valeur in DictNouvVal : + MaLigneTexteDict=lineToDict(MaLigneTexte) + trouvecol=MaLigneTexte.find(Valeur) + if trouvecol > -1: + trouve=(Valeur==MaLigneTexteDict[trouvecol]) + else: + trouve=False + if trouve: + debut=MaLigneGlob.find(motcle) + if debut==-1 : debut=0 + Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) + Nouveau=MaLigneGlob[0:debut]+Nouveau + jdc.getLines()[indexLigneGlob]=Nouveau + MaLigneTexte=Nouveau # raccourci honteux mais ... + MaLigneGlob=Nouveau + if Valeur in liste : + ecritErreur((command,fact,motcle,Valeur),indexLigneGlob) + else : + logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) + boolChange=1 + indexLigneGlob=indexLigneGlob+1 + indexTexteMC=indexTexteMC+1 + if (trouveUnMC == 0) and ( defaut == 1): + logging.warning("OPTION (defaut) de CALCG a verifier ligne %s" ,c.lineno ) + ecritErreur((command,fact,motcle,"DEFAUT"),c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------------- +def changementValeurDsMCFSiRegle(jdc,command,fact,motcle,DictNouvVal,liste_regles,defaut=0): +#-------------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + liste=() + changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,mesRegles,defaut) + +#--------------------------------------------------------------------------------------- +def changementValeurDsMCFAvecAvertissement(jdc, command, fact,motcle,DictNouvVal,liste): +#--------------------------------------------------------------------------------------- + if command not in jdcSet : return + defaut=0 + if liste[-1] == "defaut" : + defaut=1 + changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,defaut) + +#-------------------------------------------------------------------------- +def changementValeurAvecAvertissement(jdc, command,motcle,DictNouvVal,liste): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + defaut=0 + if liste[-1] == "defaut" : + defaut=1 + changementValeur(jdc,command,motcle,DictNouvVal,liste,defaut) + +#-------------------------------------------------------------------------- +def suppressionValeurs(jdc, command,motcle,liste): +#-------------------------------------------------------------------------- + + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + for mc in c.childNodes: + if mc.name != motcle : continue + indexLigneGlob=mc.lineno-1 + while indexLigneGlob < mc.endline-1 : + MaLigneTexte = jdc.getLines()[indexLigneGlob] + MaLigne=MaLigneTexte + for Valeur in liste : + debutMC =MaLigne.find(motcle) + if debutMC ==-1 : debutMC=0 + debut1=MaLigne[0:debutMC] + chercheLigne=MaLigne[debutMC:] + trouve=chercheLigne.find(Valeur) + premier=0 + if trouve > 1 : #on a au moins une quote + debut=debut1 + chercheLigne[0:trouve-1] + index = -1 + while (-1 * index) < len(debut) : + if (debut[index] == "(") : + premier = 1 + if index == -1 : + index=len(debut) + else : + index=index+1 + break + if (debut[index] == "," ) : + break + if (debut[index] != " " ) : + assert(0) + index = index -1 + debLigne = debut[0:index] + fin=trouve+len(Valeur)+1 + if premier == 1 and chercheLigne[fin] == ',': fin = fin + 1 # on supprime la , + finLigne = chercheLigne[fin:] + MaLigne_tmp=debLigne+finLigne + # traitement ligne commancant par , + if len(MaLigne_tmp.strip()) > 0 : + if MaLigne_tmp.strip()[0]==',' : + MaLigne=MaLigne_tmp.strip()[1:] + else : + MaLigne=MaLigne_tmp[0:] + else : + MaLigne=MaLigne_tmp[0:] + boolChange=1 + jdc.getLines()[indexLigneGlob]=MaLigne + indexLigneGlob=indexLigneGlob+1 + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------- +def appelleMacroSelonValeurConcept(jdc,macro,genea): +#---------------------------------------------- + if macro not in jdcSet : return + boolChange=0 + fact=genea[0] + motcle=genea[1] + chaine="CO" + for c in jdc.root.childNodes: + if c.name != macro : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + trouveValeur=0 + for mc in ll.childNodes: + if mc.name != motcle:continue + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-2 + trouveTexteMC=0 + trouveegal=0 + trouvechaine=0 + trouveparent=0 + trouvequote=0 + while indexLigneGlob < mc.endline : + indexLigneGlob=indexLigneGlob+1 + MaLigneTexte=jdc.getLines()[indexLigneGlob] + + # on commence par chercher TABLE par exemple + # si on ne trouve pas on passe a la ligne suivante + if ( trouveTexteMC == 0 ) : + indice=MaLigneTexte.find(motcle) + if indice < 0 : continue + trouveTexteMC=1 + else : + indice=0 + + # on cherche = + aChercher=MaLigneTexte[indice:] + if (trouveegal == 0 ): + indice=aChercher.find("=") + if indice < 0 : continue + trouveegal = 1 + else : + indice = 0 + + # on cherche CO + aChercher2=aChercher[indice:] + if (trouvechaine == 0 ): + indice=aChercher2.find(chaine) + if indice < 0 : continue + trouvechaine = 1 + else : + indice = 0 + + #on cherche ( + aChercher3=aChercher2[indice:] + if (trouveparent == 0 ): + indice=aChercher3.find('(') + if indice < 0 : continue + trouveparent = 1 + else : + indice = 0 + + #on cherche la ' + aChercher4=aChercher3[indice:] + if (trouvequote == 0 ): + indice=aChercher4.find("'") + indice2=aChercher4.find('"') + if (indice < 0) and (indice2 < 0): continue + if (indice < 0) : indice=indice2 + trouvequote = 1 + else : + indice = 0 + + trouveValeur=1 + aChercher5=aChercher4[indice+1:] + indice=aChercher5.find("'") + if indice < 0 : indice=aChercher5.find('"') + valeur=aChercher5[:indice] + break + + if trouveValeur==0 : + logging.error("Pb de traduction pour MACR_LIGNE_COUPE : Pas de nom de Concept identifiable") + return + + if boolChange : + jdc.reset(jdc.getSource()) + logging.error("Pb du traduction pour MACR_LIGNE_COUPE : Deux noms de Concept possibles") + return + + boolChange=1 + ligneaTraiter=jdc.getLines()[c.lineno-1] + debut=ligneaTraiter[0:c.colno] + suite=valeur+"=" + fin=ligneaTraiter[c.colno:] + ligne=debut+suite+fin + jdc.getLines()[c.lineno-1]=ligne + nbBlanc=len(valeur)+1 + if c.lineno < c.endline: + decaleLignesdeNBlancs(jdc,c.lineno,c.endline-1,nbBlanc) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------- +def changeTouteValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): +#---------------------------------------------- + if macro not in jdcSet : return + boolChange=0 diff --git a/Traducteur2/demosRN.py b/Traducteur2/demosRN.py new file mode 100755 index 00000000..1742af7a --- /dev/null +++ b/Traducteur2/demosRN.py @@ -0,0 +1,523 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV11V12.py --infile=xxxx --outfile=yyyy +""" + +import os, sys +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +import optparse + +from Traducteur.load import getJDC +from Traducteur.mocles import parseKeywords +from Traducteur.removemocle import * +from Traducteur.renamemocle import * +from Traducteur.renamemocle import * +from Traducteur.inseremocle import * +from Traducteur.changeValeur import * +from Traducteur.movemocle import * +from Traducteur.dictErreurs import * +from Traducteur.regles import pasDeRegle +from Traducteur import log + + + +atraiter=( + "Genere_Une_Erreur_Traduction", + ) + +dict_erreurs={ + "Genere_Une_Erreur_Traduction":"Message pour test de genereErreurpourCommande ", + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + #### genere une erreur si on trouve la commande dans le jdc #############################e + genereErreurPourCommande(jdc,"Genere_Une_Erreur_Traduction") + exit() + + #### traitement de AFFE_CARA_ELEM ############################## + changementValeurDsMCFSiRegle(jdc,"AFFE_CARA_ELEM","POUTRE","CARA",{"R1":"R_DEBUT","R2":"R_FIN", + "EP1":"EP_DEBUT","EP2":"EP_FIN"}, + ((("POUTRE","MAILLE",),"nexistepasMCsousMCF"), + (("POUTRE","SECTION","CERCLE",jdc),"MCsousMCFaPourValeur"), + (("POUTRE","VARI_SECT","HOMOTHETIQUE",jdc),"MCsousMCFaPourValeur"), + ), + ) + + #### traitement de AFFE_CHAR_MECA ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_MECA","METHODE",pasDeRegle(),0) + # Suppression des mot-clés LIAISON_XFEM + removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_XFEM",pasDeRegle(),0) + removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT_XFEM",pasDeRegle(),0) + # Modification des parametres du mot-clé DDL_POUTRE + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","GROUP_MA","GROUP_MA_REPE",pasDeRegle(),0) + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","MAILLE","MAILLE_REPE",pasDeRegle(),0) + + # Résorption des mot-clés ANGLE_NAUT et CENTRE + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) + + #### traitement de AFFE_CHAR_MECA_F ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_MECA_F","METHODE",pasDeRegle(),0) + # Résorption des mot-clés ANGLE_NAUT et CENTRE + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) + + genereErreurMotCleInFact(jdc,"AFFE_CHAR_MECA_F","ONDE_PLANE","DIRECTION") + + #### traitement de AFFE_CHAR_THER ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_THER","METHODE",pasDeRegle(),0) + + #### traitement de AFFE_MODELE ############################## + # Suppression des mot-clés GRILLE et VERIF + removeMotCle(jdc,"AFFE_MODELE","GRILLE",pasDeRegle(),0) + removeMotCle(jdc,"AFFE_MODELE","VERIF",pasDeRegle(),0) + + d3DINCO={"3D_INCO":"3D_INCO_UP","3D_INCO_OSGS":"3D_INCO_UPO", + "3D_INCO_GD":"3D_INCO_UPG","3D_INCO_LOG":"3D_INCO_UPG", + "3D_INCO_LUP":"3D_INCO_UP",} + dAXIS={"AXIS_INCO":"AXIS_INCO_UP","AXIS_INCO_OSGS":"AXIS_INCO_UPO", + "AXIS_INCO_GD":"AXIS_INCO_UPG","AXIS_INCO_LOG":"AXIS_INCO_UPG", + "AXIS_INCO_LUP":"AXIS_INCO_UP",} + dDPLAN={"D_PLAN_INCO":"D_PLAN_INCO_UP","D_PLAN_INCO_OSGS":"D_PLAN_INCO_UPO", + "D_PLAN_INCO_GD":"D_PLAN_INCO_UPG","D_PLAN_INCO_LOG":"D_PLAN_INCO_UPG", + "D_PLAN_INCO_LUP":"D_PLAN_INCO_UP",} + dINCO={} + dINCO.update(d3DINCO) + dINCO.update(dAXIS) + dINCO.update(dDPLAN) + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dINCO) + + #### traitement de ASSEMBLAGE ############################## + genereErreurValeurDsMCF(jdc,"ASSEMBLAGE","MATR_ASSE","OPTION",("'MASS_THER'",)) + + #### traitement de CALC_ESSAI_GEOMECA ############################## + renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_IMPOSE","GAMMA_IMPOSE",pasDeRegle(),0) + renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_ELAS","GAMMA_ELAS",pasDeRegle(),0) + + #### traitement de CALC_EUROPLEXUS ############################## + removeMotCle(jdc,"CALC_EUROPLEXUS","DIME",pasDeRegle(),0) + genereErreurMCF(jdc,"CALC_EUROPLEXUS","FONC_PARASOL") + removeMotCleInFact(jdc,"CALC_EUROPLEXUS","ARCHIVAGE","CONT_GENER") + + #### traitement de CALC_FERRAILLAGE ############################## + genereErreurPourCommande(jdc,"CALC_FERRAILLAGE") + + #### traitement de CALC_FONCTION ############################## + ajouteMotClefDansFacteur(jdc,"CALC_FONCTION","CORR_ACCE","METHODE='POLYNOME'",pasDeRegle(),0) + genereErreurMotCleInFact(jdc,"CALC_FONCTION","DSP","FREQ") + + #### traitement de CALC_G ############################## + removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","RESI_INTE_RELA",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","ITER_INTE_MAXI",pasDeRegle(),0) + + #### traitement de CALC_FATIGUE ############################## + changementValeur(jdc,"CALC_FATIGUE","COURBE_GRD_VIE",{"MANSON_C":"MANSON_COFFIN",}) + + #### traitement de CALC_IFS_DNL ############################## + removeMotCle(jdc,"CALC_IFS_DNL","ENERGIE",pasDeRegle(),0) + + #### traitement de CALC_MAC3COEUR ############################## + ajouteMotClefDansFacteur(jdc,"CALC_MAC3COEUR","DEFORMATION","ARCHIMEDE = 'OUI'",pasDeRegle()) + + #### traitement de CALC_MATR_ELEM ############################## + genereErreurValeur(jdc,"CALC_MATR_ELEM","OPTION",("'MASS_THER'",)) + + #### traitement de CALC_MISS ############################## + genereErreurValeurDsMCF(jdc,"CALC_MISS","PARAMETRE","ISSF",("'OUI'",)) + + #### traitement de CALC_MODAL ############################## + # renameCommande(jdc,"CALC_MODAL","CALC_MODES", ) + genereErreurPourCommande(jdc,"CALC_MODAL") + + #### traitement de CALC_VECT_ELEM ############################## + genereErreurValeur(jdc,"CALC_VECT_ELEM","OPTION",("'FORC_NODA'",)) + + #### traitement de CREA_MAILLAGE ############################## + renameMotCle(jdc,"CREA_MAILLAGE","CREA_GROUP_MA","CREA_MAILLE") + genereErreurMCF(jdc,"CREA_MAILLAGE","ECLA_PG") + + lMCLEF=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1', + 'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE','QUAD_LINE', + 'REPERE','RESTREINT','PENTA15_18'] + genereErreurMCF(jdc,"CREA_MAILLAGE","DETR_GROUP_MA") + removeMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","NB_MAILLE",((lMCLEF,"nexistepasMCFParmi"),)) + renameMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","GROUP_MA","NOM",((lMCLEF,"nexistepasMCFParmi"),)) + renameCommandeSiRegle(jdc,"CREA_MAILLAGE","DEFI_GROUP",((lMCLEF,"nexistepasMCFParmi"),)) + + #### traitement de DEBUT ############################## + # genereErreurPourCommande(jdc,("DEBUT",)) + removeMotCleInFact(jdc,"DEBUT","CODE","NOM",pasDeRegle(),0) + + #### traitement de DEFI_COMPOR ############################## + genereErreurValeur(jdc,"DEFI_COMPOR","LOCALISATION",["'RL'",]) + genereErreurValeur(jdc,"DEFI_COMPOR","RELATION_KIT",["'RVMIS_ISOT_CINE'",]) + genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","RELATION",["'LABORD_1D'"]) + genereErreurMCF(jdc,"DEFI_COMPOR","POLYCRISTAL") + + #### traitement de DEFI_FISS_XFEM ############################## + genereErreurPourCommande(jdc,("DEFI_FISS_XFEM",)) + removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE",pasDeRegle(),0) + removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE_GRILLE",pasDeRegle(),0) + + #### traitement de DEFI_LIST_INST ############################## + changementValeurDsMCF(jdc,"DEFI_LIST_INST","ECHEC","ACTION",{"REAC_PRECOND":"DECOUPE"}) + + #### traitement de DEFI_MATER_GC ############################## + ajouteMotClefDansFacteur(jdc,"DEFI_MATER_GC","MAZARS","CODIFICATION='ESSAI'",pasDeRegle(),0) + + removeMotCleInFactSiRegle(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR", + ((("MAZARS","CODIFICATION",["ESSAI"],jdc),"MCsousMCFaPourValeurDansListe"),),) + renameMotCleInFact(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR","UNITE_CONTRAINTE") + changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"MM":"MPa"}) + changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"M":"Pa"}) + + genereErreurMCF(jdc,"DEFI_MATER_GC","MAZARS") + + #### traitement de DEFI_MATERIAU ############################## + lMLA=["F_MRR_RR", "C_MRR_RR", "F_MTT_TT", "C_MTT_TT", "F_MZZ_ZZ", + "C_MZZ_ZZ", "F_MRT_RT", "C_MRT_RT", "F_MRZ_RZ", "C_MRZ_RZ", + "F_MTZ_TZ", "C_MTZ_TZ",] + for param in lMLA: + removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI",param,pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI_FO",param,pasDeRegle(),0) + + lMDC=["BETA","DELTA1", "DELTA2", "DEPDT",] + for mcle in lMDC: + removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",mcle,pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",mcle,pasDeRegle(),0) + + removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT","NB_VALE",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO","NB_VALE",pasDeRegle(),0) + listeMc=["C"+str(i) for i in range(1,198)] + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",listeMc,"LISTE_COEF") + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",listeMc,"LISTE_COEF") + + removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0) + + genereErreurMCF(jdc,"DEFI_MATERIAU","DIS_VISC") + lDISC=["PUIS_DX", "PUIS_DY", "PUIS_DZ", "PUIS_RX", "PUIS_RY", "PUIS_RZ", + "COEF_DX", "COEF_DY", "COEF_DZ", "COEF_RX", "COEF_RY", "COEF_RZ"] + for param in lDISC: + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_VISC",param,pasDeRegle(),0) + + lTHMD=["PERMIN_X", "PERMIN_Y", "PERMIN_Z", "PERMINXY", "PERMINYZ", "PERMINZX",] + for param in lTHMD: + removeMotCleInFact(jdc,"DEFI_MATERIAU","THM_DIFFU",param,pasDeRegle(),0) + + # lMONODD=["DELTA1", "DELTA2"] + # for param in lMONODD: + # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",param,pasDeRegle(),0) + # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",param,pasDeRegle(),0) + + removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","EF",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","NUF",pasDeRegle(),0) + + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_FO") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_NL") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_HYDR") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE_FO") + + + #### traitement de DEFI_OBSTACLE ############################## + lMCLE=("CRAYON_900","CRAYON_1300","GUID_A_CARTE_900", + "GUID_B_CARTE_900","GUID_C_CARTE_900","GUID_D_CARTE_900","GUID_E_CARTE_900", + "GUID_F_CARTE_900","GUID_A_CARTE_1300","GUID_B_CARTE_1300","GUID_C_CARTE_1300", + "GUID_D_CARTE_1300","GUID_E_CARTE_1300","GUID_F_CARTE_1300","GUID_A_CARSP_900", + "GUID_B_CARSP_900","GUID_C_CARSP_900","GUID_D_CARSP_900","GUID_E_CARSP_900", + "GUID_F_CARSP_900","GUID_A_CARSP_1300","GUID_B_CARSP_1300","GUID_C_CARSP_1300", + "GUID_D_CARSP_1300","GUID_E_CARSP_1300","GUID_F_CARSP_1300","GUID_A_GCONT_900", + "GUID_B_GCONT_900","GUID_C_GCONT_900","GUID_D_GCONT_900","GUID_E_GCONT_900", + "GUID_F_GCONT_900","GUID_A_GCONT_1300","GUID_B_GCONT_1300","GUID_C_GCONT_1300", + "GUID_D_GCONT_1300","GUID_E_GCONT_1300","GUID_F_GCONT_1300","GUID_A_GCOMB_900", + "GUID_B_GCOMB_900","GUID_C_GCOMB_900","GUID_D_GCOMB_900","GUID_E_GCOMB_900", + "GUID_F_GCOMB_900","GUID_A_GCOMB_1300","GUID_B_GCOMB_1300","GUID_C_GCOMB_1300", + "GUID_D_GCOMB_1300","GUID_E_GCOMB_1300","GUID_F_GCOMB_1300",) + genereErreurValeur(jdc,"DEFI_OBSTACLE","TYPE",lMCLE) + + #### traitement de DYNA_TRAN_MODAL ############################## + removeMotCle(jdc,"DYNA_TRAN_MODAL","LAME_FLUIDE",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_TRAN_MODAL","PARA_LAME_FLUI",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_TRAN_MODAL","RELA_TRANSIS",pasDeRegle(),0) + + #### traitement de DYNA_VIBRA ############################## + removeMotCle(jdc,"DYNA_VIBRA","LAME_FLUIDE",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_VIBRA","PARA_LAME_FLUI",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_VIBRA","RELA_TRANSIS",pasDeRegle(),0) + + #### traitement de EXTR_TABLE ############################## + changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"MATR_ELEM":"MATR_TANG_ELEM"}) + changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"CODE_RETOUR":"CODE_RETOUR_INTE"}) + + #### traitement de FACTORISER ############################## + renameMotCle(jdc,"FACTORISER","ELIM_LAGR2","ELIM_LAGR") + changementValeur(jdc,"FACTORISER","ELIM_LAGR",{"OUI":"LAGR2",}) + + #### traitement de GENE_ACCE_SEISME ############################## + genereErreurMCF(jdc,"GENE_ACCE_SEISME","MODULATION") + moveMotCleFromFactToFather(jdc,"GENE_ACCE_SEISME","MODULATION","DUREE_PHASE_FORTE") + + + removeMotCleInFact(jdc,"GENE_ACCE_SEISME","MODULATION","PARA") + removeMotCleInFactSiRegle(jdc,"GENE_ACCE_SEISME","MODULATION","INST_INI",((("MODULATION","TYPE",["GAMMA"],jdc),"MCsousMCFnaPasPourValeurDansListe"),)) + + removeMotCleInFact(jdc,"GENE_ACCE_SEISME","DSP","FREQ_PENTE") + + #### traitement de IMPR_MISS_3D ############################## + genereErreurPourCommande(jdc,"IMPR_MISS_3D") + # removeCommande(jdc,"IMPR_MISS_3D") + + #### traitement de IMPR_RESU ############################## + removeMotCle(jdc,"IMPR_RESU","RESTREINT",pasDeRegle(),0) + + #### traitement de INFO_FONCTION ############################## + genereErreurMCF(jdc,"INFO_FONCTION","NOCI_SEISME") + + #### traitement de LIRE_MAILLAGE ############################## + removeMotCle(jdc,"LIRE_MAILLAGE","ABSC_CURV",pasDeRegle(),0) + + #### traitement de LIRE_MISS_3D ############################## + genereErreurPourCommande(jdc,"LIRE_MISS_3D") + + #### traitement de MACR_ASCOUF_CALC ############################## + removeMotCle(jdc,"MACR_ASCOUF_CALC","CL_BOL_P2_GV",pasDeRegle(),0) + # genereErreurMCF(jdc,"MACR_ASCOUF_CALC","COMP_ELAS") + + #### traitement de MACR_ASCOUF_MAIL ############################## + genereErreurValeurDsMCF(jdc,"MACR_ASCOUF_MAIL","COUDE","BOL_P2",("'GV'",)) + + #### traitement de MACR_ASPIC_CALC ############################## + # genereErreurMCF(jdc,"MACR_ASPIC_CALC","COMP_ELAS") + + #### traitement de MACR_ECREVISSE ############################## + genereErreurMCF(jdc,"MACR_ECREVISSE","COMP_INCR") + + #### traitement de MACR_INFO_MAIL ############################## + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_6":"V11_2"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N":"V11_N"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N_PERSO":"V11_N_PERSO"}) + + #### traitement de MACRO_BASCULE_SCHEMA ############################## + renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_IMPL","COMPORTEMENT_IMPL",pasDeRegle()) + renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_EXPL","COMPORTEMENT_EXPL",pasDeRegle()) + + #### traitement de MACRO_MISS_3D ############################## + genereErreurPourCommande(jdc,"MACRO_MISS_3D") + + #### traitement de MACRO_MODE_MECA ############################## + # insereMotCleDansCommande(jdc,"MACRO_MODE_MECA","TYPE_RESU='DYNAMIQUE'") + chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","SOLVEUR_MODAL",) + chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","OPTION='BANDE'",pasDeRegle(),0) + chercheOperInsereFacteurSiRegle(jdc,"MACRO_MODE_MECA","NORM_MODE",((("NORM_MODE",),"nexistepas"),),1) + + lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MACRO_MODE_MECA",mcle,"SOLVEUR_MODAL") + + moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + renameCommande(jdc,"MACRO_MODE_MECA","CALC_MODES", ) + + #### traitement de MODE_ITER_INV ############################## + chercheOperInsereFacteur(jdc,"MODE_ITER_INV","SOLVEUR_MODAL",) + moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_FREQ","OPTION") + moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","OPTION") + + lINV=["OPTION", "PREC", "NMAX_ITER",] + for mcle in lINV: + renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle,mcle+"_INV",pasDeRegle(),0) + moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle+"_INV","SOLVEUR_MODAL") + + lMCLE=["NMAX_ITER_AJUSTE","PREC_AJUSTE",] + for mcle in lMCLE: + moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_FREQ",mcle,"SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_JACOBI","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_BATHE","SOLVEUR_MODAL") + + removeMotCle(jdc,"MODE_ITER_INV","CALC_MODE",pasDeRegle(),0) + + chercheOperInsereMotCleSiRegle(jdc,"MODE_ITER_INV","OPTION='AJUSTE'",((("OPTION",),"nexistepas"),),0) + + renameCommande(jdc,"MODE_ITER_INV","CALC_MODES", ) + + #### traitement de MODE_ITER_SIMULT ############################## + chercheOperInsereFacteur(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",) + removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("METHODE","TRI_DIAG",jdc),"MCnaPasPourValeur"),),) + removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("OPTION","SANS",jdc),"MCaPourValeur"),),) + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","OPTION","SOLVEUR_MODAL") + changementValeurDsMCF(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION",{"MODE_RIGIDE":"OUI"}) + renameMotCleInFact(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION","MODE_RIGIDE") + moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_FREQ","OPTION") + moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","OPTION") + + # chercheOperInsereFacteurSiRegle(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",((("METHODE",),"existe"),),1) + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","METHODE","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","TYPE_QZ","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","NMAX_ITER_BATHE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + + removeMotCleInFactSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE", + ((("SOLVEUR_MODAL","METHODE",["QZ"],jdc),"MCsousMCFnaPasPourValeurDansListe")or + (("SOLVEUR_MODAL","METHODE",),"nexistepasMCsousMCF"), + ) + ) + + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","APPROCHE","SOLVEUR_MODAL") + + lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") + + lMCLE=["NMAX_ITER_QR", "PREC_ORTHO", "NMAX_ITER_ORTHO", "PREC_LANCZOS"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") + + + renameCommande(jdc,"MODE_ITER_SIMULT","CALC_MODES", ) + + #### traitement de MODI_MAILLAGE ############################## + genereErreurValeurDsMCF(jdc,"MODI_MAILLAGE","DEFORME","OPTION",("'TRAN_APPUI'",)) + removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_APPUI"],pasDeRegle(),0) + removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_STRU"],pasDeRegle(),0) + + #### traitement de MODI_MODELE_XFEM ############################## + changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P1P1":"STANDARD",}) + changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P2P1":"STANDARD",}) + + + #### traitement de POST_DYNA_ALEA ############################## + chercheOperInsereFacteurSiRegle(jdc,"POST_DYNA_ALEA","INTERSPECTRE",((("INTE_SPEC",),"existe"),),1) + lPDA=["INTE_SPEC", "NUME_ORDRE_I", "NOEUD_I", "OPTION", "NUME_ORDRE_J", + "NOEUD_J", "NOM_CMP_I", "NOM_CMP_J", "MOMENT", "DUREE"] + for mcle in lPDA: + moveMotClefInOperToFact(jdc,"POST_DYNA_ALEA",mcle,"INTERSPECTRE") + removeMotCle(jdc,"POST_DYNA_ALEA","TOUT_ORDRE",pasDeRegle(),0) + + ajouteMotClefDansFacteur(jdc,"POST_DYNA_ALEA","FRAGILITE","METHODE = 'EMV'",pasDeRegle()) + + #### traitement de POST_ELEM ############################## + ajouteMotClefDansFacteurSiRegle(jdc,"POST_ELEM","VOLUMOGRAMME","NB_INTERV=5", + ((("VOLUMOGRAMME","NB_INTERV",),"nexistepasMCsousMCF"),),) + + #### traitement de POST_FATIGUE ############################## + changementValeur(jdc,"POST_FATIGUE","DOMMAGE",{"MANSON_C":"MANSON_COFFIN",}) + + #### traitement de POURSUITE ############################## + removeMotCle(jdc,"POURSUITE","CODE",)#"NOM",pasDeRegle(),0) + + #### traitement de RECU_FONCTION ############################## + genereErreurMCF(jdc,"RECU_FONCTION","TABLE") + + #### traitement de C_COMP_INCR et C_COMP_ELAS ############################## + lCOM=["CALCUL","STAT_NON_LINE","CALC_G", "CALC_PRECONT","DYNA_NON_LINE","CALC_META", + "TEST_COMPOR","SIMU_POINT_MAT","CALC_ESSAI_GEOMECA","CALC_FORC_NONL","LIRE_RESU", + "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_EUROPLEXUS","MACR_ECREVISSE",] + for com in lCOM: + # chercheOperInsereFacteurSiRegle(jdc,com,"COMPORTEMENT",(((["COMPORTEMENT"],),"nexistepasMCFParmi"),),1) + fusionMCFToMCF(jdc,com,["COMP_ELAS","COMP_INCR"],"COMPORTEMENT") + # renameMotCle(jdc,com,"COMP_ELAS","COMPORTEMENT") + # renameMotCle(jdc,com,"COMP_INCR","COMPORTEMENT") + chercheOperInsereFacteurSiRegle(jdc,com,"ETAT_INIT",((("COMPORTEMENT","SIGM_INIT",),"existeMCsousMCF"),),1) + moveMotCleFromFactToFact(jdc,com,"COMPORTEMENT","SIGM_INIT","ETAT_INIT") + renameMotCleInFact(jdc,com,"ETAT_INIT","SIGM_INIT","SIGM",pasDeRegle(),0) + removeMotCleInFact(jdc,com,"COMPORTEMENT","SIGM_INIT",pasDeRegle(),0) + + changementValeur(jdc,com,"OPTION",{"FORC_INT_ELEM":"FORC_INTE_ELEM"}) + + removeMotCleInFactSiRegle(jdc,com,"COMPORTEMENT","NB_VARI",((("COMPORTEMENT","RELATION","'MFRONT'",jdc),"MCsousMCFaPourValeur"),)) + + + #### traitement de TEST_COMPOR ############################## + genereErreurPourCommande(jdc,"TEST_COMPOR") + + #### traitement de THER_NON_LINE ############################## + renameMotCle(jdc,"THER_NON_LINE","COMP_THER_NL","COMPORTEMENT") + + #### traitement de C_SOLVEUR ############################## + lCOM=['CALC_ERREUR', 'CALC_FORC_AJOU', 'CALC_IFS_DNL', 'CALC_MATR_AJOU', 'CALC_PRECONT', + 'CREA_ELEM_SSD', 'DEFI_BASE_MODALE', 'DYNA_LINE_HARM', 'DYNA_LINE_TRAN', 'DYNA_NON_LINE', + 'DYNA_TRAN_MODAL', 'INFO_MODE', 'MACR_ASCOUF_CALC', 'MACR_ASPIC_CALC', 'MACRO_BASCULE_SCHEMA', + 'MACRO_MATR_AJOU', 'MECA_STATIQUE', 'MODE_ITER_SIMULT', 'MODE_ITER_INV', 'MODE_STATIQUE', + 'STAT_NON_LINE', 'THER_LINEAIRE', 'THER_NON_LINE', 'THER_NON_LINE_MO', 'CALC_ERC_DYN','CALC_MODES',] + for com in lCOM: + # Suppression de ELIM_LAGR2 + changementValeurDsMCF(jdc,com,"SOLVEUR","ELIM_LAGR2",{"OUI":"LAGR2"}) + removeMotCleInFactSiRegle(jdc,com,"SOLVEUR","ELIM_LAGR2",((("SOLVEUR","ELIM_LAGR2","NON",jdc),"MCsousMCFaPourValeur"),)) + renameMotCleInFact(jdc,com,"SOLVEUR","ELIM_LAGR2","ELIM_LAGR") + + # Suppression de la méthode FETI + genereErreurValeurDsMCF(jdc,com,"SOLVEUR","METHODE",["FETI"]) + lMCLE=["NB_REORTHO_DD","NMAX_ITER","INFO_FETI","RESI_RELA","PARTITION"] + for mocle in lMCLE: + genereErreurMotCleInFact(jdc,com,"SOLVEUR",mocle) + + #### traitement de DEFI_PART_FETI ############################## + genereErreurMCF(jdc,"DEFI_PART_FETI","EXCIT") + removeMotCle(jdc,"DEFI_PART_FETI","EXCIT",pasDeRegle(),0) + removeMotCle(jdc,"DEFI_PART_FETI","CORRECTION_CONNEX",pasDeRegle(),0) + genereErreurPourCommande(jdc,"DEFI_PART_FETI") + renameCommande(jdc,"DEFI_PART_FETI","DEFI_PARTITION", ) + + ################################################################# + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.OptionParser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier à traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + parser.add_option('-l','--logfile', dest="flog", default='log.txt', + help="fichier de log") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile,options.flog) + +if __name__ == '__main__': + main() diff --git a/Traducteur2/dictErreurs.py b/Traducteur2/dictErreurs.py new file mode 100644 index 00000000..82fc058f --- /dev/null +++ b/Traducteur2/dictErreurs.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur.load import jdcSet + + +def ecritErreur(listeGena,ligne=None) : + from sys import dict_erreurs + maCle="" + for Mot in listeGena : + maCle=maCle+"_"+Mot + #try : + if ( 1 == 1) : + maClef=maCle[1:] + if maClef in dict_erreurs : + if ligne != None : + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) + else : + logging.warning("%s",dict_erreurs[maClef]) + else : + maCle="" + for Mot in listeGena[:-1] : + maCle=maCle+"_"+Mot + maClef=maCle[1:] + maClef=maCle+"_"+"VALEUR" + if maClef in dict_erreurs : + if ligne != None : + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) + else : + logging.warning("%s",dict_erreurs[maClef]) + #except : + # pass + +def genereErreurPourCommande(jdc,listeCommande) : + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if type(listeCommande)==list: + for Mot in listeCommande : + if c.name != Mot :continue + ecritErreur((Mot,),c.lineno) + else: + if c.name != listeCommande :continue + ecritErreur((listeCommande,),c.lineno) + +def genereErreurMotCleInFact(jdc,command,fact,mocle): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle: + continue + else : + ecritErreur((command,fact,mocle,),c.lineno) + +def genereErreurMCF(jdc,command,fact): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact: + continue + else : + ecritErreur((command,fact,),c.lineno) + +def genereErreurValeur(jdc,command,fact,list_valeur): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + texte=mc.getText(jdc) + for valeur in list_valeur: + trouve=texte.find(valeur) + if trouve > -1 : + logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,mc.lineno) + +def genereErreurValeurDsMCF(jdc,command,fact,mocle,list_valeur): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + texte=n.getText(jdc) + for valeur in list_valeur: + trouve=texte.find(valeur) + if trouve > -1 : + logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,n.lineno) diff --git a/Traducteur2/edg_REP1300_FULL_PN.comm b/Traducteur2/edg_REP1300_FULL_PN.comm new file mode 100755 index 00000000..ee4744a9 --- /dev/null +++ b/Traducteur2/edg_REP1300_FULL_PN.comm @@ -0,0 +1,159 @@ + +REF=Assembly(assembly_type='REF',); + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map=((REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,U1,U1,U1,U1,U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); + +Genere_Une_Erreur_Traduction(essai='3',); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:f62a6f71fcde9f983479fc749f7e334c -:FIN CHECKSUM \ No newline at end of file diff --git a/Traducteur2/inseremocle.py b/Traducteur2/inseremocle.py new file mode 100644 index 00000000..19dc1ceb --- /dev/null +++ b/Traducteur2/inseremocle.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur.parseur import FactNode +from Traducteur.load import jdcSet +from Traducteur.dictErreurs import ecritErreur +from Traducteur import regles +debug=0 + + +#----------------------------------- +def insereMotCle(jdc,recepteur,texte): +#----------------------------------- +# appelle la methode selon la classe +# du recepteur + + if recepteur.name not in jdcSet : return + if recepteur.__class__.__name__ == "Command" : + if debug : print (" Ajout de ", texte, "dans la commande : " ,recepteur.name ) + insereMotCleDansCommande(jdc,recepteur,texte) + return + + +#-------------------------------------------- +def insereMotCleDansCommande(jdc,command,texte): +#--------------------------------------------- +# insere le texte comme 1er mot cle +# de la commande + if command.name not in jdcSet : return + if debug : print ("insereMotCle ", texte , " dans ", command.name) + numcol=chercheDebut1Mot(jdc,command) + if numcol > 0 : + jdc.splitLine(command.lineno,numcol) + indice = -1 + while texte[indice] == " " or texte[indice] == "\n": + indice = indice -1 + if texte[indice] != "," : texte=texte+"," + texteinfo=texte + texte=texte+'\n' + jdc.addLine(texte,command.lineno) + logging.info("Insertion de : %s ligne %d", texteinfo,command.lineno) + if numcol > 0 : # Les mots clefs etaient sur la meme ligne + jdc.joinLineandNext(command.lineno) + +#------------------------------------------------------------- +def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True): +#---------------------------------------------------------------- + if debug : print ("insereMotCle ", texte , " dans ", facteur.name) + + if texte[-1] == "\n" : texte=texte[0:-1] + ancien=jdc.getLine(facteur.lineno) + + # On va chercher la derniere ) pour ajouter avant + # on va verifier s il il y a un , avant + # si le texte ne finit pas par une "," + # on en met une + + indice = -1 + while texte[indice] == " " : + indice = indice -1 + if texte[indice] != "," : + texte=texte+"," + if (texte.find("#") > -1) and (texte.find("#") < texte.find(",")) : + texte=texte+"\n," + + texteinfo=texte + texte=texte+"\n" + + ligneaCouper=facteur.lineno + while ligneaCouper < facteur.endline + 1 : + trouve=0 + trouveF=0 + trouveP=0 + indiceDeCoupe=0 + while ancien.find("_F") > 0 : + longueur=len(ancien) + indice=ancien.find("_F") + indiceParcours=0 + # pour ne pas tenir compte des autres noms + # Attention si 2 MCF sur la meme ligne (la 1ere) + if trouveF == 0 : + if ((ligneaCouper!=facteur.lineno) or ((ancien.find(facteur.name) < indice ) or (ancien.find(facteur.name) < 0))) : + trouveF=1 + indiceParcours=indice + 2 + # attention pour regler DEFI_FONCTION .. + else : + indiceDeCoupe=indiceDeCoupe+indice+2 + ancien=ancien[indice +2:] + continue + if trouveF == 1 : + indiceDeCoupe=indiceDeCoupe+indice + # print "indice de Parcours" ,indiceParcours + # print ancien[indiceParcours] + # print ancien[indiceParcours+1] + # print ancien[indiceParcours+2] + while indiceParcours < longueur : + if ancien[indiceParcours] == "(" : + trouveP=1 + # print ("trouve". + break + if ancien[indiceParcours] != " " : + trouveP=0 + # print ("mouv") + break + indiceParcours = indiceParcours+1 + trouve = trouveP * trouveF + if trouve : break + ancien=ancien[indice+1:] + if trouve : + debut=indiceDeCoupe + 3 + if(jdc.getLine(ligneaCouper)[debut:]!="\n"): + jdc.splitLine(ligneaCouper,debut) + jdc.addLine(texte,ligneaCouper) + jdc.joinLineandNext(ligneaCouper) + logging.info("Insertion de %s ligne %d", texteinfo,ligneaCouper) + + # Gestion du cas particulier du mot clef facteur vide + if facteur.childNodes == []: + jdc.joinLineandNext(facteur.lineno) + + ligneaCouper=ligneaCouper+1 + ancien=jdc.getLine(ligneaCouper) + if not plusieursFois and trouve : break + + +#----------------------------------- +def chercheDebut1Mot(jdc,command): +#----------------------------------- +# Retourne le numero de colonne si le 1er mot clef est +# sur la meme ligne que le mot clef facteur +# -1 sinon + assert (command.childNodes != []) + debut=-1 + node1=command.childNodes[0] + if hasattr(node1,"lineno"): + if node1.lineno == command.lineno : + debut=node1.colno + else: + debut=chercheDebutFacteur(jdc,command) + if debut == -1 and debug : print ("attention!!! pb pour trouver le debut dans ", command) + return debut + +#----------------------------------- +def chercheDebutFacteur(jdc,facteur): +#----------------------------------- + debut=-1 + ligne=jdc.getLines()[facteur.lineno] + debut=ligne.find("_F") + if debut > -1 : debut=debut + 3 + return debut + + +#----------------------------------- +def chercheAlignement(jdc,command): +#----------------------------------- +# Retourne le nb de blanc +# pour aligner sur le 1er mot clef fils + assert (command.childNodes != []) + node1=command.childNodes[0] + nbBlanc=node1.colno + return " "*nbBlanc + +#--------------------------------------------------------------------------------------------------------- +def chercheOperInsereFacteur(jdc,nomcommande,nouveau,ensemble=regles.SansRegle, estunFacteur=1, erreur=0): +#-------------------------------------------------------------------------------------------------------- +# Cherche l oper +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + boolChange=0 + if estunFacteur : + texte=nouveau+"=_F()," + else : + texte=nouveau + if nomcommande not in jdcSet : return + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != nomcommande:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((nomcommande,nouveau),c.lineno) + boolChange=1 + insereMotCle(jdc,c,texte) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------------------------------------- +def chercheOperInsereFacteurSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): +#---------------------------------------------------------------------------------------- +# Cherche l oper +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) + +#---------------------------------------------------------------------------------------- +def chercheOperInsereMotCleSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=0): +#---------------------------------------------------------------------------------------- + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) + + +#--------------------------------------------------------------------------------------------------------- +def chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): +#--------------------------------------------------------------------------------------------------------- + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur,erreur=1) + +#------------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,ensemble=regles.SansRegle, estunFacteur=0): +#------------------------------------------------------------------------------------------------- +# Cherche la commande +# Cherche le MCF +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + if commande not in jdcSet : return + if estunFacteur : + texte=nouveau+"=_F()," + else : + texte=nouveau + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != commande : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + insereMotCleDansFacteur(jdc,mcF,texte) + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteurSiRegle(jdc,commande,fact,nouveau,liste_regles,estunFacteur=0): +#------------------------------------------------------------------------------------------- +# + if commande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,mesRegles,estunFacteur) + +#------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteurCourantSiRegle(jdc,commande,fact,nouveau,liste_regles): +#------------------------------------------------------------------------------------------- +# + if commande not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != commande : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + boolChange=1 + n=ll.childNodes[0] + ligneaCouper=n.lineno-1 + numcol=n.colno + jdc.splitLine(ligneaCouper+1,numcol) + texte=nouveau+",\n" + jdc.addLine(texte,ligneaCouper+1) + logging.info("Insertion de %s dans %s : ligne %d", nouveau,c.name,ligneaCouper+1) + if numcol > 0 : + jdc.joinLineandNext(ligneaCouper+1) + if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur2/load.py b/Traducteur2/load.py new file mode 100644 index 00000000..97128e83 --- /dev/null +++ b/Traducteur2/load.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +import re +from Traducteur import parseur +from Traducteur.mocles import parseKeywords + +import sets +jdcSet=sets.Set() + + +class JDCTrad: + """Cet objet conserve toutes les informations relatives a un fichier de commandes .comm""" + + def __init__(self,src,atraiter): + #---------------------------------------- + self.atraiter=atraiter + self.init(src,atraiter) + commands= self.root.childNodes[:] + commands.reverse() + for c in commands: + jdcSet.add(c.name) + + def init(self,src,atraiter): + #--------------------------- + # construction de self.lines + self.root=parseur.parser(src,atraiter) + self.lines=src.splitlines(1) + + def parseKeywords(self): + #----------------------- + # construction de fils (cf mocles.py) + parseKeywords(self.root) + + def reset(self,src): + #----------------------- + # reconstruction + self.init(src,self.atraiter) + self.parseKeywords() + + def getSource(self): + #----------------------- + # retourne la concatenation de + # toutes les lignes + return "".join(self.getLines()) + + def getLine(self,linenum): + #----------------------- + # retourne la linenumieme ligne + return self.getLines()[linenum-1] + + def getLines(self): + #---------------------------- + # retourne toutes les lignes + return self.lines + + def addLine(self,ligne,numero) : + #---------------------------- + # insere le texte contenu dans ligne + # dans la liste self.lines au rang numero + Ldebut=self.lines[0:numero] + Lmilieu=[ligne,] + Lfin=self.lines[numero:] + self.lines=Ldebut+Lmilieu+Lfin + + + def splitLine(self,numeroLigne,numeroColonne) : + #---------------------------------------------- + # coupe la ligne numeroLigne en 2 a numeroColonne + # ajoute des blancs en debut de 2nde Ligne pour + # aligner + numeroLigne = numeroLigne -1 + Ldebut=self.lines[0:numeroLigne] + if len(self.lines) > numeroLigne : + Lfin=self.lines[numeroLigne+1:] + else : + Lfin=[] + Lsplit=self.lines[numeroLigne] + LigneSplitDebut=Lsplit[0:numeroColonne]+"\n" + LigneSplitFin=" "*numeroColonne+Lsplit[numeroColonne:] + Lmilieu=[LigneSplitDebut,LigneSplitFin] + + self.lines=Ldebut+Lmilieu+Lfin + + def joinLineandNext(self,numeroLigne) : + #-------------------------------------- + # concatene les lignes numeroLigne et numeroLigne +1 + # enleve les blancs de debut de la ligne (numeroLigne +1) + Ldebut=self.lines[0:numeroLigne-1] + if len(self.lines) > numeroLigne : + Lfin=self.lines[numeroLigne+1:] + else : + Lfin=[] + + ligneMilieuDeb=self.lines[numeroLigne - 1 ] + ligneMilieuDeb=ligneMilieuDeb[0:-1] + ligneMilieuFin=self.lines[numeroLigne] + for i in range(len(ligneMilieuFin)): + if ligneMilieuFin[i] != " " : + ligneMilieuFin=ligneMilieuFin[i:] + break + Lmilieu=[ligneMilieuDeb+ligneMilieuFin,] + + self.lines=Ldebut+Lmilieu+Lfin + + def supLignes(self,debut,fin): + #------------------------ + Ldebut=self.lines[0:debut-1] + Lfin=self.lines[fin:] + self.lines=Ldebut+Lfin + + def remplaceLine(self,numeroLigne,nouveauTexte) : + #------------------------------------------------ + self.lines[numeroLigne]=nouveauTexte + +def getJDC(filename,atraiter): +#---------------------------- +# lit le JDC + f=open(filename) + src=f.read() + f.close() + jdc=JDCTrad(src,atraiter) + return jdc + +def getJDCFromTexte(texte,atraiter): +#----------------------------------- +# lit le JDC + jdc=JDCTrad(texte,atraiter) + return jdc diff --git a/Traducteur2/log.py b/Traducteur2/log.py new file mode 100644 index 00000000..21c4ab61 --- /dev/null +++ b/Traducteur2/log.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 os +logger=logging.getLogger() + +def initialise(flog=None): + if flog == None : + MonHome=os.environ['HOME'] + MaDir=MonHome+"/Eficas_install" + try : + os.mkdir(MaDir) + except : + pass + try : + os.listdir(MaDir) + flog=MaDir+"/convert.log" + except : + flog='/tmp/convert.log' + + hdlr=logging.FileHandler(flog,'w') + formatter = logging.Formatter('%(levelname)s: %(message)s') + hdlr.setFormatter(formatter) + logger.addHandler(hdlr) + logger.setLevel(logging.INFO) + return hdlr + + +def ferme (hdlr) : + logger.removeHandler(hdlr) diff --git a/Traducteur2/mocles.py b/Traducteur2/mocles.py new file mode 100644 index 00000000..ad5d9bd4 --- /dev/null +++ b/Traducteur2/mocles.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 compiler +import types +from Traducteur.parseur import Keyword, FactNode, lastParen, lastParen2,maskStringsAndComments +from Traducteur.visiteur import KeywordFinder, visitor +from Traducteur.utils import indexToCoordinates, lineToDict, dictToLine + +debug=0 + +#------------------------ +def parseFact(match,c,kw): +#------------------------ + submatch=match[2] + lastpar=match[0]+lastParen(c.src[match[0]:]) + if type(submatch[0][0]) ==types.IntType: + #mot cle facteur isole + no=FactNode() + kw.addChild(no) + for ii in range(len(submatch)-1): + e=submatch[ii] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,submatch[ii+1][0]) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + #last one + e=submatch[-1] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,lastpar-1) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + else: + #mot cle facteur multiple + ii=0 + for l in submatch: + lastpar=l[0][0]+lastParen2(c.src[l[0][0]:]) + ii=ii+1 + no=FactNode() + kw.addChild(no) + for j in range(len(l)-1): + e=l[j] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,l[j+1][0]) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + #last one + e=l[-1] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,lastpar-1) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + + +#----------------------- +def parseKeywords(root): +#----------------------- + """A partir d'un arbre contenant des commandes, ajoute les noeuds + fils correspondant aux mocles de la commande + """ + #print "parseKeywords" + #traceback.print_stack(limit=5) + + matchFinder=KeywordFinder() + + for c in root.childNodes: + maskedsrc=maskStringsAndComments(c.src) + #on supprime seulement les blancs du debut pour pouvoir compiler + #meme si la commande est sur plusieurs lignes seul le debut compte + ast=compiler.parse(c.src.lstrip()) + #print ast + #Ne pas supprimer les blancs du debut pour avoir les bons numeros de colonne + matchFinder.reset(maskedsrc) + visitor.walk(ast, matchFinder) + #print matchFinder.matches + if len(matchFinder.matches) > 1: + # plusieurs mocles trouves : + # un mocle commence au debut du keyword (matchFinder.matches[i][0]) + # et finit juste avant le keyword suivant + # (matchFinder.matches[i+1][0]]) + for i in range(len(matchFinder.matches)-1): + if debug:print "texte:",c.src[matchFinder.matches[i][0]:matchFinder.matches[i+1][0]] + x,y=indexToCoordinates(c.src,matchFinder.matches[i][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) + endline=y+c.lineno + endcol=x + if debug:print matchFinder.matches[i][0],matchFinder.matches[i][1],lineno,colno,endline,endcol + kw=Keyword(matchFinder.matches[i][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[i][2] + if submatch: + parseFact(matchFinder.matches[i],c,kw) + + # dernier mocle : + # il commence au debut du dernier keyword + # (matchFinder.matches[i+1][0]) et + # finit avant la parenthese fermante de la commande (c.lastParen) + + if debug:print "texte:",c.src[matchFinder.matches[i+1][0]:c.lastParen] + x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,c.lastParen) + endline=y+c.lineno + endcol=x + if debug:print matchFinder.matches[i+1][0],matchFinder.matches[i+1][1],lineno,colno,endline,endcol + kw=Keyword(matchFinder.matches[i+1][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[i+1][2] + if submatch: + parseFact(matchFinder.matches[i+1],c,kw) + + elif len(matchFinder.matches) == 1: + #un seul mocle trouve : + # il commence au debut du keyword (matchFinder.matches[0][0]) et + # finit juste avant la parenthese fermante de la + # commande (c.lastParen) + if debug:print "texte:",c.src[matchFinder.matches[0][0]:c.lastParen] + x,y=indexToCoordinates(c.src,matchFinder.matches[0][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,c.lastParen) + endline=y+c.lineno + endcol=x + if debug:print matchFinder.matches[0][0],matchFinder.matches[0][1],lineno,colno,endline,endcol + kw=Keyword(matchFinder.matches[0][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[0][2] + if submatch: + parseFact(matchFinder.matches[0],c,kw) + else: + pass diff --git a/Traducteur2/movemocle.py b/Traducteur2/movemocle.py new file mode 100644 index 00000000..b6b8d919 --- /dev/null +++ b/Traducteur2/movemocle.py @@ -0,0 +1,346 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur import removemocle +from Traducteur import inseremocle +from Traducteur.parseur import lastParen +from Traducteur.load import jdcSet +debug=0 + +#----------------------------------------------------- +def moveMotCleFromFactToFather(jdc,command,fact,mocle): +#----------------------------------------------------- +# exemple type : IMPR_GENE + + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + boolchange_c=0 + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + # test boolchange_c :il faut le faire une seule fois par commande sinon duplication du mot clé + if boolchange_c != 0 :continue + if debug : print "Changement de place :", n.name, n.lineno, n.colno + MonTexte=n.getText(jdc); + boolChange=1 + boolchange_c=1 + inseremocle.insereMotCle(jdc,c,MonTexte) + logging.info("Changement de place %s ligne %s ",n.name, n.lineno) + + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCleInFact(jdc,command,fact,mocle) + + +#---------------------------------------------------------------------------- +def moveMotCleFromFactToFactMulti(jdc,oper,factsource,mocle,liste_factcible): +#---------------------------------------------------------------------------- +# exemple type STAT_NON_LINE et RESI_INTER_RELA + for factcible in liste_factcible : + moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible) + removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) + + +#---------------------------------------------------------------------------- +def moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible): +#---------------------------------------------------------------------------- + if oper not in jdcSet : return + if debug : print "moveMotCleFromFactToFact pour " ,oper,factsource,mocle,factcible + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "cible non trouvée" + continue + + for mc in c.childNodes: + source=None + if mc.name != factsource: + continue + else : + source=mc + break + if source==None : + if debug : print "Pas de changement pour ", oper, " ", factsource, " ",mocle, "source non trouvée" + continue + + if debug : print "Changement pour ", oper, " ", factsource, " ",mocle, "cible et source trouvées" + l=source.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + MonTexte=n.getText(jdc); + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) + boolChange=1 + logging.info("Changement de place %s ligne %s vers %s",n.name, n.lineno, cible.name) + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) + + + + +#----------------------------------------------------------------------- +def moveMotClefInOperToFact(jdc,oper,mocle,factcible,plusieursFois=True): +#----------------------------------------------------------------------- +# Attention le cas type est THETA_OLD dans calc_G + + if oper not in jdcSet : return + if debug : print "movemocleinoper pour " ,oper,mocle,factcible + boolChange=9 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée" + continue + + source=None + for mc in c.childNodes: + if mc.name != mocle: + continue + else : + source=mc + break + if source==None : + if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée" + continue + MonTexte=source.getText(jdc); + boolChange=1 + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte,plusieursFois) + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCle(jdc,oper,mocle) + +#------------------------------------------------------ +def copyMotClefInOperToFact(jdc,oper,mocle,factcible): +#------------------------------------------------------ + + if oper not in jdcSet : return + if debug : print "movemocleinoper pour " ,oper,mocle,factcible + boolChange=9 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print "Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée" + continue + + source=None + for mc in c.childNodes: + if mc.name != mocle: + continue + else : + source=mc + break + if source==None : + if debug : print "Pas de changement pour ", oper, " ", mocle, " source non trouvée" + continue + MonTexte=source.getText(jdc); + boolChange=1 + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------------------- +def moveMCFToCommand(jdc,command,factsource,commandcible,factcible): +#---------------------------------------------------------------------- +# exemple CONTACT en 10 +# CONTACT devient commande DEFI_CONTACT/ZONE +# + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + for mcF in c.childNodes: + if mcF.name != factsource : continue + l=mcF.getText(jdc) + texte=l.replace(factsource,factcible) + texte='xxxx='+commandcible+'('+texte+')\n' + jdc.splitLine(c.lineno,0) + jdc.addLine(texte,c.lineno) + logging.info("Deplacement de %s dans %s ligne %s",factsource,commandcible,c.lineno) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + jdcSet.add(commandcible) + +#----------------------------------------------------- +def fusionMotCleToFact(jdc,command,listeMc,factcible,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + for mc in c.childNodes: + if mc.name not in listeMc : continue + val=mc.getText(jdc).split("=")[1].split(",")[0] + list_val.append(val) + trouveUnMC=1 + if trouveUnMC : + TexteMC=factcible+"=(" + for val in list_val : TexteMC=TexteMC+val+"," + TexteMC=TexteMC[:-1]+")," + inseremocle.insereMotCle(jdc,c,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mc in listeMc : + removemocle.removeMotCle(jdc,command,mc) + jdc.reset(jdc.getSource()) + +#----------------------------------------------------- +def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + for mcF in c.childNodes: + if mcF.name != fact: continue + for ll in mcF.childNodes[:]: + for mc in ll.childNodes: + if mc.name not in listeMc : continue + val=mc.getText(jdc).split("=")[1].split(",")[0] + list_val.append(val) + trouveUnMC=1 + if trouveUnMC : + TexteMC=new_name+"=("+",".join(list_val)+")," + inseremocle.insereMotCleDansFacteur(jdc,mcF,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mc in listeMc : + removemocle.removeMotCleInFact(jdc,command,fact,mc) + jdc.reset(jdc.getSource()) + +#----------------------------------------------------- +def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + TexteMC=factcible+'=(' + esp1=' '*len(TexteMC) + pp=0 + for mcF in c.childNodes: + if mcF.name not in listeMcF : continue + trouveUnMC=1 + val=mcF.getText(jdc) + # esp=esp1+(inseremocle.chercheDebutFacteur(jdc,mcF)-len(mcF.name))*' ' + esp=esp1+inseremocle.chercheAlignement(jdc,c) + # print len(esp) + for ll in mcF.childNodes[:]: + # if(pp>0): TexteMC+=esp + TexteMC+='_F(' + for mc in ll.childNodes: + val=mc.getText(jdc) + TexteMC+=val+'\n '+esp + # if('#' in val.split('\n')[-1]): TexteMC+='\n'+esp+' ' + lastkey = ''.join(val.split('=')[-1].split(' ')) + if((len(lastkey.split('(')) - len(lastkey.split(')'))) >= 0): + TexteMC += '),\n'+esp + # TexteMC+='),' + TexteMC+='),' + # print TexteMC + if(trouveUnMC): + inseremocle.insereMotCle(jdc,c,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mcF in listeMcF : + removemocle.removeMotCle(jdc,command,mcF) + jdc.reset(jdc.getSource()) + + + +#-------------------------------------------------------------------- +def eclaMotCleToFact(jdc,command,motcle,mot1,mot2,defaut=0): +#-------------------------------------------------------------------------- +# exemple STA10 pesanteur devient MCF avec eclatement des valeurs dans les MC +# On suppose que le MC est sur une seule ligne + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + trouveUnMC=0 + for mc in c.childNodes: + if mc.name != motcle : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + indexLigneGlob=mc.lineno-1 + MaLigneGlob=jdc.getLines()[indexLigneGlob] + Ligne=TexteMC.split('(')[1].split(')')[0].split(',') + motcle1=mot1+"="+Ligne[0] + motcle2=mot2+"=("+Ligne[1]+','+Ligne[2]+','+Ligne[3]+')' + texte=motcle+'=_F('+motcle1+','+motcle2+')' + num=lastParen(TexteMC) + Nouveau=MaLigneGlob.replace(TexteMC[0:num],texte) + jdc.getLines()[indexLigneGlob]=Nouveau + logging.info("Transformation de %s dans %s ligne %s",motcle,command,c.lineno) + boolChange=1 + if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur2/parseur.py b/Traducteur2/parseur.py new file mode 100644 index 00000000..3a525a2f --- /dev/null +++ b/Traducteur2/parseur.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re,string +import compiler + +debug=0 + +escapedQuotesRE = re.compile(r"(\\\\|\\\"|\\\')") +stringsAndCommentsRE = \ + re.compile("(\"\"\".*?\"\"\"|'''.*?'''|\"[^\"]*\"|\'[^\']*\'|#.*?\n)", re.DOTALL) +allchars = string.maketrans("", "") +allcharsExceptNewline = allchars[: allchars.index('\n')]+allchars[allchars.index('\n')+1:] +allcharsExceptNewlineTranstable = string.maketrans(allcharsExceptNewline, '*'*len(allcharsExceptNewline)) + +#------------------------------ +def maskStringsAndComments(src): +#------------------------------ + """Remplace tous les caracteres dans commentaires et strings par des * """ + + src = escapedQuotesRE.sub("**", src) + allstrings = stringsAndCommentsRE.split(src) + # every odd element is a string or comment + for i in xrange(1, len(allstrings), 2): + if allstrings[i].startswith("'''")or allstrings[i].startswith('"""'): + allstrings[i] = allstrings[i][:3]+ \ + allstrings[i][3:-3].translate(allcharsExceptNewlineTranstable)+ \ + allstrings[i][-3:] + else: + allstrings[i] = allstrings[i][0]+ \ + allstrings[i][1:-1].translate(allcharsExceptNewlineTranstable)+ \ + allstrings[i][-1] + + return "".join(allstrings) + +#un nombre queconque de blancs,un nom,des blancs +pattern_oper = re.compile(r"^\s*(.*?=\s*)?([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) +pattern_proc = re.compile(r"^\s*([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) + +implicitContinuationChars = (('(', ')'), ('[', ']'), ('{', '}')) +linecontinueRE = re.compile(r"\\\s*(#.*)?$") +emptyHangingBraces = [0,0,0,0,0] + +#-------------------------------------- +class UnbalancedBracesException: pass +#-------------------------------------- + +#----------- +class Node: +#----------- + def __init__(self): + self.childNodes=[] + + def addChild(self,node): + self.childNodes.append(node) + + +#------------------- +class FactNode(Node): +#------------------- + pass + + +#------------------- +class JDCNode(Node): +#------------------- + def __init__(self,src): + Node.__init__(self) + self.src=src + +#------------------- +class Command(Node): +#------------------- + def __init__(self,name,lineno,colno,firstparen): + Node.__init__(self) + self.name=name + self.lineno=lineno + self.colno=colno + self.firstparen=firstparen + +#------------------- +class Keyword(Node): +#------------------- + def __init__(self,name,lineno,colno,endline,endcol): + Node.__init__(self) + self.name=name + self.lineno=lineno + self.colno=colno + self.endline=endline + self.endcol=endcol + + def getText(self,jdc): + if self.endline > self.lineno: + debut=jdc.getLines()[self.lineno-1][self.colno:] + fin = jdc.getLines()[self.endline-1][:self.endcol] + texte=debut + lignecourante=self.lineno + while lignecourante < self.endline -1 : + texte = texte + jdc.getLines()[lignecourante] + lignecourante = lignecourante + 1 + if chaineBlanche(fin) == 0 : + texte=texte + fin + if texte[-1] == "\n" : + texte=texte[0:-1] + else: + texte = jdc.getLines()[self.lineno-1][self.colno:self.endcol] + return texte + +#------------------------- +def chaineBlanche(texte) : +#------------------------- +# retourne 1 si la chaine est composee de " " +# retourne 0 sinon + bool = 1 ; + for i in range(len(texte)) : + if texte[i] != " " : bool = 0 + return bool + +#------------------- +def printNode(node): +#------------------- + if hasattr(node,'name'): + print node.name + else: + print "pas de nom pour:",node + for c in node.childNodes: + printNode(c) + +#------------------------ +def parser(src,atraiter): +#------------------------ + """Parse le texte src et retourne un arbre syntaxique (root). + + Cet arbre syntaxique a comme noeuds (childNodes) les commandes a traiter (liste atraiter) + """ + lines=src.splitlines(1) + maskedSrc=maskStringsAndComments(src) + maskedLines=maskedSrc.splitlines(1) + + root=JDCNode(src) + + # (a) dans un premier temps on extrait les commandes et on les insere + # dans un arbre (root) les noeuds fils sont stockes dans + # root.childNodes (liste) + lineno=0 + for line in maskedLines: + lineno=lineno+1 + if debug:print "line",lineno,":",line + m=pattern_proc.match(line) + if m and (m.group(1) in atraiter): + if debug:print m.start(3),m.end(3),m.start(4) + root.addChild(Command(m.group(1),lineno,m.start(1),m.end(3))) + else: + m=pattern_oper.match(line) + if m and (m.group(2) in atraiter): + root.addChild(Command(m.group(2),lineno,m.start(2),m.end(4))) + + #(b) dans un deuxieme temps , on recupere le texte complet de la commande + # jusqu'a la derniere parenthese fermante + + # iterateur sur les lignes physiques masquees + iterlines=iter(maskedLines) + + linenum=0 + for c in root.childNodes: + lineno=c.lineno + colno=c.colno # debut de la commande + while linenum < lineno: + line=iterlines.next() + linenum=linenum+1 + if linenum != lineno: + if debug:print "line %s:"%linenum, line + tmp = [] + hangingBraces = list(emptyHangingBraces) + hangingComments = 0 + while 1: + # update hanging braces + for i in range(len(implicitContinuationChars)): + contchar = implicitContinuationChars[i] + numHanging = hangingBraces[i] + + hangingBraces[i] = numHanging+line.count(contchar[0]) - \ + line.count(contchar[1]) + + hangingComments ^= line.count('"""') % 2 + hangingComments ^= line.count("'''") % 2 + + if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0: + raise UnbalancedBracesException() + + if linecontinueRE.search(line): + tmp.append(lines[linenum-1]) + elif hangingBraces != emptyHangingBraces: + tmp.append(lines[linenum-1]) + elif hangingComments: + tmp.append(lines[linenum-1]) + else: + tmp.append(lines[linenum-1]) + src="".join(tmp) + c.src=src + c.endline=linenum + decal=len(line)-line.rindex(')') + c.lastParen=len(src)-decal + if debug:print "logical line %s %s:" % (c.lineno,c.endline),src + break + line=iterlines.next() + linenum=linenum+1 + + return root + + +#----------------- +def lastParen(src): +#----------------- + """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string + + La string doit contenir la premiere parenthese ouvrante + """ + + src=maskStringsAndComments(src) + level=0 + i,n=0,len(src) + while i < n: + ch=src[i] + i=i+1 + if ch in ('(','['): + level=level+1 + if ch in (')',']'): + if level == 0: + raise UnbalancedBracesException() + level=level-1 + if level == 0: + #derniere parenthese fermante + return i + +#------------------- +def lastParen2(src): +#------------------- + """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string + + La string ne contient pas la premiere parenthese ouvrante + """ + src=maskStringsAndComments(src) + level=1 + i,n=0,len(src) + while i < n: + ch=src[i] + i=i+1 + if ch in ('(','['): + level=level+1 + if ch in (')',']'): + if level == 0: + raise UnbalancedBracesException() + level=level-1 + if level == 0: + #derniere parenthese fermante + return i diff --git a/Traducteur2/regles.py b/Traducteur2/regles.py new file mode 100644 index 00000000..034844f7 --- /dev/null +++ b/Traducteur2/regles.py @@ -0,0 +1,524 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +Définition des règles +""" + +debug = 0 + +#-------------------- +class ensembleRegles : +#-------------------- + """ + Ensemble des règles + """ + def __init__(self, liste_regles): + self.liste = [] + for item in liste_regles : + args, clefRegle = item + r = regle(clefRegle, args) + self.liste.append(r) + + def verif(self, commande) : + """ + Vérification + """ + bool = 1 + for regle in self.liste : + result = regle.verif(commande) + bool = bool*result + return bool + +#-------------------------------- +class pasDeRegle(ensembleRegles): +#-------------------------------- + """ + Pas de règle + """ + def __init__(self) : + pass + + def verif (self, commande) : + """ + Vérification + """ + return 1 + + +#------------ +class regle : +#------------ + """ + Règle + """ + def __init__(self, clef_regle, args): + self.fonction = dictionnaire_regle[clef_regle] + self.list_args = args + self.bool = 0 + + def verif(self, commande): + """ + Vérification + """ + f = self.fonction(self.list_args) + return f.verif(commande) + +#--------------------- +class existeMCFParmi : +#--------------------- + """ + Existance du mot-clé facteur parmi la liste + """ + def __init__(self, list_arg): + self.listeMCF = list_arg + + def verif(self, commande) : + """ + Vérification + """ + bool = 0 + for c in commande.childNodes : + if c.name in self.listeMCF : + bool = 1 + break + return bool + +#--------------------- +class nexistepasMCFParmi(existeMCFParmi) : +#--------------------- + """ + Existance du mot-clé facteur parmi la liste + """ + def __init__(self, list_arg): + self.listeMCF = list_arg + + def verif(self, commande) : + """ + Vérification + """ + bool = existeMCFParmi.verif(self, commande) + if bool : return 0 + return 1 + +#---------------------- +class existeMCsousMCF : +#---------------------- + """ + Existance du mot-clé simple sous le mot-clé facteur + """ + def __init__(self, list_arg): + self.liste = list_arg + self.MCF = self.liste[0] + self.MC = self.liste[1] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + bool = 1 + return bool + +#---------------------- +class existeMCsousMCFcourant : +#---------------------- + """ + Existance du mot-clé simple sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + self.liste = list_arg + self.MC = self.liste[0] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + bool = 1 + return bool + +#----------------------------------------- +class nexistepasMCsousMCF(existeMCsousMCF): +#----------------------------------------- + """ + Absence du mot-clé simple sous le mot-clé facteur + """ + def __init__(self, list_arg): + existeMCsousMCF.__init__(self, list_arg) + + + def verif(self, commande): + """ + Vérification + """ + bool = existeMCsousMCF.verif(self, commande) + if bool : return 0 + return 1 + +#----------------------------------------- +class nexistepasMCsousMCFcourant(existeMCsousMCFcourant): +#----------------------------------------- + """ + Absence du mot-clé simple sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + existeMCsousMCFcourant.__init__(self, list_arg) + + + def verif(self, commande): + """ + Vérification + """ + bool = existeMCsousMCFcourant.verif(self, commande) + if bool : return 0 + return 1 + +#------------- +class existe : +#-------------- + """ + Existance du mot-clé simple + """ + def __init__(self, list_arg): + self.genea = list_arg + + def chercheMot(self, niveau, commande): + """ + Recherche du mot + """ + if commande == None : return 0 + if niveau == len(self.genea) : return 1 + texte = self.genea[niveau] + for c in commande.childNodes : + if c.name == texte : + niveau = niveau+1 + return self.chercheMot(niveau, c) + return None + + def verif(self, commande): + """ + Vérification + """ + bool = self.chercheMot(0, commande) + if bool == None : bool = 0 + return bool + +#------------- +class nexistepas : +#-------------- + """ + Absence du mot-clé simple + """ + def __init__(self, list_arg): + self.genea = list_arg + + def chercheMot(self, niveau, commande): + """ + Recherche du mot + """ + if commande == None : return 0 + if niveau == len(self.genea) : return 1 + texte = self.genea[niveau] + for c in commande.childNodes : + if c.name == texte : + niveau = niveau+1 + return self.chercheMot(niveau, c) + return None + + def verif(self, commande): + """ + Vérification + """ + bool = self.chercheMot(0, commande) + if bool : return 0 + return 1 + +#------------------------------- +class MCsousMCFaPourValeur : +#------------------------------ + """ + Égalité du mot-clé simple à une valeur sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==4) + self.genea = list_arg[0:-2] + self.MCF = list_arg[0] + self.MC = list_arg[1] + self.Val = list_arg[2] + self.Jdc = list_arg[3] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + +#------------------------------- +class MCsousMCFcourantaPourValeur : +#------------------------------ + """ + Égalité du mot-clé simple à une valeur sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.genea = list_arg[0:-1] + self.MC = list_arg[0] + self.Val = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + + +#----------------------------- +class MCsousMCFaPourValeurDansListe : +#---------------------------- + """ + Égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==4) + self.genea = list_arg[0:-2] + self.MCF = list_arg[0] + self.MC = list_arg[1] + self.LVal = list_arg[2] + self.Jdc = list_arg[3] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + for Val in self.LVal: + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------- +class MCsousMCFcourantaPourValeurDansListe : +#---------------------------- + """ + Égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.genea = list_arg[0:-1] + self.MC = list_arg[0] + self.LVal = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + for Val in self.LVal: + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCsousMCFcourantnaPasPourValeurDansListe(MCsousMCFcourantaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + MCsousMCFcourantaPourValeurDansListe.__init__(self, list_arg) + + + def verif(self, commande): + bool = MCsousMCFcourantaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +#----------------------------------------- +class MCsousMCFnaPasPourValeurDansListe(MCsousMCFaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + MCsousMCFaPourValeurDansListe.__init__(self, list_arg) + + + def verif(self, commande): + bool = MCsousMCFaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +#------------------------------ +class MCaPourValeur : +#------------------------------ + """ + Égalité du mot-clé à une valeur + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.MC = list_arg[0] + self.Val = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mc in commande.childNodes : + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCnaPasPourValeur(MCaPourValeur) : +#----------------------------------------- + """ + Non égalité du mot-clé à une valeur + """ + def __init__(self, list_arg): + MCaPourValeur.__init__(self, list_arg) + + def verif(self, commande): + """ + Vérification + """ + bool = MCaPourValeur.verif(self, commande) + if bool : return 0 + return 1 + +#------------------------------ +class MCaPourValeurDansListe : +#------------------------------ + """ + Égalité du mot-clé à une valeur dans une liste + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.MC = list_arg[0] + self.LVal = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mc in commande.childNodes : + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + #print "TexteMC=",type(TexteMC),TexteMC + #print "LVal=",type(self.LVal),self.LVal + for Val in self.LVal: + #print "Val=",type(Val),Val + #print "Find",TexteMC.find(Val) + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCnaPasPourValeurDansListe(MCaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé à une valeur dans une liste + """ + def __init__(self, list_arg): + MCaPourValeurDansListe.__init__(self, list_arg) + + def verif(self, commande): + """ + Vérification + """ + bool = MCaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +dictionnaire_regle = {"existe":existe, + "nexistepas":nexistepas, + "existeMCFParmi":existeMCFParmi, + "nexistepasMCFParmi":nexistepasMCFParmi, + "existeMCsousMCF":existeMCsousMCF, + "nexistepasMCsousMCF":nexistepasMCsousMCF, + "MCsousMCFaPourValeur":MCsousMCFaPourValeur, + "MCsousMCFaPourValeurDansListe":MCsousMCFaPourValeurDansListe, + "MCaPourValeur":MCaPourValeur, + "MCnaPasPourValeur":MCnaPasPourValeur, + "existeMCsousMCFcourant":existeMCsousMCFcourant, + "nexistepasMCsousMCFcourant":nexistepasMCsousMCFcourant, + "MCsousMCFcourantaPourValeur":MCsousMCFcourantaPourValeur, + "MCsousMCFcourantaPourValeurDansListe":MCsousMCFcourantaPourValeurDansListe, + "MCsousMCFcourantnaPasPourValeurDansListe":MCsousMCFcourantnaPasPourValeurDansListe, + "MCsousMCFnaPasPourValeurDansListe":MCsousMCFnaPasPourValeurDansListe, + "MCaPourValeurDansListe":MCaPourValeurDansListe, + "MCnaPasPourValeurDansListe":MCnaPasPourValeurDansListe} + + +SansRegle = pasDeRegle() diff --git a/Traducteur2/removemocle.py b/Traducteur2/removemocle.py new file mode 100644 index 00000000..6694cc1d --- /dev/null +++ b/Traducteur2/removemocle.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur import regles +from Traducteur.parseur import FactNode +from Traducteur.dictErreurs import ecritErreur +from Traducteur.load import jdcSet + +debug=0 +#debug=1 +#on n'a qu'un mocle par commande. On peut donc supprimer le mocle sans trop de precautions (a part iterer a l'envers sur les commandes) +#avant de supprimer un autre mocle, on remet a jour l'arbre syntaxique (lineno,colno,etc.) + + +#----------------------------------------------------------------------- +def removeMotCle(jdc,command,mocle,ensemble=regles.SansRegle,erreur = 0): +#----------------------------------------------------------------------- + #on itere sur les commandes a l'envers pour ne pas polluer les numeros de ligne avec les modifications + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != mocle:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((command,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,mc) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------- +def removeMotCleSiRegle(jdc,command,mocle,liste_regles) : +#------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCle(jdc,command,mocle,mesRegles,erreur=0) + +#---------------------------------------------------------------- +def removeMotCleSiRegleAvecErreur(jdc,command,mocle,liste_regles) : +#-------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCle(jdc,command,mocle,mesRegles,erreur=1) + +#---------------------------------------------------------------- +def removeMotCleAvecErreur(jdc,command,mocle) : +#-------------------------------------------------------------- + if command not in jdcSet : return + removeMotCle(jdc,command,mocle,erreur=1) + + +#-------------------------------------------------------------------- +def removeCommande(jdc,command,ensemble=regles.SansRegle,erreur=0): +#-------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if erreur : ecritErreur((command,),c.lineno) + jdc.supLignes(c.lineno,c.endline) + logging.warning("Suppression de %s ligne %s",c.name,c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------- +def removeCommandeSiRegle(jdc,command,liste_regles): +#------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeCommande(jdc,command,mesRegles,0) + +#------------------------------------------------------------- +def removeCommandeSiRegleAvecErreur(jdc,command,liste_regles): +#------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeCommande(jdc,command,mesRegles,1) + +#--------------------------------- +def removeMC(jdc,c,mc): +#--------------------------------- + if debug : print "Suppression de:",c.name,mc.name,mc.lineno,mc.colno,mc.endline,mc.endcol + logging.info("Suppression de %s dans %s ligne %d",mc.name,c.name,mc.lineno) + + if mc.endline > mc.lineno: + if debug:print "mocle sur plusieurs lignes--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:] + jdc.getLines()[mc.lineno-1]=jdc.getLines()[mc.lineno-1][:mc.colno] + jdc.getLines()[mc.endline-1]=jdc.getLines()[mc.endline-1][mc.endcol:] + + #attention : supprimer les lignes a la fin + jdc.getLines()[mc.lineno:mc.endline-1]=[] + else: + if debug:print "mocle sur une ligne--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:mc.endcol] + s=jdc.getLines()[mc.lineno-1] + jdc.getLines()[mc.lineno-1]=s[:mc.colno]+s[mc.endcol:] + fusionne(jdc,mc.lineno-1) + +#--------------------------------------------------------------------------------- +def removeMotCleInFact(jdc,command,fact,mocle,ensemble=regles.SansRegle,erreur=0): +#---------------------------------------------------------------------------------- + # on itere sur les commandes a l'envers pour ne pas polluer + # les numeros de ligne avec les modifications + if command not in jdcSet : return + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + l.reverse() + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((command,fact,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,n) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------------ +def removeMotCleInFactSiRegle(jdc,command,fact,mocle,liste_regles): +#------------------------------------------------------------------ + if command not in jdcSet : return + erreur=0 + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) + +#---------------------------------------------------------------------- +def removeMotCleInFactSiRegleAvecErreur(jdc,command,fact,mocle,liste_regles): +#---------------------------------------------------------------------- + if command not in jdcSet : return + erreur=1 + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) + + +#---------------------------------------------------------------------- +def removeMotCleInFactCourantSiRegle(jdc,command,fact,mocle,liste_regles,erreur=0): +#---------------------------------------------------------------------- + if command not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + for n in ll.childNodes: + if n.name != mocle:continue + if erreur : ecritErreur((command,fact,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,n) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------ +def fusionne(jdc,numLigne): +#------------------------------------------ +# fusionne la ligne numLigne et numLigne+1 +# si la ligne numLigne+1 ne contient que des parentheses +# fermantes +# et si la ligne numLigne ne contient pas par un "#" +# Attention a la difference de numerotation +# jdc.getLines()[numLigne] donne la ligne numLigne + 1 +# alors que joinLineandNext(numLigne) travaille sur le tableau + index=0 + texte=jdc.getLines()[numLigne] + fusion=1 + while (index < len(texte)) : + if texte[index] not in (" ",",",")",";","\n") : + fusion=0 + break + index=index+1 + + if fusion == 0 : return; + + texte=jdc.getLines()[numLigne -1] + if texte.find("#") < 0 : + fusion=1 + else : + fusion=0 + + if fusion : + jdc.joinLineandNext(numLigne) diff --git a/Traducteur2/renamemocle.py b/Traducteur2/renamemocle.py new file mode 100644 index 00000000..2372bf41 --- /dev/null +++ b/Traducteur2/renamemocle.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +from Traducteur.parseur import FactNode +from Traducteur.load import jdcSet +from Traducteur import regles +from Traducteur.dictErreurs import ecritErreur +#debug=1 +debug=0 + +#on n'a qu'un mocle par commande. +#en fin de traitement, on remet a jour l'arbre syntaxique (lineno,colno,etc.) + +#-------------------------------------------------------------------------------- +def renameMotCle(jdc,command,mocle,new_name, erreur=0,ensemble=regles.SansRegle): +#-------------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != mocle:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if debug:print "Renommage de:",c.name,mc.name,mc.lineno,mc.colno + if erreur : + ecritErreur((command,mocle),c.lineno) + else : + logging.info("Renommage de: %s %s ligne %d en %s",c.name,mc.name,mc.lineno,new_name) + s=jdc.getLines()[mc.lineno-1] + jdc.getLines()[mc.lineno-1]=s[:mc.colno]+new_name+s[mc.colno+len(mocle):] + diff=len(new_name) - len(mocle) + decaleLignesdeNBlancs(jdc,mc.lineno,mc.endline-1,diff) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------ +def renameMotCleAvecErreur(jdc,command,mocle,new_name): +#------------------------------------------------------ + if command not in jdcSet : return + renameMotCle(jdc,command,mocle,new_name,1,regles.SansRegle) + +#-------------------------------------------------------------------------- +def renameMotCleSiRegle(jdc,command,mocle,new_name,liste_regles, erreur=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameMotCle(jdc,command,mocle,new_name, erreur,mesRegles) + +#------------------------------------------- +def renameOper(jdc,command,new_name): +#------------------------------------------- + if command not in jdcSet : return + jdcSet.add(new_name) + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + if debug:print "Renommage de:",c.name,c.lineno,c.colno + logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) + boolChange=1 + s=jdc.getLines()[c.lineno-1] + jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] + diff=len(new_name) - len(command) + decaleLignesdeNBlancs(jdc,c.lineno,c.endline,diff) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------- +def decaleLignesdeNBlancs(jdc,premiere,derniere,nbBlanc): +#---------------------------------------------------------- + ligne = premiere + 1 + while ligne < derniere : + s=jdc.getLines()[ligne] + if nbBlanc > 0 : + jdc.getLines()[ligne] = nbBlanc*" " + s + else : + toutblancs=-1*nbBlanc*" " + if jdc.getLines()[ligne][0:-1*nbBlanc] == toutblancs: + jdc.getLines()[ligne] = s[-1*nbBlanc:] + ligne=ligne+1 + +#--------------------------------------------------------------------------------------------- +def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegle, erreur=0): +#--------------------------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + #on itere a l'envers + l.reverse() + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + if ensemble.verif(c) == 0 : continue + s=jdc.getLines()[n.lineno-1] + jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] + boolChange=1 + if erreur : + ecritErreur((command,fact,mocle),c.lineno) + else : + logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) + + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------- +def renameMotCleInFactSiRegle(jdc,command,fact,mocle,new_name,liste_regles): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameMotCleInFact(jdc,command,fact,mocle,new_name,mesRegles) + +def renameMotCleInFactCourantSiRegle(jdc,command,fact,mocle,new_name,liste_regles,erreur=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + #on itere a l'envers + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + for n in ll.childNodes: + if n.name != mocle:continue + s=jdc.getLines()[n.lineno-1] + jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] + boolChange=1 + if erreur : + ecritErreur((command,fact,mocle),c.lineno) + else : + logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) + + if boolChange : jdc.reset(jdc.getSource()) + + +#----------------------------------------------------------------- +def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle): +#----------------------------------------------------------------- +# nom de la commande "ancien format" , nom de la commande " nouveau format " + if command not in jdcSet : return + jdcSet.add(new_name) + boolChange=0 + if debug : + if ensemble != regles.SansRegle : + logging.info("traitement de %s renomme en %s sous conditions", command, new_name) + else : + logging.info("traitement de %s renomme en %s ", command, new_name) + for c in jdc.root.childNodes: + if c.name != command:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if debug:print "Renommage de:",c.name,new_name ,c.lineno,c.colno + logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) + s=jdc.getLines()[c.lineno-1] + jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] + + if boolChange : jdc.reset(jdc.getSource()) + +#----------------------------------------------------------- +def renameCommandeSiRegle(jdc,command,new_name,liste_regles): +#----------------------------------------------------------- + + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameCommande(jdc,command,new_name,mesRegles) diff --git a/Traducteur2/toto.comm b/Traducteur2/toto.comm new file mode 120000 index 00000000..d710d2b2 --- /dev/null +++ b/Traducteur2/toto.comm @@ -0,0 +1 @@ +edg_REP1300_FULL_PN.comm \ No newline at end of file diff --git a/Traducteur2/traduitV10V11.py b/Traducteur2/traduitV10V11.py new file mode 100755 index 00000000..f15f7b13 --- /dev/null +++ b/Traducteur2/traduitV10V11.py @@ -0,0 +1,1631 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV10V11.py --infile=xxxx --outfile=yyyy +""" + +import log +import optparse +import sys + +from Traducteur.load import getJDC +from Traducteur.mocles import parseKeywords +from Traducteur.removemocle import * +from Traducteur.renamemocle import * +from Traducteur.renamemocle import * +from Traducteur.inseremocle import * +from Traducteur.changeValeur import * +from Traducteur.movemocle import * +from Traducteur.dictErreurs import * +from Traducteur.regles import pasDeRegle + +atraiter=( + "AFFE_CARA_ELEM", + "AFFE_CHAR_MECA", + "AFFE_CHAR_MECA_F", + "AFFE_CHAR_OPS011", + "AFFE_CHAR_THER", + "AFFE_CHAR_THER_F", + "AFFE_MATERIAU", + "AFFE_MODELE", + "ASSE_ELEM_SSD", + "ASSEMBLAGE", + "CALC_CHAM_ELEM", + "CALC_CHAMP", + "CALC_ECREVISSE", + "CALC_ELEM", + "CALC_ERREUR", + "CALC_ESSAI", + "CALC_EUROPLEXUS", + "CALC_FATIGUE", + "CALC_FERRAILLAGE", + "CALC_FONC_INTERP", + "CALC_FONCTION", + "CALC_FORC_AJOU", + "CALC_G", + "CALC_IFS_DNL", + "CALC_INTE_SPEC", + "CALC_MAC3COEUR", + "CALC_MATR_AJOU", + "CALC_MATR_ELEM", + "CALC_META", + "CALC_MISS", + "CALC_MODAL", + "CALC_MODE_ROTATION", + "CALC_NO", + "CALC_POINT_MAT", + "CALC_PRECONT", + "CALC_SENSI", + "CALC_SPEC", + "CALC_TABLE", + "CALC_THETA", + "COMB_FOURIER", + "COMB_SISM_MODAL", + "COPIER", + "CREA_CHAMP", + "CREA_ELEM_SSD", + "CREA_MAILLAGE", + "CREA_RESU", + "CREA_TABLE", + "DEBUT", + "DEFI_BASE_MODALE", + "DEFI_CABLE_BP", + "DEFI_COMPOR", + "DEFI_CONTACT", + "DEFI_COQU_MULT", + "DEFI_FICHIER", + "DEFI_FISS_XFEM", + "DEFI_FONC_ELEC", + "DEFI_FOND_FISS", + "DEFI_GLRC", + "DEFI_GROUP", + "DEFI_INTE_SPEC", + "DEFI_LIST_INST", + "DEFI_MATER_GC", + "DEFI_MATERIAU", + "DEFI_NAPPE", + "DEFI_PARA_SENSI", + "DEFI_PART_FETI", + "DEFI_SOL_MISS", + "DEFI_SPEC_TURB", + "DETRUIRE", + "DYNA_ALEA_MODAL", + "DYNA_ISS_VARI", + "DYNA_LINE_HARM", + "DYNA_LINE_TRAN", + "DYNA_NON_LINE", + "DYNA_SPEC_MODAL", + "DYNA_TRAN_MODAL", + "DYNA_VIBRA", + "EXEC_LOGICIEL", + "EXTR_RESU", + "EXTR_TABLE", + "FACTORISER", + "FORMULE", + "GENE_ACCE_SEISME", + "GENE_FONC_ALEA", + "GENE_VARI_ALEA", + "IMPR_CO", + "IMPR_DIAG_CAMPBELL", + "IMPR_FONCTION", + "IMPR_GENE", + "IMPR_OAR", + "IMPR_RESU", + "IMPR_STURM", + "IMPR_TABLE", + "INCLUDE", + "INCLUDE_MATERIAU", + "INFO_EXEC_ASTER", + "INFO_FONCTION", + "INFO_MODE", + "LIRE_CHAMP", + "LIRE_FONCTION", + "LIRE_IMPE_MISS", + "LIRE_INTE_SPEC", + "LIRE_MAILLAGE", + "LIRE_RESU", + "LIRE_TABLE", + "MACR_ADAP_MAIL", + "MACR_ASCOUF_CALC", + "MACR_ASCOUF_MAIL", + "MACR_ASPIC_CALC", + "MACR_ASPIC_MAIL", + "MACR_CARA_POUTRE", + "MACR_ECLA_PG", + "MACR_ECRE_CALC", + "MACR_ECREVISSE", + "MACR_ELEM_DYNA", + "MACR_FIABILITE", + "MACR_FIAB_IMPR", + "MACR_INFO_MAIL", + "MACR_LIGN_COUPE", + "MACRO_ELAS_MULT", + "MACRO_EXPANS", + "MACRO_MATR_AJOU", + "MACRO_MATR_ASSE", + "MACRO_MISS_3D", + "MACRO_MODE_MECA", + "MACRO_PROJ_BASE", + "MACR_RECAL", + "MACR_SPECTRE", + "MECA_STATIQUE", + "MODE_ITER_INV", + "MODE_ITER_SIMULT", + "MODE_STATIQUE", + "MODI_MODELE_XFEM", + "MODI_REPERE", + "NORM_MODE", + "NUME_DDL", + "NUME_DDL_GENE", + "OBSERVATION", + "POST_BORDET", + "POST_CHAMP", + "POST_CHAM_XFEM", + "POST_COQUE", + "POST_DECOLLEMENT", + "POST_DYNA_ALEA", + "POST_ELEM", + "POST_ENDO_FISS", + "POST_FATIGUE", + "POST_GP", + "POST_K1_K2_K3", + "POST_K_TRANS", + "POST_MAC3COEUR", + "POST_MAIL_XFEM", + "POST_RCCM", + "POST_RELEVE_T", + "POST_RUPTURE", + "POST_USURE", + "POURSUITE", + "PROJ_BASE", + "PROJ_CHAMP", + "PROJ_RESU_BASE", + "PROJ_SPEC_BASE", + "PROPA_FISS", + "PROPA_XFEM", + "RAFF_XFEM", + "RECU_FONCTION", + "RECU_GENE", + "RESOUDRE", + "REST_SPEC_PHYS", + "SIMU_POINT_MAT", + "STANLEY", + "STAT_NON_LINE", + "TEST_COMPOR", + "TEST_FICHIER", + "TEST_FONCTION", + "TEST_RESU", + "TEST_TABLE", + "TEST_TEMPS", + "THER_LINEAIRE", + "THER_NON_LINE", + "THER_NON_LINE_MO", + + "CALC_CHAMPNO", + "CALC_METANO", + "CALC_ERREURNO", + + ) + +dict_erreurs={ + + "CALC_G_THETA_DTAN_ORIG":"La valeur de DTAN_ORIG est maintenant calculée automatiquement", + "CALC_G_THETA_DTAN_EXTR":"La valeur de DTAN_EXTR est maintenant calculée automatiquement", + "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la définition du CONTACT : nommer DEFI_CONTACT,verifier les paramètres globaux et le mettre dans le calcul", + "DEFI_COMPOR_MONOCRISTAL_FAMI_SYST_GLIS":"Famille de système de glissement supprimée : choisir une autre famille", + "DEFI_COMPOR_MULTIFIBRE_DEFORMATION":"Il faut maintenant renseigner le mot-clé DEFORMATION dans STAT_NON_LINE ou DYNA_NON_LINE.", + "DEFI_MATERIAU_ECRO_FLEJOU":"Le comportement ECRO_FLEJOU a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi d'écrouissage'.", + "DEFI_MATERIAU_VMIS_POUTRE":"Le comportement VMIS_POUTRE a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi plastique.", + "DEFI_MATERIAU_VMIS_POUTRE_FO":"Le comportement VMIS_POUTRE_FO a été supprimé. Il faut maintenant utiliser un modèle de poutre multifibres avec une loi plastique.", + "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_LEMAITRE_IRRA_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_LMARC_IRRA_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_LMARC_IRRA_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_LMARC_IRRA_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_A":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_B":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_GRAN_IRRA_LOG_GRAN_S":"Les paramètres de la loi de grandissement se définissent maintenant par une fonction avec GRAN_FO.", + "DEFI_MATERIAU_ENDO_SCALAIRE":"Les paramètres définissant la loi ENDO_SCALAIRE ont changé. Il faut renseigner les nouveaux paramètres.", + "DEFI_MATERIAU_MAZARS":"Le paramètres BETA définissant la loi MAZARS a été supprimé. Il faut renseigner le nouveau paramètre K.", + "DEFI_MATERIAU_MONO_VISC3":"Le comportement MONO_VISC3 a été supprimé.", + "DEFI_MATERIAU_MONO_DD_CC":"Le comportement MONO_DD_CC a été supprimé.", + "DYNA_LINE_TRAN_INCREMENT_FONC_INST":"Le mot-clé FONC_INST a été supprimé. Il faut maintenant utiliser ", + "LIRE_RESU_TYPE_RESU":"Il n'est plus possible de lire un résultat de type HARM_GENE. Il faut choisir un autre type.", + "MACRO_ELAS_MULT_CAS_CHARGE_OPTION":"Seule l'option SIEF_ELGA est permise pour MACRO_ELAS_MULT. Il faut calculer les autres options avec CALC_CHAMP.", + "MODI_MODELE_XFEM_CONTACT":"La formulation du contact aux arêtes P1P1A a été supprimée. Il faut choisir une autre formulation.", + "POST_GP":"La commande POST_GP a été supprimée. Il faut maintenant utiliser la commande CALC_GP.", + "AFFE_CARA_ELEM_COQUE_EPAIS_F":"Il n'est plus possible de faire d'analyse de sensibilité.", + "AFFE_CARA_ELEM_DISCRET_VALE_F":"Il n'est plus possible de faire d'analyse de sensibilité.", + "AFFE_CARA_ELEM_DISCRET_2D_VALE_F":"Il n'est plus possible de faire d'analyse de sensibilité.", + "CALC_CHAMP_REPE_COQUE":"Pour les éléments de structures, les résultats sont calculés sur tous les sous-points. Pour extraire un champ sur un seul sous-point, il faut utiliser POST_CHAMP.", + "CALC_THETA_THETA_BANDE":"L'option THETA_BANDE n'existe plus, il faut choisir entre THETA_2D ou THETA_3D." + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + genereErreurPourCommande(jdc,("CALC_SENSI",)) + + + #### traitement des cas particuliers ############################## + # On ne traite pas les commandes TEST* + removeCommande(jdc,"TEST_COMPOR") + removeCommande(jdc,"TEST_FICHIER") + removeCommande(jdc,"TEST_FONCTION") + removeCommande(jdc,"TEST_RESU") + removeCommande(jdc,"TEST_TABLE") + removeCommande(jdc,"TEST_TEMPS") + + #### traitement de AFFE_CARA_ELEM ############################## + # Déplacement de PREC_AIRE et PREC_INERTIE dans MULTIFIBRE + moveMotCleFromFactToFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_AIRE","MULTIFIBRE") + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_AIRE",pasDeRegle(),0) + moveMotCleFromFactToFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_INERTIE","MULTIFIBRE") + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","POUTRE","PREC_INERTIE",pasDeRegle(),0) + # Résorption de la sensibilité + genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","COQUE","EPAIS_F") + genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET","VALE_F") + genereErreurMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET_2D","VALE_F") + # Suppression de GRILLE_NCOU + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","GRILLE","GRILLE_NCOU",pasDeRegle(),0) + # Suppression de ORIG_AXE + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","GRILLE","ORIG_AXE",pasDeRegle(),0) + + #### traitement de AFFE_CHAR_MECA/_F ############################## + renameMotCle(jdc,"AFFE_CHAR_MECA","SIGM_INTERNE","PRE_SIGM") + renameMotCle(jdc,"AFFE_CHAR_MECA","EPSI_INIT","PRE_EPSI") + renameMotCle(jdc,"AFFE_CHAR_MECA_F","SIGM_INTERNE","PRE_SIGM") + renameMotCle(jdc,"AFFE_CHAR_MECA_F","EPSI_INIT","PRE_EPSI") + + #### traitement de AFFE_CHAR_OPS011 ############################## + genereErreurPourCommande(jdc,("AFFE_CHAR_OPS011",)) + + #### traitement de AFFE_CHAR_THER/_F ############################## + renameMotCle(jdc,"AFFE_CHAR_THER","GRAD_TEMP_INIT","PRE_GRAD_TEMP") + renameMotCle(jdc,"AFFE_CHAR_THER_F","GRAD_TEMP_INIT","PRE_GRAD_TEMP") + + #### traitement de AFFE_MATERIAU ############################## + # VALE_REF obligatoire si NOM_VARC in ('TEMP', 'SECH') + lNOMVARC=["CORR","IRRA","HYDR","EPSA","M_ACIER","M_ZIRC","NEUT1","NEUT2"] + removeMotCleInFactSiRegle(jdc,"AFFE_MATERIAU","AFFE_VARC","VALE_REF",((("NOM_VARC",lNOMVARC,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) + # renommage CHAMP_GD en CHAM_GD + renameMotCleInFact(jdc,"AFFE_MATERIAU","AFFE_VARC","CHAMP_GD","CHAM_GD",pasDeRegle(),0) + + #### traitement de AFFE_MODELE ############################## + dXFEMCONT={"3D_XFEM_CONT":"3D","C_PLAN_XFEM_CONT":"C_PLAN","D_PLAN_XFEM_CONT":"D_PLAN"} + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dXFEMCONT) + + #### traitement de ASSE_ELEM_SSD ############################## + # Rien à faire + + #### traitement de ASSEMBLAGE ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de C_COMP_INCR ############################## + # Suppression de ALGO_C_PLAN et ALGO_1D + lCOMMANDE=["CALC_FORC_NONL","CALC_IFS_DNL","CALC_POINT_MAT", + "CALC_PRECONT","CALCUL","DYNA_NON_LINE","LIRE_RESU", + "MACR_ECREVISSE","SIMU_POINT_MAT","STAT_NON_LINE", + "TEST_COMPOR",] + for com in lCOMMANDE : + removeMotCleInFact(jdc,com,"COMP_INCR","ALGO_C_PLAN",pasDeRegle(),0) + removeMotCleInFact(jdc,com,"COMP_INCR","ALGO_1D",pasDeRegle(),0) + renameMotCleInFact(jdc,com,"COMP_INCR","RESI_DEBO_MAXI","RESI_CPLAN_MAXI",pasDeRegle(),0) + renameMotCleInFact(jdc,com,"COMP_INCR","RESI_DEBO_RELA","RESI_CPLAN_RELA",pasDeRegle(),0) + renameMotCleInFact(jdc,com,"COMP_INCR","ITER_MAXI_DEBORST","ITER_CPLAN_MAXI",pasDeRegle(),0) + + #### traitement de C_NEWTON ############################## + # Renommage de EXTRAPOL en EXTRAPOLE + lCOMMANDE=["CALC_IFS_DNL","CALC_POINT_MAT","CALC_PRECONT", + "DYNA_NON_LINE","MACR_ASCOUF_CALC","MACR_ASPIC_CALC", + "SIMU_POINT_MAT","STAT_NON_LINE","TEST_COMPOR",] + dPRED={"EXTRAPOL":"EXTRAPOLE"} + for com in lCOMMANDE : + changementValeurDsMCF(jdc,com,"NEWTON","PREDICTION",dPRED) + + #### traitement de C_SOLVEUR ############################## + # Renommage de EXTRAPOL en EXTRAPOLE + lCOMMANDE=["CALC_ELEM","CALC_FORC_AJOU","CALC_IFS_DNL", + "CALC_MATR_AJOU","CALC_PRECONT","CREA_ELEM_SSD", + "DEFI_BASE_MODALE","DYNA_LINE_HARM","DYNA_LINE_HARM", + "DYNA_LINE_TRAN","DYNA_NON_LINE","DYNA_TRAN_MODAL", + "IMPR_STURM","MACR_ASCOUF_CALC","MACR_ASPIC_CALC", + "MACRO_ELAS_MULT","MACRO_MATR_AJOU","MACRO_MATR_ASSE", + "MECA_STATIQUE","MODE_ITER_INV","MODE_ITER_INV", + "MODE_ITER_SIMULT","MODE_ITER_SIMULT","MODE_STATIQUE", + "STAT_NON_LINE","THER_LINEAIRE","THER_NON_LINE","THER_NON_LINE_MO",] + dPRED={"EXTRAPOL":"EXTRAPOLE"} + for com in lCOMMANDE : + removeMotCleInFact(jdc,com,"SOLVEUR","OUT_OF_CORE",pasDeRegle(),0) + removeMotCleInFact(jdc,com,"SOLVEUR","LIBERE_MEMOIRE",pasDeRegle(),0) + + #### traitement de CALC_CHAMP ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de CALC_ECREVISSE ############################## + # Rien à faire + + #### traitement de CALC_ELEM ############################## + # renommage de la commande + renameCommande(jdc,"CALC_ELEM","CALC_CHAMP", ) + # Suppression des types de charges + removeMotCleInFact(jdc,"CALC_CHAMP","EXCIT","TYPE_CHARGE",pasDeRegle(),0) + # Suppression des types d'option' + removeMotCle(jdc,"CALC_CHAMP","TYPE_OPTION",pasDeRegle(),0) + # Redistribution des options de calcul + ## dictionnaire contenant les options + lTOUT=["SIEF_ELNO","SIGM_ELNO","SIEF_ELGA", + "SIPO_ELNO","EFGE_ELNO","EFCA_ELNO","SICA_ELNO", + "SIRO_ELEM","SIPM_ELNO","SIRO_ELEM", + "EFCA_ELNO","SIPO_ELNO","SIPM_ELNO", + "EPTU_ELNO","SITU_ELNO","SICO_ELNO", + "EPSI_ELNO","EPSI_ELGA","EPSG_ELNO","EPSG_ELGA", + "EPME_ELNO","EPME_ELGA","EPMG_ELNO","EPMG_ELGA", + "DEGE_ELNO","EPTU_ELNO", + "EPSP_ELNO","EPSP_ELGA", + "EPFD_ELNO","EPFD_ELGA","EPVC_ELNO","EPVC_ELGA", + "EPFP_ELNO","EPFP_ELGA", + "EPOT_ELEM","ECIN_ELEM","ENEL_ELGA","ENEL_ELNO", + "ETOT_ELGA","ETOT_ELNO","ETOT_ELEM","DISS_ELGA","DISS_ELNO", + "SIEQ_ELNO","SIEQ_ELGA","CRIT_ELNO","EPEQ_ELNO","EPEQ_ELGA","EPMQ_ELNO","EPMQ_ELGA", + "ENDO_ELGA","ENDO_ELNO","SITQ_ELNO","EPTQ_ELNO","INDL_ELGA","DERA_ELNO","DERA_ELGA", + "SITQ_ELNO","EPTQ_ELNO", + "VARI_ELNO","VATU_ELNO","VACO_ELNO","VARC_ELGA", + "VAEX_ELGA","VAEX_ELNO", + "FLHN_ELGA", + "FLUX_ELGA","FLUX_ELNO","SOUR_ELGA", + "INTE_ELNO","PRAC_ELNO", + "SIZ1_NOEU","ERZ1_ELEM","SIZ2_NOEU","ERZ2_ELEM", + "ERME_ELEM","ERME_ELNO","ERTH_ELEM","ERTH_ELNO", + "QIRE_ELEM","QIRE_ELNO","QIZ1_ELEM","QIZ2_ELEM", + "SING_ELEM","SING_ELNO", + "DURT_ELNO"] + lCONTRAINTE=["SIEF_ELNO","SIGM_ELNO","SIEF_ELGA", + "SIPO_ELNO","EFGE_ELNO","EFCA_ELNO","SICA_ELNO", + "SIRO_ELEM","SIPM_ELNO","SIRO_ELEM", + "EFCA_ELNO","SIPO_ELNO","SIPM_ELNO", + "EPTU_ELNO","SITU_ELNO","SICO_ELNO",] + lDEFORMATION=["EPSI_ELNO","EPSI_ELGA","EPSG_ELNO","EPSG_ELGA", + "EPME_ELNO","EPME_ELGA","EPMG_ELNO","EPMG_ELGA", + "DEGE_ELNO","EPTU_ELNO", + "EPSP_ELNO","EPSP_ELGA", + "EPFD_ELNO","EPFD_ELGA","EPVC_ELNO","EPVC_ELGA", + "EPFP_ELNO","EPFP_ELGA",] + lENERGIE=["EPOT_ELEM","ECIN_ELEM","ENEL_ELGA","ENEL_ELNO", + "ETOT_ELGA","ETOT_ELNO","ETOT_ELEM","DISS_ELGA","DISS_ELNO",] + lCRITERES=["SIEQ_ELNO","SIEQ_ELGA","CRIT_ELNO","EPEQ_ELNO","EPEQ_ELGA","EPMQ_ELNO","EPMQ_ELGA", + "ENDO_ELGA","ENDO_ELNO","SITQ_ELNO","EPTQ_ELNO","INDL_ELGA","DERA_ELNO","DERA_ELGA", + "SITQ_ELNO","EPTQ_ELNO"] + lVARI_INTERNE=["VARI_ELNO","VATU_ELNO","VACO_ELNO","VARC_ELGA", + "VAEX_ELGA","VAEX_ELNO",] + lHYDRAULIQUE=["FLHN_ELGA",] + lTHERMIQUE=["FLUX_ELGA","FLUX_ELNO","SOUR_ELGA",] + lACOUSTIQUE=["INTE_ELNO","PRAC_ELNO"] + lERREUR=["SIZ1_NOEU","ERZ1_ELEM","SIZ2_NOEU","ERZ2_ELEM", + "ERME_ELEM","ERME_ELNO","ERTH_ELEM","ERTH_ELNO", + "QIRE_ELEM","QIRE_ELNO","QIZ1_ELEM","QIZ2_ELEM", + "SING_ELEM","SING_ELNO",] + lMETA=["DURT_ELNO"] + #SPMX_ELGA / NOM_CHAM / NOM_CMP + ## Erreur pour les options supprimées + genereErreurValeur(jdc,"CALC_ELEM","OPTION",("'SICA_ELNO'","'EFCA_ELNO'","'PMPB_ELNO'","'PMPB_ELGA'",)) + lCHANOPT={"SICO_ELNO":"SIGM_ELNO","EPTU_ELNO":"EPSI_ELNO","SITU_ELNO":"SIGM_ELNO","SITQ_ELNO":"SIGM_ELNO","EPTQ_ELNO":"EPSI_ELNO"} + changementValeur(jdc,"CALC_ELEM","OPTION",lCHANOPT) + ## copie de OPTION dans MCF TEMPORAIRE pour chaque type + chercheOperInsereFacteur(jdc,"CALC_CHAMP","TEMPORAIRE") + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","CONTRAINTE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","DEFORMATION",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ENERGIE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","CRITERES",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","VARI_INTERNE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","HYDRAULIQUE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","THERMIQUE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ACOUSTIQUE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","ERREUR",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMP","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMP","TEMPORAIRE","OPTION","META",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMP","OPTION",pasDeRegle(),0) + ## déplacement au premier niveau de mot-clés + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","CONTRAINTE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","DEFORMATION") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ENERGIE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","CRITERES") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","VARI_INTERNE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","HYDRAULIQUE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","THERMIQUE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ACOUSTIQUE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","ERREUR") + moveMotCleFromFactToFather(jdc,"CALC_CHAMP","TEMPORAIRE","META") + ## suppression des mot-clés s'ils ne contiennent pas d'options à traiter + removeMotCleSiRegle(jdc,"CALC_CHAMP","CONTRAINTE",((("CONTRAINTE",lCONTRAINTE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","DEFORMATION",((("DEFORMATION",lDEFORMATION,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","ENERGIE",((("ENERGIE",lENERGIE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","CRITERES",((("CRITERES",lCRITERES,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","VARI_INTERNE",((("VARI_INTERNE",lVARI_INTERNE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","HYDRAULIQUE",((("HYDRAULIQUE",lHYDRAULIQUE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","THERMIQUE",((("THERMIQUE",lTHERMIQUE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","ACOUSTIQUE",((("ACOUSTIQUE",lACOUSTIQUE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","ERREUR",((("ERREUR",lERREUR,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMP","META",((("META",lMETA,jdc),"MCnaPasPourValeurDansListe"),)) + ## suppression des valeurs non-licites + suppressionValeurs(jdc,"CALC_CHAMP","CONTRAINTE",list(set(lTOUT)-set(lCONTRAINTE))) + suppressionValeurs(jdc,"CALC_CHAMP","DEFORMATION",list(set(lTOUT)-set(lDEFORMATION))) + suppressionValeurs(jdc,"CALC_CHAMP","ENERGIE",list(set(lTOUT)-set(lENERGIE))) + suppressionValeurs(jdc,"CALC_CHAMP","CRITERES",list(set(lTOUT)-set(lCRITERES))) + suppressionValeurs(jdc,"CALC_CHAMP","VARI_INTERNE",list(set(lTOUT)-set(lVARI_INTERNE))) + suppressionValeurs(jdc,"CALC_CHAMP","HYDRAULIQUE",list(set(lTOUT)-set(lHYDRAULIQUE))) + suppressionValeurs(jdc,"CALC_CHAMP","THERMIQUE",list(set(lTOUT)-set(lTHERMIQUE))) + suppressionValeurs(jdc,"CALC_CHAMP","ACOUSTIQUE",list(set(lTOUT)-set(lACOUSTIQUE))) + suppressionValeurs(jdc,"CALC_CHAMP","ERREUR",list(set(lTOUT)-set(lERREUR))) + suppressionValeurs(jdc,"CALC_CHAMP","META",list(set(lTOUT)-set(lMETA))) + ## ajout CALC_META ou CALC_ERREUR + lMOTCLE=[] + lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS", + "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"] + ### traitement métallurgie + llistMETA=[] + llistMETA=list(lMOTCLE) + llistMETA.extend(["META",]) + for mc in llistMETA : + copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE") + moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_META","TEMPORAIRE") + for mc in llistMETA : + moveMotCleFromFactToFather(jdc,"CALC_META","TEMPORAIRE",mc) + removeCommandeSiRegle(jdc,"CALC_META",((("META","COMP_INCR","ETAT_INIT"),"nexistepasMCFParmi"),)) + renameMotCle(jdc,"CALC_META","META","OPTION") + removeMotCle(jdc,"CALC_META","TEMPORAIRE",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMP","TEMPORAIRE",pasDeRegle(),0) + ### traitement calcul d'erreur + llistERREUR=[] + llistERREUR=list(lMOTCLE) + llistERREUR.extend(["ERREUR","SOLVEUR","RESU_DUAL","PREC_ESTI","TYPE_ESTI"]) + for mc in llistERREUR : + copyMotClefInOperToFact(jdc,"CALC_CHAMP",mc,"TEMPORAIRE") + moveMCFToCommand(jdc,"CALC_CHAMP","TEMPORAIRE","CALC_ERREUR","TEMPORAIRE") + for mc in llistERREUR : + moveMotCleFromFactToFather(jdc,"CALC_ERREUR","TEMPORAIRE",mc) + removeCommandeSiRegle(jdc,"CALC_ERREUR",((("ERREUR"),"nexistepasMCFParmi"),)) + renameMotCle(jdc,"CALC_ERREUR","ERREUR","OPTION") + removeMotCle(jdc,"CALC_ERREUR","TEMPORAIRE",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMP","TEMPORAIRE",pasDeRegle(),0) + ### traitement de REPE_COQUE + removeMotCle(jdc,"CALC_CHAMP","REPE_COQUE",pasDeRegle(),1) + ## ménage final + removeCommandeSiRegle(jdc,"CALC_CHAMP",((("CONTRAINTE","DEFORMATION","ENERGIE","CRITERES","VARI_INTERNE","HYDRAULIQUE","THERMIQUE","ACOUSTIQUE"),"nexistepasMCFParmi"),)) + removeMotCle(jdc,"CALC_CHAMP","META",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMP","ERREUR",pasDeRegle(),0) + + #### traitement de CALC_ERREUR ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de CALC_ESSAI ############################## + # Rien à faire + + #### traitement de CALC_EUROPLEXUS ############################## + # Rien à faire + + #### traitement de CALC_FATIGUE ############################## + # Rien à faire + + #### traitement de CALC_FERRAILLAGE ############################## + # Rien à faire + + #### traitement de CALC_FONCTION ############################## + # Rien à faire + + #### traitement de CALC_FORC_AJOU ############################## + # Rien à faire + + #### traitement de CALC_G ############################## + # Suppression SYME_CHAR + removeMotCle(jdc,"CALC_G","SYME_CHAR",pasDeRegle(),0) + # Règle sur DEGRE + removeMotCleInFactSiRegle(jdc,"CALC_G","LISSAGE","DEGRE",((("LISSAGE_THETA","LEGENDRE",jdc),"MCnaPasPourValeur")or(("LISSAGE_G","LEGENDRE",jdc),"MCnaPasPourValeur"),)) + # Suppression de DTAN_ORIG et DTAN_EXTR pour calcul automatique + removeMotCleInFact(jdc,"CALC_G","THETA","DTAN_ORIG",pasDeRegle(),1) + removeMotCleInFact(jdc,"CALC_G","THETA","DTAN_EXTR",pasDeRegle(),1) + # Résorption de la sensibilité + removeMotCle(jdc,"CALC_G","SENSIBILITE",pasDeRegle(),0) + # Restriction de ETAT_INIT à SIGM_INIT sous COMP_INCR + moveMotCleFromFactToFact(jdc,"CALC_G","ETAT_INIT","SIGM","COMP_INCR") + renameMotCleInFact(jdc,"CALC_G","COMP_INCR","SIGM","SIGM_INIT",pasDeRegle(),0) + removeMotCleInFactSiRegle(jdc,"CALC_G","COMP_INCR","SIGM_INIT",((("RELATION","ELAS",jdc),"MCnaPasPourValeur"),)) + removeMotCle(jdc,"CALC_G","ETAT_INIT",pasDeRegle(),0) + # Renommage de l'option K_G_MODA en CALC_K_G + changementValeur(jdc,"CALC_G","OPTION",{"K_G_MODA":"CALC_K_G",}) + # Suppression de EXCIT dans le cas elas_mult + removeMotCleSiRegle(jdc,"CALC_G","EXCIT",((("NOM_CAS",),"existe"),)) + # Ajout règle UN_PARMI('THETA','FOND_FISS','FISSURE') + removeMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA",((("THETA","FOND_FISS",),"existeMCsousMCF"),)) + removeMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA",((("THETA","FISSURE",),"existeMCsousMCF"),)) + + #### traitement de CALC_IFS_DNL ############################## + # Renommage CRIT_FLAMB en CRIT_STAB + renameMotCle(jdc,"CALC_IFS_DNL","CRIT_FLAMB","CRIT_STAB") + removeMotCleInFact(jdc,"CALC_IFS_DNL","CRIT_FLAMB","INST_CALCUL",pasDeRegle(),1) + # Résorption de la sensibilité + removeMotCle(jdc,"CALC_IFS_DNL","SENSIBILITE",pasDeRegle(),0) + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"CALC_IFS_DNL","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de CALC_INTE_SPEC ############################## + # Rien à faire + + #### traitement de CALC_MAC3COEUR ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de CALC_MATR_AJOU ############################## + # Suppression d'algo pour PETSc + removeMotCleSiRegle(jdc,"RESOUDRE","ALGORITHME",((("BCGS","BICG","TFQMR",),"MCaPourValeur"),)) + + #### traitement de CALC_MATR_ELEM ############################## + # Rien à faire + + #### traitement de CALC_META ############################## + # OPTION est obligatoire + chercheOperInsereFacteurSiRegle(jdc,"CALC_META","OPTION='META_ELNO'",((("OPTION",),"nexistepas"),),0) + + #### traitement de CALC_MISS ############################## + # Suppression de TYPE_CHARGE + removeMotCle(jdc,"CALC_MISS","TYPE_CHARGE",pasDeRegle(),0) + + #### traitement de CALC_MODAL ############################## + # renommage de STOP_FREQ_VIDE + renameMotCle(jdc,"CALC_MODAL","STOP_FREQ_VIDE","STOP_BANDE_VIDE") + + #### traitement de CALC_MODE_ROTATION ############################## + # renommage de MATR_A et MATR_B + renameMotCle(jdc,"CALC_MODE_ROTATION","MATR_A","MATR_RIGI") + renameMotCle(jdc,"CALC_MODE_ROTATION","MATR_B","MATR_MASS") + + #### traitement de CALC_NO ############################## + # renommage de la commande + renameCommande(jdc,"CALC_NO","CALC_CHAMPNO", ) + # Suppression des types de charges + removeMotCleInFact(jdc,"CALC_CHAMPNO","EXCIT","TYPE_CHARGE",pasDeRegle(),0) + # Redistribution des options de calcul + ## dictionnaire contenant les options + lTOUT=["FORC_NODA","REAC_NODA","DERA_NOEU","DURT_NOEU","EFCA_NOEU", + "EFGE_NOEU","ENDO_NOEU","ENEL_NOEU","EPMG_NOEU","EPSG_NOEU", + "EPSI_NOEU","EPSP_NOEU","EPVC_NOEU","EPFD_NOEU","EPFP_NOEU", + "EPMQ_NOEU","EPEQ_NOEU","SIEQ_NOEU","ERME_NOEU","ERTH_NOEU", + "QIRE_NOEU","FLUX_NOEU","HYDR_NOEU","INTE_NOEU","META_NOEU", + "PMPB_NOEU","PRAC_NOEU","SIEF_NOEU","SICA_NOEU","SICO_NOEU", + "SIGM_NOEU","SIPO_NOEU","VAEX_NOEU","VARI_NOEU","DISS_NOEU"] + lCONTRAINTE=["EFCA_NOEU","EFGE_NOEU","SIEF_NOEU","SICA_NOEU", + "SICO_NOEU","SIGM_NOEU","SIPO_NOEU",] + lDEFORMATION=["EPMG_NOEU","EPSG_NOEU","EPSI_NOEU","EPSP_NOEU", + "EPVC_NOEU","EPFD_NOEU","EPFP_NOEU",] + lENERGIE=["ENEL_NOEU","DISS_NOEU",] + lCRITERES=["DERA_NOEU","ENDO_NOEU","EPEQ_NOEU","EPMQ_NOEU", + "SIEQ_NOEU","PMPB_NOEU",] + lVARI_INTERNE=["VAEX_NOEU","VARI_NOEU",] + lTHERMIQUE=["FLUX_NOEU","HYDR_NOEU",] + lACOUSTIQUE=["INTE_NOEU","PRAC_NOEU",] + lFORCE=["FORC_NODA","REAC_NODA",] + lERREUR=["ERME_NOEU","ERTH_NOEU","QIRE_NOEU",] + lMETA=["DURT_NOEU","META_NOEU",] + ## Erreur pour les options supprimées + genereErreurValeur(jdc,"CALC_CHAMPNO","OPTION",("'SICA_NOEU'","'EFCA_NOEU'","'PMPB_NOEU'",)) + changementValeur(jdc,"CALC_CHAMPNO","OPTION",{"SICO_NOEU":"SIGM_NOEU",}) + ## copie de OPTION dans MCF TEMPORAIRE pour chaque type + chercheOperInsereFacteur(jdc,"CALC_CHAMPNO","TEMPORAIRE") + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","CONTRAINTE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","DEFORMATION",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ENERGIE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","CRITERES",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","VARI_INTERNE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","THERMIQUE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ACOUSTIQUE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","FORCE",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","ERREUR",pasDeRegle(),0) + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO","OPTION","TEMPORAIRE") + renameMotCleInFact(jdc,"CALC_CHAMPNO","TEMPORAIRE","OPTION","META",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMPNO","OPTION",pasDeRegle(),0) + ## déplacement au premier niveau de mot-clés + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","CONTRAINTE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","DEFORMATION") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ENERGIE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","CRITERES") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","VARI_INTERNE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","THERMIQUE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ACOUSTIQUE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","FORCE") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","ERREUR") + moveMotCleFromFactToFather(jdc,"CALC_CHAMPNO","TEMPORAIRE","META") + ## suppression des mot-clés s'ils ne contiennent pas d'options à traiter + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","CONTRAINTE",((("CONTRAINTE",lCONTRAINTE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","DEFORMATION",((("DEFORMATION",lDEFORMATION,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ENERGIE",((("ENERGIE",lENERGIE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","CRITERES",((("CRITERES",lCRITERES,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","VARI_INTERNE",((("VARI_INTERNE",lVARI_INTERNE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","THERMIQUE",((("THERMIQUE",lTHERMIQUE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ACOUSTIQUE",((("ACOUSTIQUE",lACOUSTIQUE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","FORCE",((("FORCE",lFORCE,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","ERREUR",((("ERREUR",lERREUR,jdc),"MCnaPasPourValeurDansListe"),)) + removeMotCleSiRegle(jdc,"CALC_CHAMPNO","META",((("META",lMETA,jdc),"MCnaPasPourValeurDansListe"),)) + ## suppression des valeurs non-licites + suppressionValeurs(jdc,"CALC_CHAMPNO","CONTRAINTE",list(set(lTOUT)-set(lCONTRAINTE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","DEFORMATION",list(set(lTOUT)-set(lDEFORMATION))) + suppressionValeurs(jdc,"CALC_CHAMPNO","ENERGIE",list(set(lTOUT)-set(lENERGIE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","CRITERES",list(set(lTOUT)-set(lCRITERES))) + suppressionValeurs(jdc,"CALC_CHAMPNO","VARI_INTERNE",list(set(lTOUT)-set(lVARI_INTERNE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","THERMIQUE",list(set(lTOUT)-set(lTHERMIQUE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","ACOUSTIQUE",list(set(lTOUT)-set(lACOUSTIQUE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","FORCE",list(set(lTOUT)-set(lFORCE))) + suppressionValeurs(jdc,"CALC_CHAMPNO","ERREUR",list(set(lTOUT)-set(lERREUR))) + suppressionValeurs(jdc,"CALC_CHAMPNO","META",list(set(lTOUT)-set(lMETA))) + ## ajout CALC_METANO ou CALC_ERREURNO + lMOTCLE=[] + lMOTCLE=["reuse","RESULTAT","TOUT_ORDRE","NUME_ORDRE","NUME_MODE","NOEUD_CMP","NOM_CAS", + "INST","FREQ","LIST_INST","LIST_FREQ","LIST_ORDRE","CRITERE","PRECISION","EXCIT"] + ### traitement métallurgie + llistMETA=[] + llistMETA=list(lMOTCLE) + llistMETA.append("META") + for mc in llistMETA : + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE") + moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_METANO","TEMPORAIRE") + for mc in llistMETA : + moveMotCleFromFactToFather(jdc,"CALC_METANO","TEMPORAIRE",mc) + removeCommandeSiRegle(jdc,"CALC_METANO",((("META"),"nexistepasMCFParmi"),)) + renameMotCle(jdc,"CALC_METANO","META","OPTION") + removeMotCle(jdc,"CALC_METANO","TEMPORAIRE",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMPNO","TEMPORAIRE",pasDeRegle(),0) + ### traitement calcul d'erreur + llistERREUR=[] + llistERREUR=list(lMOTCLE) + llistERREUR.append("ERREUR") + for mc in llistERREUR : + copyMotClefInOperToFact(jdc,"CALC_CHAMPNO",mc,"TEMPORAIRE") + moveMCFToCommand(jdc,"CALC_CHAMPNO","TEMPORAIRE","CALC_ERREURNO","TEMPORAIRE") + for mc in llistERREUR : + moveMotCleFromFactToFather(jdc,"CALC_ERREURNO","TEMPORAIRE",mc) + removeCommandeSiRegle(jdc,"CALC_ERREURNO",((("ERREUR"),"nexistepasMCFParmi"),)) + renameMotCle(jdc,"CALC_ERREURNO","ERREUR","OPTION") + removeMotCle(jdc,"CALC_ERREURNO","TEMPORAIRE",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMPNO","TEMPORAIRE",pasDeRegle(),0) + ## ménage final + removeCommandeSiRegle(jdc,"CALC_CHAMPNO",((("CONTRAINTE","DEFORMATION","ENERGIE","CRITERES","VARI_INTERNE","THERMIQUE","ACOUSTIQUE","FORCE"),"nexistepasMCFParmi"),)) + renameCommande(jdc,"CALC_CHAMPNO","CALC_CHAMP") + renameCommande(jdc,"CALC_METANO","CALC_META") + renameCommande(jdc,"CALC_ERREURNO","CALC_ERREUR") + removeMotCle(jdc,"CALC_CHAMP","METANO",pasDeRegle(),0) + removeMotCle(jdc,"CALC_CHAMP","ERREURNO",pasDeRegle(),0) + + #### traitement de CALC_POINT_MAT ############################## + # Rien à faire + + #### traitement de CALC_PRECONT ############################## + # Renommage de IMPLEX + changementValeur(jdc,"CALC_PRECONT","METHODE",{"IMPL_EX":"IMPLEX"}) + removeMotCle(jdc,"CALC_PRECONT","IMPL_EX",pasDeRegle(),0) + + #### traitement de CALC_SENSI ############################## + # Résorption de la sensibilité + removeCommande(jdc,"CALC_SENSI") + #genereErreurPourCommande(jdc,("CALC_SENSI",)) + + #### traitement de CALC_SPEC ############################## + # Déplacement d'un mot-clé facteur facteur + moveMotCleFromFactToFather(jdc,"CALC_SPEC","TAB_ECHANT","LONGUEUR_ECH") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","DUREE") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","POURCENT") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","LONGUEUR_ECH","NB_PTS") + removeMotCle(jdc,"CALC_SPEC","LONGUEUR_ECH",pasDeRegle(),0) + renameMotCle(jdc,"CALC_SPEC","DUREE","LONGUEUR_DUREE") + renameMotCle(jdc,"CALC_SPEC","POURCENT","LONGUEUR_POURCENT") + renameMotCle(jdc,"CALC_SPEC","NB_PTS","LONGUEUR_NB_PTS") + moveMotClefInOperToFact(jdc,"CALC_SPEC","LONGUEUR_DUREE","TAB_ECHANT") + moveMotClefInOperToFact(jdc,"CALC_SPEC","POURCENT_DUREE","TAB_ECHANT") + moveMotClefInOperToFact(jdc,"CALC_SPEC","LONGUEUR_NB_PTS","TAB_ECHANT") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","TAB_ECHANT","RECOUVREMENT") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","DUREE") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","POURCENT") + moveMotCleFromFactToFather(jdc,"CALC_SPEC","RECOUVREMENT","NB_PTS") + removeMotCle(jdc,"CALC_SPEC","RECOUVREMENT",pasDeRegle(),0) + renameMotCle(jdc,"CALC_SPEC","DUREE","RECOUVREMENT_DUREE") + renameMotCle(jdc,"CALC_SPEC","POURCENT","RECOUVREMENT_POURCENT") + renameMotCle(jdc,"CALC_SPEC","NB_PTS","RECOUVREMENT_NB_PTS") + moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_DUREE","TAB_ECHANT") + moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_POURCENT","TAB_ECHANT") + moveMotClefInOperToFact(jdc,"CALC_SPEC","RECOUVREMENT_NB_PTS","TAB_ECHANT") + + #### traitement de CALC_TABLE ############################## + # Renommage de AJOUT en AJOUT_LIGNE + dOPE={"AJOUT":"AJOUT_LIGNE",} + changementValeurDsMCF(jdc,"CALC_TABLE","ACTION","OPERATION",dOPE) + # Résorption de la sensibilité + removeMotCle(jdc,"CALC_TABLE","SENSIBILITE",pasDeRegle(),0) + # Renommage critere table + dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} + changementValeurDsMCF(jdc,"CALC_TABLE","FILTRE","CRIT_COMP",dCRIT) + + #### traitement de CALC_THETA ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"CALC_THETA","OPTION",pasDeRegle(),0) + removeMotCle(jdc,"CALC_THETA","THETA_BANDE",pasDeRegle(),1) + removeMotCle(jdc,"CALC_THETA","GRAD_NOEU_THETA",pasDeRegle(),0) + + #### traitement de COMB_FOURIER ############################## + # Homogénéisation de ANGLE + renameMotCle(jdc,"COMB_FOURIER","ANGL","ANGLE") + + #### traitement de COMB_SISM_MODAL ############################## + genereErreurValeur(jdc,"COMB_SISM_MODAL","OPTION",("'EFCA_ELNO'",)) + + #### traitement de CREA_CHAMP ############################## + removeMotCle(jdc,"CREA_CHAMP","SENSIBILITE",pasDeRegle(),0) + removeMotCle(jdc,"CREA_CHAMP","PROL_ZERO",pasDeRegle(),0) + + #### traitement de CREA_ELEM_SSD ############################## + # Rien à faire + + #### traitement de CREA_MAILLAGE ############################## + # Suppression de la possibilité de copier un maillage + lFACTEUR=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1', + 'DETR_GROUP_MA', 'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE', + 'QUAD_LINE', 'REPERE','RESTREINT','PENTA15_18','GEOM_FIBRE'] + renameCommandeSiRegle(jdc,"CREA_MAILLAGE","COPIER",(((lFACTEUR),"nexistepasMCFParmi"),)) + renameMotCle(jdc,"COPIER","MAILLAGE","CONCEPT") + + #### traitement de CREA_RESU ############################## + # Rien à faire + + #### traitement de CREA_TABLE ############################## + removeMotCle(jdc,"CREA_TABLE","SENSIBILITE",pasDeRegle(),0) + + #### traitement de DEBUT ############################## + # Suppression du mot-clé TITRE + removeMotCleInFact(jdc,"DEBUT","CATALOGUE","TITRE",pasDeRegle(),0) + # Suppression du mot-clé IMPRESSION + removeMotCle(jdc,"DEBUT","IMPRESSION",pasDeRegle(),0) + # Suppression des mots-clés mémoire dynamique + removeMotCleInFact(jdc,"DEBUT","MEMOIRE","GESTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEBUT","MEMOIRE","TYPE_ALLOCATION",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEBUT","MEMOIRE","TAILLE",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEBUT","MEMOIRE","PARTITION",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEBUT","MEMOIRE","DYNAMIQUE",pasDeRegle(),0) + + #### traitement de DEFI_BASE_MODALE ############################## + # Rien à faire + + #### traitement de DEFI_CABLE_BP ############################## + # Rien à faire + + #### traitement de DEFI_COMPOR ############################## + # Suppression famille de sytèmes de glissement + lFAMGLIS=["'BASAL'", "'PRISMATIQUE'","'PYRAMIDAL1'","'PYRAMIDAL2'","'MACLAGE'",] + genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","FAMI_SYST_GLIS",lFAMGLIS) + # Suppression famille de sytèmes de glissement + genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECOULEMENT",("'MONO_VISC3'",)) + # Suppression de ALGO_1D + removeMotCleInFact(jdc,"DEFI_COMPOR","MULTIFIBRE","ALGO_1D",pasDeRegle(),0) + # Suppression de DEFORMATION + genereErreurMotCleInFact(jdc,"DEFI_COMPOR","MULTIFIBRE","DEFORMATION") + + #### traitement de DEFI_CONTACT ############################## + genereErreurValeurDsMCF(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT",("'AVANCE'",)) + genereErreurValeurDsMCF(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT",("'AVANCE'",)) + # résorption de RACCORD_LINE_QUAD et éléments de Barsoum + genereErreurMCF(jdc,"DEFI_CONTACT","FOND_FISSURE") + genereErreurMCF(jdc,"DEFI_CONTACT","NOEUD_FOND") + genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_NO_FOND") + genereErreurMCF(jdc,"DEFI_CONTACT","MAILLE_FOND") + genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_MA_FOND") + genereErreurMCF(jdc,"DEFI_CONTACT","RACCORD_LINE_QUAD") + genereErreurMCF(jdc,"DEFI_CONTACT","NOEUD_RACC") + genereErreurMCF(jdc,"DEFI_CONTACT","GROUP_NO_RACC") + genereErreurMCF(jdc,"DEFI_CONTACT","EXCLUSION_PIV_NUL") + genereErreurMCF(jdc,"DEFI_CONTACT","COEF_ECHELLE") + # résorption de COMPLIANCE + genereErreurMCF(jdc,"DEFI_CONTACT","COMPLIANCE") + genereErreurMCF(jdc,"DEFI_CONTACT","ASPERITE") + genereErreurMCF(jdc,"DEFI_CONTACT","E_N") + genereErreurMCF(jdc,"DEFI_CONTACT","E_V") + # résorption de l'usure + genereErreurMCF(jdc,"DEFI_CONTACT","USURE") + genereErreurMCF(jdc,"DEFI_CONTACT","K") + genereErreurMCF(jdc,"DEFI_CONTACT","H") + # Suppression de schémas d'inégration pour XFEM + lSCHEMA=["FPG2","FPG3","FPG4","FPG6","FPG7","SIMPSON1","NCOTES1","NCOTES2"] + removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","INTEGRATION",((("FORMULATION","XFEM",jdc),"MCaPourValeur")and(("ZONE","INTEGRATION",lSCHEMA,jdc),"MCsousMCFaPourValeurDansListe"),),) + # règles sur relation + removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","RELATION",((("ZONE","RELATION","NON",jdc),"MCsousMCFaPourValeur"),),) + # Suppression de schémas d'inégration pour méthode CONTINUE + lSCHEMA=["NOEUD","SIMPSON1","SIMPSON2","NCOTES1","NCOTES2"] + removeMotCleInFactSiRegle(jdc,"DEFI_CONTACT","ZONE","INTEGRATION",((("FORMULATION","CONTINUE",jdc),"MCaPourValeur")and(("ZONE","INTEGRATION",lSCHEMA,jdc),"MCsousMCFaPourValeurDansListe"),),) + # Ajout règle sur REAC_GEOM + removeMotCleSiRegle(jdc,"DEFI_CONTACT","REAC_GEOM",((("ALGO_RESO_GEOM","NEWTON",jdc),"MCaPourValeur"),)) + + #### traitement de DEFI_COQU_MULT ############################## + renameCommande(jdc,"DEFI_COQU_MULT","DEFI_COMPOSITE", ) + + #### traitement de DEFI_FICHIER ############################## + # Rien à faire + + #### traitement de DEFI_FISS_XFEM ############################## + # Suppression de ORIE_FOND + removeMotCle(jdc,"DEFI_FISS_XFEM","ORIE_FOND",pasDeRegle(),0) + # Fusion FORM_FISS='ELLIPSE' et FORM_FISS='INCLUSION' + dFORME={"INCLUSION":"ELLIPSE",} + changementValeurDsMCF(jdc,"DEFI_FISS_XFEM","DEFI_FISS","FORM_FISS",dOPE) + + #### traitement de DEFI_FONC_ELEC ############################## + # Rien à faire + + #### traitement de DEFI_FOND_FISS ############################## + renameMotCle(jdc,"DEFI_FOND_FISS","FOND_FISS","FONDFISS") + # Cas FOND OUVERT + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_FOND_FISS","FONDFISS","TYPE_FOND='OUVERT'",((("FONDFISS",),"existe"),)) + # Cas FOND FERME + chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='FERME'",((("FOND_FERME",),"existe"),),0) + renameMotCle(jdc,"DEFI_FOND_FISS","FOND_FERME","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") + # Cas FOND INF + chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='INF'",((("FOND_INF",),"existe"),),0) + renameMotCle(jdc,"DEFI_FOND_FISS","FOND_SUP","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") + # Cas FOND SUP + chercheOperInsereFacteurSiRegle(jdc,"DEFI_FOND_FISS","TYPE_FOND='SUP'",((("FOND_SUP",),"existe"),),0) + renameMotCle(jdc,"DEFI_FOND_FISS","FOND_SUP","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","TYPE_FOND","FONDFISS") + # Autres mots-clés + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","DTAN_ORIG","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","DTAN_EXTR","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","VECT_GRNO_ORIG","FONDFISS") + moveMotClefInOperToFact(jdc,"DEFI_FOND_FISS","VECT_GRNO_EXTR","FONDFISS") + removeMotCle(jdc,"DEFI_FOND_FISS","NORMALE",pasDeRegle(),0) + # + renameMotCle(jdc,"DEFI_FOND_FISS","FONDFISS","FOND_FISS") + + #### traitement de DEFI_GLRC ############################## + # Renommage de mot-clés + renameMotCle(jdc,"DEFI_GLRC","GC","GAMMA_C") + renameMotCle(jdc,"DEFI_GLRC","SYC","NYC") + renameMotCle(jdc,"DEFI_GLRC","EPSI_FLEX","KAPPA_FLEX") + + #### traitement de DEFI_GROUPE ############################## + # Rien à faire + + #### traitement de DEFI_INTE_SPEC ############################## + # Rien à faire + + #### traitement de DEFI_LIST_INST ############################## + dMETHODE={"UNIFORME":"MANUEL","EXTRAPOLE":"MANUEL","AUCUNE":"AUTO"} + changementValeurDsMCF(jdc,"DEFI_LIST_INST","ECHEC","SUBD_METHODE",dMETHODE) + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","SUBD_COEF_PAS_1",pasDeRegle(),0) + + #### traitement de DEFI_MATER_GC ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de DEFI_MATERIAU ############################## + # Suppression des critères pour les poutres + genereErreurMCF(jdc,"DEFI_MATERIAU","ECRO_FLEJOU") + genereErreurMCF(jdc,"DEFI_MATERIAU","VMIS_POUTRE") + genereErreurMCF(jdc,"DEFI_MATERIAU","VMIS_POUTRE_FO") + # Modification de la loi de grandissement + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_A") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_B") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LEMAITRE_IRRA","GRAN_S") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_A") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_B") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","LMARC_IRRA","GRAN_S") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_A") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_B") + genereErreurMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA_LOG","GRAN_S") + # Modification des paramètres de la loi ENDO_SCALAIRE + genereErreurMCF(jdc,"DEFI_MATERIAU","ENDO_SCALAIRE") + # Modification des paramètres de la loi MAZARS + genereErreurMCF(jdc,"DEFI_MATERIAU","MAZARS") + genereErreurMCF(jdc,"DEFI_MATERIAU","MAZARS_FO") + # Modification des paramètres de la loi GLRC_DM + renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYT","NYT",pasDeRegle(),0) + renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYC","NYC",pasDeRegle(),0) + renameMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","SYF","NYF",pasDeRegle(),0) + # Suppression de la loi MONO_VISC3 + genereErreurMCF(jdc,"DEFI_MATERIAU","MONO_VISC3") + # Suppression de la loi MONO_DD_CC + genereErreurMCF(jdc,"DEFI_MATERIAU","MONO_DD_CC") + + #### traitement de DEFI_NAPPE ############################## + # Rien à faire + + #### traitement de DEFI_PARA_SENSI ############################## + # Résorption de la sensibilité + removeCommande(jdc,"DEFI_PARA_SENSI") + #genereErreurPourCommande(jdc,("DEFI_PARA_SENSI",)) + + #### traitement de DEFI_PART_FETI ############################## + # Rien à faire + + #### traitement de DEFI_SOL_MISS ############################## + # Rien à faire + + #### traitement de DEFI_SPEC_TURB ############################## + # Homogénéisation de ANGLE + renameMotCleInFact(jdc,"DEFI_SPEC_TURB","SPEC_EXCI_POINT","ANGL","ANGLE",pasDeRegle(),0) + + #### traitement de DETRUIRE ############################## + # Résorption de la sensibilité + removeMotCleInFact(jdc,"DETRUIRE","CONCEPT","SENSIBILITE",pasDeRegle(),0) + # Suppression mot-clé ALARME + removeMotCle(jdc,"DETRUIRE","ALARME",pasDeRegle(),0) + + #### traitement de DYNA_ALEA_MODAL ############################## + # Rien à faire + + #### traitement de DYNA_ISS_VARI ############################## + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DYNA_ISS_VARI","MATR_COHE","TYPE='MITA_LUCO'",((("MATR_COHE",),"existe"),)) + + #### traitement de DYNA_LINE_HARM ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"DYNA_LINE_HARM","SENSIBILITE",pasDeRegle(),0) + # Suppression mot-clé TYPE_CHARGE + removeMotCleInFact(jdc,"DYNA_LINE_HARM","EXCIT","TYPE_CHARGE",pasDeRegle(),0) + # Ajout AMOR_MODAL + chercheOperInsereFacteurSiRegle(jdc,"DYNA_LINE_HARM","AMOR_MODAL",((("AMOR_REDUIT","LIST_AMOR",),"existeMCFParmi"),),1) + moveMotClefInOperToFact(jdc,"DYNA_LINE_HARM","AMOR_REDUIT","AMOR_MODAL") + moveMotClefInOperToFact(jdc,"DYNA_LINE_HARM","LIST_AMOR","AMOR_MODAL") + + #### traitement de DYNA_LINE_TRAN ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"DYNA_LINE_TRAN","SENSIBILITE",pasDeRegle(),0) + # Ajout SCHEMA_TEMPS + chercheOperInsereFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS",((("NEWMARK","WILSON","DIFF_CENTRE","ADAPT",),"existeMCFParmi"),),1) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='NEWMARK'",((("NEWMARK",),"existeMCFParmi"),)) + moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","NEWMARK","ALPHA","SCHEMA_TEMPS") + moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","NEWMARK","DELTA","SCHEMA_TEMPS") + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","ALPHA","BETA",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","DELTA","GAMMA",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_LINE_TRAN","NEWMARK",pasDeRegle(),0) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='WILSON'",((("WILSON",),"existeMCFParmi"),)) + moveMotCleFromFactToFact(jdc,"DYNA_LINE_TRAN","WILSON","THETA","SCHEMA_TEMPS") + removeMotCle(jdc,"DYNA_LINE_TRAN","WILSON",pasDeRegle(),0) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='DIFF_CENTRE'",((("DIFF_CENTRE",),"existeMCFParmi"),)) + removeMotCle(jdc,"DYNA_LINE_TRAN","DIFF_CENTRE",pasDeRegle(),0) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_LINE_TRAN","SCHEMA_TEMPS","SCHEMA='ADAPT_ORDRE2'",((("ADAPT",),"existeMCFParmi"),)) + removeMotCle(jdc,"DYNA_LINE_TRAN","ADAPT",pasDeRegle(),0) + # Renommage dans ETAT_INIT + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","DYNA_TRANS","RESULTAT",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","DEPL_INIT","DEPL",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","ACCE_INIT","ACCE",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","VITE_INIT","VITE",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ETAT_INIT","NUME_INIT","NUME_ORDRE",pasDeRegle(),0) + # Suppression mot-clé TYPE_CHARGE + removeMotCleInFact(jdc,"DYNA_LINE_TRAN","EXCIT","TYPE_CHARGE",pasDeRegle(),0) + # Suppression mot-clé FONC_INST + genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","INCREMENT","FONC_INST") + # Suppression mot-clé PAS_CALCUL + removeMotCleInFact(jdc,"DYNA_LINE_TRAN","INCREMENT","PAS_CALCUL",pasDeRegle(),0) + # Renommage dans ARCHIVAGE + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ARCHIVAGE","LIST_ARCH","LIST_INST",pasDeRegle(),0) + + #### traitement de DYNA_NON_LINE ############################## + # Renommage CRIT_FLAMB en CRIT_STAB + renameMotCle(jdc,"DYNA_NON_LINE","CRIT_FLAMB","CRIT_STAB") + # Résorption de la sensibilité + removeMotCle(jdc,"DYNA_NON_LINE","SENSIBILITE",pasDeRegle(),0) + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"DYNA_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de DYNA_SPEC_MODAL ############################## + # Rien à faire + + #### traitement de DYNA_TRAN_MODAL ############################## + # Ajout SCHEMA_TEMPS + chercheOperInsereFacteur(jdc,"DYNA_TRAN_MODAL","SCHEMA_TEMPS") + chercheOperInsereMotCleSiRegle(jdc,"DYNA_TRAN_MODAL","METHODE='EULER'",((("METHODE",),"nexistepas"),),) + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","METHODE","SCHEMA_TEMPS") + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","SCHEMA_TEMPS","METHODE","SCHEMA",pasDeRegle(),0) + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","BASE_ELAS_FLUI","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NUME_VITE_FLUI","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","ETAT_STAT","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","PREC_DUREE","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","CHOC_FLUI","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NB_MODE","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NB_MODE_FLUI","SCHEMA_TEMPS") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","TS_REG_ETAB","SCHEMA_TEMPS") + # Renommage des matrices + renameMotCle(jdc,"DYNA_TRAN_MODAL","MASS_GENE","MATR_MASS") + renameMotCle(jdc,"DYNA_TRAN_MODAL","RIGI_GENE","MATR_RIGI") + renameMotCle(jdc,"DYNA_TRAN_MODAL","AMOR_GENE","MATR_AMOR") + # Ajout AMOR_MODAL + chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","AMOR_MODAL",((("AMOR_REDUIT","LIST_AMOR",),"existeMCFParmi"),),1) + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","AMOR_REDUIT","AMOR_MODAL") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","LIST_AMOR","AMOR_MODAL") + # couplage + chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","VITESSE_VARIABLE='NON'",((("COUPLAGE_EDYOS"),"existe"),),1) + moveMotCleFromFactToFather(jdc,"DYNA_TRAN_MODAL","COUPLAGE_EDYOS","VITE_ROTA") + # Renommage dans ETAT_INIT + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","RESU_GENE","RESULTAT",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","INIT_GENE","DEPL",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","DEPL_INIT_GENE","DEPL",pasDeRegle(),0) + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","ETAT_INIT","VITE_INIT_GENE","VITE",pasDeRegle(),0) + # Renommage dans ARCHIVAGE + renameMotCleInFact(jdc,"DYNA_LINE_TRAN","ARCHIVAGE","LIST_ARCH","LIST_INST",pasDeRegle(),0) + # Paramètres LAME_FLUIDE + chercheOperInsereFacteurSiRegle(jdc,"DYNA_TRAN_MODAL","PARA_LAMEFLUI",((("NMAX_ITER","RESI_RELA","LAMBDA"),"existeMCFParmi"),),1) + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","NMAX_ITER","PARA_LAMEFLUI") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","RESI_RELA","PARA_LAMEFLUI") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_MODAL","LAMBDA","PARA_LAMEFLUI") + renameMotCle(jdc,"DYNA_TRAN_MODAL","PARA_LAMEFLUI","PARA_LAME_FLUI") + + #### traitement de DYNA_VIBRA ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de EXEC_LOGICIEL ############################## + # Rien à faire + + #### traitement de EXTR_RESU ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"EXTR_RESU","SENSIBILITE",pasDeRegle(),0) + + #### traitement de EXTR_TABLE ############################## + # Renommage critere table + dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} + changementValeurDsMCF(jdc,"RECU_TABLE","FILTRE","CRIT_COMP",dCRIT) + + #### traitement de FACTORISER ############################## + # Suppression de RENUM + removeMotCleSiRegle(jdc,"FACTORISER","RENUM",((("PRE_COND","LDLT_INC",jdc),"MCaPourValeur"),)) + removeMotCleSiRegle(jdc,"FACTORISER","RENUM",((("PRE_COND","LDLT_SP",jdc),"MCaPourValeur"),)) + # Modification mot-clés liés à la mémoire + removeMotCle(jdc,"FACTORISER","LIBERE_MEMOIRE",pasDeRegle(),0) + renameMotCle(jdc,"FACTORISER","OUT_OF_CORE","GESTION_MEMOIRE") + dMEM={"OUI":"OUT_OF_CORE","NON":"IN_CORE"} + changementValeur(jdc,"FACTORISER","GESTION_MEMOIRE",dCRIT) + + #### traitement de FORMULE ############################## + # Rien à faire + + #### traitement de GENE_ACCE_SEISME ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de GENE_FONC_ALEA ############################## + # Rien à faire + + #### traitement de GENE_VARI_ALEA ############################## + # Rien à faire + + #### traitement de IMPR_CO ############################## + # Résorption de la sensibilité + removeMotCleInFact(jdc,"IMPR_CO","CONCEPT","SENSIBILITE",pasDeRegle(),0) + + #### traitement de IMPR_DIAG_CAMPBELL ############################## + # Rien à faire + + #### traitement de IMPR_FONCTION ############################## + # Rien à faire + + #### traitement de IMPR_GENE ############################## + # Rien à faire + + #### traitement de IMPR_OAR ############################## + # Rien à faire + + #### traitement de IMPR_RESU ############################## + # Résorption de la sensibilité + removeMotCleInFact(jdc,"IMPR_RESU","RESU","SENSIBILITE",pasDeRegle(),0) + # Suppression de l'écriture au format ENSIGHT + genereErreurValeur(jdc,"IMPR_RESU","FORMAT",("'ENSIGHT'",)) + # Homogénéisation de ANGLE + renameMotCleInFact(jdc,"IMPR_RESU","FORMAT","ANGL","ANGLE",pasDeRegle(),0) + # Suppression mot-clé MODELE + removeMotCle(jdc,"IMPR_RESU","MODELE",pasDeRegle(),0) + + #### traitement de IMPR_STURM ############################## + renameMotCle(jdc,"IMPR_STURM","TYPE_RESU","TYPE_MODE") + # renommage de MATR_A, MATR_B et MATR_C + renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI",((("TYPE_MODE","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_B","MATR_MASS",((("TYPE_MODE","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"IMPR_STURM","MATR_B","MATR_RIGI_GEOM",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCle(jdc,"IMPR_STURM","MATR_A","MATR_RIGI") + renameMotCle(jdc,"IMPR_STURM","MATR_B","MATR_MASS") + # + chercheOperInsereMotCleSiRegle(jdc,"IMPR_STURM","FREQ_MIN=0.",((("FREQ_MIN",),"nexistepas")and(("FREQ_MAX",),"existeMCFParmi"),),) + fusionMotCleToFact(jdc,"IMPR_STURM",("FREQ_MIN","FREQ_MAX"),"FREQ") + fusionMotCleToFact(jdc,"IMPR_STURM",("CHAR_CRIT_MIN","CHAR_CRIT_MAX"),"CHAR_CRIT") + # Ajout COMPTAGE + chercheOperInsereFacteurSiRegle(jdc,"IMPR_STURM","COMPTAGE",((("NMAX_ITER_SHIFT","PREC_SHIFT","SEUIL_FREQ"),"existeMCFParmi"),),1) + moveMotClefInOperToFact(jdc,"IMPR_STURM","NMAX_ITER_SHIFT","COMPTAGE") + moveMotClefInOperToFact(jdc,"IMPR_STURM","PREC_SHIFT","COMPTAGE") + moveMotClefInOperToFact(jdc,"IMPR_STURM","SEUIL_FREQ","COMPTAGE") + renameMotCleInFactSiRegle(jdc,"IMPR_STURM","COMPTAGE","SEUIL_FREQ","SEUIL_CHAR_CRIT",((("TYPE_MODE","MODE_FLAMB",jdc),"MCaPourValeur"),),) + # Suppression UNITE + removeMotCle(jdc,"IMPR_STURM","UNITE",pasDeRegle(),0) + # Renommage de la commande + renameCommande(jdc,"IMPR_STURM","INFO_MODE", ) + + #### traitement de IMPR_TABLE ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"IMPR_TABLE","SENSIBILITE",pasDeRegle(),0) + # Renommage critere table + dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} + changementValeurDsMCF(jdc,"IMPR_TABLE","FILTRE","CRIT_COMP",dCRIT) + # Suppression de FORMAT_C + genereErreurMCF(jdc,"IMPR_TABLE","FORMAT_C") + + #### traitement de INCLUDE ############################## + # Rien à faire + + #### traitement de INCLUDE_MATERIAU ############################## + # Rien à faire + + #### traitement de INFO_EXEC_ASTER ############################## + # Rien à faire + + #### traitement de INFO_FONCTION ############################## + # Rien à faire + + #### traitement de INFO_MODE ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de LIRE_CHAMP ############################## + # Rien à faire + + #### traitement de LIRE_FONCTION ############################## + # Rien à faire + + #### traitement de LIRE_IMPE_MISS ############################## + # Rien à faire + + #### traitement de LIRE_INTE_SPEC ############################## + # Rien à faire + + #### traitement de LIRE_MAILLAGE ############################## + # Rien à faire + + #### traitement de LIRE_RESU ############################## + # Suppression du type HARM_GENE + genereErreurValeur(jdc,"LIRE_RESU","TYPE_RESU",("'HARM_GENE'",)) + # renommage de MATR_A et MATR_B + renameMotCle(jdc,"LIRE_RESU","MATR_A","MATR_RIGI") + renameMotCle(jdc,"LIRE_RESU","MATR_B","MATR_MASS") + removeMotCle(jdc,"LIRE_RESU","NUME_DDL",pasDeRegle(),0) + # Suppression de certains champ + lSUPCHAMPS=["'EFCA_ELNO'","'EFCA_NOEU'","'EPTQ_ELNO'","'EPTU_ELNO'", + "'PMPB_ELNO'","'PMPB_NOEU'","'SITQ_ELNO'","'SICA_ELNO'", + "'SICO_ELNO'","'SITU_ELNO'","'SICA_NOEU'","'SICO_NOEU'", + "'SPMX_ELGA'","'VACO_ELNO'","'VATU_ELNO'",] + genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",lSUPCHAMPS) + genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",lSUPCHAMPS) + genereErreurValeur(jdc,"LIRE_RESU","NOM_CHAM",lSUPCHAMPS) + + #### traitement de LIRE_TABLE ############################## + # Rien à faire + + #### traitement de MACR_ADAP_MAIL ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"MACR_ADAP_MAIL","SENSIBILITE",pasDeRegle(),0) + # Changement de version + changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V10_1":"V10_6"}) + # Changement d'adaptation + changementValeur(jdc,"MACR_ADAP_MAIL","ADAPTATION",{"RAFFINEMENT_ZONE":"RAFF_DERA_ZONE"}) + # Renommage du mot-clé ELEMENTS_NON_HOMARD + renameMotCle(jdc,"MACR_ADAP_MAIL","ELEMENTS_NON_HOMARD","ELEMENTS_ACCEPTES") + changementValeur(jdc,"MACR_ADAP_MAIL","ELEMENTS_ACCEPTES",{"REFUSER":"HOMARD","IGNORER":"IGNORE_PYRA"}) + + #### traitement de MACR_ASCOUF_CALC ############################## + # Rien à faire + + #### traitement de MACR_ASCOUF_MAIL ############################## + # Rien à faire + + #### traitement de MACR_ASPIC_CALC ############################## + # Rien à faire + + #### traitement de MACR_ASPIC_MAIL ############################## + # Rien à faire + + #### traitement de MACR_CARA_POUTRE ############################## + renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_Y","SYME_ZZ") + renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_X","SYME_Y") + renameMotCle(jdc,"MACR_CARA_POUTRE","SYME_ZZ","SYME_Z") + + #### traitement de MACR_ECLA_PG ############################## + # Rien à faire + + #### traitement de MACR_ECRE_CALC ############################## + # Changement de version + changementValeur(jdc,"MACR_ECRE_CALC","VERSION",{"3.1.1":"3.2.1","3.1.2":"3.2.1","3.2":"3.2.1"}) + + #### traitement de MACR_ECREVISSE ############################## + # Changement de version + changementValeur(jdc,"MACR_ECRE_CALC","VERSION",{"3.1.1":"3.2.1","3.1.2":"3.2.1","3.2":"3.2.1"}) + + #### traitement de MACR_ELEM_DYNA ############################## + # Rien à faire + + #### traitement de MACR_FIABILITE ############################## + genereErreurPourCommande(jdc,("MACR_FIABILITE",)) + + #### traitement de MACR_FIAB_IMPR ############################## + genereErreurPourCommande(jdc,("MACR_FIAB_IMPR",)) + + #### traitement de MACR_INFO_MAIL ############################## + # Changement de version + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_1":"V10_6"}) + # Renommage du mot-clé ELEMENTS_NON_HOMARD + renameMotCle(jdc,"MACR_INFO_MAIL","ELEMENTS_NON_HOMARD","ELEMENTS_ACCEPTES") + changementValeur(jdc,"MACR_INFO_MAIL","ELEMENTS_ACCEPTES",{"REFUSER":"HOMARD","IGNORER":"IGNORE_PYRA"}) + + #### traitement de MACR_LIGN_COUPE ############################## + # Rien à faire + + #### traitement de MACRO_ELAS_MULT ############################## + # Résorption de NUME_COUCHE NIVE_COUCHE + removeMotCleInFact(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","NUME_COUCHE",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","NIVE_COUCHE",pasDeRegle(),0) + # Réduction de la liste des options calculables + lOPT=["'EFGE_ELNO'","'EPOT_ELEM'","'SIGM_ELNO'","'SICA_ELNO'","'EFCA_ELNO'", + "'DEGE_ELNO'","'EPSI_ELNO'","'EPSI_ELGA'","'EPSG_ELNO'","'EPSG_ELGA'", + "'EPSP_ELNO'","'EPSP_ELGA'","'ECIN_ELEM'","'FLUX_ELGA'","'FLUX_ELNO'", + "'SOUR_ELGA'","'PRAC_ELNO'","'INTE_ELNO'","'SIZ1_NOEU'","'ERZ1_ELEM'", + "'SIZ2_NOEU'","'ERZ2_ELEM'","'VNOR_ELEM_DEPL'","'ERME_ELNO'", + "'ERME_ELEM'","'SIEQ_ELNO'","'SIEQ_ELGA'","'EPEQ_ELNO'","'QIRE_ELEM'", + "'QIRE_ELNO'","'QIZ1_ELEM'","'QIZ2_ELEM'","'EPEQ_ELGA'","'FORC_NODA'", + "'REAC_NODA'","'EPSI_NOEU'","'SIGM_NOEU'","'EFGE_NOEU'","'SIEQ_NOEU'", + "'EPEQ_NOEU'","'FLUX_NOEU'",] + genereErreurValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",lOPT) + + #### traitement de MACRO_EXPANS ############################## + # Rien à faire + + #### traitement de MACRO_MATR_AJOU ############################## + # Rien à faire + + #### traitement de MACRO_MATR_ASSE ############################## + # Suppression de paramètres mémoire + removeMotCleInFact(jdc,"MACRO_MATR_ASSE","SOLVEUR","OUT_OF_CORE",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACRO_MATR_ASSE","SOLVEUR","LIBERE_MEMOIRE",pasDeRegle(),0) + # Suppression de RIGI_MECA_LAGR + genereErreurValeurDsMCF(jdc,"MACRO_MATR_ASSE","MATR_ASSE","OPTION",("'RIGI_MECA_LAGR'",)) + genereErreurMotCleInFact(jdc,"MACRO_MATR_ASSE","MATR_ASSE","THETA") + genereErreurMotCleInFact(jdc,"MACRO_MATR_ASSE","MATR_ASSE","PROPAGATION") + # Renommage de la commande + renameCommande(jdc,"MACRO_MATR_ASSE","ASSEMBLAGE", ) + + #### traitement de MACRO_MISS_3D ############################## + # Rien à faire + + #### traitement de MACRO_MODE_MECA ############################## + # renommage de MATR_A et MATR_B + renameMotCle(jdc,"MACRO_MODE_MECA","MATR_A","MATR_RIGI") + renameMotCle(jdc,"MACRO_MODE_MECA","MATR_B","MATR_MASS") + # Suppression des mot-clés FREQ_* + renameMotCle(jdc,"MACRO_MODE_MECA","CALC_FREQ","CALCFREQ") + moveMotCleFromFactToFather(jdc,"MACRO_MODE_MECA","CALCFREQ","FREQ_MIN") + moveMotCleFromFactToFather(jdc,"MACRO_MODE_MECA","CALCFREQ","FREQ_MAX") + fusionMotCleToFact(jdc,"MACRO_MODE_MECA",("FREQ_MIN","FREQ_MAX"),"FREQ") + moveMotClefInOperToFact(jdc,"MACRO_MODE_MECA","FREQ","CALCFREQ",) + renameMotCle(jdc,"MACRO_MODE_MECA","CALCFREQ","CALC_FREQ") + removeMotCleInFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","NB_BLOC_FREQ",pasDeRegle(),0) + renameMotCleInFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","STOP_FREQ_VIDE","STOP_BANDE_VIDE",pasDeRegle(),0) + # Renommage critere de Sturm + changementValeurDsMCF(jdc,"MACRO_MODE_MECA","VERI_MODE","STURM",{"OUI":"GLOBAL",}) + + #### traitement de MACRO_PROJ_BASE ############################## + renameMotCle(jdc,"MACRO_PROJ_BASE","PROFIL","STOCKAGE") + # Renommage de la commande + renameCommande(jdc,"MACRO_PROJ_BASE","PROJ_BASE", ) + + #### traitement de MACR_RECAL ############################## + renameMotCle(jdc,"MACR_RECAL","POIDS","LIST_POIDS") + + #### traitement de MACR_SPECTRE ############################## + # Rien à faire + + #### traitement de MECA_STATIQUE ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"MECA_STATIQUE","SENSIBILITE",pasDeRegle(),0) + + #### traitement de MODE_ITER_INV ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"MODE_ITER_INV","SENSIBILITE",pasDeRegle(),0) + # renommage de MATR_A, MATR_B et MATR_C + renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_B","MATR_MASS",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCle(jdc,"MODE_ITER_INV","MATR_C","MATR_AMOR") + renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_INV","MATR_B","MATR_RIGI_GEOM",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_INV","CALC_FREQ","CALC_CHAR_CRIT",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur")or(("TYPE_RESU","GENERAL",jdc),"MCaPourValeur"),),1) + renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","NMAX_FREQ","NMAX_CHAR_CRIT",pasDeRegle(),0) + renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","SEUIL_FREQ","SEUIL_CHAR_CRIT",pasDeRegle(),0) + renameMotCle(jdc,"MODE_ITER_INV","MATR_A","MATR_RIGI") + renameMotCle(jdc,"MODE_ITER_INV","MATR_B","MATR_MASS") + + #### traitement de MODE_ITER_SIMULT ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"MODE_ITER_SIMULT","SENSIBILITE",pasDeRegle(),0) + # renommage de MATR_A, MATR_B et MATR_C + renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_MASS",((("TYPE_RESU","DYNAMIQUE",jdc),"MCaPourValeur"),),1) + renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_C","MATR_AMOR") + renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_RIGI_GEOM",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur"),),1) + renameMotCleSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","CALC_CHAR_CRIT",((("TYPE_RESU","MODE_FLAMB",jdc),"MCaPourValeur")or(("TYPE_RESU","GENERAL",jdc),"MCaPourValeur"),),1) + renameMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","NMAX_FREQ","NMAX_CHAR_CRIT",pasDeRegle(),0) + renameMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","SEUIL_FREQ","SEUIL_CHAR_CRIT",pasDeRegle(),0) + renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_A","MATR_RIGI") + renameMotCle(jdc,"MODE_ITER_SIMULT","MATR_B","MATR_MASS") + # renommage STOP_FREQ_VIDE + renameMotCle(jdc,"MODE_ITER_SIMULT","STOP_FREQ_VIDE","STOP_BANDE_VIDE") + + #### traitement de MODE_STATIQUE ############################## + # renommage du mot-clé FREQ + renameMotCleInFact(jdc,"MODE_STATIQUE","MODE_INTERF","FREQ","SHIFT",pasDeRegle(),0) + + #### traitement de MODI_MODELE_XFEM ############################## + genereErreurValeur(jdc,"MODI_MODELE_XFEM","CONTACT",("'P1P1A'",)) + + #### traitement de MODI_REPERE ############################## + # renommage de DEFI_REPERE + renameMotCle(jdc,"MODI_REPERE","DEFI_REPERE","AFFE") + moveMotCleFromFactToFather(jdc,"MODI_REPERE","AFFE","REPERE") + # localisation dans AFFE + moveMotClefInOperToFact(jdc,"MODI_REPERE","GROUP_MA","AFFE",) + moveMotClefInOperToFact(jdc,"MODI_REPERE","GROUP_NO","AFFE",) + moveMotClefInOperToFact(jdc,"MODI_REPERE","MAILLE","AFFE",) + moveMotClefInOperToFact(jdc,"MODI_REPERE","NOEUD","AFFE",) + + #### traitement de NORM_MODE ############################## + removeMotCle(jdc,"NORM_MODE","SENSIBILITE",pasDeRegle(),0) + + #### traitement de NUME_DDL ############################## + # Rien à faire + + #### traitement de NUME_DDL_GENE ############################## + # Rien à faire + + #### traitement de OBSERVATION ############################## + # renommage de MATR_A et MATR_B + renameMotCle(jdc,"OBSERVATION","MATR_A","MATR_RIGI") + renameMotCle(jdc,"OBSERVATION","MATR_B","MATR_MASS") + + #### traitement de POST_BORDET ############################## + # Rien à faire + + #### traitement de POST_CHAMP ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de POST_CHAM_XFEM ############################## + # Suppression mot-clé MAILLAGE_SAIN + removeMotCle(jdc,"POST_CHAM_XFEM","MAILLAGE_SAIN",pasDeRegle(),0) + + #### traitement de POST_COQUE ############################## + # Rien à faire + + #### traitement de POST_DECOLLEMENT ############################## + # Rien à faire + + #### traitement de POST_DYNA_ALEA ############################## + # Suppression du mot-clé NUME_VITE_FLUI + removeMotCle(jdc,"POST_DYNA_ALEA","NUME_VITE_FLUI",pasDeRegle(),0) + + #### traitement de POST_ELEM ############################## + # Rien à faire + + #### traitement de POST_ENDO_FISS ############################## + # Suppression du mot-clé MODELE + removeMotCle(jdc,"POST_ENDO_FISS","MODELE",pasDeRegle(),0) + # Renommage de SEUIL + renameMotCleInFact(jdc,"POST_ENDO_FISS","RECHERCHE","SEUIL","BORNE_MIN",pasDeRegle(),0) + + #### traitement de POST_FATIGUE ############################## + # Suppression du chargement periodique + genereErreurValeur(jdc,"POST_FATIGUE","CHARGEMENT",("'PERIODIQUE'",)) + + #### traitement de POST_GP ############################## + # Suppression de POST_GP au profit de CALC_GP + genereErreurPourCommande(jdc,("POST_GP",)) + + #### traitement de POST_K1_K2_K3 ############################## + # Suppression de VECT_K1 + removeMotCle(jdc,"POST_K1_K2_K3","VECT_K1",pasDeRegle(),0) + # Suppression de SYME_CHAR + removeMotCle(jdc,"POST_K1_K2_K3","SYME_CHAR",pasDeRegle(),0) + # Suppression de TABL_DEPL + removeMotCle(jdc,"POST_K1_K2_K3","TABL_DEPL_SUP",pasDeRegle(),0) + removeMotCle(jdc,"POST_K1_K2_K3","TABL_DEPL_INF",pasDeRegle(),0) + # Suppression de MAILLAGE + removeMotCle(jdc,"POST_K1_K2_K3","MAILLAGE",pasDeRegle(),0) + # Suppression de DTAN + removeMotCle(jdc,"POST_K1_K2_K3","DTAN_ORIG",pasDeRegle(),0) + removeMotCle(jdc,"POST_K1_K2_K3","DTAN_EXTR",pasDeRegle(),0) + + #### traitement de POST_K_TRANS ############################## + # Suppression de la possibilité de donner un mode_meca + genereErreurMotCleInFact(jdc,"POST_K_TRANS","K_MODAL","RESU_MODA") + + #### traitement de POST_MAC3COEUR ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de POST_MAIL_XFEM ############################## + # Suppression du mot-clé MAILLAGE_SAIN + removeMotCle(jdc,"POST_MAIL_XFEM","MAILLAGE_SAIN",pasDeRegle(),0) + + #### traitement de POST_RCCM ############################## + # Rien à faire + + #### traitement de POST_RELEVE_T ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"POST_RELEVE_T","SENSIBILITE",pasDeRegle(),0) + + #### traitement de POST_RUPTURE ############################## + # Rien à faire, n'existe pas en 10 + + #### traitement de POST_USURE ############################## + # Rien à faire + + #### traitement de POURSUITE ############################## + # Suppression du mot-clé TITRE + removeMotCleInFact(jdc,"POURSUITE","CATALOGUE","TITRE",pasDeRegle(),0) + removeMotCle(jdc,"POURSUITE","IMPRESSION",pasDeRegle(),0) + # Suppression des mots-clés mémoire dynamique + removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","GESTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","TYPE_ALLOCATION",pasDeRegle(),0) + removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","TAILLE",pasDeRegle(),0) + removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","PARTITION",pasDeRegle(),0) + removeMotCleInFact(jdc,"POURSUITE","MEMOIRE","DYNAMIQUE",pasDeRegle(),0) + + #### traitement de PROJ_BASE ############################## + # Suppression de RESU_GENE pour défaut de validation + genereErreurMCF(jdc,"PROJ_BASE","RESU_GENE") + + #### traitement de PROJ_CHAMP ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"PROJ_CHAMP","SENSIBILITE",pasDeRegle(),0) + + #### traitement de PROJ_RESU_BASE ############################## + # Suppression de RESU_GENE pour défaut de validation + genereErreurMCF(jdc,"PROJ_RESU_BASE","RESU_GENE") + + #### traitement de PROJ_SPEC_BASE ############################## + # Rien à faire + + #### traitement de PROPA_FISS ############################## + # Suppression de DTAN_ORIG et DTAN_EXTR pour calcul automatique + removeMotCleInFact(jdc,"PROPA_FISS","FISSURE","DTAN_ORIG",pasDeRegle(),0) + removeMotCleInFact(jdc,"PROPA_FISS","FISSURE","DTAN_EXTR",pasDeRegle(),0) + + #### traitement de PROPA_XFEM ############################## + # Suppression paramètres Loi de Paris + removeMotCle(jdc,"PROPA_XFEM","NB_POINT_FOND",pasDeRegle(),0) + removeMotCle(jdc,"PROPA_XFEM","TABLE",pasDeRegle(),0) + removeMotCle(jdc,"PROPA_XFEM","LOI_PROPA",pasDeRegle(),0) + removeMotCle(jdc,"PROPA_XFEM","COMP_LINE",pasDeRegle(),0) + + #### traitement de RAFF_XFEM ############################## + # Rien à faire + + #### traitement de RECU_FONCTION ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"RECU_FONCTION","SENSIBILITE",pasDeRegle(),0) + # Renommage critere table + dCRIT={"ABS_MAXI":"MAXI_ABS","ABS_MINI":"MINI_ABS"} + changementValeurDsMCF(jdc,"RECU_FONCTION","FILTRE","CRIT_COMP",dCRIT) + + #### traitement de RECU_GENE ############################## + # Rien à faire + + #### traitement de RESOUDRE ############################## + # Suppression d'algo pour PETSc + removeMotCleSiRegle(jdc,"RESOUDRE","ALGORITHME",((("BCGS","BICG","TFQMR",),"MCaPourValeur"),)) + + #### traitement de REST_SPEC_PHYS ############################## + # Rien à faire + + #### traitement de SIMU_POINT_MAT ############################## + # VALE_REF obligatoire si NOM_VARC in ('TEMP', 'SECH') + lNOMVARC=["CORR","IRRA","HYDR","EPSA","M_ACIER","M_ZIRC","NEUT1","NEUT2"] + removeMotCleInFactSiRegle(jdc,"SIMU_POINT_MAT","AFFE_VARC","VALE_REF",((("NOM_VARC",lNOMVARC,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"SIMU_POINT_MAT","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de STANLEY ############################## + # Rien à faire + + #### traitement de STAT_NON_LINE ############################## + # Renommage de IMPLEX + changementValeur(jdc,"STAT_NON_LINE","METHODE",{"IMPL_EX":"IMPLEX"}) + removeMotCle(jdc,"STAT_NON_LINE","IMPL_EX",pasDeRegle(),0) + # Renommage CRIT_FLAMB en CRIT_STAB + renameMotCle(jdc,"STAT_NON_LINE","CRIT_FLAMB","CRIT_STAB") + # Résorption de la sensibilité + removeMotCle(jdc,"STAT_NON_LINE","SENSIBILITE",pasDeRegle(),0) + # Déplacement du calcul d'erreur en temps ERRE_TEMPS + chercheOperInsereFacteurSiRegle(jdc,"STAT_NON_LINE","CRIT_QUALITE",((("INCREMENT","ERRE_TEMPS"),"existeMCsousMCF"),),1) + moveMotCleFromFactToFact(jdc,"STAT_NON_LINE","INCREMENT","ERRE_TEMPS","CRIT_QUALITE") + renameMotCleInFact(jdc,"STAT_NON_LINE","CRIT_QUALITE","ERRE_TEMPS","ERRE_TEMPS_THM",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","ERRE_TEMPS",pasDeRegle(),0) + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"STAT_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de THER_LINEAIRE ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"THER_LINEAIRE","SENSIBILITE",pasDeRegle(),0) + removeMotCle(jdc,"THER_LINEAIRE","SENS_INIT",pasDeRegle(),0) + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"THER_LINEAIRE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de THER_NON_LINE ############################## + # Résorption de la sensibilité + removeMotCle(jdc,"THER_NON_LINE","SENSIBILITE",pasDeRegle(),0) + # Suppression du mot clé OPTION ###################################### + moveMCFToCommand(jdc,"THER_NON_LINE","OPTION","CALC_CHAMP","THERMIQUE") + # Suppression de ARCHIVAGE/DETR_NUME_SUIV + removeMotCleInFact(jdc,"THER_NON_LINE","ARCHIVAGE","DETR_NUME_SUIV",pasDeRegle(),0) + + #### traitement de THER_NON_LINE_MO ############################## + # Rien à faire + + ################################################################# + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.Optionparser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier à traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile) + +if __name__ == '__main__': + main() diff --git a/Traducteur2/traduitV11V12.py b/Traducteur2/traduitV11V12.py new file mode 100755 index 00000000..e64fad7c --- /dev/null +++ b/Traducteur2/traduitV11V12.py @@ -0,0 +1,619 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV11V12.py --infile=xxxx --outfile=yyyy +""" + +import log +import optparse +import sys + +from Traducteur.load import getJDC +from Traducteur.mocles import parseKeywords +from Traducteur.removemocle import * +from Traducteur.renamemocle import * +from Traducteur.renamemocle import * +from Traducteur.inseremocle import * +from Traducteur.changeValeur import * +from Traducteur.movemocle import * +from Traducteur.dictErreurs import * +from Traducteur.regles import pasDeRegle + +atraiter=( + "AFFE_CARA_ELEM", + "AFFE_CHAR_MECA", + "AFFE_CHAR_MECA_C", + "AFFE_CHAR_MECA_F", + "AFFE_CHAR_THER", + "AFFE_MODELE", + "ASSEMBLAGE", + "CALC_ESSAI_GEOMECA", + "CALC_EUROPLEXUS", + "CALC_FATIGUE", + "CALC_FERRAILLAGE", + "CALC_FONCTION", + "CALC_FORC_NONL", + "CALC_G", + "CALC_IFS_DNL", + "CALC_MAC3COEUR", + "CALC_MATR_ELEM", + "CALC_META", + "CALC_MISS", + "CALC_MODAL", + "CALC_PRECONT", + "CALCUL", + "CALC_VECT_ELEM", + "CREA_MAILLAGE", + "DEBUT", + "DEFI_COMPOR", + "DEFI_FISS_XFEM", + "DEFI_LIST_INST", + "DEFI_MATER_GC", + "DEFI_MATERIAU", + "DEFI_OBSTACLE", + "DEFI_PART_PA_OPS", + "DYNA_NON_LINE", + "DYNA_TRAN_MODAL", + "DYNA_VIBRA", + "EXTR_TABLE", + "FACTORISER", + "GENE_ACCE_SEISME", + "IMPR_MISS_3D", + "IMPR_RESU", + "INFO_FONCTION", + "LIRE_MAILLAGE", + "LIRE_MISS_3D", + "LIRE_RESU", + "MACR_ASCOUF_CALC", + "MACR_ASCOUF_MAIL", + "MACR_ASPIC_CALC", + "MACR_ECREVISSE", + "MACR_INFO_MAIL", + "MACRO_BASCULE_SCHEMA", + "MACRO_MISS_3D", + "MACRO_MODE_MECA", + "MECA_STATIQUE", + "MODE_ITER_INV", + "MODE_ITER_SIMULT", + "MODI_MAILLAGE", + "MODI_MODELE_XFEM", + "POST_DYNA_ALEA", + "POST_ELEM", + "POST_FATIGUE", + "POURSUITE", + "RECU_FONCTION", + "STAT_NON_LINE", + "SIMU_POINT_MAT", + "TEST_COMPOR", + "THER_NON_LINE", + "DEFI_PART_FETI" + ) + +dict_erreurs={ + "AFFE_CHAR_MECA_F_ONDE_PLANE_DIRECTION":"Trois valeurs sont nécessaire pour définir la DIRECTION", + "CREA_MAILLAGE_ECLA_PG":"Le mot-clé NOM_CHAM est obligatoire", + "CALC_EUROPLEXUS_FONC_PARASOL":"Le mot-clé GROUP_MA est obligatoire dans le mot-clé facteur FONC_PARASOL "+ + "pour l'opérateur CALC_EUROPLEXUS", + "CALC_FERRAILLAGE":"Certains mots clés de CALC_FERRAILLAGE / AFFE sont obligatoires. "+ + "Pour TYPE_COMB='ELU' : PIVA et PIVB et ES, ES doit être supérieur à 0. "+ + "Pour TYPE_COMB='ELS' : CEQUI.", + "CALC_FONCTION_DSP_FREQ":"Le mot-clé FREQ n'est plus disponible remplacer par LIST_FREQ. La liste de réel \ + doit être obtenu avec DEFI_LIST_REEL", + "CALC_MODAL":"La commande CALC_MODAL a été supprimé et remplacer par CALC_MODES", + "CREA_MAILLAGE_DETR_GROUP_MA":"Le mot-clé DETR_GROUP_MA n'est plus disponible dans CREA_MAILLAGE. Utiliser la commande "+ + "DEFI_GROUP a la place, attention celle-ci est réentrante.", + "DEFI_COMPOR_POLYCRISTAL":"Le mot-clé MU_LOCA est obligatoire.", + "DEFI_FISS_XFEM":"Le mot-clé MAILLAGE est obligatoire", + "DEFI_MATER_GC_MAZARS":"Les mot-clés EIJ, EPSI_C, FTJ du mot-clé facteur MAZARS sont obligatoire", + "DEFI_MATERIAU_THER_FO":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_THER_ORTH":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_THER_NL":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_THER_HYDR":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_THER_COQUE":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_THER_COQUE_FO":"Attention les mot-clés suivants ('THER','THER_FO','THER_ORTH','THER_NL','THER_HYDR', "+ + "'THER_COQUE','THER_COQUE_FO') ne peuvent être utilisé en même temps.", + "DEFI_MATERIAU_DIS_VISC":"Les mot-clés C et PUIS_ALPHA du mot-clé facteur DIS_VISC sont obligatoire.", + "GENE_ACCE_SEISME_MODULATION":"Le mot-clé DUREE_PHASE_FORTE est obligatoire.", + "IMPR_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ + " CALC_MISS", + "INFO_FONCTION_NOCI_SEISME":"Le mot-clé FREQ_FOND est obligatoire.", + "LIRE_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ + " CALC_MISS", + "MACRO_MISS_3D":"Les commandes IMPR_MISS_3D, MACRO_MISS_3D et LIRE_MISS_3D ont été réunies dans la commande"+ + " CALC_MISS", + "RECU_FONCTION_TABLE":"Si la valeur de TABLE est obtenu par GENE_FONC_ALEA remplacer par le mot-clé " + "INTE_SPEC", + "TEST_COMPOR":"La commande TEST_COMPOR produit une table de sortie dans tous les cas.", + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + #### traitement de DEFI_PART_PA_OPS ############################## + genereErreurPourCommande(jdc,"DEFI_PART_PA_OPS") + + #### traitement de AFFE_CARA_ELEM ############################## + changementValeurDsMCFSiRegle(jdc,"AFFE_CARA_ELEM","POUTRE","CARA",{"R1":"R_DEBUT","R2":"R_FIN", + "EP1":"EP_DEBUT","EP2":"EP_FIN"}, + ((("POUTRE","MAILLE",),"nexistepasMCsousMCF"), + (("POUTRE","SECTION","CERCLE",jdc),"MCsousMCFaPourValeur"), + (("POUTRE","VARI_SECT","HOMOTHETIQUE",jdc),"MCsousMCFaPourValeur"), + ), + ) + + #### traitement de AFFE_CHAR_MECA ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_MECA","METHODE",pasDeRegle(),0) + # Suppression des mot-clés LIAISON_XFEM + removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_XFEM",pasDeRegle(),0) + removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT_XFEM",pasDeRegle(),0) + # Modification des parametres du mot-clé DDL_POUTRE + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","GROUP_MA","GROUP_MA_REPE",pasDeRegle(),0) + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_POUTRE","MAILLE","MAILLE_REPE",pasDeRegle(),0) + + # Résorption des mot-clés ANGLE_NAUT et CENTRE + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) + + #### traitement de AFFE_CHAR_MECA_F ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_MECA_F","METHODE",pasDeRegle(),0) + # Résorption des mot-clés ANGLE_NAUT et CENTRE + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","ANGL_NAUT",pasDeRegle(),0) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_SOLIDE","CENTRE",pasDeRegle(),0) + + genereErreurMotCleInFact(jdc,"AFFE_CHAR_MECA_F","ONDE_PLANE","DIRECTION") + + #### traitement de AFFE_CHAR_THER ############################## + # Suppression du mot-clé METHODE + removeMotCle(jdc,"AFFE_CHAR_THER","METHODE",pasDeRegle(),0) + + #### traitement de AFFE_MODELE ############################## + # Suppression des mot-clés GRILLE et VERIF + removeMotCle(jdc,"AFFE_MODELE","GRILLE",pasDeRegle(),0) + removeMotCle(jdc,"AFFE_MODELE","VERIF",pasDeRegle(),0) + + d3DINCO={"3D_INCO":"3D_INCO_UP","3D_INCO_OSGS":"3D_INCO_UPO", + "3D_INCO_GD":"3D_INCO_UPG","3D_INCO_LOG":"3D_INCO_UPG", + "3D_INCO_LUP":"3D_INCO_UP",} + dAXIS={"AXIS_INCO":"AXIS_INCO_UP","AXIS_INCO_OSGS":"AXIS_INCO_UPO", + "AXIS_INCO_GD":"AXIS_INCO_UPG","AXIS_INCO_LOG":"AXIS_INCO_UPG", + "AXIS_INCO_LUP":"AXIS_INCO_UP",} + dDPLAN={"D_PLAN_INCO":"D_PLAN_INCO_UP","D_PLAN_INCO_OSGS":"D_PLAN_INCO_UPO", + "D_PLAN_INCO_GD":"D_PLAN_INCO_UPG","D_PLAN_INCO_LOG":"D_PLAN_INCO_UPG", + "D_PLAN_INCO_LUP":"D_PLAN_INCO_UP",} + dINCO={} + dINCO.update(d3DINCO) + dINCO.update(dAXIS) + dINCO.update(dDPLAN) + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dINCO) + + #### traitement de ASSEMBLAGE ############################## + genereErreurValeurDsMCF(jdc,"ASSEMBLAGE","MATR_ASSE","OPTION",("'MASS_THER'",)) + + #### traitement de CALC_ESSAI_GEOMECA ############################## + renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_IMPOSE","GAMMA_IMPOSE",pasDeRegle(),0) + renameMotCleInFact(jdc,"CALC_ESSAI_GEOMECA","ESSAI_CISA_C","EPSI_ELAS","GAMMA_ELAS",pasDeRegle(),0) + + #### traitement de CALC_EUROPLEXUS ############################## + removeMotCle(jdc,"CALC_EUROPLEXUS","DIME",pasDeRegle(),0) + genereErreurMCF(jdc,"CALC_EUROPLEXUS","FONC_PARASOL") + removeMotCleInFact(jdc,"CALC_EUROPLEXUS","ARCHIVAGE","CONT_GENER") + + #### traitement de CALC_FERRAILLAGE ############################## + genereErreurPourCommande(jdc,"CALC_FERRAILLAGE") + + #### traitement de CALC_FONCTION ############################## + ajouteMotClefDansFacteur(jdc,"CALC_FONCTION","CORR_ACCE","METHODE='POLYNOME'",pasDeRegle(),0) + genereErreurMotCleInFact(jdc,"CALC_FONCTION","DSP","FREQ") + + #### traitement de CALC_G ############################## + removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","RESI_INTE_RELA",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_G","COMP_ELAS","ITER_INTE_MAXI",pasDeRegle(),0) + + #### traitement de CALC_FATIGUE ############################## + changementValeur(jdc,"CALC_FATIGUE","COURBE_GRD_VIE",{"MANSON_C":"MANSON_COFFIN",}) + + #### traitement de CALC_IFS_DNL ############################## + removeMotCle(jdc,"CALC_IFS_DNL","ENERGIE",pasDeRegle(),0) + + #### traitement de CALC_MAC3COEUR ############################## + ajouteMotClefDansFacteur(jdc,"CALC_MAC3COEUR","DEFORMATION","ARCHIMEDE = 'OUI'",pasDeRegle()) + + #### traitement de CALC_MATR_ELEM ############################## + genereErreurValeur(jdc,"CALC_MATR_ELEM","OPTION",("'MASS_THER'",)) + + #### traitement de CALC_MISS ############################## + genereErreurValeurDsMCF(jdc,"CALC_MISS","PARAMETRE","ISSF",("'OUI'",)) + + #### traitement de CALC_MODAL ############################## + # renameCommande(jdc,"CALC_MODAL","CALC_MODES", ) + genereErreurPourCommande(jdc,"CALC_MODAL") + + #### traitement de CALC_VECT_ELEM ############################## + genereErreurValeur(jdc,"CALC_VECT_ELEM","OPTION",("'FORC_NODA'",)) + + #### traitement de CREA_MAILLAGE ############################## + renameMotCle(jdc,"CREA_MAILLAGE","CREA_GROUP_MA","CREA_MAILLE") + genereErreurMCF(jdc,"CREA_MAILLAGE","ECLA_PG") + + lMCLEF=['COQU_VOLU', 'CREA_FISS', 'CREA_GROUP_MA', 'CREA_MAILLE', 'CREA_POI1', + 'ECLA_PG', 'HEXA20_27', 'LINE_QUAD', 'MODI_MAILLE','QUAD_LINE', + 'REPERE','RESTREINT','PENTA15_18'] + genereErreurMCF(jdc,"CREA_MAILLAGE","DETR_GROUP_MA") + removeMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","NB_MAILLE",((lMCLEF,"nexistepasMCFParmi"),)) + renameMotCleInFactSiRegle(jdc,"CREA_MAILLAGE","DETR_GROUP_MA","GROUP_MA","NOM",((lMCLEF,"nexistepasMCFParmi"),)) + renameCommandeSiRegle(jdc,"CREA_MAILLAGE","DEFI_GROUP",((lMCLEF,"nexistepasMCFParmi"),)) + + #### traitement de DEBUT ############################## + # genereErreurPourCommande(jdc,("DEBUT",)) + removeMotCleInFact(jdc,"DEBUT","CODE","NOM",pasDeRegle(),0) + + #### traitement de DEFI_COMPOR ############################## + genereErreurValeur(jdc,"DEFI_COMPOR","LOCALISATION",["'RL'",]) + genereErreurValeur(jdc,"DEFI_COMPOR","RELATION_KIT",["'RVMIS_ISOT_CINE'",]) + genereErreurValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","RELATION",["'LABORD_1D'"]) + genereErreurMCF(jdc,"DEFI_COMPOR","POLYCRISTAL") + + #### traitement de DEFI_FISS_XFEM ############################## + genereErreurPourCommande(jdc,("DEFI_FISS_XFEM",)) + removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE",pasDeRegle(),0) + removeMotCle(jdc,"DEFI_FISS_XFEM","MODELE_GRILLE",pasDeRegle(),0) + + #### traitement de DEFI_LIST_INST ############################## + changementValeurDsMCF(jdc,"DEFI_LIST_INST","ECHEC","ACTION",{"REAC_PRECOND":"DECOUPE"}) + + #### traitement de DEFI_MATER_GC ############################## + ajouteMotClefDansFacteur(jdc,"DEFI_MATER_GC","MAZARS","CODIFICATION='ESSAI'",pasDeRegle(),0) + + removeMotCleInFactSiRegle(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR", + ((("MAZARS","CODIFICATION",["ESSAI"],jdc),"MCsousMCFaPourValeurDansListe"),),) + renameMotCleInFact(jdc,"DEFI_MATER_GC","MAZARS","UNITE_LONGUEUR","UNITE_CONTRAINTE") + changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"MM":"MPa"}) + changementValeurDsMCF(jdc,"DEFI_MATER_GC","MAZARS","UNITE_CONTRAINTE",{"M":"Pa"}) + + genereErreurMCF(jdc,"DEFI_MATER_GC","MAZARS") + + #### traitement de DEFI_MATERIAU ############################## + lMLA=["F_MRR_RR", "C_MRR_RR", "F_MTT_TT", "C_MTT_TT", "F_MZZ_ZZ", + "C_MZZ_ZZ", "F_MRT_RT", "C_MRT_RT", "F_MRZ_RZ", "C_MRZ_RZ", + "F_MTZ_TZ", "C_MTZ_TZ",] + for param in lMLA: + removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI",param,pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","META_LEMA_ANI_FO",param,pasDeRegle(),0) + + lMDC=["BETA","DELTA1", "DELTA2", "DEPDT",] + for mcle in lMDC: + removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",mcle,pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",mcle,pasDeRegle(),0) + + removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT","NB_VALE",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO","NB_VALE",pasDeRegle(),0) + listeMc=["C"+str(i) for i in range(1,198)] + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",listeMc,"LISTE_COEF") + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",listeMc,"LISTE_COEF") + + removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0) + + genereErreurMCF(jdc,"DEFI_MATERIAU","DIS_VISC") + lDISC=["PUIS_DX", "PUIS_DY", "PUIS_DZ", "PUIS_RX", "PUIS_RY", "PUIS_RZ", + "COEF_DX", "COEF_DY", "COEF_DZ", "COEF_RX", "COEF_RY", "COEF_RZ"] + for param in lDISC: + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_VISC",param,pasDeRegle(),0) + + lTHMD=["PERMIN_X", "PERMIN_Y", "PERMIN_Z", "PERMINXY", "PERMINYZ", "PERMINZX",] + for param in lTHMD: + removeMotCleInFact(jdc,"DEFI_MATERIAU","THM_DIFFU",param,pasDeRegle(),0) + + # lMONODD=["DELTA1", "DELTA2"] + # for param in lMONODD: + # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC",param,pasDeRegle(),0) + # removeMotCleInFact(jdc,"DEFI_MATERIAU","MONO_DD_CC_IRRA",param,pasDeRegle(),0) + + removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","EF",pasDeRegle(),0) + removeMotCleInFact(jdc,"DEFI_MATERIAU","GLRC_DM","NUF",pasDeRegle(),0) + + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_FO") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_NL") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_HYDR") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE") + genereErreurMCF(jdc,"DEFI_MATERIAU","THER_COQUE_FO") + + + #### traitement de DEFI_OBSTACLE ############################## + lMCLE=("CRAYON_900","CRAYON_1300","GUID_A_CARTE_900", + "GUID_B_CARTE_900","GUID_C_CARTE_900","GUID_D_CARTE_900","GUID_E_CARTE_900", + "GUID_F_CARTE_900","GUID_A_CARTE_1300","GUID_B_CARTE_1300","GUID_C_CARTE_1300", + "GUID_D_CARTE_1300","GUID_E_CARTE_1300","GUID_F_CARTE_1300","GUID_A_CARSP_900", + "GUID_B_CARSP_900","GUID_C_CARSP_900","GUID_D_CARSP_900","GUID_E_CARSP_900", + "GUID_F_CARSP_900","GUID_A_CARSP_1300","GUID_B_CARSP_1300","GUID_C_CARSP_1300", + "GUID_D_CARSP_1300","GUID_E_CARSP_1300","GUID_F_CARSP_1300","GUID_A_GCONT_900", + "GUID_B_GCONT_900","GUID_C_GCONT_900","GUID_D_GCONT_900","GUID_E_GCONT_900", + "GUID_F_GCONT_900","GUID_A_GCONT_1300","GUID_B_GCONT_1300","GUID_C_GCONT_1300", + "GUID_D_GCONT_1300","GUID_E_GCONT_1300","GUID_F_GCONT_1300","GUID_A_GCOMB_900", + "GUID_B_GCOMB_900","GUID_C_GCOMB_900","GUID_D_GCOMB_900","GUID_E_GCOMB_900", + "GUID_F_GCOMB_900","GUID_A_GCOMB_1300","GUID_B_GCOMB_1300","GUID_C_GCOMB_1300", + "GUID_D_GCOMB_1300","GUID_E_GCOMB_1300","GUID_F_GCOMB_1300",) + genereErreurValeur(jdc,"DEFI_OBSTACLE","TYPE",lMCLE) + + #### traitement de DYNA_TRAN_MODAL ############################## + removeMotCle(jdc,"DYNA_TRAN_MODAL","LAME_FLUIDE",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_TRAN_MODAL","PARA_LAME_FLUI",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_TRAN_MODAL","RELA_TRANSIS",pasDeRegle(),0) + + #### traitement de DYNA_VIBRA ############################## + removeMotCle(jdc,"DYNA_VIBRA","LAME_FLUIDE",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_VIBRA","PARA_LAME_FLUI",pasDeRegle(),0) + removeMotCle(jdc,"DYNA_VIBRA","RELA_TRANSIS",pasDeRegle(),0) + + #### traitement de EXTR_TABLE ############################## + changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"MATR_ELEM":"MATR_TANG_ELEM"}) + changementValeurDsMCF(jdc,"EXTR_TABLE","FILTRE","VALE_K",{"CODE_RETOUR":"CODE_RETOUR_INTE"}) + + #### traitement de FACTORISER ############################## + renameMotCle(jdc,"FACTORISER","ELIM_LAGR2","ELIM_LAGR") + changementValeur(jdc,"FACTORISER","ELIM_LAGR",{"OUI":"LAGR2",}) + + #### traitement de GENE_ACCE_SEISME ############################## + genereErreurMCF(jdc,"GENE_ACCE_SEISME","MODULATION") + moveMotCleFromFactToFather(jdc,"GENE_ACCE_SEISME","MODULATION","DUREE_PHASE_FORTE") + + + removeMotCleInFact(jdc,"GENE_ACCE_SEISME","MODULATION","PARA") + removeMotCleInFactSiRegle(jdc,"GENE_ACCE_SEISME","MODULATION","INST_INI",((("MODULATION","TYPE",["GAMMA"],jdc),"MCsousMCFnaPasPourValeurDansListe"),)) + + removeMotCleInFact(jdc,"GENE_ACCE_SEISME","DSP","FREQ_PENTE") + + #### traitement de IMPR_MISS_3D ############################## + genereErreurPourCommande(jdc,"IMPR_MISS_3D") + # removeCommande(jdc,"IMPR_MISS_3D") + + #### traitement de IMPR_RESU ############################## + removeMotCle(jdc,"IMPR_RESU","RESTREINT",pasDeRegle(),0) + + #### traitement de INFO_FONCTION ############################## + genereErreurMCF(jdc,"INFO_FONCTION","NOCI_SEISME") + + #### traitement de LIRE_MAILLAGE ############################## + removeMotCle(jdc,"LIRE_MAILLAGE","ABSC_CURV",pasDeRegle(),0) + + #### traitement de LIRE_MISS_3D ############################## + genereErreurPourCommande(jdc,"LIRE_MISS_3D") + + #### traitement de MACR_ASCOUF_CALC ############################## + removeMotCle(jdc,"MACR_ASCOUF_CALC","CL_BOL_P2_GV",pasDeRegle(),0) + # genereErreurMCF(jdc,"MACR_ASCOUF_CALC","COMP_ELAS") + + #### traitement de MACR_ASCOUF_MAIL ############################## + genereErreurValeurDsMCF(jdc,"MACR_ASCOUF_MAIL","COUDE","BOL_P2",("'GV'",)) + + #### traitement de MACR_ASPIC_CALC ############################## + # genereErreurMCF(jdc,"MACR_ASPIC_CALC","COMP_ELAS") + + #### traitement de MACR_ECREVISSE ############################## + genereErreurMCF(jdc,"MACR_ECREVISSE","COMP_INCR") + + #### traitement de MACR_INFO_MAIL ############################## + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_6":"V11_2"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N":"V11_N"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V10_N_PERSO":"V11_N_PERSO"}) + + #### traitement de MACRO_BASCULE_SCHEMA ############################## + renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_IMPL","COMPORTEMENT_IMPL",pasDeRegle()) + renameMotCle(jdc,"MACRO_BASCULE_SCHEMA","COMP_INCR_EXPL","COMPORTEMENT_EXPL",pasDeRegle()) + + #### traitement de MACRO_MISS_3D ############################## + genereErreurPourCommande(jdc,"MACRO_MISS_3D") + + #### traitement de MACRO_MODE_MECA ############################## + # insereMotCleDansCommande(jdc,"MACRO_MODE_MECA","TYPE_RESU='DYNAMIQUE'") + chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","SOLVEUR_MODAL",) + chercheOperInsereFacteur(jdc,"MACRO_MODE_MECA","OPTION='BANDE'",pasDeRegle(),0) + chercheOperInsereFacteurSiRegle(jdc,"MACRO_MODE_MECA","NORM_MODE",((("NORM_MODE",),"nexistepas"),),1) + + lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MACRO_MODE_MECA",mcle,"SOLVEUR_MODAL") + + moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MACRO_MODE_MECA","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + renameCommande(jdc,"MACRO_MODE_MECA","CALC_MODES", ) + + #### traitement de MODE_ITER_INV ############################## + chercheOperInsereFacteur(jdc,"MODE_ITER_INV","SOLVEUR_MODAL",) + moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_FREQ","OPTION") + moveMotCleFromFactToFather(jdc,"MODE_ITER_INV","CALC_CHAR_CRIT","OPTION") + + lINV=["OPTION", "PREC", "NMAX_ITER",] + for mcle in lINV: + renameMotCleInFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle,mcle+"_INV",pasDeRegle(),0) + moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_MODE",mcle+"_INV","SOLVEUR_MODAL") + + lMCLE=["NMAX_ITER_AJUSTE","PREC_AJUSTE",] + for mcle in lMCLE: + moveMotCleFromFactToFact(jdc,"MODE_ITER_INV","CALC_FREQ",mcle,"SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_JACOBI","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","PREC_BATHE","SOLVEUR_MODAL") + + removeMotCle(jdc,"MODE_ITER_INV","CALC_MODE",pasDeRegle(),0) + + chercheOperInsereMotCleSiRegle(jdc,"MODE_ITER_INV","OPTION='AJUSTE'",((("OPTION",),"nexistepas"),),0) + + renameCommande(jdc,"MODE_ITER_INV","CALC_MODES", ) + + #### traitement de MODE_ITER_SIMULT ############################## + chercheOperInsereFacteur(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",) + removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("METHODE","TRI_DIAG",jdc),"MCnaPasPourValeur"),),) + removeMotCleSiRegle(jdc,"MODE_ITER_SIMULT","OPTION",((("OPTION","SANS",jdc),"MCaPourValeur"),),) + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","OPTION","SOLVEUR_MODAL") + changementValeurDsMCF(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION",{"MODE_RIGIDE":"OUI"}) + renameMotCleInFact(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL","OPTION","MODE_RIGIDE") + moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_FREQ","OPTION") + moveMotCleFromFactToFather(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","OPTION") + + # chercheOperInsereFacteurSiRegle(jdc,"MODE_ITER_SIMULT","SOLVEUR_MODAL",((("METHODE",),"existe"),),1) + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","METHODE","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","TYPE_QZ","SOLVEUR_MODAL") + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT","NMAX_ITER_BATHE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","COEF_DIM_ESPACE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","DIM_SOUS_ESPACE","SOLVEUR_MODAL") + + removeMotCleInFactSiRegle(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE", + ((("SOLVEUR_MODAL","METHODE",["QZ"],jdc),"MCsousMCFnaPasPourValeurDansListe")or + (("SOLVEUR_MODAL","METHODE",),"nexistepasMCsousMCF"), + ) + ) + + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","APPROCHE","SOLVEUR_MODAL") + moveMotCleFromFactToFact(jdc,"MODE_ITER_SIMULT","CALC_CHAR_CRIT","APPROCHE","SOLVEUR_MODAL") + + lMCLE=["PREC_SOREN", "NMAX_ITER_SOREN", "PARA_ORTHO_SOREN"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") + + lMCLE=["NMAX_ITER_QR", "PREC_ORTHO", "NMAX_ITER_ORTHO", "PREC_LANCZOS"] + for mcle in lMCLE: + moveMotClefInOperToFact(jdc,"MODE_ITER_SIMULT",mcle,"SOLVEUR_MODAL") + + + renameCommande(jdc,"MODE_ITER_SIMULT","CALC_MODES", ) + + #### traitement de MODI_MAILLAGE ############################## + genereErreurValeurDsMCF(jdc,"MODI_MAILLAGE","DEFORME","OPTION",("'TRAN_APPUI'",)) + removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_APPUI"],pasDeRegle(),0) + removeMotCleInFact(jdc,"MODI_MAILLAGE","DEFORME",["GROUP_NO_STRU"],pasDeRegle(),0) + + #### traitement de MODI_MODELE_XFEM ############################## + changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P1P1":"STANDARD",}) + changementValeur(jdc,"MODI_MODELE_XFEM","CONTACT",{"P2P1":"STANDARD",}) + + + #### traitement de POST_DYNA_ALEA ############################## + chercheOperInsereFacteurSiRegle(jdc,"POST_DYNA_ALEA","INTERSPECTRE",((("INTE_SPEC",),"existe"),),1) + lPDA=["INTE_SPEC", "NUME_ORDRE_I", "NOEUD_I", "OPTION", "NUME_ORDRE_J", + "NOEUD_J", "NOM_CMP_I", "NOM_CMP_J", "MOMENT", "DUREE"] + for mcle in lPDA: + moveMotClefInOperToFact(jdc,"POST_DYNA_ALEA",mcle,"INTERSPECTRE") + removeMotCle(jdc,"POST_DYNA_ALEA","TOUT_ORDRE",pasDeRegle(),0) + + ajouteMotClefDansFacteur(jdc,"POST_DYNA_ALEA","FRAGILITE","METHODE = 'EMV'",pasDeRegle()) + + #### traitement de POST_ELEM ############################## + ajouteMotClefDansFacteurSiRegle(jdc,"POST_ELEM","VOLUMOGRAMME","NB_INTERV=5", + ((("VOLUMOGRAMME","NB_INTERV",),"nexistepasMCsousMCF"),),) + + #### traitement de POST_FATIGUE ############################## + changementValeur(jdc,"POST_FATIGUE","DOMMAGE",{"MANSON_C":"MANSON_COFFIN",}) + + #### traitement de POURSUITE ############################## + removeMotCle(jdc,"POURSUITE","CODE",)#"NOM",pasDeRegle(),0) + + #### traitement de RECU_FONCTION ############################## + genereErreurMCF(jdc,"RECU_FONCTION","TABLE") + + #### traitement de C_COMP_INCR et C_COMP_ELAS ############################## + lCOM=["CALCUL","STAT_NON_LINE","CALC_G", "CALC_PRECONT","DYNA_NON_LINE","CALC_META", + "TEST_COMPOR","SIMU_POINT_MAT","CALC_ESSAI_GEOMECA","CALC_FORC_NONL","LIRE_RESU", + "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_EUROPLEXUS","MACR_ECREVISSE",] + for com in lCOM: + # chercheOperInsereFacteurSiRegle(jdc,com,"COMPORTEMENT",(((["COMPORTEMENT"],),"nexistepasMCFParmi"),),1) + fusionMCFToMCF(jdc,com,["COMP_ELAS","COMP_INCR"],"COMPORTEMENT") + # renameMotCle(jdc,com,"COMP_ELAS","COMPORTEMENT") + # renameMotCle(jdc,com,"COMP_INCR","COMPORTEMENT") + chercheOperInsereFacteurSiRegle(jdc,com,"ETAT_INIT",((("COMPORTEMENT","SIGM_INIT",),"existeMCsousMCF"),),1) + moveMotCleFromFactToFact(jdc,com,"COMPORTEMENT","SIGM_INIT","ETAT_INIT") + renameMotCleInFact(jdc,com,"ETAT_INIT","SIGM_INIT","SIGM",pasDeRegle(),0) + removeMotCleInFact(jdc,com,"COMPORTEMENT","SIGM_INIT",pasDeRegle(),0) + + changementValeur(jdc,com,"OPTION",{"FORC_INT_ELEM":"FORC_INTE_ELEM"}) + + removeMotCleInFactSiRegle(jdc,com,"COMPORTEMENT","NB_VARI",((("COMPORTEMENT","RELATION","'MFRONT'",jdc),"MCsousMCFaPourValeur"),)) + + + #### traitement de TEST_COMPOR ############################## + genereErreurPourCommande(jdc,"TEST_COMPOR") + + #### traitement de THER_NON_LINE ############################## + renameMotCle(jdc,"THER_NON_LINE","COMP_THER_NL","COMPORTEMENT") + + #### traitement de C_SOLVEUR ############################## + lCOM=['CALC_ERREUR', 'CALC_FORC_AJOU', 'CALC_IFS_DNL', 'CALC_MATR_AJOU', 'CALC_PRECONT', + 'CREA_ELEM_SSD', 'DEFI_BASE_MODALE', 'DYNA_LINE_HARM', 'DYNA_LINE_TRAN', 'DYNA_NON_LINE', + 'DYNA_TRAN_MODAL', 'INFO_MODE', 'MACR_ASCOUF_CALC', 'MACR_ASPIC_CALC', 'MACRO_BASCULE_SCHEMA', + 'MACRO_MATR_AJOU', 'MECA_STATIQUE', 'MODE_ITER_SIMULT', 'MODE_ITER_INV', 'MODE_STATIQUE', + 'STAT_NON_LINE', 'THER_LINEAIRE', 'THER_NON_LINE', 'THER_NON_LINE_MO', 'CALC_ERC_DYN','CALC_MODES',] + for com in lCOM: + # Suppression de ELIM_LAGR2 + changementValeurDsMCF(jdc,com,"SOLVEUR","ELIM_LAGR2",{"OUI":"LAGR2"}) + removeMotCleInFactSiRegle(jdc,com,"SOLVEUR","ELIM_LAGR2",((("SOLVEUR","ELIM_LAGR2","NON",jdc),"MCsousMCFaPourValeur"),)) + renameMotCleInFact(jdc,com,"SOLVEUR","ELIM_LAGR2","ELIM_LAGR") + + # Suppression de la méthode FETI + genereErreurValeurDsMCF(jdc,com,"SOLVEUR","METHODE",["FETI"]) + lMCLE=["NB_REORTHO_DD","NMAX_ITER","INFO_FETI","RESI_RELA","PARTITION"] + for mocle in lMCLE: + genereErreurMotCleInFact(jdc,com,"SOLVEUR",mocle) + + #### traitement de DEFI_PART_FETI ############################## + genereErreurMCF(jdc,"DEFI_PART_FETI","EXCIT") + removeMotCle(jdc,"DEFI_PART_FETI","EXCIT",pasDeRegle(),0) + removeMotCle(jdc,"DEFI_PART_FETI","CORRECTION_CONNEX",pasDeRegle(),0) + genereErreurPourCommande(jdc,"DEFI_PART_FETI") + renameCommande(jdc,"DEFI_PART_FETI","DEFI_PARTITION", ) + + ################################################################# + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.Optionparser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier à traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile) + +if __name__ == '__main__': + main() diff --git a/Traducteur2/traduitV7V8.py b/Traducteur2/traduitV7V8.py new file mode 100644 index 00000000..d0a79658 --- /dev/null +++ b/Traducteur2/traduitV7V8.py @@ -0,0 +1,519 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV7V8.py --infile=xxxx --outfile=yyyy +""" + +import sys +import log +import optparse + +from load import getJDC +from mocles import parseKeywords +from removemocle import * +from renamemocle import * +from renamemocle import * +from inseremocle import * +from changeValeur import * +from movemocle import * +from dictErreurs import genereErreurPourCommande,genereErreurMotCleInFact + +import calcG + +atraiter=( "IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE", + "CALC_G_LOCAL_T","CALC_G_THETA_T","CALC_G","AFFE_CHAR_MECA", + "AFFE_CHAR_THER_F","IMPR_CO","DEFI_SQUELETTE","DEFI_FONCTION", + "CALC_THETA","AFFE_MODELE","DYNA_NON_LINE","CALC_ELEM", + "CALC_NO","EXTR_MODE","CALC_META","IMPR_RESU","TEST_RESU", + "DEFI_THER_JOULE","DYNA_TRAN_EXPLI","DEBUT","CALC_CHAM_ELEM", + "AFFE_CHAR_THER", "MACR_LIGN_COUPE","POST_RCCM","PROJ_MESU_MODAL", + "CREA_RESU","CREA_CHAMP","DIST_LIGN_3D","MODI_MAILLAGE","LIRE_TABLE", + "POST_SIMPLIFIE","AFFE_MATERIAU","DEFI_MAILLAGE","DEPL_INTERNE", + "POST_DYNA_ALEA","RECU_FONCTION","DYNA_TRAN_MODAL","DEFI_INTERF_DYNA", + "CALC_PRECONT","DEFI_TEXTURE","TEST_RESU","COMB_CHAM_NO","COMB_CHAM_ELEM", + "CALC_FATIGUE","IMPR_OAR", "AFFE_CHAR_MECA_F", + "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_CABRI_CALC", + "MACR_ADAP_MAIL","IMPR_FICO_HOMARD","DEFI_PART_FETI" + ) + +dict_erreurs={ +#STA8 + "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", + "DEFI_THER_JOULE": "la commande DIST_LIGN_3D a ete supprimee", + "DIST_LIGN_3D": "la commande DIST_LIGN_3D a ete supprimee", + "AFFE_MODELE_AFFE": "Les modelisations APPUI_REP, ASSE_GRIL et 3D_JOINT_CT ont ete supprimees", + "AFFE_CHAR_MECA_CONTACT_FROTTEMENT": "Suppression d un mot clef FROTTEMENT", + "AFFE_CHAR_MECA_SECH_CALCULEE": "le sechage est maintenant une variable de commande", + "AFFE_CHAR_MECA_HYDR_CALCULEE": "l'hydratation est maintenant une variable de commande", + "AFFE_CHAR_MECA_EPSA_CALCULEE":"EPSA est maintenant une variable de commande", + "AFFE_CHAR_MECA_PRESSION_CALCULEE":"PRESSION_CALCULEE est remplace par EVOL_CHAR", + "MACR_LIGN_COUPE" : "MACR_LIGN_COUPE demande un traitement manuel", + "POST_RCCM" : "POST_RCCM demande un traitement manuel", + "DEFI_MATERIAU_CHABOCHE" : "remplacer la valeur CINx_CHAB", + "DEFI_MATERIAU_POLY_CFC" : "le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", + "DEFI_MATERIAU_ECOU_PLAS1" : "le materiau ECOU_PLAS1 est supprime", + "DEFI_MATERIAU_COMP_THM_ELAS_THM" : "le materiau ELAS_THM a ete supprime", + "DEFI_MATERIAU_COMP_THM_SURF_ETAT_SATU" : "le materiau SURF_ETAT_SATU a ete supprime", + "DEFI_MATERIAU_COMP_THM_SURF_ETAT_NSAT" : "le materiau SURF_ETAT_NSAT a ete supprime", + "DEFI_MATERIAU_COMP_THM_CAM_CLAY_THM" : "le materiau CAM_CLAY_THM a ete supprime", + "DEFI_MATERIAU_COMP_THM_LIQU_SATU_GAT" : "le materiau LIQU_SATU_GAT a ete supprime", + "DEFI_MATERIAU_COMP_THM_LIQU_NSAT_GAT" : "le materiau LIQU_NSAT_GAT a ete supprime", + "DEFI_MATERIAU_GLRC" : "le materiau GLRC a ete remplace par GLRC_DAMAGE", + "DEFI_MATERIAU_GLRC_FO" : "le materiau GLRC_FO a ete remplace par GLRC_DAMAGE", + "DEFI_MATERIAU_OHNO" : "le materiau OHNO a ete remplace par TAHERI", + "DEFI_MATERIAU_OHNO_FO" : "le materiau OHNO a ete remplace par TAHERI", + "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC", + "CALC_G_THETA_T_OPTION_VALEUR":"verifier la valeur d OPTION", + "CALC_G_THETA_T_OPTION_DEFAUT":"verifier la valeur d OPTION donnee a la place du defaut", + "CALC_G_MODELE":"Mot Clef MODELE supprime sous CALC_G", + "CALC_G_DEPL":"Mot Clef DEPL supprime sous CALC_G", + "CALC_G_CHAM_MATER":"Mot Clef CHAM_MATER supprime sous CALC_G", + "CALC_G_CARA_ELEM":"Mot Clef CARA_ELEM supprime sous CALC_G", + "CALC_G_RESULTAT=XXX,":"Mot Clef RESULTAT a completer sous CALC_G", + "AFFE_MODELE_AFFE_MODELISATION_VALEUR":"verifier la valeur de MODELISATION", + "STAT_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", + "STAT_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", + "STAT_NON_LINE_VARI_COMM":"suppression des variables de commande", + "STAT_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du STAT_NON_LINE", + "DYNA_NON_LINE_COMP_INCR_RELATION_VALEUR":"verifier la valeur de RELATION", + "DYNA_NON_LINE_COMP_INCR_RELATION_KIT_VALEUR":"verifier la valeur de RELATION_KIT", + "DYNA_NON_LINE_VARI_COMM":"suppression des variables de commande", + "DYNA_NON_LINE_INCREMENT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du DYNA_NON_LINE", + "CALC_PRECONT_SUBD_PAS":"Si SUBD_PAS=1 il n'y a pas subdivision : le mot est clef est ote du CALC_PRECONT", + "TEST_RESU_UNITE":"suppression du mot clef UNITE dans TEST_RESU", + "POST_SIMPLIFIE":"commande POST_SIMPLIFIE supprimee", + "POST_DYNA_ALEA_GAUSS":"la methode GAUSS a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_VANMARCKE":"la methode VANMARCKE a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_DEPASSEMENT":"la methode DEPASSEMENT a ete supprimee de POST_DYNA_ALEA", + "POST_DYNA_ALEA_RAYLEIGH":"la methode RAYLEIGH a ete supprimee de POST_DYNA_ALEA", + "DYNA_TRAN_MODAL_EXCIT_NUME_MODE":"le numero du mode utilise pour EXCIT DYNA_TRAN_MODAL est le numero d'ORDRE", + "DEFI_INTERF_DYNA_INTERFACE_DDL_ACTIF":"DDL_ACTIF supprime de DEFI_INTERF_DYNA; utiliser MASQUE", + "DEFI_TEXTURE":"le materiau POLY_CFC est remplace par le comportement POLYCRISTAL", + "CREA_RESU_NOM_CHAM_VALEUR":"HYDR_ELGA est remplace par HYDR_ELNO_ELGA et HYDR_NOEU_ELGA", + "COMB_CHAM_NO":"COMB_CHAM_NO est remplace par CREA_CHAMP", + "COMB_CHAM_ELEM":"COMB_CHAM_ELEM est remplace par CREA_CHAMP", + "IMPR_OAR":"IMPR_OAR demande un traitement manuel", + "IMPR_FICO_HOMARD":"IMPR_FICO_HOMARD a ete integre dans MACR_ADPA_MAIL", + } + +sys.dict_erreurs=dict_erreurs + +#atraiter=( "MACR_ADAP_MAIL",) + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + ####################### traitement erreurs ######################## + genereErreurPourCommande(jdc,("DEBUT","POST_RCCM","DIST_LIGN_3D","IMPR_OAR","COMB_CHAM_NO","COMB_CHAM_ELEM")) + + ####################### traitement CALC_META ####################### + renameMotCleInFact(jdc,"CALC_META","ETAT_INIT","META_INIT","META_INIT_ELNO") + + ####################### traitement CALC_FONCTION ####################### + removeMotCleSiRegle(jdc,"CALC_FONCTION","NOM_PARA",((("MAX"),"existeMCFParmi"),)) + renameCommandeSiRegle(jdc,"CALC_FONCTION","INFO_FONCTION", ((("RMS","MAX","NOCI_SEISME","NORME","ECART-TYPE"),"existeMCFParmi"),)) + renameMotCleInFact(jdc,"CALC_FONCTION","LISS_ENVELOP","FONCTION","NAPPE") + + ####################### traitement IMPR_GENE ####################### + moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","UNITE") + moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","FORMAT") + + ####################### traitement STAT/DYNA_NON_LINE ####################### + moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) + removeMotCleAvecErreur(jdc,"STAT_NON_LINE","VARI_COMM") + moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","VARI_COMM") + + dStatNonLine={"ELAS":"ELAS_THER"} + lavertit=("ELAS") + changementValeurDsMCFAvecAvertissement(jdc,"STAT_NON_LINE","COMP_INCR","RELATION_KIT",dStatNonLine,lavertit) + + lavertit=("CHABOCHE","ASSE_COMBU","OHNO","GLRC") + dchaboche={"CHABOCHE":"VMIS_CIN1_CHAB","ASSE_COMBU":"XXX_IRA","OHNO":"VISC_TAHERI","GLRC":"GLRC_DAMAGE"} + changementValeurDsMCFAvecAvertissement(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dchaboche,lavertit) + changementValeurDsMCFAvecAvertissement(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dchaboche,lavertit) + + removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegleAvecErreur(jdc,"STAT_NON_LINE","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"STAT_NON_LINE","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + renameMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegleAvecErreur(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + renameMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + + moveMotClefInOperToFact(jdc,"STAT_NON_LINE","PARM_THETA","COMP_INCR") + moveMotClefInOperToFact(jdc,"DYNA_NON_LINE","PARM_THETA","COMP_INCR") + moveMotClefInOperToFact(jdc,"DYNA_TRAN_EXPLI","PARM_THETA","COMP_INCR") + + ####################### traitement DEFI_MATERIAU ####################### + renameMotCle(jdc,"DEFI_MATERIAU","LEMAITRE","LEMAITRE_IRRA") + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","QSR_K",("LEMAITRE_IRRA",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","BETA",("LEMAITRE_IRRA",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","PHI_ZERO",("LEMAITRE_IRRA",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","L",("LEMAITRE_IRRA",)) + removeMotCle(jdc,"DEFI_MATERIAU","FLU_IRRA") + renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","CHABOCHE","CINx_CHAB") + renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO","TAHERI") + renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO_FO","TAHERI_FO") + renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC","GLRC_DAMAGE") + renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC_FO","GLRC_DAMAGE") + + renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","A","GRAN_A") + renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","B","GRAN_B") + renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","S","GRAN_S") + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_A",("LEMAITRE_IRRA",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_B",("LEMAITRE_IRRA",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_S",("LEMAITRE_IRRA",)) + removeMotCle(jdc,"DEFI_MATERIAU","GRAN_IRRA") + + chercheOperInsereFacteurSiRegle(jdc,"DEFI_MATERIAU","ELAS",((("CABLE",),"existe"),)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","E", ("ELAS",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","NU", ("ELAS",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","RHO",("ELAS",)) + moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","CABLE","ALPHA",("ELAS",)) + ajouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","ELAS","NU=0.,",((("ELAS","NU"),"nexistepasMCsousMCF"),)) + + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","POLY_CFC") + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ECOU_PLAS1") + + lavertit=("ELAS_THM","SURF_ETAT_SATU","SURF_ETAT_NSAT","CAM_CLAY_THM","LIQU_SATU_GAT","LIQU_NSAT_GAT") + dTHM={"ELAS_THM":"xxx", "SURF_ETAT_SATU":"xxx", "SURF_ETAT_NSAT":"xxx","CAM_CLAY_THM":"xxx","LIQU_SATU_GAT":"xxx","LIQU_NSAT_GAT":"xxx"} + changementValeurAvecAvertissement(jdc,"DEFI_MATERIAU","COMP_THM",dTHM,lavertit) + + dfatigue={"MATAKE":"MATAKE_MODI_AC", "DOMM_MAXI":"MATAKE_MODI_AV", "FATEMI_SOCIE":"FATESOCI_MODI_AV"} + changementValeurDsMCF(jdc,"DEFI_MATERIAU","CISA_PLAN_CRIT","CRITERE",dfatigue) + + ####################### traitement IMPR_CO ####################### + chercheOperInsereFacteurSiRegle(jdc,"IMPR_CO","CONCEPT",((("CO",),"existe"),)) + moveMotClefInOperToFact(jdc,"IMPR_CO","CO","CONCEPT") + renameMotCleInFact(jdc,"IMPR_CO","CONCEPT","CO","NOM") + + ####################### traitement DEFI_SQUELETTE ####################### + chercheOperInsereFacteurSiRegle(jdc,"DEFI_SQUELETTE","CYCLIQUE",((("MODE_CYCL",),"existe"),)) + moveMotClefInOperToFact(jdc,"DEFI_SQUELETTE","MODE_CYCL","CYCLIQUE") + + ####################### traitement AFFE_CHAR_* ####################### + removeMotCle(jdc,"AFFE_CHAR_MECA","VERI_DDL") + removeMotCle(jdc,"AFFE_CHAR_MECA","SECH_CALCULEE") + removeMotCle(jdc,"AFFE_CHAR_MECA","HYDR_CALCULEE") + removeMotCle(jdc,"AFFE_CHAR_MECA","PRESSION_CALCULEE") + removeMotCleAvecErreur(jdc,"AFFE_CHAR_MECA","EPSA_CALCULEE") + removeMotCle(jdc,"AFFE_CHAR_THER_F","VERI_DDL") + removeMotCle(jdc,"AFFE_CHAR_THER","VERI_DDL") + + ####################### traitement AFFE_CHAR_MECA (CONTACT) ####################### + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","COEF_MULT_ESCL","COEF_MULT") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NOM_CHAM","NOM_CMP") + renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) + renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","APPARIEMENT") + + ####################### traitement AFFE_CHAR_MECA_F (CONTACT) ####################### + renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","COEF_MULT_ESCL","COEF_MULT") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","NOM_CHAM","NOM_CMP") + renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) + renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),)) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","APPARIEMENT") + + ####################### traitement CALC_G ####################### + chercheOperInsereFacteurSiRegle(jdc,"CALC_G_LOCAL_T","LISSAGE",((("LISSAGE_G","LISSAGE_THETA","DEGRE"),"existeMCFParmi"),)) + moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_THETA","LISSAGE") + moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_G","LISSAGE") + moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","DEGRE","LISSAGE") + + dlocal={"CALC_G_LGLO":"G_LAGR", "G_BILINEAIRE":"G_BILI", "CALC_G_MAX":"G_MAX"} + changementValeur(jdc,"CALC_G_LOCAL_T","OPTION",dlocal) + # + dtheta={"CALC_G_LAGR":"G_LAGR_GLOB", "G_BILINEAIRE":"G_BILI_GLOB", "CALC_G_MAX":"G_MAX_GLOB","CALC_G":"CALC_G_GLOB"} + # Attention si le defaut doit generer un avertissement Il faut le mettre comme dernier mot de la liste + lavertit=("CALC_G_LAGR","CALC_G","defaut") + changementValeurAvecAvertissement(jdc,"CALC_G_THETA_T","OPTION",dtheta,lavertit) + renameOper(jdc,"CALC_G_LOCAL_T","CALC_G") + renameOper(jdc,"CALC_G_THETA_T","CALC_G") + + # Attention cela necessite un traitement particulier et ne peut pas etre generalise tel quel + # Attention egalement doit etre fait avant le regroupement dans THETA + calcG.traitementRayon(jdc) + renameMotCle(jdc,"CALC_G","THETA","THETA_OLD") + chercheOperInsereFacteur(jdc,"CALC_G","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","THETA_OLD","THETA") + renameMotCleInFact(jdc,"CALC_G","THETA","THETA_OLD","THETA") + + moveMotClefInOperToFact(jdc,"CALC_G","FOND_FISS","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","R_INF_FO","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","R_SUP_FO","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","R_INF","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","R_SUP","THETA") + moveMotClefInOperToFact(jdc,"CALC_G","FISSURE","THETA") + renameMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA","THETA_LAGR",((("THETA","R_INF"),"existeMCsousMCF"),)) + renameMotCleInFactSiRegle(jdc,"CALC_G","THETA","THETA","THETA_LAGR",((("THETA","R_SUP"),"existeMCsousMCF"),)) + moveMotCleFromFactToFather(jdc,"CALC_G","THETA","THETA_LAGR") + removeMotCleAvecErreur(jdc,"CALC_G","MODELE") + removeMotCleAvecErreur(jdc,"CALC_G","DEPL") + removeMotCleAvecErreur(jdc,"CALC_G","CHAM_MATER") + removeMotCleAvecErreur(jdc,"CALC_G","CARA_ELEM") + chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,"CALC_G","RESULTAT=XXX,",((("THETA_LAGR",),"existeMCFParmi"),),0) + + ####################### traitement AFFE_MODELE ####################### + daffeModele={"PLAN_FISSURE":"PLAN_JOINT", "AXIS_FISSURE":"AXIS_JOINT"} + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",daffeModele) + removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","APPUI_REP",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","ASSE_GRIL",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleSiRegleAvecErreur(jdc,"AFFE_MODELE","AFFE",((("AFFE","MODELISATION","3D_JOINT_CT",jdc),"MCsousMCFaPourValeur"),)) + renameMotCleInFact(jdc,"AFFE_MODELE","AFFE_SOUS_STRUC","MAILLE","SUPER_MAILLE") + + ####################### traitement PROJ_MESU_MODAL ####################### + removeMotCleInFact(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_PARA") + removeMotCleInFactSiRegleAvecErreur(jdc,"AFFE_CHAR_MECA","CONTACT","FROTTEMENT",((("CONTACT","METHODE","CONTRAINTE",jdc),"MCsousMCFaPourValeur"),)) + + ####################### traitement CALC_ELEM / CALC_NO ####################### + dcalcelemno={"ERRE_ELGA_NORE":"ERRE_ELEM_SIGM","ERRE_ELEM_NOZ1":"ERZ1_ELEM_SIGM","ERRE_ELEM_NOZ2":"ERZ2_ELEM_SIGM","ERRE_ELNO_ELGA":"ERRE_ELNO_ELEM","ERRE_NOEU_ELGA":"ERRE_NOEU_ELEM","ERTH_ELEM_TEMP":"ERRE_ELEM_TEMP","ERTH_ELNO_ELEM":"ERRE_ELNO_ELEM","EPGR_ELNO":"EPFP_ELNO","EPGR_ELGA":"EPFP_ELGA","DURT_ELGA_TEMP":"DURT_ELNO_TEMP"} + changementValeur(jdc,"CALC_ELEM","OPTION",dcalcelemno) + changementValeur(jdc,"CALC_NO","OPTION",dcalcelemno) + changementValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",dcalcelemno) + changementValeur(jdc,"TEST_RESU","RESU",dcalcelemno) + removeMotCleAvecErreur(jdc,"TEST_RESU","UNITE") + + chercheOperInsereFacteurSiRegle(jdc,"CALC_ELEM","REPE_COQUE",((("NUME_COUCHE","NIVE_COUCHE","ANGLE","PLAN"),"existeMCFParmi"),)) + moveMotClefInOperToFact(jdc,"CALC_ELEM","NIVE_COUCHE","REPE_COQUE") + moveMotClefInOperToFact(jdc,"CALC_ELEM","NUME_COUCHE","REPE_COQUE") + moveMotClefInOperToFact(jdc,"CALC_ELEM","ANGLE","REPE_COQUE") + moveMotClefInOperToFact(jdc,"CALC_ELEM","PLAN","REPE_COQUE") + + + ####################### traitement EXTR_MODE ####################### + ajouteMotClefDansFacteurSiRegle(jdc,"EXTR_MODE","FILTRE_MODE","SEUIL=1.E-3", ((("FILTRE_MODE","CRIT_EXTR",),"existeMCsousMCF"),(("FILTRE_MODE","SEUIL",),"nexistepasMCsousMCF"))) + + ####################### traitement DYNA_TRAN_EXPLI ####################### + removeMotCle(jdc,"DYNA_TRAN_EXPLI","NEWMARK") + removeMotCle(jdc,"DYNA_TRAN_EXPLI","HHT") + chercheOperInsereFacteur(jdc,"DYNA_TRAN_EXPLI","DIFF_CENT") + + ####################### traitement CREA_RESU ####################### + dcrearesu={"HYDR_ELGA":"HYDR_NOEU_ELGA"} + lavertit=("HYDR_ELGA",) + changementValeur(jdc,"CREA_RESU","NOM_CHAM",dcrearesu,lavertit) + + ####################### traitement CREA_CHAMP ####################### + dcrearesu={"HYDR_ELGA":"HYDR_ELNO_ELGA"} + lavertit=("HYDR_ELGA",) + changementValeur(jdc,"CREA_CHAMP","NOM_CHAM",dcrearesu,lavertit) + changementValeur(jdc,"CREA_CHAMP","TYPE_CHAM",dcrearesu,lavertit) + + ####################### traitement TEST_RESU ####################### + dcrearesu={"HYDR_ELGA":"HYDR_NOEU_ELGA"} + lavertit=("HYDR_ELGA",) + changementValeurDsMCFAvecAvertissement(jdc,"TEST_RESU","RESU","NOM_CHAM",dcrearesu,lavertit) + + ####################### traitement DEBUT ####################### + removeMotCleSiRegle(jdc,"DEBUT","BASE",((("BASE","FICHIER","LOCALE",jdc),"MCsousMCFaPourValeur"),)) + + ####################### traitement DEFI_THER_JOULE ####################### + removeCommande(jdc,"DEFI_THER_JOULE") + + ####################### traitement CALC_CHAM_ELEM ####################### + removeCommandeSiRegleAvecErreur(jdc,"CALC_CHAM_ELEM",((("OPTION","SOUR_ELGA_ELEC",jdc),"MCaPourValeur"),)) + + ####################### traitement MACR_LIGNE_COUPE ####################### + appelleMacroSelonValeurConcept(jdc,"MACR_LIGN_COUPE",("LIGN_COUPE","TABLE")) + removeMotCleInFact(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TABLE") + + ####################### traitement MODI_MAILLAGE ####################### + removeMotCle(jdc,"MODI_MAILLAGE","MODELE") + + ####################### traitement LIRE_TABLE ####################### + removeMotCle(jdc,"LIRE_TABLE","TYPE_TABLE") + + ####################### traitement POST_SIMPLIFIE ####################### + removeCommande(jdc,"POST_SIMPLIFIE") + + ####################### traitement AFFE_MATERIAU ####################### + removeMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","SECH_REF") + + ####################### traitement DEFI_MAILLAGE ####################### + renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_MAILLE","MAILLE","SUPER_MAILLE") + renameMotCle(jdc,"DEFI_MAILLAGE","DEFI_MAILLE","DEFI_SUPER_MAILLE") + renameMotCleInFact(jdc,"DEFI_MAILLAGE","RECO_GLOBAL","MAILLE","SUPER_MAILLE") + renameMotCleInFact(jdc,"DEFI_MAILLAGE","RECO_MAILLE","MAILLE","SUPER_MAILLE") + renameMotCle(jdc,"DEFI_MAILLAGE","RECO_MAILLE","RECO_SUPER_MAILLE") + renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_NOEUD","MAILLE","SUPER_MAILLE") + renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_GROUP_NO","MAILLE","SUPER_MAILLE") + + ####################### traitement DEPL_INTERNE ####################### + renameMotCle(jdc,"DEPL_INTERNE","MAILLE","SUPER_MAILLE") + + + ####################### traitement POST_DYNA_ALEA ####################### + removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","GAUSS") + removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","RAYLEIGH") + removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","DEPASSEMENT") + removeMotCleAvecErreur(jdc,"POST_DYNA_ALEA","VANMARCKE") + + ####################### traitement RECU_FONCTION ####################### +# il faut aussi ajouter la regle suivante : +# s'il existe TYPE_RESU='FONCTION_C', renommer NOM_PARA_TABL='FONCTION_C' + removeMotCleSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL",((("TYPE_RESU","FONCTION_C",jdc),"MCaPourValeur"),)) + chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL='FONCTION_C',",((("TYPE_RESU","FONCTION_C",jdc),"MCaPourValeur"),),estunFacteur=0) + removeMotCle(jdc,"RECU_FONCTION","TYPE_RESU") + chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","NOM_PARA_TABL='FONCTION',",((("OBSTACLE",),"existe"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE",((("OBSTACLE",),"existe"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE","NOM_PARA='LIEU',",((("OBSTACLE",),"existe"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"RECU_FONCTION","FILTRE","VALE_K='DEFIOBST',",((("OBSTACLE",),"existe"),)) + renameMotCle(jdc,"RECU_FONCTION","OBSTACLE","TABLE") + + ####################### traitement DYNA_TRAN_MODAL ####################### + renameMotCleInFact(jdc,"DYNA_TRAN_MODAL","EXCIT","NUME_MODE","NUME_ORDRE",erreur=1) + + ####################### traitement DEFI_INTERF_DYNA ####################### + removeMotCleInFact(jdc,"DEFI_INTERF_DYNA","INTERFACE","DDL_ACTIF",erreur=1) + + + ####################### traitement CALC_PRECONT ####################### + removeMotCleInFactSiRegle(jdc,"CALC_PRECONT","INCREMENT","SUBD_PAS_MINI",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegle(jdc,"CALC_PRECONT","INCREMENT","COEF_SUBD_PAS_1",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegleAvecErreur(jdc,"CALC_PRECONT","INCREMENT","SUBD_PAS",((("INCREMENT","SUBD_PAS","1",jdc),"MCsousMCFaPourValeur"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"CALC_PRECONT","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"CALC_PRECONT","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) + renameMotCleInFact(jdc,"CALC_PRECONT","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + + + ####################### traitement DEFI_TEXTURE ####################### + removeCommande(jdc,"DEFI_TEXTURE") + + + ####################### traitement COMB_CHAM_NO ####################### + renameMotCleInFact(jdc,"COMB_CHAM_NO","COMB_C","CHAM_NO","CHAM_GD") + chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","TYPE_CHAM='xxx',",estunFacteur=0,erreur=1) + chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","MODELE=xxx,",estunFacteur=0,erreur=1) + chercheOperInsereFacteur(jdc,"COMB_CHAM_NO","OPERATION='ASSE',",estunFacteur=0,erreur=1) + renameMotCle(jdc,"COMB_CHAM_NO","COMB_C","ASSE") + ajouteMotClefDansFacteur(jdc,"COMB_CHAM_NO","ASSE","CUMUL='NON',") + ajouteMotClefDansFacteur(jdc,"COMB_CHAM_NO","ASSE","TOUT='OUI',") + renameOper(jdc,"COMB_CHAM_NO","CREA_CHAMP") + + + ####################### traitement MACR_ASCOUF_CALC ####################### + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_ASCOUF_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_ASCOUF_CALC","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS")) + + + ####################### traitement MACR_ASPIC_CALC ####################### + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_ASPIC_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + renameMotCleInFact(jdc,"MACR_ASPIC_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_ASPIC_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + + + ####################### traitement MACR_CABRI_CALC ####################### + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_CABRI_CALC","INCREMENT","SUBD_METHODE='UNIFORME',",((("INCREMENT","SUBD_PAS"),"existeMCsousMCF"),)) + renameMotCleInFact(jdc,"MACR_CABRI_CALC","INCREMENT","COEF_SUBD_PAS_1","SUBD_COEF_PAS_1") + moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS")) + moveMotCleFromFactToFactMulti(jdc,"MACR_CABRI_CALC","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS")) + + + ####################### traitement CALC_FATIGUE ####################### + dfatigue={"MATAKE":"MATAKE_MODI_AC", "DOMM_MAXI":"MATAKE_MODI_AV", "FATEMI_SOCIE":"FATESOCI_MODI_AV"} + changementValeur(jdc,"CALC_FATIGUE","CRITERE",dfatigue) + + ####################### traitement DEFI_PART_FETI ####################### + removeMotCleSiRegle(jdc,"DEFI_PART_FETI","MAILLAGE", ((("MODELE",),"existeMCFParmi"),(("MAILLAGE",),"existeMCFParmi"))) + + ####################### traitement MACR_ADAP_MAIL ####################### + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","MAILLAGE_N") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","MAILLAGE_NP1") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","RESULTAT_N") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","INDICATEUR") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","NOM_CMP_INDICA") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_PE") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_ABS") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_RAFF_REL") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_PE") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_ABS") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRIT_DERA_REL") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","NIVE_MAX") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","INST") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","PRECISION") + moveMotCleFromFactToFather(jdc,"MACR_ADAP_MAIL","ADAPTATION","CRITERE") + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFFINEMENT',",((("ADAPTATION","LIBRE","RAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='DERAFFINEMENT',",((("ADAPTATION","LIBRE","DERAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFF_DERA',",((("ADAPTATION","LIBRE","RAFF_DERA",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RAFFINEMENT_UNIFORME',",((("ADAPTATION","UNIFORME","RAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='DERAFFINEMENT_UNIFORME',",((("ADAPTATION","UNIFORME","DERAFFINEMENT",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + chercheOperInsereFacteurSiRegle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW='RIEN',",((("ADAPTATION","UNIFORME","RIEN",jdc),"MCsousMCFaPourValeur"),),estunFacteur=0) + removeMotCle(jdc,"MACR_ADAP_MAIL","ADAPTATION") + renameMotCle(jdc,"MACR_ADAP_MAIL","ADAPTATIONEW","ADAPTATION") + dcalcelemno={"ERRE_ELGA_NORE":"ERRE_ELEM_SIGM","ERRE_ELEM_NOZ1":"ERZ1_ELEM_SIGM","ERRE_ELEM_NOZ2":"ERZ2_ELEM_SIGM","ERRE_ELNO_ELGA":"ERRE_ELNO_ELEM","ERRE_NOEU_ELGA":"ERRE_NOEU_ELEM","ERTH_ELEM_TEMP":"ERRE_ELEM_TEMP","ERTH_ELNO_ELEM":"ERRE_ELNO_ELEM","EPGR_ELNO":"EPFP_ELNO","EPGR_ELGA":"EPFP_ELGA","DURT_ELGA_TEMP":"DURT_ELNO_TEMP"} + changementValeur(jdc,"MACR_ADAP_MAIL","ADAPTATION",dcalcelemno) + + + ####################### traitement IMPR_FICO_HOMARD ####################### + removeCommande(jdc,"IMPR_FICO_HOMARD") + + + ######################################################################### + + + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.Optionparser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier a traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile) + +if __name__ == '__main__': + main() diff --git a/Traducteur2/traduitV8V9.py b/Traducteur2/traduitV8V9.py new file mode 100644 index 00000000..092e6c19 --- /dev/null +++ b/Traducteur2/traduitV8V9.py @@ -0,0 +1,436 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV7V8.py --infile=xxxx --outfile=yyyy +""" + +import log +import optparse +import sys + +from load import getJDC +from mocles import parseKeywords +from removemocle import * +from renamemocle import * +from renamemocle import * +from inseremocle import * +from changeValeur import * +from movemocle import * +from dictErreurs import genereErreurPourCommande,genereErreurMotCleInFact + +import calcG + + +atraiter=( "DEFI_MAILLAGE","CALC_VECT_ELEM","DYNA_TRAN_EXPLI","DYNA_NON_LINE","STAT_NON_LINE","FACT_LDLT","FACT_GRAD","RESO_LDLT","RESO_GRAD","DYNA_TRAN_MODAL","NORM_MODE","MACRO_MODE_MECA","POST_RCCM","THER_NON_LINE","THER_NON_LINE_MO","THER_LINEAIRE","THER_NON_LINE_MO","DEFI_CABLE_BP","GENE_VARI_ALEA","DEFI_MATERIAU","IMPR_MATRICE","CALC_G","CALC_MATR_ELEM","MACR_ADAP_MAIL","MACR_INFO_MAIL","REST_BASE_PHYS","COMB_SISM_MODAL","TEST_FICHIER","MACR_ELEM_DYNA","CREA_CHAMP","AFFE_CHAR_MECA","AFE_CHAR_MECA_F","MODI_MAILLAGE","DEFI_FISS_XFEM","AFFE_MODELE","POST_MAIL_XFEM","CALC_NO","LIRE_CHAMP","AFFE_MATERIAU","MACR_ASCOUF_CALC","MACR_ASPIC_CALC","CALC_PRECONT","LIRE_INTE_SPEC","MACR_CARA_POUTRE","MACR_LIGN_COUPE") + +dict_erreurs={ +# STA9 + "POST_RCCM_SITUATION_NUME_PASSAGE":"Utilisation de NUME_PASSAGE pour le type TUYAUTERIE impossible en 9.2. On ne traite pour le moment que les chemins de passage simples.", + "POST_RCCM_SITUATION_NB_CYCL_SEISME":"POST_RCCM : maintenant les SITUATIONS sismiques ont leur propre mot clef facteur SEISME, attention, traduction incomplete", + "DEFI_MATERIAU_BAZANT_FD" : "le materiau BAZANT_FD a ete supprime", + "DEFI_MATERIAU_APPUI_ELAS" : "le materiau APPUI_ELAS a ete supprime", + "DEFI_MATERIAU_PORO_JOINT" : "le materiau PORO_JOINT a ete supprime", + "DEFI_MATERIAU_ZIRC_CYRA2" : "le materiau ZIRC_CYRA2 a ete supprime", + "DEFI_MATERIAU_ZIRC_EPRI" : "le materiau ZIRC_EPRI a ete supprime", + "IMPR_MATRICE_MATR_ELEM_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", + "IMPR_MATRICE_MATR_ASSE_FORMAT=RESULTAT" : "IMPR_MATRICE au format RESULTAT a ete supprime", + "CALC_G_OPTION=G_LAGR" : "l'OPTION G_LAGR de CALC_G a ete supprimee", + "CALC_G_OPTION=G_LAGR_GLOB" : "l'OPTION G_LAGR_GLOB de CALC_G a ete supprimee", + "CALC_MATR_ELEM_THETA" : "l'OPTION RIGI_MECA_LAGR de CALC_MATR_ELEM a ete supprimee", + "TEST_FICHIER_NB_CHIFFRE" : "le fonctionnement de TEST_FICHIER a change entre la V8 et la V9, consultez la doc, en particulier pour entrer la bonne valeur de NB_VALE", + "DYNA_NON_LINE_PILOTAGE" : "le PILOTAGE n'est pas actif dans DYNA_NON_LINE ", + "DYNA_NON_LINE_RECH_LINEAIRE" : "la RECH_LINEAIRE n'est pas active dans DYNA_NON_LINE ", + "DEFI_FISS_XFEM_CONTACT" : "en v9, le contact pour XFEM est defini dans un AFFE_CHAR_MECA(CONTACT=_F) en propre", + "POST_MAIL_XFEM" : "dans POST_MAIL_XFEM il faut entrer le MODELE et le MAILLAGE_SAIN", + "AFFE_MATERIAU_AFFE_TEMP_REF" : "Passage aux variables de commande : definir un materiau dependant de la temperature 'AFFE_MATERIAU(AFFE_VARC=_F(...))' et supprimer TEMP_CALCULEE dans les chargements", + "STAT_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "STAT_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "STAT_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "DYNA_NON_LINE_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_LAGR_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_SOLV_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + "CALC_PRECONT_ETAT_INIT_VARI_NON_LOCAL" : "Le solveur NON_LOCAL a ete supprime", + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + ####################### traitement erreurs ######################## + genereErreurPourCommande(jdc,("POST_RCCM","DEFI_MATERIAU","TEST_FICHIER","DYNA_NON_LINE","DEFI_FISS_XFEM","POST_MAIL_XFEM")) + + ####################### traitement Sous-Structuration ####################### + renameMotCleInFact(jdc,"DEFI_MAILLAGE","DEFI_SUPER_MAILLE","MACR_ELEM_STAT","MACR_ELEM") + renameMotCleInFact(jdc,"DYNA_NON_LINE","SOUS_STRUC","MAILLE","SUPER_MAILLE") + renameMotCleInFact(jdc,"STAT_NON_LINE","SOUS_STRUC","MAILLE","SUPER_MAILLE") + renameMotCleInFact(jdc,"CALC_VECT_ELEM","SOUS_STRUC","MAILLE","SUPER_MAILLE") + ######################################################################### + + ####################### traitement MACR_ELEM_DYNA ####################### + removeMotCle(jdc,"MACR_ELEM_DYNA","OPTION") + ######################################################################### + + ####################### traitement MODI_MAILLAGE ####################### + renameMotCle(jdc,"MODI_MAILLAGE","ORIE_SHB8","ORIE_SHB") + ######################################################################### + + ####################### traitement XFEM ####################### + dXFEM={"3D_XFEM":"3D", "C_PLAN_X":"C_PLAN", "D_PLAN_X":"D_PLAN"} + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dXFEM) + renameMotCleInFact(jdc,"DEFI_FISS_XFEM","ORIE_FOND","PT_ORIGIN","POINT_ORIG") + removeMotCleAvecErreur(jdc,"DEFI_FISS_XFEM","CONTACT") + ######################################################################### + + ####################### traitement Resolution lineaire ##################### + renameMotCle(jdc,"RESO_LDLT","MATR_FACT","MATR") + renameMotCle(jdc,"RESO_GRAD","MATR_ASSE","MATR") + renameMotCle(jdc,"RESO_GRAD","MATR_FACT","MATR_PREC") + renameOper(jdc,"RESO_LDLT","RESOUDRE") + renameOper(jdc,"RESO_GRAD","RESOUDRE") + renameOper(jdc,"FACT_LDLT","FACTORISER") + renameOper(jdc,"FACT_GRAD","FACTORISER") + ######################################################################### + + ####################### traitement DYNA_TRAN_MODAL ###################### + removeMotCle(jdc,"DYNA_TRAN_MODAL","NB_MODE_DIAG") + ######################################################################### + + ############# traitement MASS_INER dans NORM_MODE/MACRO_MODE_MECA ########## + removeMotCle(jdc,"NORM_MODE","MASS_INER") + removeMotCleInFact(jdc,"MACRO_MODE_MECA","NORM_MODE","MASS_INER") + ######################################################################### + + ####################### traitement POST_RCCM ############################ + removeMotCleInFactSiRegleAvecErreur(jdc,"POST_RCCM","SITUATION","NUME_PASSAGE",((("TYPE_RESU_MECA","TUYAUTERIE",jdc),"MCaPourValeur"),)) + chercheOperInsereFacteurSiRegle(jdc,"POST_RCCM","SEISME", ((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) + moveMotCleFromFactToFact(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME","SEISME") +# ajouteMotClefDansFacteurSiRegle(jdc,"POST_RCCM","SITUATION", "transferez_au_bloc_SEISME_CHAR_ETAT_NB_OCCUR,NUME_SITU,NUME_GROUP_et_eventuellement_NOM_SITU_et_NUME_RESU_THER",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"POST_RCCM","SITUATION","supprimez_a_la_main_ce_bloc",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) +# removeMotCleInFactSiRegleAvecErreur(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) + removeMotCleInFactSiRegle(jdc,"POST_RCCM","SITUATION","NB_CYCL_SEISME",((("SITUATION","NB_CYCL_SEISME"),"existeMCsousMCF"),)) + removeMotCleInFact(jdc,"POST_RCCM","CHAR_MECA","TYPE_CHAR",) + removeMotCleInFact(jdc,"POST_RCCM","RESU_MECA","TYPE_CHAR",) + ######################################################################### + + ####################### traitement THER_NON_LINE ############################ + renameMotCleInFact(jdc,"THER_NON_LINE","TEMP_INIT","NUME_INIT","NUME_ORDRE") + renameMotCle(jdc,"THER_NON_LINE","TEMP_INIT","ETAT_INIT",) + renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_INIT","NUME_INST_INIT") + renameMotCleInFact(jdc,"THER_NON_LINE","INCREMENT","NUME_FIN","NUME_INST_FIN") + + renameMotCleInFact(jdc,"THER_NON_LINE_MO","TEMP_INIT","NUME_INIT","NUME_ORDRE") + renameMotCle(jdc,"THER_NON_LINE_MO","TEMP_INIT","ETAT_INIT",) + ######################################################################### + + ####################### traitement THER_LINEAIRE ############################ + renameMotCleInFact(jdc,"THER_LINEAIRE","TEMP_INIT","NUME_INIT","NUME_ORDRE") + renameMotCle(jdc,"THER_LINEAIRE","TEMP_INIT","ETAT_INIT",) + renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_INIT","NUME_INST_INIT") + renameMotCleInFact(jdc,"THER_LINEAIRE","INCREMENT","NUME_FIN","NUME_INST_FIN") + renameMotCleInFact(jdc,"THER_LINEAIRE","ARCHIVAGE","LIST_ARCH","LIST_INST") + ######################################################################### + + ####################### traitement THER_NON_LINE ############################ + renameMotCleInFact(jdc,"THER_NON_LINE","TEMP_INIT","NUME_INIT","NUME_ORDRE") + renameMotCle(jdc,"THER_NON_LINE","TEMP_INIT","ETAT_INIT",) + ######################################################################### + + ####################### traitement DEFI_CABLE_BP ###################### + removeMotCle(jdc,"DEFI_CABLE_BP","MAILLAGE") + ######################################################################### + + ####################### traitement GENE_VARI_ALEA ###################### + removeMotCleSiRegle(jdc,"GENE_VARI_ALEA","COEF_VAR",((("TYPE","EXPONENTIELLE",jdc),"MCaPourValeur"),)) + ######################################################################### + + ####################### traitement DEFI_MATERIAU ###################### + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","BAZANT_FD") + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","PORO_JOINT") + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","APPUI_ELAS") + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ZIRC_EPRI") + removeMotCleAvecErreur(jdc,"DEFI_MATERIAU","ZIRC_CYRA2") + # BARCELONE + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","MU","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PORO","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","LAMBDA","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","KAPPA","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","M","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PRES_CRIT","BARCELONE") + moveMotCleFromFactToFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","BARCELONE") + renameMotCleInFact(jdc,"DEFI_MATERIAU","CAM_CLAY","PA","KCAM") + # CAM_CLAY +# ajouteMotClefDansFacteur(jdc,"DEFI_MATERIAU","CAM_CLAY","MU=xxx",) +# ajouteMotClefDansFacteurSiRegle(jdc,"DEFI_MATERIAU","CAM_CLAY","PTRAC=XXX",((("CAM_CLAY","KCAM"),"existeMCsousMCF"),)) + # VENDOCHAB + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","S_VP","S") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","N_VP","N") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","M_VP","UN_SUR_M", erreur=1) + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","K_VP","UN_SUR_K") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","SEDVP1","ALPHA_D") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB","SEDVP2","BETA_D") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","S_VP","S") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","N_VP","N") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","M_VP","UN_SUR_M", erreur=1) + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","K_VP","UN_SUR_K") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP1","ALPHA_D") + renameMotCleInFact(jdc,"DEFI_MATERIAU","VENDOCHAB_FO","SEDVP2","BETA_D") + # GLRC + renameCommandeSiRegle(jdc,"DEFI_MATERIAU","DEFI_GLRC", ((("GLRC_DAMAGE","GLRC_ACIER",),"existeMCFParmi"),)) + ######################################################################### + + ####################### traitement IMPR_MATRICE ###################### + removeCommandeSiRegleAvecErreur(jdc,"IMPR_MATRICE",((("MATR_ELEM","FORMAT","RESULTAT",jdc),"MCsousMCFaPourValeur"),)) + removeCommandeSiRegleAvecErreur(jdc,"IMPR_MATRICE",((("MATR_ASSE","FORMAT","RESULTAT",jdc),"MCsousMCFaPourValeur"),)) + ######################################################################### + + ####################### traitement MACR_ADAP/INFO_MAIL ###################### + dadap_mail={ "V8_5":"V9_5", "V8_N":"V9_N", "V8_N_PERSO":"V9_N_PERSO"} + changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",dadap_mail) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",dadap_mail) + ######################################################################### + + ####################### traitement REST_BASE_PHYS ###################### + renameCommandeSiRegle(jdc,"REST_BASE_PHYS","REST_SOUS_STRUC", ((("RESULTAT","SQUELETTE","SOUS_STRUC","BASE_MODALE","CYCLIQUE","SECTEUR"),"existeMCFParmi"),)) + renameCommandeSiRegle(jdc,"REST_BASE_PHYS","REST_COND_TRAN", ((("MACR_ELEM_DYNA","RESU_PHYS"),"existeMCFParmi"),)) + renameCommande(jdc,"REST_BASE_PHYS","REST_GENE_PHYS", ) + ######################################################################### + + ####################### traitement CALC_G ###################### + removeMotCleSiRegleAvecErreur(jdc,"CALC_G","OPTION",((("OPTION","G_LAGR",jdc),"MCaPourValeur"),)) + removeMotCleSiRegleAvecErreur(jdc,"CALC_G","OPTION",((("OPTION","G_LAGR_GLOB",jdc),"MCaPourValeur"),)) + removeMotCle(jdc,"CALC_G","PROPAGATION") + removeMotCle(jdc,"CALC_G","THETA_LAGR") + removeMotCle(jdc,"CALC_G","DIRE_THETA_LAGR") + ######################################################################### + + ####################### traitement COMB_SISM_MODAL ###################### + ajouteMotClefDansFacteurSiRegle(jdc,"COMB_SISM_MODAL","EXCIT","MULTI_APPUI='DECORRELE'", ((("EXCIT","MONO_APPUI"),"nexistepasMCsousMCF"),)) + ######################################################################### + + ####################### traitement TEST_FICHIER ###################### + renameMotCleAvecErreur(jdc,"TEST_FICHIER","NB_CHIFFRE","NB_VALE") + removeMotCle(jdc,"TEST_FICHIER","EPSILON") + ######################################################################### + + ####################### traitement CALC_MATR_ELEM ###################### + removeMotCleSiRegle(jdc,"CALC_MATR_ELEM","OPTION",((("OPTION","RIGI_MECA_LAGR",jdc),"MCaPourValeur"),)) + removeMotCleAvecErreur(jdc,"CALC_MATR_ELEM","PROPAGATION") + removeMotCle(jdc,"CALC_MATR_ELEM","THETA") + ######################################################################### + + ####################### traitement ITER_INTE_PAS ###################### + removeMotCleInFactSiRegle(jdc,"STAT_NON_LINE","COMP_INCR","ITER_INTE_PAS",((("COMP_INCR","DEFORMATION","SIMO_MIEHE",jdc),"MCsousMCFaPourValeur"),)) + removeMotCleInFactSiRegle(jdc,"DYNA_NON_LINE","COMP_INCR","ITER_INTE_PAS",((("COMP_INCR","DEFORMATION","SIMO_MIEHE",jdc),"MCsousMCFaPourValeur"),)) + ######################################################################### + + ################## traitement RECH_LINEAIRE et PILOTAGE dans DYNA_NON_LINE ################# + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","RECH_LINEAIRE") + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","PILOTAGE") + ######################################################################### + + ####################### traitement DYNA_TRAN_EXPLI ###################### + renameOper(jdc,"DYNA_TRAN_EXPLI","DYNA_NON_LINE") + ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","TCHAMWA","FORMULATION='ACCELERATION'") + ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","DIFF_CENT","FORMULATION='ACCELERATION'") + ######################################################################### + + ####################### traitement SCHEMA_TEMPS dans DYNA_NON_LINE ###################### + ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","NEWMARK","FORMULATION='DEPLACEMENT'") + ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","HHT","FORMULATION='DEPLACEMENT'") + ajouteMotClefDansFacteur(jdc,"DYNA_NON_LINE","TETA_METHODE","FORMULATION='DEPLACEMENT'") + renameMotCleInFact(jdc,"DYNA_NON_LINE","NEWMARK","ALPHA","BETA",) + renameMotCleInFact(jdc,"DYNA_NON_LINE","NEWMARK","DELTA","GAMMA",) + renameMotCleInFact(jdc,"DYNA_NON_LINE","TETA_METHODE","TETA","THETA",) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","NEWMARK","SCHEMA='NEWMARK'",((("NEWMARK",),"existeMCFParmi"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","TETA_METHODE","SCHEMA='THETA_METHODE'",((("TETA_METHODE",),"existeMCFParmi"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","HHT","SCHEMA='HHT'",((("HHT",),"existeMCFParmi"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","TCHAMWA","SCHEMA='TCHAMWA'",((("TCHAMWA",),"existeMCFParmi"),)) + ajouteMotClefDansFacteurSiRegle(jdc,"DYNA_NON_LINE","DIFF_CENT","SCHEMA='DIFF_CENT'",((("DIFF_CENT",),"existeMCFParmi"),)) + renameMotCle(jdc,"DYNA_NON_LINE","NEWMARK","SCHEMA_TEMPS") + renameMotCle(jdc,"DYNA_NON_LINE","TETA_METHODE","SCHEMA_TEMPS") + renameMotCle(jdc,"DYNA_NON_LINE","HHT","SCHEMA_TEMPS") + renameMotCle(jdc,"DYNA_NON_LINE","DIFF_CENT","SCHEMA_TEMPS") + renameMotCle(jdc,"DYNA_NON_LINE","TCHAMWA","SCHEMA_TEMPS") + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","EVOLUTION") + moveMotClefInOperToFact(jdc,"DYNA_NON_LINE","STOP_CFL","SCHEMA_TEMPS") + ######################################################################### + + ####################### traitement CONTACT ###################### + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","KT_ULTM") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","EFFO_N_INIT") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_N_IRRA") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_N_FO") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","RIGI_MZ") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_1") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_2") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_3") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","ANGLE_4") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_1") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_2") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_3") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","MOMENT_4") + removeMotCleInFact(jdc,"DEFI_MATERIAU","DIS_CONTACT","C_PRAGER_MZ") + dDis_Choc={"DIS_CONTACT":"DIS_CHOC"} + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dDis_Choc) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dDis_Choc) + renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") + renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_INCR","DIS_CONTACT","DIS_CHOC") + dGrilles={"GRILLE_CRAYONS":"DIS_GRICRA"} + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dGrilles) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dGrilles) + + renameCommandeSiRegle(jdc,"AFFE_CHAR_MECA_F","AFFE_CHAR_MECA",((("CONTACT",),"existeMCFParmi"),)) + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","RECHERCHE") + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","PROJECTION") + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","VECT_Y") + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","VECT_ORIE_POU") + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","MODL_AXIS") + dAppariement={"MAIT_ESCL_SYME":"MAIT_ESCL"} + changementValeurDsMCF(jdc,"AFFE_CHAR_MECA","CONTACT","APPARIEMENT",dAppariement) + + ajouteMotClefDansFacteurSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","TYPE_APPA='FIXE'",((("CONTACT","DIRE_APPA",),"existeMCsousMCF"),)) + ######################################################################### + + ####################### traitement CREA_CHAMP ###################### + chercheOperInsereFacteurSiRegle(jdc,"CREA_CHAMP","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) + dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} + changementValeur(jdc,"CREA_CHAMP","TYPE_CHAM",dTypeChamp) + ######################################################################### + + ####################### traitement CALC_NO ###################### + chercheOperInsereFacteurSiRegle(jdc,"CALC_NO","PRECISION=1.E-3,", ((("PRECISION",),"nexistepas"),(("CRITERE",),"existe"),),0) + ######################################################################### + + ######### traitement variables de commandes TEMP_CALCULEE/TEMP_REF ############## + genereErreurMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","TEMP_REF") + ################################################################################ + + ################# traitement LIRE_CHAMP ####################################### +# dTypeChamp={"ELEM_ERREUR":"ELEM_ERRE_R"} + changementValeur(jdc,"LIRE_CHAMP","TYPE_CHAM",dTypeChamp) + ################################################################################ + + + ######### traitement SUIVI_DDL ################################################# +# en pre-traitement il faudrait une methode qui separe tous les mots clefs facteurs en les dupliquant +# par exemple ici mettre autant de mots clefs facteurs SUIVI_DDL qu'il a de _F + ajouteMotClefDansFacteur(jdc,"STAT_NON_LINE","SUIVI_DDL","SUIVI_DDL='OUI'") + renameMotCle(jdc,"STAT_NON_LINE","SUIVI_DDL","OBSERVATION") +# en post-traitement il faudrait une methode qui fusionne tous les mots clefs facteurs en double +# par exemple ici les OBSERVATION + ################################################################################ + + + ######### traitement EVOLUTION in STAT/DYNA_NON_LINE ########################### + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT","EVOLUTION") + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT","EVOLUTION") + ################################################################################ + + ######### traitement du MODELE GRILLE ############################################## + dGrille={"GRILLE":"GRILLE_EXCENTRE"} + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",dGrille) + ################################################################################ + + ######### traitement de MACR_ASPIC/ASCOUF_CALC GRILLE ########################## + removeMotCle(jdc,"MACR_ASCOUF_CALC","CHARGE") + removeMotCle(jdc,"MACR_ASPIC_CALC","CHARGE") + ################################################################################ + + + ############ suppression de NON_LOCAL ########################################## + removeMotCleAvecErreur(jdc,"STAT_NON_LINE","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"STAT_NON_LINE","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"STAT_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"DYNA_NON_LINE","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"DYNA_NON_LINE","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + + removeMotCleAvecErreur(jdc,"CALC_PRECONT","LAGR_NON_LOCAL") + removeMotCleAvecErreur(jdc,"CALC_PRECONT","SOLV_NON_LOCAL") + removeMotCleInFact(jdc,"CALC_PRECONT","ETAT_INIT","VARI_NON_LOCAL",erreur=1) + ################################################################################ + + ######### traitement de LIRE_INTE_SPEC ######################################### + renameMotCle(jdc,"LIRE_INTE_SPEC","FORMAT","FORMAT_C") + ################################################################################ + + ######### traitement de MACR_CARA_POUTRE ###################################### + chercheOperInsereFacteurSiRegle(jdc,"MACR_CARA_POUTRE","FORMAT='ASTER'", ((("UNITE_MAILLAGE",),"existe"),),0) + renameMotCle(jdc,"MACR_CARA_POUTRE","UNITE_MAILLAGE","UNITE") + ################################################################################ + + ######### traitement de MACR_LIGN_COUPE ###################################### +# il y a un probleme s'il y a plusieurs mots clefs facteurs LIGN_COUPE : la regle ne marche qu'une fois par commande + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","REPERE='LOCAL'", ((("LIGN_COUPE","VECT_Y",),"existeMCsousMCF"),),0) +# autre probleme : s'il y a plusieurs mots clefs facteurs le traducteur peut, dans l'insertion, se tromper de mot clef facteur + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_NO'", ((("LIGN_COUPE","GROUP_NO",),"existeMCsousMCF"),),0) + ajouteMotClefDansFacteurSiRegle(jdc,"MACR_LIGN_COUPE","LIGN_COUPE","TYPE='GROUP_MA'", ((("LIGN_COUPE","GROUP_MA",),"existeMCsousMCF"),),0) + ################################################################################ + + ####################### traitement DRUCKER_PRAGER ####################### + dPRAGER={"DRUCKER_PRAGER":"DRUCK_PRAGER",} + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION",dPRAGER) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION",dPRAGER) + changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION",dPRAGER) + changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION",dPRAGER) + ######################################################################### + + ####################### traitement RELATION_KIT ####################### + dKIT={"ELAS_THER":"ELAS",} + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RELATION_KIT",dKIT) + changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RELATION_KIT",dKIT) + changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RELATION_KIT",dKIT) + ######################################################################### + + + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.Optionparser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier a traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile) + +if __name__ == '__main__': + main() diff --git a/Traducteur2/traduitV9V10.py b/Traducteur2/traduitV9V10.py new file mode 100755 index 00000000..11db2ccd --- /dev/null +++ b/Traducteur2/traduitV9V10.py @@ -0,0 +1,749 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV9V10.py --infile=xxxx --outfile=yyyy +""" + +import log +import optparse +import sys + +from Traducteur.load import getJDC +from Traducteur.mocles import parseKeywords +from Traducteur.removemocle import * +from Traducteur.renamemocle import * +from Traducteur.renamemocle import * +from Traducteur.inseremocle import * +from Traducteur.changeValeur import * +from Traducteur.movemocle import * +from Traducteur.dictErreurs import * +from Traducteur.regles import pasDeRegle + +atraiter=("AFFE_CARA_ELEM","AFFE_CHAR_CINE","AFFE_CHAR_MECA","AFFE_CHAR_MECA_F","AFFE_MATERIAU","AFFE_MODELE", + "CALC_CHAM_ELEM","CALC_ELEM","CALC_G","CALC_META","CALC_MODAL","CALC_PRECONT","CALCUL","CALC_MISS","CALC_NO", + "COMB_FOURIER","COMB_SISM_MODAL","CREA_CHAMP","CREA_RESU", + "DEFI_BASE_MODALE","DEFI_COMPOR","DEFI_CONTACT","DEFI_GLRC","DEFI_LIST_INST","DEFI_MATERIAU", + "DYNA_ISS_VARI","DYNA_LINE_HARM","DYNA_LINE_TRAN","DYNA_NON_LINE","DYNA_TRAN_MODAL", + "EXTR_RESU","IMPR_MACR_ELEM","IMPR_MATRICE","IMPR_RESU","LIRE_RESU", + "MACR_ADAP_MAIL","MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_ECREVISSE", + "MACR_INFO_MAIL","MACR_LIGN_COUPE","MACRO_ELAS_MULT","MACRO_MATR_AJOU","MACRO_MISS_3D", + "MECA_STATIQUE","MODE_ITER_INV","MODE_ITER_SIMULT","MODE_STATIQUE","MODI_REPERE", + "POST_CHAM_XFEM","POST_ELEM","POST_GP","POST_K1_K2_K3","POST_RCCM","POST_RELEVE_T","POST_ZAC", + "PROJ_CHAMP","PROJ_MESU_MODAL","RECU_FONCTION","REST_SOUS_STRUC","REST_GENE_PHYS","REST_SPEC_PHYS", + "STAT_NON_LINE","SIMU_POINT_MAT","TEST_RESU","THER_LINEAIRE","THER_NON_LINE","THER_NON_LINE_MO",) + +dict_erreurs={ +# STA10 +# + "AFFE_CHAR_MECA_CONTACT":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", + "AFFE_CHAR_MECA_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", + "AFFE_CHAR_MECA_F_LIAISON_UNILATER":"Attention, modification de la definition du CONTACT : nommer DEFI_CONTACT,verifier les parametres globaux et le mettre dans le calcul", + "AFFE_CHAR_MECA_GRAPPE_FLUIDE":"Resorption de GRAPPE_FLUIDE en version 10", + "DEFI_MATERIAU_LMARC":"Resorption loi LMARC en version 10", + "DEFI_MATERIAU_LMARC_FO":"Resorption loi LMARC en version 10", + "POST_ZAC":"Resorption POST_ZAC en version 10", + "AFFE_CHAR_MECA_ARLEQUIN":"Resorption ARLEQUIN en version 10", + + "PROJ_CHAMP_CHAM_NO":"Attention, verifier pour PROJ_CHAMP la presence de MODELE1/MAILLAGE1 et MODELE2/MAILLAGE2", + + "COMB_SISM_MODAL_COMB_MULT_APPUI":"Attention, verifier GROUP_APPUI pour COMB_SISM_MODAL car on est dans le cas MULTI_APPUI=DECORRELE", + + "CALC_PRECONT_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "CALC_PRECONT_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_LINE_HARM_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_LINE_HARM_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_LINE_TRAN_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_LINE_TRAN_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_TRAN_MODAL_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_TRAN_MODAL_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACR_ASCOUF_CALC_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACR_ASCOUF_CALC_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACR_ASPIQ_CALC_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACR_ASPIQ_CALC_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACRO_MATR_AJOU_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MACRO_MATR_AJOU_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MECA_STATIQUE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MECA_STATIQUE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MODE_STATIQUE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "MODE_STATIQUE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "STAT_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "STAT_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "THER_LINEAIRE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "THER_LINEAIRE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "THER_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "THER_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_NON_LINE_SOLVEUR_PARALLELISME":"Modification du PARALLELISME qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + "DYNA_NON_LINE_SOLVEUR_PARTITION":"Modification de PARTITION qui se definit au niveau de AFFE_MODELE ou MODI_MODELE", + + "STAT_NON_LINE_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans STAT_NON_LINE", + "CALC_PRECONT_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans CALC_PRECONT", + "DYNA_NON_LINE_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans DYNA_NON_LINE", + "MACR_ASCOUF_CALC_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans MACR_ASCOUF_CALC", + "MACR_ASPIQ_CALC_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans MACR_ASPIQ_CALC", + "SIMU_POINT_MAT_INCREMENT":"Attention, modification de la subdivision des pas : nommer DEFI_LIST_INST et verifier son appel dans SIMU_POINT_MAT", + + "CALC_ELEM_SENSIBILITE":"Le post-traitement SENSIBILITE est a supprimer de CALC_ELEM et a faire via CALC_SENSI", + + "CALC_MISS_OPTION":"Attention, transfert MACRO_MISS_3D en CALC_MISS : utiliser un DEFI_SOL_MISS pour obtenir TABLE_SOL", + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + ####################### initialisation et traitement des erreurs ######################### + + + #####RESORPTION + + genereErreurPourCommande(jdc,("POST_ZAC",)) + genereErreurMCF(jdc,"AFFE_CHAR_MECA","GRAPPE_FLUIDE") + genereErreurMCF(jdc,"DEFI_MATERIAU","LMARC") + genereErreurMCF(jdc,"DEFI_MATERIAU","LMARC_FO") + genereErreurMCF(jdc,"AFFE_CHAR_MECA","ARLEQUIN") + + + #####SOLVEUR + + ####################### traitement MUMPS/PARALELLISME-PARTITION ################## + #commandes concernes en plus : CALC_FORC_AJOU?,CALC_MATR_AJOU? + # */SOLVEUR/CHARGE_PROCO_MA(SD)--> AFFE_MODELE (ou MODI_MODELE)/PARTITION/. + # */SOLVEUR/PARALLELISME =CENTRALISE--> AFFE_MODELE (ou MODI_MODELE)/PARTITION/PARALLELISME = CENTRALISE + # */SOLVEUR/PARALLELISME = "DISTRIBUE_MC/MD/SD"--> AFFE_MODELE/PARTITION/PARALLELISME = "MAIL_CONTIGU/MAIL_DISPERSE/SOUS_DOMAINE" + # */SOLVEUR/PARTITION --> AFFE_MODELE (ou MODI_MODELE)/PARTITION/PARTITION + + + genereErreurMotCleInFact(jdc,"CALC_PRECONT","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"CALC_PRECONT","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"DYNA_LINE_HARM","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"DYNA_LINE_HARM","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"DYNA_LINE_TRAN","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"DYNA_TRAN_MODAL","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"DYNA_TRAN_MODAL","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"MACR_ASCOUF_CALC","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"MACR_ASCOUF_CALC","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"MACR_ASPIQ_CALC","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"MACR_ASPIQ_CALC","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"MACRO_MATR_AJOU","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"MACRO_MATR_AJOU","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"MECA_STATIQUE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"MECA_STATIQUE","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"MODE_STATIQUE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"MODE_STATIQUE","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"STAT_NON_LINE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"STAT_NON_LINE","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"THER_LINEAIRE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"THER_LINEAIRE","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"THER_NON_LINE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"THER_NON_LINE","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"THER_NON_LINE_MO","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"THER_NON_LINE_MO","SOLVEUR","PARTITION") + genereErreurMotCleInFact(jdc,"DYNA_NON_LINE","SOLVEUR","PARALLELISME") + genereErreurMotCleInFact(jdc,"DYNA_NON_LINE","SOLVEUR","PARTITION") + + ####################### traitement mot cle INCREMENT redecoupage en temps ####################### + renameMotCleSiRegle(jdc,"STAT_NON_LINE","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"STAT_NON_LINE","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"STAT_NON_LINE","INCREMENT_NEW","INCREMENT") + + renameMotCleSiRegle(jdc,"CALC_PRECONT","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"CALC_PRECONT","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_PRECONT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"CALC_PRECONT","INCREMENT_NEW","INCREMENT") + + + renameMotCleSiRegle(jdc,"DYNA_NON_LINE","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"DYNA_NON_LINE","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"DYNA_NON_LINE","INCREMENT_NEW","INCREMENT") + + renameMotCleSiRegle(jdc,"MACR_ASCOUF_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"MACR_ASCOUF_CALC","INCREMENT_NEW","INCREMENT") + + renameMotCleSiRegle(jdc,"MACR_ASPIQ_CALC","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"MACR_ASPIQ_CALC","INCREMENT_NEW","INCREMENT") + + renameMotCleSiRegle(jdc,"SIMU_POINT_MAT","INCREMENT","INCREMENT_NEW",((("INCREMENT","SUBD_METHODE"),"existeMCsousMCF"),),1) + moveMCFToCommand(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","DEFI_LIST_INST","ECHEC") + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_COEF_PAS_1",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_FIN",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_IGNO",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_ITER_PLUS",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_METHODE",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_NIVEAU",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_OPTION",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","SUBD_PAS_MINI",pasDeRegle(),0) + renameMotCle(jdc,"SIMU_POINT_MAT","INCREMENT_NEW","INCREMENT") + + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","INST_INIT") + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","INST_FIN") + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","NUME_INST_FIN") + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","NUME_INST_INIT") + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","PRECISION") + chercheOperInsereFacteur(jdc,"DEFI_LIST_INST","DEFI_LIST",pasDeRegle(),1) + moveMotCleFromFactToFact(jdc,"DEFI_LIST_INST","ECHEC","LIST_INST","DEFI_LIST") + removeMotCleInFact(jdc,"DEFI_LIST_INST","ECHEC","LIST_INST") + + ###################### traitement de NPREC_SOLVEUR ########## + removeMotCleInFact(jdc,"MODE_ITER_SIMULT","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) + removeMotCleInFact(jdc,"MODE_ITER_INV","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_MODAL","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) + removeMotCle(jdc,"IMPR_STURM","NPREC_SOLVEUR") + removeMotCleInFact(jdc,"MACRO_MATR_AJOU","CALC_FREQ","NPREC_SOLVEUR",pasDeRegle(),0) + + ###################### traitement CALC_MODAL SOLVEUR ############ + removeMotCle(jdc,"CALC_MODAL","SOLVEUR",pasDeRegle()) + + ##################### traitement DYNA_TRAN-MODAL ADAPT ################# + changementValeur(jdc,"DYNA_TRAN_MODAL","METHODE",{"ADAPT":"ADAPT_ORDRE2"}) + + #################### traitement STAT/DYNA_NON_LINE OBSERVATION SUIVI_DDL=NON ########### + removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","OBSERVATION","SUIVI_DDL",((("SUIVI_DDL","NON",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","OBSERVATION","SUIVI_DDL",((("SUIVI_DDL","NON",jdc),"MCsousMCFcourantaPourValeur"),)) + + ################### traitement STAT/DYNA_NON_LINE ARCH_ETAT_INIT ########### + removeMotCleInFact(jdc,"STAT_NON_LINE","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) + removeMotCleInFact(jdc,"SIMU_POINT_MAT","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","ARCHIVAGE","ARCH_ETAT_INIT",pasDeRegle(),0) + + ################### traitement STAT/DYNA_NON_LINE CRIT_FLAMB ############### + removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","CRIT_FLAMB","INST_CALCUL",((("INST_CALCUL","TOUT_PAS",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","CRIT_FLAMB","INST_CALCUL",((("INST_CALCUL","TOUT_PAS",jdc),"MCsousMCFcourantaPourValeur"),)) + + #####COMPORTEMENT/CARA + + ################### traitement AFFE_MODELE/SHB8 ########################## + changementValeurDsMCF(jdc,"AFFE_MODELE","AFFE","MODELISATION",{"SHB8":"SHB"}) + + ################### traitement COMP_ELAS et COMP_INCR DEFORMATION = GREEN ##############" + dGREEN={"GREEN_GR":"GROT_GDEP","GREEN":"GROT_GDEP","REAC_GEOM":"GROT_GDEP","EULER_ALMANSI":"GROT_GDEP","COROTATIONNEL":"GDEF_HYPO_ELAS"} + changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"CALCUL","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"POST_GP","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"CALC_G","COMP_ELAS","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"CALCUL","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"CALC_NO","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"LIRE_RESU","COMP_INCR","DEFORMATION",dGREEN) + changementValeurDsMCF(jdc,"MACR_ECREVISSE","COMP_INCR","DEFORMATION",dGREEN) + + ###################### traitement COMP_INCR/COMP_ELAS RESO_INTE ########## + dALGOI={"RUNGE_KUTTA_2":"RUNGE_KUTTA","RUNGE_KUTTA_4":"RUNGE_KUTTA"} + removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"CALCUL","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"CALCUL","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"MACR_ASPIQ_CALC","COMP_ELAS","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"CALC_PRE_CONT","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"CALC_NO","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFactCourantSiRegle(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE",((("RESO_INTE","IMPLICITE",jdc),"MCsousMCFcourantaPourValeur"),)) + + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"CALCUL","COMP_ELAS","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"CALCUL","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"MACR_ASPIQF_CALC","COMP_ELAS","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"CALC_PRECONT","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"CALC_NO","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE",dALGOI) + changementValeurDsMCF(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE",dALGOI) + + renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_ELAS","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"STAT_NON_LINE","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_ELAS","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"DYNA_NON_LINE","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"CALCUL","COMP_ELAS","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"CALCUL","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","COMP_ELAS","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"MACR_ASCOUF_CALC","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"MACR_ASPIQF_CALC","COMP_ELAS","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"MACR_ASPIQ_CALC","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"SIMU_POINT_MAT","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"CALC_PRECONT","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"CALC_NO","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"LIRE_RESU","COMP_INCR","RESO_INTE","ALGO_INTE") + renameMotCleInFact(jdc,"MACR_ECREVISSE","COMP_INCR","RESO_INTE","ALGO_INTE") + + ###################### traitement COMP_ELAS/ITER_INTE_PAS ###### + removeMotCleInFact(jdc,"CALCUL","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","COMP_ELAS","ITER_INTE_PAS",pasDeRegle(),0) + + ###################### traitement CALC_G/COMP_INCR/RELATION ELAS_VMIS_PUIS #### + changementValeurDsMCF(jdc,"CALC_G","COMP_INCR","RELATION",{"ELAS_VMIS_PUIS":"VMIS_ISOT_PUIS"}) + + ########################" traitement DEFI_COMPOR/MULTIFIBRE/DEFORMATION=REAC_GEOM ######### + changementValeurDsMCF(jdc,"DEFI_COMPOR","MULTIFIBRE","DEFORMATION",dGREEN) + + ####################### traitement DEFI_COMPOR/MONOCRISTAL/ECOULEMENT ############# + dECOULEMENT={"ECOU_VISC1":"MONO_VISC1","ECOU_VISC2":"MONO_VISC2","ECOU_VISC3":"MONO_VISC3","KOCKS_RAUCH":"MONO_DD_KR"} + changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECOULEMENT",dECOULEMENT) + dISOT={"ECRO_ISOT1":"MONO_ISOT1","ECRO_ISOT2":"MONO_ISOT2"} + dCINE={"ECRO_CINE1":"MONO_CINE1","ECRO_CINE2":"MONO_CINE2"} + changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECRO_ISOT",dISOT) + changementValeurDsMCF(jdc,"DEFI_COMPOR","MONOCRISTAL","ECRO_CINE",dCINE) + + ################### traitement DEFI_MATERIAU monocristallin ####### + renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC1","MONO_VISC1") + renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC2","MONO_VISC2") + renameMotCle(jdc,"DEFI_MATERIAU","ECOU_VISC3","MONO_VISC3") + renameMotCle(jdc,"DEFI_MATERIAU","ECRO_CINE1","MONO_CINE1") + renameMotCle(jdc,"DEFI_MATERIAU","ECRO_CINE2","MONO_CINE2") + renameMotCle(jdc,"DEFI_MATERIAU","ECRO_ISOT1","MONO_ISOT1") + renameMotCle(jdc,"DEFI_MATERIAU","ECRO_ISOT2","MONO_ISOT2") + renameMotCle(jdc,"DEFI_MATERIAU","KOCKS_RAUCH","MONO_DD_KR") + + ################ traitement DEFI_MATERIAU/THER_HYDR ####### + removeMotCleInFact(jdc,"DEFI_MATERIAU","THER_HYDR","QSR_K") + + ##################### traitement AFFE_CARA_ELEM/DISCRET ###############" + dDISCRET={"K_T_N_NS":"K_T_N", "K_T_L_NS":"K_T_L", "K_TR_N_NS":"K_TR_N", "K_TR_L_NS":"K_TR_L", + "M_T_N_NS":"M_T_N", "M_T_L_NS":"M_T_L", "M_TR_N_NS":"M_TR_N", "M_TR_L_NS":"M_TR_L", + "A_T_N_NS":"A_T_N", "A_T_L_NS":"A_T_L", "A_TR_N_NS":"A_TR_N", "A_TR_L_NS":"A_TR_L"} + dlist_DISCRET=["K_T_N_NS","K_T_L_NS", "K_TR_N_NS","K_TR_L_NS","M_T_N_NS","M_T_L_NS","M_TR_N_NS","M_TR_L_NS","A_T_N_NS","A_T_L_NS","A_TR_N_NS","A_TR_L_NS"] + + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET_2D","SYME") + removeMotCleInFact(jdc,"AFFE_CARA_ELEM","DISCRET","SYME") + ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CARA_ELEM","DISCRET","SYME='NON'",((("CARA",dlist_DISCRET,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CARA_ELEM","DISCRET_2D","SYME='NON'",((("CARA",dlist_DISCRET,jdc),"MCsousMCFcourantaPourValeurDansListe"),)) + changementValeurDsMCF(jdc,"AFFE_CARA_ELEM","DISCRET_2D","CARA",dDISCRET) + changementValeurDsMCF(jdc,"AFFE_CARA_ELEM","DISCRET","CARA",dDISCRET) + + #####CHARGEMENT + + ####################### traitement CONTACT ############################################### + + + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","ITER_MULT_MAXI","ITER_CONT_MULT") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NB_REAC_GEOM","NB_ITER_GEOM") + ajouteMotClefDansFacteurCourantSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","RESOLUTION='NON'",((("METHODE","VERIF",jdc),"MCsousMCFcourantaPourValeur"),)) + copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","MODELE","CONTACT") + moveMCFToCommand(jdc,"AFFE_CHAR_MECA","CONTACT","DEFI_CONTACT","ZONE") + removeMotCle(jdc,"AFFE_CHAR_MECA","CONTACT",pasDeRegle(),1) + + + removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE") + ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle()) + copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","MODELE","LIAISON_UNILATER") + moveMCFToCommand(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","DEFI_CONTACT","ZONE") + removeMotCle(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER",pasDeRegle(),1) + + removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE") + ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","METHODE='LIAISON_UNIL'",pasDeRegle()) + ajouteMotClefDansFacteur(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","FORMULATION='LIAISON_UNIL'",pasDeRegle()) + copyMotClefInOperToFact(jdc,"AFFE_CHAR_MECA_F","MODELE","LIAISON_UNILATER") + moveMCFToCommand(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","DEFI_CONTACT","ZONE") + removeMotCle(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER",pasDeRegle(),1) + + chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='XFEM'",((("ZONE","METHODE","XFEM",jdc),"MCsousMCFaPourValeur"),)) + chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='CONTINUE'",((("ZONE","METHODE","CONTINUE",jdc),"MCsousMCFaPourValeur"),)) + chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='VERIF'",((("ZONE","METHODE","VERIF",jdc),"MCsousMCFaPourValeur"),)) + chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='LIAISON_UNIL'",((("ZONE","METHODE","LIAISON_UNIL",jdc),"MCsousMCFaPourValeur"),)) + liste_meth_ZONE=["GCP","CONTRAINTE","LAGRANGIEN","PENALISATION"] + chercheOperInsereMotCleSiRegle(jdc,"DEFI_CONTACT","FORMULATION='DISCRETE'",((("ZONE","METHODE",liste_meth_ZONE,jdc),"MCsousMCFaPourValeurDansListe"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='LAGRANGIEN'",((("METHODE","LAGRANGIEN",jdc),"MCsousMCFcourantaPourValeur"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT='LAGRANGIEN'",((("METHODE","LAGRANGIEN",jdc),"MCsousMCFcourantaPourValeur"),(("COULOMB",),"existeMCsousMCFcourant"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='GCP'",((("METHODE","GCP",jdc),"MCsousMCFcourantaPourValeur"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='PENALISATION'",((("METHODE","PENALISATION",jdc),"MCsousMCFcourantaPourValeur"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_FROT='PENALISATION'",((("METHODE","PENALISATION",jdc),"MCsousMCFcourantaPourValeur"),(("COULOMB",),"existeMCsousMCFcourant"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DEFI_CONTACT","ZONE","ALGO_CONT='CONTRAINTE'",((("METHODE","CONTRAINTE",jdc),"MCsousMCFcourantaPourValeur"),)) + removeMotCleInFact(jdc,"DEFI_CONTACT","ZONE","METHODE") + + + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","COEF_RESI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","FROTTEMENT") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_CONT_MAXI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_FROT_MAXI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_GCP_MAXI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_GEOM_MAXI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","LISSAGE") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","NB_RESOL") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","PRE_COND") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","REAC_GEOM") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","REAC_ITER") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","RECH_LINEAIRE") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","STOP_INTERP") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","STOP_SINGULIER") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","RESI_ABSO") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_CONT_MULT") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","ITER_PRE_MAXI") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","NB_ITER_GEOM") + moveMotCleFromFactToFather(jdc,"DEFI_CONTACT","ZONE","MODELE") + + + # FORMULATION = DEPL/VITE + # Si EXCL_FROT_1 + # Si EXCL_FROT_2 + + + ####################### traitement DCX/DCY/DCZ ############################# + dDC={"DCX":"DX","DCY":"DY","DCZ":"DZ"} + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCX","DX") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCY","DY") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA","DDL_IMPO","DCZ","DZ") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCX","DX") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCY","DY") + renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","DDL_IMPO","DCZ","DZ") + renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCX","DX") + renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCY","DY") + renameMotCleInFact(jdc,"AFFE_CHAR_CINE","MECA_IMPO","DCZ","DZ") + # QUESTION Non pris en compte : AFFE_CHAR_MECA/LIAISON_DDL","DDL",Liste de valeurs avec DC*) + # peut_etre avec changeTouteValeur ? + + ######################### traitement COMB_SISM_MODAL APPUI #######################"" + # attention il faut traiter d'abord DECORRELE avant CORRELE sinon CORRELE apparaît dans DECORELLE + moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MONO_APPUI") + moveMotCleFromFactToFather(jdc,"COMB_SISM_MODAL","EXCIT","MULTI_APPUI") + removeMotCleInFactSiRegle(jdc,"COMB_SISM_MODAL","COMB_MULT_APPUI","TYPE_COMBI",((("MULTI_APPUI","DECORRELE",jdc),"MCaPourValeur"),)) + renameMotCleSiRegle(jdc,"COMB_SISM_MODAL","COMB_MULT_APPUI","GROUP_APPUI",((("MULTI_APPUI","DECORRELE",jdc),"MCaPourValeur"),),1) + + ######################## traitement DYNA_TRAN_MODAL ################## + ajouteMotClefDansFacteurCourantSiRegle(jdc,"DYNA_TRAN_MODAL","CHOC","FROTTEMENT='COULOMB'",((("COULOMB",),"existeMCsousMCFcourant"),)) + + ######################### traitement AFFE_CHAR_MECA PESANTEUR ROTATION################# + eclaMotCleToFact(jdc,"AFFE_CHAR_MECA","PESANTEUR","GRAVITE","DIRECTION") + eclaMotCleToFact(jdc,"AFFE_CHAR_MECA","ROTATION","VITESSE","AXE") + moveMotClefInOperToFact(jdc,"AFFE_CHAR_MECA","CENTRE","ROTATION") + + ######################## traitement DEFI_BASE_MODALE ############## + renameMotCleInFact(jdc,"DEFI_BASE_MODALE","RITZ","MODE_STAT","MODE_INTF") + renameMotCleInFact(jdc,"DEFI_BASE_MODALE","RITZ","MULT_ELAS","MODE_INTF") + + ####################### traitement DYNA_ISS_VARI ################# + renameMotCle(jdc,"DYNA_ISS_VARI","PAS","FREQ_PAS") + + + #####IMPRESSION + + #################### traitement IMPR_RESU ####################### + removeMotCleInFact(jdc,"IMPR_RESU","RESU","INFO_RESU") + + ######################### traitement IMPR_MATRICE #################### + removeCommande(jdc,"IMPR_MATRICE") + + ####################### traitement PROJ_CHAMP ##################### + renameMotCle(jdc,"PROJ_CHAMP","CHAM_NO","CHAM_GD",1,pasDeRegle()) + changementValeur(jdc,"PROJ_CHAMP","METHODE",{ "ELEM":"COLLOCATION"}) + + ####################### traitement MACR_ADAP_MAIL ##############" + changementValeur(jdc,"MACR_ADAP_MAIL","TYPE_VALEUR_INDICA",{"V_ABSOLUE":"ABSOLU","V_RELATIVE":"RELATIF"}) + renameMotCle(jdc,"MACR_ADAP_MAIL","INDICATEUR","NOM_CHAM") + renameMotCle(jdc,"MACR_ADAP_MAIL","NOM_CMP_INDICA","NOM_CMP") + renameMotCle(jdc,"MACR_ADAP_MAIL","TYPE_OPER_INDICA","USAGE_CHAMP") + renameMotCle(jdc,"MACR_ADAP_MAIL","TYPE_VALEUR_INDICA","USAGE_CMP") + ajouteMotClefDansFacteurCourantSiRegle(jdc,"MACR_ADAP_MAIL","ZONE","TYPE='BOITE'",((("RAYON",),"nexistepasMCsousMCFcourant"),)) + ajouteMotClefDansFacteurCourantSiRegle(jdc,"MACR_ADAP_MAIL","ZONE","TYPE='SPHERE'",((("RAYON",),"existeMCsousMCFcourant"),)) + changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V9_5":"V10_1"}) + changementValeur(jdc,"MACR_ADAP_MAIL","VERSION_HOMARD",{"V9_N":"V10_1_N"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V9_5":"V10_1"}) + changementValeur(jdc,"MACR_INFO_MAIL","VERSION_HOMARD",{"V9_N":"V10_1_N"}) + + ###################### traitement de POST_CHAM_XFEM ################# + removeMotCle(jdc,"POST_CHAM_XFEM","MODELE",pasDeRegle(),0) + removeMotCle(jdc,"POST_CHAM_XFEM","MAILLAGE_FISS",pasDeRegle(),0) + removeMotCle(jdc,"POST_CHAM_XFEM","NOM_CHAM",pasDeRegle(),0) + + ##################### traitement de SIMU_POINT_MAT/SUPPORT ############# + chercheOperInsereFacteur(jdc,"SIMU_POINT_MAT","SUPPORT='POINT'",pasDeRegle(),0) + + ###################### traitement AFFE_CARA_ELEM/UNITE_EUROPLEXUS ###### + renameMotCleInFact(jdc,"AFFE_CARA_ELEM","RIGI_PARASOL","UNITE_EUROPLEXUS","UNITE",pasDeRegle(),0) + + #################### traitement DEFI_GLRC/IMPRESSION ############# + removeMotCle(jdc,"DEFI_GLRC","IMPRESSION",pasDeRegle(),0) + + ################### traitement AFFICHAGE ##### + removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","LONG_I",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","LONG_R",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","NOM_COLONNE",pasDeRegle(),0) + removeMotCleInFact(jdc,"DYNA_NON_LINE","AFFICHAGE","PREC_R",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","LONG_I",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","LONG_R",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","NOM_COLONNE",pasDeRegle(),0) + removeMotCleInFact(jdc,"STAT_NON_LINE","AFFICHAGE","PREC_R",pasDeRegle(),0) + + ################### traitement CALC_NO *RESU ######### + removeMotCle(jdc,"CALC_NO","GROUP_MA_RESU",pasDeRegle(),0) + removeMotCle(jdc,"CALC_NO","MAILLE_RESU",pasDeRegle(),0) + removeMotCle(jdc,"CALC_NO","GROUP_NO_RESU",pasDeRegle(),0) + removeMotCle(jdc,"CALC_NO","NOEUD_RESU",pasDeRegle(),0) + + ################## traitement POST_K1_K2_K3/MAILLAGE ###### + removeMotCleSiRegle(jdc,"POST_K1_K2_K3","MAILLAGE",((("RESULTAT"),"existeMCFParmi"),)) + + ######### traitement CALC_ELEM/TYPE_ESTI #### + dESTI={"ERRE_ELEM_SIGM":"ERME_ELEM","ERZ1_ELEM_SIGM":"ERZ1_ELEM","ERZ2_ELEM_SIGM":"ERZ2_ELEM", + "QIRE_ELEM_SIGM":"QIRE_ELEM","QIZ1_ELEM_SIGM":"QIZ1_ELEM","QIZ2_ELEM_SIGM":"QIZ2_ELEM"} + changementValeur(jdc,"CALC_ELEM","TYPE_ESTI",dESTI) + + ######### suppression CALC_ELEM/NORME ###### + removeMotCle(jdc,"CALC_ELEM","NORME",pasDeRegle(),0) + + ########## traitement CALC_ELEM/CALC_NO OPTION + #dSENSI={"DEDE_ELNO_DLDE":"DEDE_ELNO","DEDE_NOEU_DLDE":"DEDE_NOEU","DESI_ELNO_DLSI":"DESI_ELNO","DESI_NOEU_DLSI":"DESI_NOEU", + # "DETE_ELNO_DLTE":"DETE_ELNO","DETE_NOEU_DLTE":"DETE_NOEU"} + dOPTION={"DEDE_ELNO_DLDE":"DEDE_ELNO","DEDE_NOEU_DLDE":"DEDE_NOEU","DESI_ELNO_DLSI":"DESI_ELNO","DESI_NOEU_DLSI":"DESI_NOEU", + "DETE_ELNO_DLTE":"DETE_ELNO","DETE_NOEU_DLTE":"DETE_NOEU", + "INTE_ELNO_ACTI":"INTE_ELNO","INTE_ELNO_REAC":"INTE_ELNO","INTE_NOEU_ACTI":"INTE_NOEU","INTE_NOEU_REAC":"INTE_NOEU", + "PRES_DBEL_DEPL":"PRME_ELNO","PRES_ELNO_IMAG":"PRAC_ELNO","PRES_ELNO_REEL":"PRAC_ELNO", + "PRES_NOEU_DBEL":"PRAC_NOEU","PRES_NOEU_IMAG":"PRAC_NOEU","PRES_NOEU_REEL":"PRAC_NOEU", + "ARCO_ELNO_SIGM":"SIRO_ELEM","ARCO_NOEU_SIGM":"SIRO_ELEM", + "ENDO_ELNO_ELGA":"ENDO_ELNO","ENDO_ELNO_SIGA":"ENDO_ELNO","ENDO_ELNO_SINO":"ENDO_ELNO","ENDO_NOEU_SINO":"ENDO_NOEU", + "ERRE_ELEM_SIGM":"ERME_ELEM","ERRE_ELEM_TEMP":"ERTH_ELEM", + "CRIT_ELNO_RUPT":"CRIT_ELNO","DEGE_ELNO_DEPL":"DEGE_ELNO","DEGE_NOEU_DEPL":"DEGE_NOEU", + "DURT_ELNO_META":"DURT_ELNO","DURT_NOEU_META":"DURT_NOEU","ECIN_ELEM_DEPL":"ECIN_ELEM","ENEL_ELNO_ELGA":"ENEL_ELNO", + "ENEL_NOEU_ELGA":"ENEL_NOEU","EPEQ_ELNO_TUYO":"EPTQ_ELNO","EPME_ELGA_DEPL":"EPME_ELGA","EPME_ELNO_DEPL":"EPME_ELNO", + "EPMG_ELGA_DEPL":"EPMG_ELGA","EPMG_ELNO_DEPL":"EPMG_ELNO","EPMG_NOEU_DEPL":"EPMG_NOEU","EPOT_ELEM_DEPL":"EPOT_ELEM", + "EPSG_ELGA_DEPL":"EPSG_ELGA","EPSG_ELNO_DEPL":"EPSG_ELNO","EPSG_NOEU_DEPL":"EPSG_NOEU", + "EPSI_ELGA_DEPL":"EPSI_ELGA","EPSI_NOEU_DEPL":"EPSI_NOEU","EPSI_ELNO_DEPL":"EPSI_ELNO","EPSI_ELNO_TUYO":"EPTU_ELNO", + "ERZ1_ELEM_SIGM":"ERZ1_ELEM","ERZ2_ELEM_SIGM":"ERZ2_ELEM", + "ETOT_ELNO_ELGA":"ETOT_ELNO","EXTR_ELGA_VARI":"VAEX_ELGA","EXTR_ELNO_VARI":"VAEX_ELNO","EXTR_NOEU_VARI":"VAEX_NOEU", + "FLUX_ELGA_TEMP":"FLUX_ELGA","FLUX_ELNO_TEMP":"FLUX_ELNO","FLUX_NOEU_TEMP":"FLUX_NOEU", + "HYDR_NOEU_ELGA":"HYDR_NOEU","HYDR_ELNO_ELGA":"HYDR_ELNO", + "META_ELNO_TEMP":"META_ELNO","META_NOEU_TEMP":"META_NOEU", + "PMPB_ELGA_SIEF":"PMPB_ELGA","PMPB_ELNO_SIEF":"PMPB_ELNO","PMPB_NOEU_SIEF":"PMPB_NOEU", + "QIRE_ELEM_SIGM":"QIRE_ELEM","QIRE_ELNO_ELEM":"QIRE_ELNO","QIRE_NOEU_ELEM":"QIRE_NOEU", + "QIZ1_ELEM_SIGM":"QIZ1_ELEM","QIZ2_ELEM_SIGM":"QIZ2_ELEM", + "SIEF_ELGA_DEPL":"SIEF_ELGA","SIEF_ELNO_ELGA":"SIEF_ELNO","SIEF_NOEU_ELGA":"SIEF_NOEU", + "SIEQ_ELNO_TUYO":"SITQ_ELNO","SING_ELNO_ELEM":"SING_ELNO","SIPO_ELNO_DEPL":"SIPO_ELNO","SIPO_NOEU_DEPL":"SIPO_NOEU", + "SOUR_ELGA_ELEC":"SOUR_ELGA", + "DCHA_ELGA_SIGM":"DERA_ELGA","DCHA_ELNO_SIGM":"DERA_ELNO","DCHA_NOEU_SIGM":"DERA_NOEU", + "RADI_ELGA_SIGM":"DERA_ELGA","RADI_ELNO_SIGM":"DERA_ELNO","RADI_NOEU_SIGM":"DERA_NOEU", + "EFGE_ELNO_CART":"EFCA_ELNO","EFGE_NOEU_CART":"EFCA_NOEU","EFGE_ELNO_DEPL":"EFGE_ELNO","EFGE_NOEU_DEPL":"EFGE_NOEU", + "EQUI_ELGA_EPME":"EPMQ_ELGA","EQUI_ELNO_EPME":"EPMQ_ELNO","EQUI_NOEU_EPME":"EPMQ_NOEU", + "EQUI_ELGA_EPSI":"EPEQ_ELGA","EQUI_ELNO_EPSI":"EPEQ_ELNO","EQUI_NOEU_EPSI":"EPEQ_NOEU", + "EQUI_ELGA_SIGM":"SIEQ_ELGA","EQUI_ELNO_SIGM":"SIEQ_ELNO","EQUI_NOEU_SIGM":"SIEQ_NOEU", + "SIGM_ELNO_CART":"SICA_ELNO","SIGM_NOEU_CART":"SICA_NOEU","SIGM_ELNO_COQU":"SICO_ELNO","SIGM_NOEU_COQU":"SICO_ELNO", + "SIGM_ELNO_TUYO":"SITU_ELNO", + "SIGM_ELNO_DEPL":"SIGM_ELNO","SIGM_NOEU_DEPL":"SIGM_NOEU","SIGM_NOZ1_ELGA":"SIZ1_ELGA","SIGM_NOZ2_ELGA":"SIZ2_ELGA", + "VALE_NCOU_MAXI":"SPMX_ELGA","VARI_ELNO_COQU":"VACO_ELNO","VARI_ELNO_TUYO":"VATU_ELNO", + "VARI_NOEU_ELGA":"VARI_NOEU","VARI_ELNO_ELGA":"VARI_ELNO", + "INDI_LOCA_ELGA":"INDL_ELGA"} + #"FORC_NODA":"FORC_NOEU","REAC_NODA":"REAC_NOEU" + changementValeurDsMCF(jdc,"AFFE_MATERIAU","AFFE_VARC","NOM_CHAM",dOPTION) + changementValeur(jdc,"COMB_FOURIER","NOM_CHAM",dOPTION) + changementValeur(jdc,"CREA_CHAMP","NOM_CHAM",dOPTION) + changementValeur(jdc,"CREA_RESU","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"EXTR_RESU","ARCHIVAGE","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",dOPTION) + changementValeur(jdc,"LIRE_RESU","NOM_CHAM",dOPTION) + changementValeur(jdc,"MACR_ADAP_MAIL","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"MACR_ASPIC_CALC","IMPRESSION","NOM_CHAM",dOPTION) + changementValeur(jdc,"MACR_LIGN_COUPE","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"MODI_REPERE","MODI_CHAM","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",dOPTION) + changementValeur(jdc,"PROJ_CHAMP","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",dOPTION) + changementValeur(jdc,"RECU_FONCTION","NOM_CHAM",dOPTION) + changementValeur(jdc,"REST_GENE_PHYS","NOM_CHAM",dOPTION) + changementValeur(jdc,"REST_SOUS_STRUC","NOM_CHAM",dOPTION) + changementValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",dOPTION) + changementValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",dOPTION) + + changementValeur(jdc,"CALC_CHAM_ELEM","OPTION",dOPTION) + changementValeur(jdc,"CALC_ELEM","OPTION",dOPTION) + changementValeur(jdc,"CALC_META","OPTION",dOPTION) + changementValeur(jdc,"CALC_NO","OPTION",dOPTION) + changementValeur(jdc,"COMB_SISM_MODAL","OPTION",dOPTION) + changementValeur(jdc,"MECA_STATIQUE","OPTION",dOPTION) + changementValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",dOPTION) + changementValeur(jdc,"THER_NON_LINE","OPTION",dOPTION) + + ############ Message si suppressionValeurs ou Valeurs ambigue CALC_ELEM/OPTION + rOPTION=("'DEUL_ELGA_DEPL'","'DEUL_ELGA_TEMP'","'DURT_ELGA_META'", + "'ERRE_ELNO_DEPL'", "'ERRE_NOEU_ELEM'", "'ERRE_ELNO_ELEM'","'EPSP_NOEU_ZAC'","'HYDR_ELNO_ELGA'", + "'SIGM_NOEU_ZAC'","'SIGM_ELNO_SIEF'","'SIGM_NOEU_SIEF'","'SIPO_ELNO_SIEF'","'SIPO_NOEU_SIEF'", + "'SIRE_ELNO_DEPL'","'SIRE_NOEU_DEPL'","'SIEF_NOEU'", + "'PRES_ELNO_DBEL'", "'VARI_NOEU'") + # Options ambigue : PRES_ELNO_DBEL --> prac_elno/prme_elno, ERRE* --> ERME_ELNO ou ERTH_ELNO selon PHENOMENE + # En commentaires les commandes non concernees par rOPTION + + genereErreurValeurDsMCF(jdc,"AFFE_MATERIAU","AFFE_VARC","NOM_CHAM",rOPTION) + #genereErreurValeur(jdc,"COMB_FOURIER","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"CREA_CHAMP","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"CREA_RESU","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"EXTR_RESU","ARCHIVAGE","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"IMPR_RESU","RESU","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_MED","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"LIRE_RESU","FORMAT_IDEAS","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"LIRE_RESU","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"MACR_ADAP_MAIL","NOM_CHAM",rOPTION) + #genereErreurDsMCF(jdc,"MACR_ASPIC_CALC","IMPRESSION","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"MACR_LIGN_COUPE","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"MODI_REPERE","MODI_CHAM","NOM_CHAM",rOPTION) + #genereErreurValeurDsMCF(jdc,"POST_RCCM","RESU_MECA","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"POST_ELEM","INTEGRALE","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"POST_ELEM","MINMAX","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"POST_RELEVE_T","ACTION","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"PROJ_CHAMP","NOM_CHAM",rOPTION) + #genereErreurValeurDsMCF(jdc,"PROJ_MESU_MODAL","MODELE_MESURE","NOM_CHAM",rOPTION) + genereErreurValeur(jdc,"RECU_FONCTION","NOM_CHAM",rOPTION) + #genereErreurValeur(jdc,"REST_GENE_PHYS","NOM_CHAM",rOPTION) + #genereErreurValeur(jdc,"REST_SOUS_STRUC","NOM_CHAM",rOPTION) + #genereErreurValeur(jdc,"REST_SPEC_PHYS","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"TEST_RESU","RESU","NOM_CHAM",rOPTION) + genereErreurValeurDsMCF(jdc,"TEST_RESU","GENE","NOM_CHAM",rOPTION) + + genereErreurValeur(jdc,"CALC_CHAM_ELEM","OPTION",rOPTION) + genereErreurValeur(jdc,"CALC_ELEM","OPTION",rOPTION) + #genereErreurValeur(jdc,"CALC_META","OPTION",rOPTION) + genereErreurValeur(jdc,"CALC_NO","OPTION",rOPTION) + #genereErreurValeur(jdc,"COMB_SISM_MODAL","OPTION",rOPTION) + #genereErreurValeur(jdc,"MECA_STATIQUE","OPTION",rOPTION) + genereErreurValeurDsMCF(jdc,"MACRO_ELAS_MULT","CAS_CHARGE","OPTION",rOPTION) + #genereErreurValeur(jdc,"THER_NON_LINE","OPTION",rOPTION) + + ########### Message si CALC_ELEM/SENSIBILITE + genereErreurMCF(jdc,"CALC_ELEM","SENSIBILITE") + + # non fait CALC_NO OPTION=FORC_NODA_NONL + + ########## traitement MACRO_MISS_3D --> CALC_MISS + renameCommandeSiRegle(jdc,"MACRO_MISS_3D","CALC_MISS",((("OPTION","MODULE","MISS_IMPE",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","ISSF"),"nexistepasMCsousMCF"),(("PARAMETRE","DIRE_ONDE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_LISTE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_NB"),"nexistepasMCsousMCF"),)) + renameCommandeSiRegle(jdc,"MACRO_MISS_3D","CALC_MISS",((("OPTION","MODULE","MISS_IMPE",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","ISSF","NON",jdc),"MCsousMCFaPourValeur"),(("PARAMETRE","DIRE_ONDE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_LISTE"),"nexistepasMCsousMCF"),(("PARAMETRE","CONTR_NB"),"nexistepasMCsousMCF"),)) + removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_RESU_IMPE",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_RESU_FORC",pasDeRegle(),0) + removeMotCleInFact(jdc,"CALC_MISS","PARAMETRE","FICH_POST_TRAI",pasDeRegle(),0) + removeMotCle(jdc,"CALC_MISS","UNITE_OPTI_MISS",pasDeRegle()) + removeMotCle(jdc,"CALC_MISS","UNITE_MODELE_SOL",pasDeRegle()) + removeMotCle(jdc,"CALC_MISS","OPTION",pasDeRegle(),1) + changementValeur(jdc,"CALC_MISS","VERSION",{"V1_4":"V6.5"}) + changementValeur(jdc,"CALC_MISS","VERSION",{"V1_5":"V6.6"}) + changementValeur(jdc,"CALC_MISS","VERSION",{"V1_3":"V6.5"}) + + macr="" + interf="" + amor="" + for c in jdc.root.childNodes: + if c.name != "IMPR_MACR_ELEM" : continue + for mc in c.childNodes: + if mc.name == "MACR_ELEM_DYNA" : macr=mc.getText(jdc) + if mc.name == "GROUP_MA_INTERF": interf=mc.getText(jdc) + if mc.name == "AMOR_REDUIT": amor=mc.getText(jdc) + if amor != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",amor,pasDeRegle(),0) + if interf != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",interf,pasDeRegle(),0) + if macr != "" : chercheOperInsereFacteur(jdc,"CALC_MISS",macr,pasDeRegle(),0) + + chercheOperInsereFacteur(jdc,"CALC_MISS","TABLE_SOL=''",pasDeRegle(),0) + chercheOperInsereFacteur(jdc,"CALC_MISS","TYPE_RESU='FICHIER'",pasDeRegle(),0) + + ################################################################# + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.Optionparser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier a traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile) + +if __name__ == '__main__': + main() + diff --git a/Traducteur2/utils.py b/Traducteur2/utils.py new file mode 100644 index 00000000..31ab5e87 --- /dev/null +++ b/Traducteur2/utils.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re + +def indexToCoordinates(src, index): + """return le numero de la colonne (x) et le numero de la ligne (y) dans src""" + y = src[: index].count("\n") + startOfLineIdx = src.rfind("\n", 0, index)+1 + x = index-startOfLineIdx + return x, y + +def lineToDict(line): + """Transforme une ligne (string) en un dictionnaire de mots + reperes par le numero de la colonne""" + + words = re.split("(\w+)", line) + h = {};i = 0 + for word in words: + h[i] = word + i+=len(word) + return h + +def dictToLine(d): + """Transformation inverse: a partir d'un dictionnaire retourne une ligne""" + cols = d + cols.sort() + return "".join([d[colno]for colno in cols]) diff --git a/Traducteur2/visiteur.py b/Traducteur2/visiteur.py new file mode 100644 index 00000000..b1e8aa2f --- /dev/null +++ b/Traducteur2/visiteur.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re +from compiler import visitor + +class MatchFinder: + """Visiteur de base : gestion des matches """ + def reset(self,line): + self.matches=[] + self._matches = [] + self.words = re.split("(\w+)", line) # every other one is a non word + self.positions = [] + i = 0 + for word in self.words: + self.positions.append(i) + i+=len(word) + self.index = 0 + + def popWordsUpTo(self, word): + if word == "*": + return # won't be able to find this + posInWords = self.words.index(word) + idx = self.positions[posInWords] + self.words = self.words[posInWords+1:] + self.positions = self.positions[posInWords+1:] + + def appendMatch(self,name): + idx = self.getNextIndexOfWord(name) + self._matches.append((idx, name)) + + def getNextIndexOfWord(self,name): + return self.positions[self.words.index(name)] + + +class KeywordFinder(MatchFinder): + """Visiteur pour les keywords d'une commande """ + + def visitKeyword(self,node): + idx = self.getNextIndexOfWord(node.name) + self.popWordsUpTo(node.name) + prevmatches=self._matches + self._matches = [] + for child in node.getChildNodes(): + self.visit(child) + prevmatches.append((idx, node.name,self._matches)) + self._matches=prevmatches + #on ne garde que les matches du niveau Keyword le plus haut + self.matches=self._matches + + def visitTuple(self,node): + matchlist=[] + for child in node.getChildNodes(): + self._matches = [] + self.visit(child) + if self._matches: + # Pour eviter les tuples et listes ordinaires, + # on ne garde que les visites fructueuses + matchlist.append(self._matches) + self._matches=matchlist + + visitList=visitTuple + + def visitName(self,node): + self.popWordsUpTo(node.name) + + def visitAssName(self,node): + self.popWordsUpTo(node.name) diff --git a/Traducteur3/.mocles.py.swp b/Traducteur3/.mocles.py.swp new file mode 100644 index 00000000..9a2f5669 Binary files /dev/null and b/Traducteur3/.mocles.py.swp differ diff --git a/Traducteur3/.toto.comm.swp b/Traducteur3/.toto.comm.swp new file mode 100644 index 00000000..824366dd Binary files /dev/null and b/Traducteur3/.toto.comm.swp differ diff --git a/Traducteur3/.visiteur.py.swp b/Traducteur3/.visiteur.py.swp new file mode 100644 index 00000000..9ad7b735 Binary files /dev/null and b/Traducteur3/.visiteur.py.swp differ diff --git a/Traducteur3/CMakeLists.txt b/Traducteur3/CMakeLists.txt new file mode 100644 index 00000000..d1c51c80 --- /dev/null +++ b/Traducteur3/CMakeLists.txt @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM 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 +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +# Installation de tous les fichiers Python, texte et images du repertoire et des sous-repertoires (sauf CVS) +install ( + FILES + calcG.py changeValeur.py dictErreurs.py __init__.py inseremocle.py + load.py log.py mocles.py movemocle.py parseur.py regles.py removemocle.py + renamemocle.py traduitV7V8.py traduitV8V9.py traduitV9V10.py utils.py + visiteur.py + DESTINATION ${CMAKE_INSTALL_PREFIX}/Traducteur + ) + +### Local Variables: +### mode: cmake +### End: diff --git a/Traducteur3/__init__.py b/Traducteur3/__init__.py new file mode 100644 index 00000000..e4044aec --- /dev/null +++ b/Traducteur3/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# diff --git a/Traducteur3/changeValeur.py b/Traducteur3/changeValeur.py new file mode 100644 index 00000000..50b0c9c9 --- /dev/null +++ b/Traducteur3/changeValeur.py @@ -0,0 +1,317 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +from Traducteur.utils import lineToDict +import logging +from Traducteur.dictErreurs import ecritErreur +from Traducteur.load import jdcSet +from Traducteur.renamemocle import decaleLignesdeNBlancs +from Traducteur.removemocle import removeMotCleInFact +from Traducteur import regles + + +#-------------------------------------------------------------------------- +def changementValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + trouveUnMC=0 + for mc in c.childNodes: + if mc.name != motcle : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-1 + indexTexteMC=0 + while indexLigneGlob < mc.endline : + if indexTexteMC > len(liste_ligne_MC)-1 : break + MaLigneGlob=jdc.getLines()[indexLigneGlob] + MaLigneTexte=liste_ligne_MC[indexTexteMC] + for Valeur in DictNouvVal : + MaLigneTexteDict=lineToDict(MaLigneTexte) + trouvecol=MaLigneTexte.find(Valeur) + if trouvecol > -1: + trouve=(Valeur==MaLigneTexteDict[trouvecol]) + else: + trouve=False + if trouve: + debut=MaLigneGlob.find(motcle) + if debut==-1 : debut=0 + Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) + Nouveau=MaLigneGlob[0:debut]+Nouveau + jdc.getLines()[indexLigneGlob]=Nouveau + MaLigneTexte=Nouveau # raccourci honteux mais ... + MaLigneGlob=Nouveau + if Valeur in liste : + ecritErreur((command,motcle,Valeur),indexLigneGlob) + else : + logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) + boolChange=1 + indexLigneGlob=indexLigneGlob+1 + indexTexteMC=indexTexteMC+1 + if (trouveUnMC == 0) and ( defaut == 1): + ecritErreur((command,motcle,"DEFAUT"),c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------------- +def changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste=(),ensemble=regles.SansRegle,defaut=0): +#-------------------------------------------------------------------------------- + + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + trouveUnMC=0 + for mc in ll.childNodes: + if mc.name != motcle:continue + if ensemble.verif(c) == 0 : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-1 + indexTexteMC=0 + while indexLigneGlob < mc.endline : + if indexTexteMC > len(liste_ligne_MC)-1 : break + MaLigneGlob=jdc.getLines()[indexLigneGlob] + MaLigneTexte=liste_ligne_MC[indexTexteMC] + for Valeur in DictNouvVal : + MaLigneTexteDict=lineToDict(MaLigneTexte) + trouvecol=MaLigneTexte.find(Valeur) + if trouvecol > -1: + trouve=(Valeur==MaLigneTexteDict[trouvecol]) + else: + trouve=False + if trouve: + debut=MaLigneGlob.find(motcle) + if debut==-1 : debut=0 + Nouveau=MaLigneGlob[debut:].replace(Valeur,DictNouvVal[Valeur]) + Nouveau=MaLigneGlob[0:debut]+Nouveau + jdc.getLines()[indexLigneGlob]=Nouveau + MaLigneTexte=Nouveau # raccourci honteux mais ... + MaLigneGlob=Nouveau + if Valeur in liste : + ecritErreur((command,fact,motcle,Valeur),indexLigneGlob) + else : + logging.info("Changement de %s par %s dans %s ligne %d",Valeur,DictNouvVal[Valeur],command,indexLigneGlob) + boolChange=1 + indexLigneGlob=indexLigneGlob+1 + indexTexteMC=indexTexteMC+1 + if (trouveUnMC == 0) and ( defaut == 1): + logging.warning("OPTION (defaut) de CALCG a verifier ligne %s" ,c.lineno ) + ecritErreur((command,fact,motcle,"DEFAUT"),c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------------- +def changementValeurDsMCFSiRegle(jdc,command,fact,motcle,DictNouvVal,liste_regles,defaut=0): +#-------------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + liste=() + changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,mesRegles,defaut) + +#--------------------------------------------------------------------------------------- +def changementValeurDsMCFAvecAvertissement(jdc, command, fact,motcle,DictNouvVal,liste): +#--------------------------------------------------------------------------------------- + if command not in jdcSet : return + defaut=0 + if liste[-1] == "defaut" : + defaut=1 + changementValeurDsMCF(jdc,command,fact,motcle,DictNouvVal,liste,defaut) + +#-------------------------------------------------------------------------- +def changementValeurAvecAvertissement(jdc, command,motcle,DictNouvVal,liste): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + defaut=0 + if liste[-1] == "defaut" : + defaut=1 + changementValeur(jdc,command,motcle,DictNouvVal,liste,defaut) + +#-------------------------------------------------------------------------- +def suppressionValeurs(jdc, command,motcle,liste): +#-------------------------------------------------------------------------- + + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + for mc in c.childNodes: + if mc.name != motcle : continue + indexLigneGlob=mc.lineno-1 + while indexLigneGlob < mc.endline-1 : + MaLigneTexte = jdc.getLines()[indexLigneGlob] + MaLigne=MaLigneTexte + for Valeur in liste : + debutMC =MaLigne.find(motcle) + if debutMC ==-1 : debutMC=0 + debut1=MaLigne[0:debutMC] + chercheLigne=MaLigne[debutMC:] + trouve=chercheLigne.find(Valeur) + premier=0 + if trouve > 1 : #on a au moins une quote + debut=debut1 + chercheLigne[0:trouve-1] + index = -1 + while (-1 * index) < len(debut) : + if (debut[index] == "(") : + premier = 1 + if index == -1 : + index=len(debut) + else : + index=index+1 + break + if (debut[index] == "," ) : + break + if (debut[index] != " " ) : + assert(0) + index = index -1 + debLigne = debut[0:index] + fin=trouve+len(Valeur)+1 + if premier == 1 and chercheLigne[fin] == ',': fin = fin + 1 # on supprime la , + finLigne = chercheLigne[fin:] + MaLigne_tmp=debLigne+finLigne + # traitement ligne commancant par , + if len(MaLigne_tmp.strip()) > 0 : + if MaLigne_tmp.strip()[0]==',' : + MaLigne=MaLigne_tmp.strip()[1:] + else : + MaLigne=MaLigne_tmp[0:] + else : + MaLigne=MaLigne_tmp[0:] + boolChange=1 + jdc.getLines()[indexLigneGlob]=MaLigne + indexLigneGlob=indexLigneGlob+1 + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------- +def appelleMacroSelonValeurConcept(jdc,macro,genea): +#---------------------------------------------- + if macro not in jdcSet : return + boolChange=0 + fact=genea[0] + motcle=genea[1] + chaine="CO" + for c in jdc.root.childNodes: + if c.name != macro : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + trouveValeur=0 + for mc in ll.childNodes: + if mc.name != motcle:continue + TexteMC=mc.getText(jdc) + liste_ligne_MC=TexteMC.splitlines() + indexLigneGlob=mc.lineno-2 + trouveTexteMC=0 + trouveegal=0 + trouvechaine=0 + trouveparent=0 + trouvequote=0 + while indexLigneGlob < mc.endline : + indexLigneGlob=indexLigneGlob+1 + MaLigneTexte=jdc.getLines()[indexLigneGlob] + + # on commence par chercher TABLE par exemple + # si on ne trouve pas on passe a la ligne suivante + if ( trouveTexteMC == 0 ) : + indice=MaLigneTexte.find(motcle) + if indice < 0 : continue + trouveTexteMC=1 + else : + indice=0 + + # on cherche = + aChercher=MaLigneTexte[indice:] + if (trouveegal == 0 ): + indice=aChercher.find("=") + if indice < 0 : continue + trouveegal = 1 + else : + indice = 0 + + # on cherche CO + aChercher2=aChercher[indice:] + if (trouvechaine == 0 ): + indice=aChercher2.find(chaine) + if indice < 0 : continue + trouvechaine = 1 + else : + indice = 0 + + #on cherche ( + aChercher3=aChercher2[indice:] + if (trouveparent == 0 ): + indice=aChercher3.find('(') + if indice < 0 : continue + trouveparent = 1 + else : + indice = 0 + + #on cherche la ' + aChercher4=aChercher3[indice:] + if (trouvequote == 0 ): + indice=aChercher4.find("'") + indice2=aChercher4.find('"') + if (indice < 0) and (indice2 < 0): continue + if (indice < 0) : indice=indice2 + trouvequote = 1 + else : + indice = 0 + + trouveValeur=1 + aChercher5=aChercher4[indice+1:] + indice=aChercher5.find("'") + if indice < 0 : indice=aChercher5.find('"') + valeur=aChercher5[:indice] + break + + if trouveValeur==0 : + logging.error("Pb de traduction pour MACR_LIGNE_COUPE : Pas de nom de Concept identifiable") + return + + if boolChange : + jdc.reset(jdc.getSource()) + logging.error("Pb du traduction pour MACR_LIGNE_COUPE : Deux noms de Concept possibles") + return + + boolChange=1 + ligneaTraiter=jdc.getLines()[c.lineno-1] + debut=ligneaTraiter[0:c.colno] + suite=valeur+"=" + fin=ligneaTraiter[c.colno:] + ligne=debut+suite+fin + jdc.getLines()[c.lineno-1]=ligne + nbBlanc=len(valeur)+1 + if c.lineno < c.endline: + decaleLignesdeNBlancs(jdc,c.lineno,c.endline-1,nbBlanc) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------- +def changeTouteValeur(jdc,command,motcle,DictNouvVal,liste=(),defaut=0): +#---------------------------------------------- + if macro not in jdcSet : return + boolChange=0 diff --git a/Traducteur3/demosRN.py b/Traducteur3/demosRN.py new file mode 100755 index 00000000..477603f4 --- /dev/null +++ b/Traducteur3/demosRN.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +""" +usage="""usage: %prog [options] +Typical use is: + python traduitV11V12.py --infile=xxxx --outfile=yyyy +""" + +import os, sys +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +import optparse + +from Traducteur.load import getJDC +from Traducteur.mocles import parseKeywords +from Traducteur.removemocle import * +from Traducteur.renamemocle import * +from Traducteur.renamemocle import * +from Traducteur.inseremocle import * +from Traducteur.changeValeur import * +from Traducteur.movemocle import * +from Traducteur.dictErreurs import * +from Traducteur.regles import pasDeRegle +from Traducteur import log + + + +atraiter=( + "Genere_Une_Erreur_Traduction", + "RodBank", + "Assembly", + "Techno_data", + "Model_data", + ) + +dict_erreurs={ + "Genere_Une_Erreur_Traduction":"Message pour test de genereErreurpourCommande ", + } + +sys.dict_erreurs=dict_erreurs + +def traduc(infile,outfile,flog=None): + + hdlr=log.initialise(flog) + jdc=getJDC(infile,atraiter) + root=jdc.root + + #Parse les mocles des commandes + parseKeywords(root) + + # genere une erreur si on trouve la commande dans le jdc # + genereErreurPourCommande(jdc,"Genere_Une_Erreur_Traduction") + + f=open(outfile,'w') + f.write(jdc.getSource()) + f.close() + + log.ferme(hdlr) + +def main(): + parser = optparse.OptionParser(usage=usage) + + parser.add_option('-i','--infile', dest="infile", default='toto.comm', + help="Le fichier à traduire") + parser.add_option('-o','--outfile', dest="outfile", default='tutu.comm', + help="Le fichier traduit") + + parser.add_option('-l','--logfile', dest="flog", default='log.txt', + help="fichier de log") + + options, args = parser.parse_args() + traduc(options.infile,options.outfile,options.flog) + +if __name__ == '__main__': + main() diff --git a/Traducteur3/dictErreurs.py b/Traducteur3/dictErreurs.py new file mode 100644 index 00000000..82fc058f --- /dev/null +++ b/Traducteur3/dictErreurs.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur.load import jdcSet + + +def ecritErreur(listeGena,ligne=None) : + from sys import dict_erreurs + maCle="" + for Mot in listeGena : + maCle=maCle+"_"+Mot + #try : + if ( 1 == 1) : + maClef=maCle[1:] + if maClef in dict_erreurs : + if ligne != None : + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) + else : + logging.warning("%s",dict_erreurs[maClef]) + else : + maCle="" + for Mot in listeGena[:-1] : + maCle=maCle+"_"+Mot + maClef=maCle[1:] + maClef=maCle+"_"+"VALEUR" + if maClef in dict_erreurs : + if ligne != None : + logging.warning("ligne %d : %s ",ligne,dict_erreurs[maClef]) + else : + logging.warning("%s",dict_erreurs[maClef]) + #except : + # pass + +def genereErreurPourCommande(jdc,listeCommande) : + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if type(listeCommande)==list: + for Mot in listeCommande : + if c.name != Mot :continue + ecritErreur((Mot,),c.lineno) + else: + if c.name != listeCommande :continue + ecritErreur((listeCommande,),c.lineno) + +def genereErreurMotCleInFact(jdc,command,fact,mocle): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle: + continue + else : + ecritErreur((command,fact,mocle,),c.lineno) + +def genereErreurMCF(jdc,command,fact): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact: + continue + else : + ecritErreur((command,fact,),c.lineno) + +def genereErreurValeur(jdc,command,fact,list_valeur): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + texte=mc.getText(jdc) + for valeur in list_valeur: + trouve=texte.find(valeur) + if trouve > -1 : + logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,mc.lineno) + +def genereErreurValeurDsMCF(jdc,command,fact,mocle,list_valeur): + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + texte=n.getText(jdc) + for valeur in list_valeur: + trouve=texte.find(valeur) + if trouve > -1 : + logging.warning("%s doit etre supprimee ou modifiee dans %s : ligne %d",valeur,c.name,n.lineno) diff --git a/Traducteur3/edg_REP1300_FULL_PN.comm b/Traducteur3/edg_REP1300_FULL_PN.comm new file mode 100755 index 00000000..ee4744a9 --- /dev/null +++ b/Traducteur3/edg_REP1300_FULL_PN.comm @@ -0,0 +1,159 @@ + +REF=Assembly(assembly_type='REF',); + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map=((REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,U1,U1,U1,U1,U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); + +Genere_Une_Erreur_Traduction(essai='3',); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:f62a6f71fcde9f983479fc749f7e334c -:FIN CHECKSUM \ No newline at end of file diff --git a/Traducteur3/inseremocle.py b/Traducteur3/inseremocle.py new file mode 100644 index 00000000..19dc1ceb --- /dev/null +++ b/Traducteur3/inseremocle.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur.parseur import FactNode +from Traducteur.load import jdcSet +from Traducteur.dictErreurs import ecritErreur +from Traducteur import regles +debug=0 + + +#----------------------------------- +def insereMotCle(jdc,recepteur,texte): +#----------------------------------- +# appelle la methode selon la classe +# du recepteur + + if recepteur.name not in jdcSet : return + if recepteur.__class__.__name__ == "Command" : + if debug : print (" Ajout de ", texte, "dans la commande : " ,recepteur.name ) + insereMotCleDansCommande(jdc,recepteur,texte) + return + + +#-------------------------------------------- +def insereMotCleDansCommande(jdc,command,texte): +#--------------------------------------------- +# insere le texte comme 1er mot cle +# de la commande + if command.name not in jdcSet : return + if debug : print ("insereMotCle ", texte , " dans ", command.name) + numcol=chercheDebut1Mot(jdc,command) + if numcol > 0 : + jdc.splitLine(command.lineno,numcol) + indice = -1 + while texte[indice] == " " or texte[indice] == "\n": + indice = indice -1 + if texte[indice] != "," : texte=texte+"," + texteinfo=texte + texte=texte+'\n' + jdc.addLine(texte,command.lineno) + logging.info("Insertion de : %s ligne %d", texteinfo,command.lineno) + if numcol > 0 : # Les mots clefs etaient sur la meme ligne + jdc.joinLineandNext(command.lineno) + +#------------------------------------------------------------- +def insereMotCleDansFacteur(jdc,facteur,texte,plusieursFois=True): +#---------------------------------------------------------------- + if debug : print ("insereMotCle ", texte , " dans ", facteur.name) + + if texte[-1] == "\n" : texte=texte[0:-1] + ancien=jdc.getLine(facteur.lineno) + + # On va chercher la derniere ) pour ajouter avant + # on va verifier s il il y a un , avant + # si le texte ne finit pas par une "," + # on en met une + + indice = -1 + while texte[indice] == " " : + indice = indice -1 + if texte[indice] != "," : + texte=texte+"," + if (texte.find("#") > -1) and (texte.find("#") < texte.find(",")) : + texte=texte+"\n," + + texteinfo=texte + texte=texte+"\n" + + ligneaCouper=facteur.lineno + while ligneaCouper < facteur.endline + 1 : + trouve=0 + trouveF=0 + trouveP=0 + indiceDeCoupe=0 + while ancien.find("_F") > 0 : + longueur=len(ancien) + indice=ancien.find("_F") + indiceParcours=0 + # pour ne pas tenir compte des autres noms + # Attention si 2 MCF sur la meme ligne (la 1ere) + if trouveF == 0 : + if ((ligneaCouper!=facteur.lineno) or ((ancien.find(facteur.name) < indice ) or (ancien.find(facteur.name) < 0))) : + trouveF=1 + indiceParcours=indice + 2 + # attention pour regler DEFI_FONCTION .. + else : + indiceDeCoupe=indiceDeCoupe+indice+2 + ancien=ancien[indice +2:] + continue + if trouveF == 1 : + indiceDeCoupe=indiceDeCoupe+indice + # print "indice de Parcours" ,indiceParcours + # print ancien[indiceParcours] + # print ancien[indiceParcours+1] + # print ancien[indiceParcours+2] + while indiceParcours < longueur : + if ancien[indiceParcours] == "(" : + trouveP=1 + # print ("trouve". + break + if ancien[indiceParcours] != " " : + trouveP=0 + # print ("mouv") + break + indiceParcours = indiceParcours+1 + trouve = trouveP * trouveF + if trouve : break + ancien=ancien[indice+1:] + if trouve : + debut=indiceDeCoupe + 3 + if(jdc.getLine(ligneaCouper)[debut:]!="\n"): + jdc.splitLine(ligneaCouper,debut) + jdc.addLine(texte,ligneaCouper) + jdc.joinLineandNext(ligneaCouper) + logging.info("Insertion de %s ligne %d", texteinfo,ligneaCouper) + + # Gestion du cas particulier du mot clef facteur vide + if facteur.childNodes == []: + jdc.joinLineandNext(facteur.lineno) + + ligneaCouper=ligneaCouper+1 + ancien=jdc.getLine(ligneaCouper) + if not plusieursFois and trouve : break + + +#----------------------------------- +def chercheDebut1Mot(jdc,command): +#----------------------------------- +# Retourne le numero de colonne si le 1er mot clef est +# sur la meme ligne que le mot clef facteur +# -1 sinon + assert (command.childNodes != []) + debut=-1 + node1=command.childNodes[0] + if hasattr(node1,"lineno"): + if node1.lineno == command.lineno : + debut=node1.colno + else: + debut=chercheDebutFacteur(jdc,command) + if debut == -1 and debug : print ("attention!!! pb pour trouver le debut dans ", command) + return debut + +#----------------------------------- +def chercheDebutFacteur(jdc,facteur): +#----------------------------------- + debut=-1 + ligne=jdc.getLines()[facteur.lineno] + debut=ligne.find("_F") + if debut > -1 : debut=debut + 3 + return debut + + +#----------------------------------- +def chercheAlignement(jdc,command): +#----------------------------------- +# Retourne le nb de blanc +# pour aligner sur le 1er mot clef fils + assert (command.childNodes != []) + node1=command.childNodes[0] + nbBlanc=node1.colno + return " "*nbBlanc + +#--------------------------------------------------------------------------------------------------------- +def chercheOperInsereFacteur(jdc,nomcommande,nouveau,ensemble=regles.SansRegle, estunFacteur=1, erreur=0): +#-------------------------------------------------------------------------------------------------------- +# Cherche l oper +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + boolChange=0 + if estunFacteur : + texte=nouveau+"=_F()," + else : + texte=nouveau + if nomcommande not in jdcSet : return + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != nomcommande:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((nomcommande,nouveau),c.lineno) + boolChange=1 + insereMotCle(jdc,c,texte) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------------------------------------- +def chercheOperInsereFacteurSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): +#---------------------------------------------------------------------------------------- +# Cherche l oper +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) + +#---------------------------------------------------------------------------------------- +def chercheOperInsereMotCleSiRegle(jdc,nomcommande,nouveau,liste_regles, estunFacteur=0): +#---------------------------------------------------------------------------------------- + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur) + + +#--------------------------------------------------------------------------------------------------------- +def chercheOperInsereFacteurSiRegleAvecAvertissement(jdc,nomcommande,nouveau,liste_regles, estunFacteur=1): +#--------------------------------------------------------------------------------------------------------- + if nomcommande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + chercheOperInsereFacteur(jdc,nomcommande,nouveau,mesRegles,estunFacteur,erreur=1) + +#------------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,ensemble=regles.SansRegle, estunFacteur=0): +#------------------------------------------------------------------------------------------------- +# Cherche la commande +# Cherche le MCF +# cree le texte +# appelle insereMotCle pour ajouter le texte +# + if commande not in jdcSet : return + if estunFacteur : + texte=nouveau+"=_F()," + else : + texte=nouveau + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != commande : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + insereMotCleDansFacteur(jdc,mcF,texte) + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteurSiRegle(jdc,commande,fact,nouveau,liste_regles,estunFacteur=0): +#------------------------------------------------------------------------------------------- +# + if commande not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + ajouteMotClefDansFacteur(jdc,commande,fact,nouveau,mesRegles,estunFacteur) + +#------------------------------------------------------------------------------------------- +def ajouteMotClefDansFacteurCourantSiRegle(jdc,commande,fact,nouveau,liste_regles): +#------------------------------------------------------------------------------------------- +# + if commande not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != commande : continue + for mcF in c.childNodes: + if mcF.name != fact : continue + l=mcF.childNodes[:] + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + boolChange=1 + n=ll.childNodes[0] + ligneaCouper=n.lineno-1 + numcol=n.colno + jdc.splitLine(ligneaCouper+1,numcol) + texte=nouveau+",\n" + jdc.addLine(texte,ligneaCouper+1) + logging.info("Insertion de %s dans %s : ligne %d", nouveau,c.name,ligneaCouper+1) + if numcol > 0 : + jdc.joinLineandNext(ligneaCouper+1) + if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur3/load.py b/Traducteur3/load.py new file mode 100644 index 00000000..f5aa5b52 --- /dev/null +++ b/Traducteur3/load.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +import re +from Traducteur import parseur +from Traducteur.mocles import parseKeywords + +jdcSet=set() + + +class JDCTrad: + """Cet objet conserve toutes les informations relatives a un fichier de commandes .comm""" + + def __init__(self,src,atraiter): + #---------------------------------------- + self.atraiter=atraiter + self.init(src,atraiter) + commands= self.root.childNodes[:] + commands.reverse() + for c in commands: + jdcSet.add(c.name) + + def init(self,src,atraiter): + #--------------------------- + # construction de self.lines + self.root=parseur.parser(src,atraiter) + self.lines=src.splitlines(1) + + def parseKeywords(self): + #----------------------- + # construction de fils (cf mocles.py) + parseKeywords(self.root) + + def reset(self,src): + #----------------------- + # reconstruction + self.init(src,self.atraiter) + self.parseKeywords() + + def getSource(self): + #----------------------- + # retourne la concatenation de + # toutes les lignes + return "".join(self.getLines()) + + def getLine(self,linenum): + #----------------------- + # retourne la linenumieme ligne + return self.getLines()[linenum-1] + + def getLines(self): + #---------------------------- + # retourne toutes les lignes + return self.lines + + def addLine(self,ligne,numero) : + #---------------------------- + # insere le texte contenu dans ligne + # dans la liste self.lines au rang numero + Ldebut=self.lines[0:numero] + Lmilieu=[ligne,] + Lfin=self.lines[numero:] + self.lines=Ldebut+Lmilieu+Lfin + + + def splitLine(self,numeroLigne,numeroColonne) : + #---------------------------------------------- + # coupe la ligne numeroLigne en 2 a numeroColonne + # ajoute des blancs en debut de 2nde Ligne pour + # aligner + numeroLigne = numeroLigne -1 + Ldebut=self.lines[0:numeroLigne] + if len(self.lines) > numeroLigne : + Lfin=self.lines[numeroLigne+1:] + else : + Lfin=[] + Lsplit=self.lines[numeroLigne] + LigneSplitDebut=Lsplit[0:numeroColonne]+"\n" + LigneSplitFin=" "*numeroColonne+Lsplit[numeroColonne:] + Lmilieu=[LigneSplitDebut,LigneSplitFin] + + self.lines=Ldebut+Lmilieu+Lfin + + def joinLineandNext(self,numeroLigne) : + #-------------------------------------- + # concatene les lignes numeroLigne et numeroLigne +1 + # enleve les blancs de debut de la ligne (numeroLigne +1) + Ldebut=self.lines[0:numeroLigne-1] + if len(self.lines) > numeroLigne : + Lfin=self.lines[numeroLigne+1:] + else : + Lfin=[] + + ligneMilieuDeb=self.lines[numeroLigne - 1 ] + ligneMilieuDeb=ligneMilieuDeb[0:-1] + ligneMilieuFin=self.lines[numeroLigne] + for i in range(len(ligneMilieuFin)): + if ligneMilieuFin[i] != " " : + ligneMilieuFin=ligneMilieuFin[i:] + break + Lmilieu=[ligneMilieuDeb+ligneMilieuFin,] + + self.lines=Ldebut+Lmilieu+Lfin + + def supLignes(self,debut,fin): + #------------------------ + Ldebut=self.lines[0:debut-1] + Lfin=self.lines[fin:] + self.lines=Ldebut+Lfin + + def remplaceLine(self,numeroLigne,nouveauTexte) : + #------------------------------------------------ + self.lines[numeroLigne]=nouveauTexte + +def getJDC(filename,atraiter): +#---------------------------- +# lit le JDC + f=open(filename) + src=f.read() + f.close() + jdc=JDCTrad(src,atraiter) + return jdc + +def getJDCFromTexte(texte,atraiter): +#----------------------------------- +# lit le JDC + jdc=JDCTrad(texte,atraiter) + return jdc diff --git a/Traducteur3/log.py b/Traducteur3/log.py new file mode 100644 index 00000000..21c4ab61 --- /dev/null +++ b/Traducteur3/log.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 os +logger=logging.getLogger() + +def initialise(flog=None): + if flog == None : + MonHome=os.environ['HOME'] + MaDir=MonHome+"/Eficas_install" + try : + os.mkdir(MaDir) + except : + pass + try : + os.listdir(MaDir) + flog=MaDir+"/convert.log" + except : + flog='/tmp/convert.log' + + hdlr=logging.FileHandler(flog,'w') + formatter = logging.Formatter('%(levelname)s: %(message)s') + hdlr.setFormatter(formatter) + logger.addHandler(hdlr) + logger.setLevel(logging.INFO) + return hdlr + + +def ferme (hdlr) : + logger.removeHandler(hdlr) diff --git a/Traducteur3/log.txt b/Traducteur3/log.txt new file mode 100644 index 00000000..85f57675 --- /dev/null +++ b/Traducteur3/log.txt @@ -0,0 +1 @@ +WARNING: ligne 159 : Message pour test de genereErreurpourCommande diff --git a/Traducteur3/mocles.py b/Traducteur3/mocles.py new file mode 100644 index 00000000..0c890f8b --- /dev/null +++ b/Traducteur3/mocles.py @@ -0,0 +1,168 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 compiler +import ast +import types +from Traducteur.parseur import Keyword, FactNode, lastParen, lastParen2,maskStringsAndComments +from Traducteur.visiteur import KeywordFinder, NodeVisitor +from Traducteur.utils import indexToCoordinates, lineToDict, dictToLine + +debug=0 + +#------------------------ +def parseFact(match,c,kw): +#------------------------ + submatch=match[2] + lastpar=match[0]+lastParen(c.src[match[0]:]) + #if type(submatch[0][0]) ==types.IntType: + if isinstance(submatch[0][0], int) : + #mot cle facteur isole + no=FactNode() + kw.addChild(no) + for ii in range(len(submatch)-1): + e=submatch[ii] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,submatch[ii+1][0]) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + #last one + e=submatch[-1] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,lastpar-1) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + else: + #mot cle facteur multiple + ii=0 + for l in submatch: + lastpar=l[0][0]+lastParen2(c.src[l[0][0]:]) + ii=ii+1 + no=FactNode() + kw.addChild(no) + for j in range(len(l)-1): + e=l[j] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,l[j+1][0]) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + #last one + e=l[-1] + x,y=indexToCoordinates(c.src,e[0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,lastpar-1) + endline=y+c.lineno + endcol=x + no.addChild(Keyword(e[1],lineno,colno,endline,endcol)) + + +#----------------------- +def parseKeywords(root): +#----------------------- + """A partir d'un arbre contenant des commandes, ajoute les noeuds + fils correspondant aux mocles de la commande + """ + debug=1 + #traceback.print_stack(limit=5) + + matchFinder=KeywordFinder() + + for c in root.childNodes: + if debug : print ('parse -------------- ', c.name) + maskedsrc=maskStringsAndComments(c.src) + #on supprime seulement les blancs du debut pour pouvoir compiler + #meme si la commande est sur plusieurs lignes seul le debut compte + #ast=compiler.parse(c.src.lstrip()) + #print ast + monAst=ast.parse(c.src.lstrip()) + if debug : print (ast.dump(monAst)) + #Ne pas supprimer les blancs du debut pour avoir les bons numeros de colonne + matchFinder.reset(maskedsrc) + matchFinder.visit(monAst) + if debug : print ("matchFinder.matches", matchFinder.matches) + if len(matchFinder.matches) > 1: + # plusieurs mocles trouves : + # un mocle commence au debut du keyword (matchFinder.matches[i][0]) + # et finit juste avant le keyword suivant + # (matchFinder.matches[i+1][0]]) + for i in range(len(matchFinder.matches)-1): + if debug:print ("texte:",c.src[matchFinder.matches[i][0]:matchFinder.matches[i+1][0]]) + x,y=indexToCoordinates(c.src,matchFinder.matches[i][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) + endline=y+c.lineno + endcol=x + if debug:print (matchFinder.matches[i][0],matchFinder.matches[i][1],lineno,colno,endline,endcol) + kw=Keyword(matchFinder.matches[i][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[i][2] + if submatch: + parseFact(matchFinder.matches[i],c,kw) + + # dernier mocle : + # il commence au debut du dernier keyword + # (matchFinder.matches[i+1][0]) et + # finit avant la parenthese fermante de la commande (c.lastParen) + + if debug:print ("texte:",c.src[matchFinder.matches[i+1][0]:c.lastParen]) + x,y=indexToCoordinates(c.src,matchFinder.matches[i+1][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,c.lastParen) + endline=y+c.lineno + endcol=x + if debug:print (matchFinder.matches[i+1][0],matchFinder.matches[i+1][1],lineno,colno,endline,endcol) + kw=Keyword(matchFinder.matches[i+1][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[i+1][2] + if submatch: + parseFact(matchFinder.matches[i+1],c,kw) + + elif len(matchFinder.matches) == 1: + #un seul mocle trouve : + # il commence au debut du keyword (matchFinder.matches[0][0]) et + # finit juste avant la parenthese fermante de la + # commande (c.lastParen) + if debug:print ("texte:",c.src[matchFinder.matches[0][0]:c.lastParen]) + x,y=indexToCoordinates(c.src,matchFinder.matches[0][0]) + lineno=y+c.lineno + colno=x + x,y=indexToCoordinates(c.src,c.lastParen) + endline=y+c.lineno + endcol=x + if debug:print ( matchFinder.matches[0][0],matchFinder.matches[0][1],lineno,colno,endline,endcol) + kw=Keyword(matchFinder.matches[0][1],lineno,colno,endline,endcol) + c.addChild(kw) + submatch= matchFinder.matches[0][2] + if submatch: + parseFact(matchFinder.matches[0],c,kw) + else: + pass diff --git a/Traducteur3/movemocle.py b/Traducteur3/movemocle.py new file mode 100644 index 00000000..4a43752f --- /dev/null +++ b/Traducteur3/movemocle.py @@ -0,0 +1,346 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur import removemocle +from Traducteur import inseremocle +from Traducteur.parseur import lastParen +from Traducteur.load import jdcSet +debug=0 + +#----------------------------------------------------- +def moveMotCleFromFactToFather(jdc,command,fact,mocle): +#----------------------------------------------------- +# exemple type : IMPR_GENE + + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + boolchange_c=0 + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + # test boolchange_c :il faut le faire une seule fois par commande sinon duplication du mot clé + if boolchange_c != 0 :continue + if debug : print ("Changement de place :", n.name, n.lineno, n.colno) + MonTexte=n.getText(jdc); + boolChange=1 + boolchange_c=1 + inseremocle.insereMotCle(jdc,c,MonTexte) + logging.info("Changement de place %s ligne %s ",n.name, n.lineno) + + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCleInFact(jdc,command,fact,mocle) + + +#---------------------------------------------------------------------------- +def moveMotCleFromFactToFactMulti(jdc,oper,factsource,mocle,liste_factcible): +#---------------------------------------------------------------------------- +# exemple type STAT_NON_LINE et RESI_INTER_RELA + for factcible in liste_factcible : + moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible) + removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) + + +#---------------------------------------------------------------------------- +def moveMotCleFromFactToFact(jdc,oper,factsource,mocle,factcible): +#---------------------------------------------------------------------------- + if oper not in jdcSet : return + if debug : print ("moveMotCleFromFactToFact pour " ,oper,factsource,mocle,factcible) + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print ("Pas de changement pour ", oper, " ", factsource, " ",mocle, "cible non trouvée") + continue + + for mc in c.childNodes: + source=None + if mc.name != factsource: + continue + else : + source=mc + break + if source==None : + if debug : print ("Pas de changement pour ", oper, " ", factsource, " ",mocle, "source non trouvée") + continue + + if debug : print ("Changement pour ", oper, " ", factsource, " ",mocle, "cible et source trouvées") + l=source.childNodes[:] + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + MonTexte=n.getText(jdc); + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) + boolChange=1 + logging.info("Changement de place %s ligne %s vers %s",n.name, n.lineno, cible.name) + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCleInFact(jdc,oper,factsource,mocle) + + + + +#----------------------------------------------------------------------- +def moveMotClefInOperToFact(jdc,oper,mocle,factcible,plusieursFois=True): +#----------------------------------------------------------------------- +# Attention le cas type est THETA_OLD dans calc_G + + if oper not in jdcSet : return + if debug : print ( "movemocleinoper pour " ,oper,mocle,factcible) + boolChange=9 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print ("Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée") + continue + + source=None + for mc in c.childNodes: + if mc.name != mocle: + continue + else : + source=mc + break + if source==None : + if debug : print ("Pas de changement pour ", oper, " ", mocle, " source non trouvée") + continue + MonTexte=source.getText(jdc); + boolChange=1 + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte,plusieursFois) + if boolChange : jdc.reset(jdc.getSource()) + removemocle.removeMotCle(jdc,oper,mocle) + +#------------------------------------------------------ +def copyMotClefInOperToFact(jdc,oper,mocle,factcible): +#------------------------------------------------------ + + if oper not in jdcSet : return + if debug : print ("movemocleinoper pour " ,oper,mocle,factcible) + boolChange=9 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != oper : continue + cible=None + for mc in c.childNodes: + if mc.name != factcible : + continue + else : + cible=mc + break + if cible==None : + if debug : print ("Pas de changement pour ", oper, " ", factcible, " ", "cible non trouvée") + continue + + source=None + for mc in c.childNodes: + if mc.name != mocle: + continue + else : + source=mc + break + if source==None : + if debug : print ("Pas de changement pour ", oper, " ", mocle, " source non trouvée") + continue + MonTexte=source.getText(jdc); + boolChange=1 + inseremocle.insereMotCleDansFacteur(jdc,cible,MonTexte) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------------------- +def moveMCFToCommand(jdc,command,factsource,commandcible,factcible): +#---------------------------------------------------------------------- +# exemple CONTACT en 10 +# CONTACT devient commande DEFI_CONTACT/ZONE +# + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + for mcF in c.childNodes: + if mcF.name != factsource : continue + l=mcF.getText(jdc) + texte=l.replace(factsource,factcible) + texte='xxxx='+commandcible+'('+texte+')\n' + jdc.splitLine(c.lineno,0) + jdc.addLine(texte,c.lineno) + logging.info("Deplacement de %s dans %s ligne %s",factsource,commandcible,c.lineno) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + jdcSet.add(commandcible) + +#----------------------------------------------------- +def fusionMotCleToFact(jdc,command,listeMc,factcible,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + for mc in c.childNodes: + if mc.name not in listeMc : continue + val=mc.getText(jdc).split("=")[1].split(",")[0] + list_val.append(val) + trouveUnMC=1 + if trouveUnMC : + TexteMC=factcible+"=(" + for val in list_val : TexteMC=TexteMC+val+"," + TexteMC=TexteMC[:-1]+")," + inseremocle.insereMotCle(jdc,c,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mc in listeMc : + removemocle.removeMotCle(jdc,command,mc) + jdc.reset(jdc.getSource()) + +#----------------------------------------------------- +def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + for mcF in c.childNodes: + if mcF.name != fact: continue + for ll in mcF.childNodes[:]: + for mc in ll.childNodes: + if mc.name not in listeMc : continue + val=mc.getText(jdc).split("=")[1].split(",")[0] + list_val.append(val) + trouveUnMC=1 + if trouveUnMC : + TexteMC=new_name+"=("+",".join(list_val)+")," + inseremocle.insereMotCleDansFacteur(jdc,mcF,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mc in listeMc : + removemocle.removeMotCleInFact(jdc,command,fact,mc) + jdc.reset(jdc.getSource()) + +#----------------------------------------------------- +def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0): +#----------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command : continue + list_val=[] + trouveUnMC=0 + TexteMC=factcible+'=(' + esp1=' '*len(TexteMC) + pp=0 + for mcF in c.childNodes: + if mcF.name not in listeMcF : continue + trouveUnMC=1 + val=mcF.getText(jdc) + # esp=esp1+(inseremocle.chercheDebutFacteur(jdc,mcF)-len(mcF.name))*' ' + esp=esp1+inseremocle.chercheAlignement(jdc,c) + # print len(esp) + for ll in mcF.childNodes[:]: + # if(pp>0): TexteMC+=esp + TexteMC+='_F(' + for mc in ll.childNodes: + val=mc.getText(jdc) + TexteMC+=val+'\n '+esp + # if('#' in val.split('\n')[-1]): TexteMC+='\n'+esp+' ' + lastkey = ''.join(val.split('=')[-1].split(' ')) + if((len(lastkey.split('(')) - len(lastkey.split(')'))) >= 0): + TexteMC += '),\n'+esp + # TexteMC+='),' + TexteMC+='),' + # print TexteMC + if(trouveUnMC): + inseremocle.insereMotCle(jdc,c,TexteMC) + jdc.reset(jdc.getSource()) + boolChange=1 + if boolChange : + jdc.reset(jdc.getSource()) + for mcF in listeMcF : + removemocle.removeMotCle(jdc,command,mcF) + jdc.reset(jdc.getSource()) + + + +#-------------------------------------------------------------------- +def eclaMotCleToFact(jdc,command,motcle,mot1,mot2,defaut=0): +#-------------------------------------------------------------------------- +# exemple STA10 pesanteur devient MCF avec eclatement des valeurs dans les MC +# On suppose que le MC est sur une seule ligne + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command : continue + trouveUnMC=0 + for mc in c.childNodes: + if mc.name != motcle : continue + trouveUnMC=1 + TexteMC=mc.getText(jdc) + indexLigneGlob=mc.lineno-1 + MaLigneGlob=jdc.getLines()[indexLigneGlob] + Ligne=TexteMC.split('(')[1].split(')')[0].split(',') + motcle1=mot1+"="+Ligne[0] + motcle2=mot2+"=("+Ligne[1]+','+Ligne[2]+','+Ligne[3]+')' + texte=motcle+'=_F('+motcle1+','+motcle2+')' + num=lastParen(TexteMC) + Nouveau=MaLigneGlob.replace(TexteMC[0:num],texte) + jdc.getLines()[indexLigneGlob]=Nouveau + logging.info("Transformation de %s dans %s ligne %s",motcle,command,c.lineno) + boolChange=1 + if boolChange : jdc.reset(jdc.getSource()) diff --git a/Traducteur3/parseur.py b/Traducteur3/parseur.py new file mode 100644 index 00000000..2635b9ab --- /dev/null +++ b/Traducteur3/parseur.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re,string + +debug=0 + +escapedQuotesRE = re.compile(r"(\\\\|\\\"|\\\')") +stringsAndCommentsRE = \ + re.compile("(\"\"\".*?\"\"\"|'''.*?'''|\"[^\"]*\"|\'[^\']*\'|#.*?\n)", re.DOTALL) + +import six +if six.PY2 : + allchars = string.maketrans(u"", "") + allcharsExceptNewline = allchars[: allchars.index('\n')]+allchars[allchars.index('\n')+1:] + allcharsExceptNewlineTranstable = string.maketrans(allcharsExceptNewline, '*'*len(allcharsExceptNewline)) +else : + allchars=bytes.maketrans(b"",b"") + allcharsExceptNewline = allchars[: allchars.index(b'\n')]+allchars[allchars.index(b'\n')+1:] + allcharsExceptNewlineTranstable = bytes.maketrans(allcharsExceptNewline, b'*'*len(allcharsExceptNewline)) + + +#------------------------------ +def maskStringsAndComments(src): +#------------------------------ + """Remplace tous les caracteres dans commentaires et strings par des * """ + + src = escapedQuotesRE.sub("**", src) + allstrings = stringsAndCommentsRE.split(src) + # every odd element is a string or comment + for i in range(1, len(allstrings), 2): + if allstrings[i].startswith("'''")or allstrings[i].startswith('"""'): + allstrings[i] = allstrings[i][:3]+ \ + allstrings[i][3:-3].translate(allcharsExceptNewlineTranstable)+ \ + allstrings[i][-3:] + else: + allstrings[i] = allstrings[i][0]+ \ + allstrings[i][1:-1].translate(allcharsExceptNewlineTranstable)+ \ + allstrings[i][-1] + + return "".join(allstrings) + +#un nombre queconque de blancs,un nom,des blancs +pattern_oper = re.compile(r"^\s*(.*?=\s*)?([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) +pattern_proc = re.compile(r"^\s*([a-zA-Z_]\w*)(\s*)(\()(.*)",re.DOTALL) + +implicitContinuationChars = (('(', ')'), ('[', ']'), ('{', '}')) +linecontinueRE = re.compile(r"\\\s*(#.*)?$") +emptyHangingBraces = [0,0,0,0,0] + +#-------------------------------------- +class UnbalancedBracesException: pass +#-------------------------------------- + +#----------- +class Node: +#----------- + def __init__(self): + self.childNodes=[] + + def addChild(self,node): + self.childNodes.append(node) + + +#------------------- +class FactNode(Node): +#------------------- + pass + + +#------------------- +class JDCNode(Node): +#------------------- + def __init__(self,src): + Node.__init__(self) + self.src=src + +#------------------- +class Command(Node): +#------------------- + def __init__(self,name,lineno,colno,firstparen): + Node.__init__(self) + self.name=name + self.lineno=lineno + self.colno=colno + self.firstparen=firstparen + +#------------------- +class Keyword(Node): +#------------------- + def __init__(self,name,lineno,colno,endline,endcol): + Node.__init__(self) + self.name=name + self.lineno=lineno + self.colno=colno + self.endline=endline + self.endcol=endcol + + def getText(self,jdc): + if self.endline > self.lineno: + debut=jdc.getLines()[self.lineno-1][self.colno:] + fin = jdc.getLines()[self.endline-1][:self.endcol] + texte=debut + lignecourante=self.lineno + while lignecourante < self.endline -1 : + texte = texte + jdc.getLines()[lignecourante] + lignecourante = lignecourante + 1 + if chaineBlanche(fin) == 0 : + texte=texte + fin + if texte[-1] == "\n" : + texte=texte[0:-1] + else: + texte = jdc.getLines()[self.lineno-1][self.colno:self.endcol] + return texte + +#------------------------- +def chaineBlanche(texte) : +#------------------------- +# retourne 1 si la chaine est composee de " " +# retourne 0 sinon + bool = 1 ; + for i in range(len(texte)) : + if texte[i] != " " : bool = 0 + return bool + +#------------------- +def printNode(node): +#------------------- + if hasattr(node,'name'): + print (node.name) + else: + print ("pas de nom pour:",node) + for c in node.childNodes: + printNode(c) + +#------------------------ +def parser(src,atraiter): +#------------------------ + """Parse le texte src et retourne un arbre syntaxique (root). + + Cet arbre syntaxique a comme noeuds (childNodes) les commandes a traiter (liste atraiter) + """ + lines=src.splitlines(1) + maskedSrc=maskStringsAndComments(src) + maskedLines=maskedSrc.splitlines(1) + + root=JDCNode(src) + + # (a) dans un premier temps on extrait les commandes et on les insere + # dans un arbre (root) les noeuds fils sont stockes dans + # root.childNodes (liste) + lineno=0 + for line in maskedLines: + lineno=lineno+1 + if debug:print ("line",lineno,":",line) + m=pattern_proc.match(line) + if m and (m.group(1) in atraiter): + if debug:print (m.start(3),m.end(3),m.start(4)) + root.addChild(Command(m.group(1),lineno,m.start(1),m.end(3))) + else: + m=pattern_oper.match(line) + if m and (m.group(2) in atraiter): + root.addChild(Command(m.group(2),lineno,m.start(2),m.end(4))) + + #(b) dans un deuxieme temps , on recupere le texte complet de la commande + # jusqu'a la derniere parenthese fermante + + # iterateur sur les lignes physiques masquees + iterlines=iter(maskedLines) + + linenum=0 + for c in root.childNodes: + lineno=c.lineno + colno=c.colno # debut de la commande + while linenum < lineno: + line=iterlines.__next__() + linenum=linenum+1 + if linenum != lineno: + if debug:print ("line %s:"%linenum, line) + tmp = [] + hangingBraces = list(emptyHangingBraces) + hangingComments = 0 + while 1: + # update hanging braces + for i in range(len(implicitContinuationChars)): + contchar = implicitContinuationChars[i] + numHanging = hangingBraces[i] + + hangingBraces[i] = numHanging+line.count(contchar[0]) - \ + line.count(contchar[1]) + + hangingComments ^= line.count('"""') % 2 + hangingComments ^= line.count("'''") % 2 + + if hangingBraces[0] < 0 or hangingBraces[1] < 0 or hangingBraces[2] < 0: + raise UnbalancedBracesException() + + if linecontinueRE.search(line): + tmp.append(lines[linenum-1]) + elif hangingBraces != emptyHangingBraces: + tmp.append(lines[linenum-1]) + elif hangingComments: + tmp.append(lines[linenum-1]) + else: + tmp.append(lines[linenum-1]) + src="".join(tmp) + c.src=src + c.endline=linenum + decal=len(line)-line.rindex(')') + c.lastParen=len(src)-decal + if debug:print ("logical line %s %s:" % (c.lineno,c.endline),src) + break + line=iterlines.__next__() + linenum=linenum+1 + + return root + + +#----------------- +def lastParen(src): +#----------------- + """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string + + La string doit contenir la premiere parenthese ouvrante + """ + + src=maskStringsAndComments(src) + level=0 + i,n=0,len(src) + while i < n: + ch=src[i] + i=i+1 + if ch in ('(','['): + level=level+1 + if ch in (')',']'): + if level == 0: + raise UnbalancedBracesException() + level=level-1 + if level == 0: + #derniere parenthese fermante + return i + +#------------------- +def lastParen2(src): +#------------------- + """Retourne la position de la derniere parenthese fermante dans src a partir du debut de la string + + La string ne contient pas la premiere parenthese ouvrante + """ + src=maskStringsAndComments(src) + level=1 + i,n=0,len(src) + while i < n: + ch=src[i] + i=i+1 + if ch in ('(','['): + level=level+1 + if ch in (')',']'): + if level == 0: + raise UnbalancedBracesException() + level=level-1 + if level == 0: + #derniere parenthese fermante + return i diff --git a/Traducteur3/regles.py b/Traducteur3/regles.py new file mode 100644 index 00000000..a8f78215 --- /dev/null +++ b/Traducteur3/regles.py @@ -0,0 +1,524 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +# +""" +Définition des règles +""" + +debug = 0 + +#-------------------- +class ensembleRegles : +#-------------------- + """ + Ensemble des règles + """ + def __init__(self, liste_regles): + self.liste = [] + for item in liste_regles : + args, clefRegle = item + r = regle(clefRegle, args) + self.liste.append(r) + + def verif(self, commande) : + """ + Vérification + """ + bool = 1 + for regle in self.liste : + result = regle.verif(commande) + bool = bool*result + return bool + +#-------------------------------- +class pasDeRegle(ensembleRegles): +#-------------------------------- + """ + Pas de règle + """ + def __init__(self) : + pass + + def verif (self, commande) : + """ + Vérification + """ + return 1 + + +#------------ +class regle : +#------------ + """ + Règle + """ + def __init__(self, clef_regle, args): + self.fonction = dictionnaire_regle[clef_regle] + self.list_args = args + self.bool = 0 + + def verif(self, commande): + """ + Vérification + """ + f = self.fonction(self.list_args) + return f.verif(commande) + +#--------------------- +class existeMCFParmi : +#--------------------- + """ + Existence du mot-clé facteur parmi la liste + """ + def __init__(self, list_arg): + self.listeMCF = list_arg + + def verif(self, commande) : + """ + Vérification + """ + bool = 0 + for c in commande.childNodes : + if c.name in self.listeMCF : + bool = 1 + break + return bool + +#--------------------- +class nexistepasMCFParmi(existeMCFParmi) : +#--------------------- + """ + Existence du mot-clé facteur parmi la liste + """ + def __init__(self, list_arg): + self.listeMCF = list_arg + + def verif(self, commande) : + """ + Vérification + """ + bool = existeMCFParmi.verif(self, commande) + if bool : return 0 + return 1 + +#---------------------- +class existeMCsousMCF : +#---------------------- + """ + Existence du mot-clé simple sous le mot-clé facteur + """ + def __init__(self, list_arg): + self.liste = list_arg + self.MCF = self.liste[0] + self.MC = self.liste[1] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + bool = 1 + return bool + +#---------------------- +class existeMCsousMCFcourant : +#---------------------- + """ + Existence du mot-clé simple sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + self.liste = list_arg + self.MC = self.liste[0] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + bool = 1 + return bool + +#----------------------------------------- +class nexistepasMCsousMCF(existeMCsousMCF): +#----------------------------------------- + """ + Absence du mot-clé simple sous le mot-clé facteur + """ + def __init__(self, list_arg): + existeMCsousMCF.__init__(self, list_arg) + + + def verif(self, commande): + """ + Vérification + """ + bool = existeMCsousMCF.verif(self, commande) + if bool : return 0 + return 1 + +#----------------------------------------- +class nexistepasMCsousMCFcourant(existeMCsousMCFcourant): +#----------------------------------------- + """ + Absence du mot-clé simple sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + existeMCsousMCFcourant.__init__(self, list_arg) + + + def verif(self, commande): + """ + Vérification + """ + bool = existeMCsousMCFcourant.verif(self, commande) + if bool : return 0 + return 1 + +#------------- +class existe : +#-------------- + """ + Existence du mot-clé simple + """ + def __init__(self, list_arg): + self.genea = list_arg + + def chercheMot(self, niveau, commande): + """ + Recherche du mot + """ + if commande == None : return 0 + if niveau == len(self.genea) : return 1 + texte = self.genea[niveau] + for c in commande.childNodes : + if c.name == texte : + niveau = niveau+1 + return self.chercheMot(niveau, c) + return None + + def verif(self, commande): + """ + Vérification + """ + bool = self.chercheMot(0, commande) + if bool == None : bool = 0 + return bool + +#------------- +class nexistepas : +#-------------- + """ + Absence du mot-clé simple + """ + def __init__(self, list_arg): + self.genea = list_arg + + def chercheMot(self, niveau, commande): + """ + Recherche du mot + """ + if commande == None : return 0 + if niveau == len(self.genea) : return 1 + texte = self.genea[niveau] + for c in commande.childNodes : + if c.name == texte : + niveau = niveau+1 + return self.chercheMot(niveau, c) + return None + + def verif(self, commande): + """ + Vérification + """ + bool = self.chercheMot(0, commande) + if bool : return 0 + return 1 + +#------------------------------- +class MCsousMCFaPourValeur : +#------------------------------ + """ + Égalité du mot-clé simple à une valeur sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==4) + self.genea = list_arg[0:-2] + self.MCF = list_arg[0] + self.MC = list_arg[1] + self.Val = list_arg[2] + self.Jdc = list_arg[3] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + +#------------------------------- +class MCsousMCFcourantaPourValeur : +#------------------------------ + """ + Égalité du mot-clé simple à une valeur sous le mot-clé facteur courant + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.genea = list_arg[0:-1] + self.MC = list_arg[0] + self.Val = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + + +#----------------------------- +class MCsousMCFaPourValeurDansListe : +#---------------------------- + """ + Égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==4) + self.genea = list_arg[0:-2] + self.MCF = list_arg[0] + self.MC = list_arg[1] + self.LVal = list_arg[2] + self.Jdc = list_arg[3] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mcf in commande.childNodes : + if mcf.name != self.MCF : continue + l = mcf.childNodes[:] + l.reverse() + for ll in l: + for mc in ll.childNodes: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + for Val in self.LVal: + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------- +class MCsousMCFcourantaPourValeurDansListe : +#---------------------------- + """ + Égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.genea = list_arg[0:-1] + self.MC = list_arg[0] + self.LVal = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, mcf): + """ + Vérification + """ + bool = 0 + l = mcf.childNodes[:] + l.reverse() + for mc in l: + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + for Val in self.LVal: + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCsousMCFcourantnaPasPourValeurDansListe(MCsousMCFcourantaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + MCsousMCFcourantaPourValeurDansListe.__init__(self, list_arg) + + + def verif(self, commande): + bool = MCsousMCFcourantaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +#----------------------------------------- +class MCsousMCFnaPasPourValeurDansListe(MCsousMCFaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé simple à une valeur dans une liste + sous le mot-clé facteur + """ + def __init__(self, list_arg): + MCsousMCFaPourValeurDansListe.__init__(self, list_arg) + + + def verif(self, commande): + bool = MCsousMCFaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +#------------------------------ +class MCaPourValeur : +#------------------------------ + """ + Égalité du mot-clé à une valeur + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.MC = list_arg[0] + self.Val = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mc in commande.childNodes : + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + if (TexteMC.find(self.Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCnaPasPourValeur(MCaPourValeur) : +#----------------------------------------- + """ + Non égalité du mot-clé à une valeur + """ + def __init__(self, list_arg): + MCaPourValeur.__init__(self, list_arg) + + def verif(self, commande): + """ + Vérification + """ + bool = MCaPourValeur.verif(self, commande) + if bool : return 0 + return 1 + +#------------------------------ +class MCaPourValeurDansListe : +#------------------------------ + """ + Égalité du mot-clé à une valeur dans une liste + """ + def __init__(self, list_arg): + assert (len(list_arg)==3) + self.MC = list_arg[0] + self.LVal = list_arg[1] + self.Jdc = list_arg[2] + + def verif(self, commande): + """ + Vérification + """ + bool = 0 + for mc in commande.childNodes : + if mc.name != self.MC : continue + TexteMC = mc.getText(self.Jdc) + #print "TexteMC=",type(TexteMC),TexteMC + #print "LVal=",type(self.LVal),self.LVal + for Val in self.LVal: + #print "Val=",type(Val),Val + #print "Find",TexteMC.find(Val) + if (TexteMC.find(Val) < 0 ): continue + bool = 1 + return bool + +#----------------------------------------- +class MCnaPasPourValeurDansListe(MCaPourValeurDansListe) : +#----------------------------------------- + """ + Non égalité du mot-clé à une valeur dans une liste + """ + def __init__(self, list_arg): + MCaPourValeurDansListe.__init__(self, list_arg) + + def verif(self, commande): + """ + Vérification + """ + bool = MCaPourValeurDansListe.verif(self, commande) + if bool : return 0 + return 1 + +dictionnaire_regle = {"existe":existe, + "nexistepas":nexistepas, + "existeMCFParmi":existeMCFParmi, + "nexistepasMCFParmi":nexistepasMCFParmi, + "existeMCsousMCF":existeMCsousMCF, + "nexistepasMCsousMCF":nexistepasMCsousMCF, + "MCsousMCFaPourValeur":MCsousMCFaPourValeur, + "MCsousMCFaPourValeurDansListe":MCsousMCFaPourValeurDansListe, + "MCaPourValeur":MCaPourValeur, + "MCnaPasPourValeur":MCnaPasPourValeur, + "existeMCsousMCFcourant":existeMCsousMCFcourant, + "nexistepasMCsousMCFcourant":nexistepasMCsousMCFcourant, + "MCsousMCFcourantaPourValeur":MCsousMCFcourantaPourValeur, + "MCsousMCFcourantaPourValeurDansListe":MCsousMCFcourantaPourValeurDansListe, + "MCsousMCFcourantnaPasPourValeurDansListe":MCsousMCFcourantnaPasPourValeurDansListe, + "MCsousMCFnaPasPourValeurDansListe":MCsousMCFnaPasPourValeurDansListe, + "MCaPourValeurDansListe":MCaPourValeurDansListe, + "MCnaPasPourValeurDansListe":MCnaPasPourValeurDansListe} + + +SansRegle = pasDeRegle() diff --git a/Traducteur3/removemocle.py b/Traducteur3/removemocle.py new file mode 100644 index 00000000..ee1eab7a --- /dev/null +++ b/Traducteur3/removemocle.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 Traducteur import regles +from Traducteur.parseur import FactNode +from Traducteur.dictErreurs import ecritErreur +from Traducteur.load import jdcSet + +debug=0 +#debug=1 +#on n'a qu'un mocle par commande. On peut donc supprimer le mocle sans trop de precautions (a part iterer a l'envers sur les commandes) +#avant de supprimer un autre mocle, on remet a jour l'arbre syntaxique (lineno,colno,etc.) + + +#----------------------------------------------------------------------- +def removeMotCle(jdc,command,mocle,ensemble=regles.SansRegle,erreur = 0): +#----------------------------------------------------------------------- + #on itere sur les commandes a l'envers pour ne pas polluer les numeros de ligne avec les modifications + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != mocle:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((command,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,mc) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------- +def removeMotCleSiRegle(jdc,command,mocle,liste_regles) : +#------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCle(jdc,command,mocle,mesRegles,erreur=0) + +#---------------------------------------------------------------- +def removeMotCleSiRegleAvecErreur(jdc,command,mocle,liste_regles) : +#-------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCle(jdc,command,mocle,mesRegles,erreur=1) + +#---------------------------------------------------------------- +def removeMotCleAvecErreur(jdc,command,mocle) : +#-------------------------------------------------------------- + if command not in jdcSet : return + removeMotCle(jdc,command,mocle,erreur=1) + + +#-------------------------------------------------------------------- +def removeCommande(jdc,command,ensemble=regles.SansRegle,erreur=0): +#-------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + commands= jdc.root.childNodes[:] + commands.reverse() + for c in commands: + if c.name != command:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if erreur : ecritErreur((command,),c.lineno) + jdc.supLignes(c.lineno,c.endline) + logging.warning("Suppression de %s ligne %s",c.name,c.lineno) + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------- +def removeCommandeSiRegle(jdc,command,liste_regles): +#------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeCommande(jdc,command,mesRegles,0) + +#------------------------------------------------------------- +def removeCommandeSiRegleAvecErreur(jdc,command,liste_regles): +#------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + removeCommande(jdc,command,mesRegles,1) + +#--------------------------------- +def removeMC(jdc,c,mc): +#--------------------------------- + if debug : print ("Suppression de:",c.name,mc.name,mc.lineno,mc.colno,mc.endline,mc.endcol) + logging.info("Suppression de %s dans %s ligne %d",mc.name,c.name,mc.lineno) + + if mc.endline > mc.lineno: + if debug: print ("mocle sur plusieurs lignes--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:]) + jdc.getLines()[mc.lineno-1]=jdc.getLines()[mc.lineno-1][:mc.colno] + jdc.getLines()[mc.endline-1]=jdc.getLines()[mc.endline-1][mc.endcol:] + + #attention : supprimer les lignes a la fin + jdc.getLines()[mc.lineno:mc.endline-1]=[] + else: + if debug: print( "mocle sur une ligne--%s--" % jdc.getLines()[mc.lineno-1][mc.colno:mc.endcol]) + s=jdc.getLines()[mc.lineno-1] + jdc.getLines()[mc.lineno-1]=s[:mc.colno]+s[mc.endcol:] + fusionne(jdc,mc.lineno-1) + +#--------------------------------------------------------------------------------- +def removeMotCleInFact(jdc,command,fact,mocle,ensemble=regles.SansRegle,erreur=0): +#---------------------------------------------------------------------------------- + # on itere sur les commandes a l'envers pour ne pas polluer + # les numeros de ligne avec les modifications + if command not in jdcSet : return + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + l.reverse() + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + if ensemble.verif(c) == 0 : continue + if erreur : ecritErreur((command,fact,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,n) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------------------ +def removeMotCleInFactSiRegle(jdc,command,fact,mocle,liste_regles): +#------------------------------------------------------------------ + if command not in jdcSet : return + erreur=0 + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) + +#---------------------------------------------------------------------- +def removeMotCleInFactSiRegleAvecErreur(jdc,command,fact,mocle,liste_regles): +#---------------------------------------------------------------------- + if command not in jdcSet : return + erreur=1 + mesRegles=regles.ensembleRegles(liste_regles) + removeMotCleInFact(jdc,command,fact,mocle,mesRegles,erreur) + + +#---------------------------------------------------------------------- +def removeMotCleInFactCourantSiRegle(jdc,command,fact,mocle,liste_regles,erreur=0): +#---------------------------------------------------------------------- + if command not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + commands= jdc.root.childNodes[:] + commands.reverse() + boolChange=0 + for c in commands: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + for n in ll.childNodes: + if n.name != mocle:continue + if erreur : ecritErreur((command,fact,mocle),c.lineno) + boolChange=1 + removeMC(jdc,c,n) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------ +def fusionne(jdc,numLigne): +#------------------------------------------ +# fusionne la ligne numLigne et numLigne+1 +# si la ligne numLigne+1 ne contient que des parentheses +# fermantes +# et si la ligne numLigne ne contient pas par un "#" +# Attention a la difference de numerotation +# jdc.getLines()[numLigne] donne la ligne numLigne + 1 +# alors que joinLineandNext(numLigne) travaille sur le tableau + index=0 + texte=jdc.getLines()[numLigne] + fusion=1 + while (index < len(texte)) : + if texte[index] not in (" ",",",")",";","\n") : + fusion=0 + break + index=index+1 + + if fusion == 0 : return; + + texte=jdc.getLines()[numLigne -1] + if texte.find("#") < 0 : + fusion=1 + else : + fusion=0 + + if fusion : + jdc.joinLineandNext(numLigne) diff --git a/Traducteur3/renamemocle.py b/Traducteur3/renamemocle.py new file mode 100644 index 00000000..e246abf2 --- /dev/null +++ b/Traducteur3/renamemocle.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 +from Traducteur.parseur import FactNode +from Traducteur.load import jdcSet +from Traducteur import regles +from Traducteur.dictErreurs import ecritErreur +#debug=1 +debug=0 + +#on n'a qu'un mocle par commande. +#en fin de traitement, on remet a jour l'arbre syntaxique (lineno,colno,etc.) + +#-------------------------------------------------------------------------------- +def renameMotCle(jdc,command,mocle,new_name, erreur=0,ensemble=regles.SansRegle): +#-------------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != mocle:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if debug: print ("Renommage de:",c.name,mc.name,mc.lineno,mc.colno) + if erreur : + ecritErreur((command,mocle),c.lineno) + else : + logging.info("Renommage de: %s %s ligne %d en %s",c.name,mc.name,mc.lineno,new_name) + s=jdc.getLines()[mc.lineno-1] + jdc.getLines()[mc.lineno-1]=s[:mc.colno]+new_name+s[mc.colno+len(mocle):] + diff=len(new_name) - len(mocle) + decaleLignesdeNBlancs(jdc,mc.lineno,mc.endline-1,diff) + + if boolChange : jdc.reset(jdc.getSource()) + +#------------------------------------------------------ +def renameMotCleAvecErreur(jdc,command,mocle,new_name): +#------------------------------------------------------ + if command not in jdcSet : return + renameMotCle(jdc,command,mocle,new_name,1,regles.SansRegle) + +#-------------------------------------------------------------------------- +def renameMotCleSiRegle(jdc,command,mocle,new_name,liste_regles, erreur=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameMotCle(jdc,command,mocle,new_name, erreur,mesRegles) + +#------------------------------------------- +def renameOper(jdc,command,new_name): +#------------------------------------------- + if command not in jdcSet : return + jdcSet.add(new_name) + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + if debug: print ("Renommage de:",c.name,c.lineno,c.colno) + logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) + boolChange=1 + s=jdc.getLines()[c.lineno-1] + jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] + diff=len(new_name) - len(command) + decaleLignesdeNBlancs(jdc,c.lineno,c.endline,diff) + if boolChange : jdc.reset(jdc.getSource()) + +#---------------------------------------------------------- +def decaleLignesdeNBlancs(jdc,premiere,derniere,nbBlanc): +#---------------------------------------------------------- + ligne = premiere + 1 + while ligne < derniere : + s=jdc.getLines()[ligne] + if nbBlanc > 0 : + jdc.getLines()[ligne] = nbBlanc*" " + s + else : + toutblancs=-1*nbBlanc*" " + if jdc.getLines()[ligne][0:-1*nbBlanc] == toutblancs: + jdc.getLines()[ligne] = s[-1*nbBlanc:] + ligne=ligne+1 + +#--------------------------------------------------------------------------------------------- +def renameMotCleInFact(jdc,command,fact,mocle,new_name, ensemble=regles.SansRegle, erreur=0): +#--------------------------------------------------------------------------------------------- + if command not in jdcSet : return + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + #on itere a l'envers + l.reverse() + for ll in l: + for n in ll.childNodes: + if n.name != mocle:continue + if ensemble.verif(c) == 0 : continue + s=jdc.getLines()[n.lineno-1] + jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] + boolChange=1 + if erreur : + ecritErreur((command,fact,mocle),c.lineno) + else : + logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) + + if boolChange : jdc.reset(jdc.getSource()) + +#-------------------------------------------------------------------------- +def renameMotCleInFactSiRegle(jdc,command,fact,mocle,new_name,liste_regles): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameMotCleInFact(jdc,command,fact,mocle,new_name,mesRegles) + +def renameMotCleInFactCourantSiRegle(jdc,command,fact,mocle,new_name,liste_regles,erreur=0): +#-------------------------------------------------------------------------- + if command not in jdcSet : return + ensemble=regles.ensembleRegles(liste_regles) + boolChange=0 + for c in jdc.root.childNodes: + if c.name != command:continue + for mc in c.childNodes: + if mc.name != fact:continue + l=mc.childNodes[:] + #on itere a l'envers + l.reverse() + for ll in l: + if ensemble.verif(ll) == 0 : continue + for n in ll.childNodes: + if n.name != mocle:continue + s=jdc.getLines()[n.lineno-1] + jdc.getLines()[n.lineno-1]=s[:n.colno]+new_name+s[n.colno+len(mocle):] + boolChange=1 + if erreur : + ecritErreur((command,fact,mocle),c.lineno) + else : + logging.info("Renommage de: %s, ligne %s, en %s",n.name,n.lineno,new_name) + + if boolChange : jdc.reset(jdc.getSource()) + + +#----------------------------------------------------------------- +def renameCommande(jdc,command,new_name,ensemble=regles.SansRegle): +#----------------------------------------------------------------- +# nom de la commande "ancien format" , nom de la commande " nouveau format " + if command not in jdcSet : return + jdcSet.add(new_name) + boolChange=0 + if debug : + if ensemble != regles.SansRegle : + logging.info("traitement de %s renomme en %s sous conditions", command, new_name) + else : + logging.info("traitement de %s renomme en %s ", command, new_name) + for c in jdc.root.childNodes: + if c.name != command:continue + if ensemble.verif(c) == 0 : continue + boolChange=1 + if debug: print ("Renommage de:",c.name,new_name ,c.lineno,c.colno) + logging.info("Renommage de: %s ligne %d en %s",c.name,c.lineno,new_name) + s=jdc.getLines()[c.lineno-1] + jdc.getLines()[c.lineno-1]=s[:c.colno]+new_name+s[c.colno+len(command):] + + if boolChange : jdc.reset(jdc.getSource()) + +#----------------------------------------------------------- +def renameCommandeSiRegle(jdc,command,new_name,liste_regles): +#----------------------------------------------------------- + + if command not in jdcSet : return + mesRegles=regles.ensembleRegles(liste_regles) + renameCommande(jdc,command,new_name,mesRegles) diff --git a/Traducteur3/toto.comm b/Traducteur3/toto.comm new file mode 100755 index 00000000..0701e84e --- /dev/null +++ b/Traducteur3/toto.comm @@ -0,0 +1,161 @@ +# + +REF=Assembly(assembly_type='REF',); + + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map=((REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,U1,U1,U1,U1,U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); + +Genere_Une_Erreur_Traduction(essai='3',); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:f62a6f71fcde9f983479fc749f7e334c -:FIN CHECKSUM diff --git a/Traducteur3/tutu.comm b/Traducteur3/tutu.comm new file mode 100644 index 00000000..0701e84e --- /dev/null +++ b/Traducteur3/tutu.comm @@ -0,0 +1,161 @@ +# + +REF=Assembly(assembly_type='REF',); + + +U1=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,4.2412,), + size=0.033,),),); + +UGD=Assembly(assembly_type='UOX', + assembly_width=0.21504, + fuel_density=0.95, + radial_description=_F(clad_outer_radius=0.00475, + guide_tube_outer_radius=0.006025, + fuel_rod_pitch=0.0126, + nfuel_rods=264,), + axial_description=_F(active_length_start=0.21, + active_length_end=4.4772,), + grids=_F(mixing=_F(positions=(0.69216,1.19766,1.70316,2.20866,2.71416,3.20416,3.69416,4.18416,), + size=0.033,), + non_mixing=_F(positions=(0.026,), + size=0.033,),),); + +RB=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N1=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4224, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +N2=RodBank(rod_type='heterogeneous', + bottom_composition='AIC', + splitting_heigh=1.4226, + upper_composition='B4C', + step_height=0.016, + nsteps=260,); + +G1=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +G2=RodBank(rod_type='homogeneous', + rod_composition='Grey', + step_height=0.016, + nsteps=260,); + +techno_data=Techno_data(assembly_list=(REF,U1,UGD,), + rodbank_list=(RB,G1,G2,N1,N2,), + radial_description=_F(nb_assembly=15, + xaxis=('RW','S','R','P','N','L','K','J','H','G','F','E','D','C','B','A','RE',), + yaxis= + ('RS','15','14','13','12','11', + '10','09','08','07','06','05','04','03','02','01','RN',), + assembly_map=((REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,U1,U1,U1,U1,U1,UGD,UGD,UGD,U1,U1,U1,U1,U1,U1,REF,),(REF,U1,U1,UGD,UGD,UGD,UGD,U1,UGD,U1,UGD,UGD,UGD,UGD,U1,U1,REF,),(REF,U1,UGD,U1,U1,U1,UGD,UGD,U1,UGD,UGD,U1,U1,U1,UGD,U1,REF,),(REF,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,U1,UGD,U1,UGD,U1,REF,),(REF,REF,U1,U1,U1,UGD,U1,UGD,U1,UGD,U1,UGD,U1,U1,U1,REF,REF,),(REF,REF,UGD,U1,U1,U1,U1,UGD,U1,UGD,U1,U1,U1,U1,UGD,REF,REF,),(REF,REF,REF,UGD,U1,UGD,UGD,U1,U1,U1,UGD,UGD,U1,UGD,REF,REF,REF,),(REF,REF,REF,REF,REF,U1,U1,U1,U1,U1,U1,U1,REF,REF,REF,REF,REF,),(REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,REF,),), + rod_map= + (['#','#','#','#','#','#','#', + '#','#','#','#','#','#','#','#','#','#'],['#','#','#','#','#','.', + '.','.','.','.','.','.','#','#','#','#','#'],['#','#','#','.','.', + '.','.','.','RB','.','.','.','.','.','#','#','#'],['#','#','.','.', + '.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'],['#','#', + '.','.','N1','.','.','.','G1','.','.','.','N1','.','.','#','#'], + ['#','.','.','G2','.','RB','.','.','.','.','.','RB','.','G2','.', + '.','#'],['#','.','.','.','.','.','.','.','N1','.','.','.','.','.', + '.','.','#'],['#','.','.','N2','.','.','.','.','.','.','.','.','.', + 'N2','.','.','#'],['#','.','RB','.','G1','.','N1','.','RB','.','N1', + '.','G1','.','RB','.','#'],['#','.','.','N2','.','.','.','.','.', + '.','.','.','.','N2','.','.','#'],['#','.','.','.','.','.','.','.', + 'N1','.','.','.','.','.','.','.','#'],['#','.','.','G2','.','RB', + '.','.','.','.','.','RB','.','G2','.','.','#'],['#','#','.','.', + 'N1','.','.','.','G1','.','.','.','N1','.','.','#','#'],['#','#', + '.','.','.','G2','.','N2','.','N2','.','G2','.','.','.','#','#'], + ['#','#','#','.','.','.','.','.','RB','.','.','.','.','.','#','#', + '#'],['#','#','#','#','#','.','.','.','.','.','.','.','#','#','#', + '#','#'],['#','#','#','#','#','#','#','#','#','#','#','#','#','#', + '#','#','#'],), + BU_map= + ([0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,0.0,0.0, + 40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0, + 40.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0, + 0.0,40.0,20.0,20.0,20.0,40.0,20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0, + 0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0, + 20.0,0.0,0.0,0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0, + 20.0,40.0,20.0,40.0,40.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,20.0,40.0, + 20.0,40.0,20.0,20.0,60.0,20.0,20.0,40.0,20.0,40.0,20.0,0.0,0.0],[0.0, + 0.0,40.0,0.0,40.0,0.0,40.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0,0.0, + 0.0],[0.0,0.0,40.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0,40.0,20.0, + 40.0,40.0,0.0,0.0],[0.0,0.0,0.0,20.0,20.0,20.0,40.0,0.0,40.0,0.0,40.0, + 20.0,20.0,20.0,0.0,0.0,0.0],[0.0,0.0,0.0,40.0,20.0,20.0,20.0,40.0, + 20.0,40.0,20.0,20.0,20.0,40.0,0.0,0.0,0.0],[0.0,0.0,40.0,0.0,40.0, + 20.0,40.0,0.0,40.0,0.0,40.0,20.0,40.0,0.0,40.0,0.0,0.0],[0.0,0.0,0.0, + 40.0,0.0,0.0,40.0,40.0,20.0,40.0,40.0,0.0,0.0,40.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],[0.0, + 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],),), + axial_description=_F(lower_refl_size=0.21, + upper_refl_size=0.21,), + nominal_power=4000000000.0, + Fuel_power_fraction=0.974, + by_pass=0.07, + core_volumic_flowrate=90940.0,); + +neutro_model=Model_data(physics='Neutronics', + scale='component', + code='APOLLO3', + radial_meshing=_F(flux_solver='subdivision', + flux_subdivision=2, + feedback_solver='subdivision', + feedback_subdivision=1,), + axial_meshing=_F(lower_refl=2, + fuel=42, + upper_refl=2,),); + +thermo_model=Model_data(physics='Thermalhydraulics', + scale='component', + code='FLICA4', + radial_meshing=_F(fluid='subdivision', + fluid_subdivision=1, + pellet=8, + clad=2,), + axial_meshing=_F(lower_refl=1, + fuel=40, + upper_refl=1,),); + +scenario_data=Scenario_data(initial_power=0.1, + initial_power_unit='% Nominal power', + initial_core_inlet_temperature=290.0, + initial_boron_concentration=1300.0, + initial_inlet_pressure=160.2, + initial_outlet_pressure=157.2, + initial_rod_positions=(('Rodbank@RB',201),('Rodbank@N1',96),('Rodbank@N2',260),('Rodbank@G1',260),('Rodbank@G2',260),('Rodcluster@H08',260)), + scenario_type='RIA', + ejected_rod='H02', + rod_position_program=((0.0,0),(0.1,260)), + SCRAM='YES', + SCRAM_power=1130.0, + complete_SCRAM_time=1.0, + post_processing=(('Fuel temperature@Thermalhydraulics','MAX'),('Neutronic power@Neutronics','SUM'),('Fuel temperature@Thermalhydraulics','MED'),('Neutronic power@Neutronics','MED')),); + +Genere_Une_Erreur_Traduction(essai='3',); +#VERSION_CATALOGUE:V_0:FIN VERSION_CATALOGUE +#CHECKSUM:f62a6f71fcde9f983479fc749f7e334c -:FIN CHECKSUM diff --git a/Traducteur3/utils.py b/Traducteur3/utils.py new file mode 100644 index 00000000..31ab5e87 --- /dev/null +++ b/Traducteur3/utils.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re + +def indexToCoordinates(src, index): + """return le numero de la colonne (x) et le numero de la ligne (y) dans src""" + y = src[: index].count("\n") + startOfLineIdx = src.rfind("\n", 0, index)+1 + x = index-startOfLineIdx + return x, y + +def lineToDict(line): + """Transforme une ligne (string) en un dictionnaire de mots + reperes par le numero de la colonne""" + + words = re.split("(\w+)", line) + h = {};i = 0 + for word in words: + h[i] = word + i+=len(word) + return h + +def dictToLine(d): + """Transformation inverse: a partir d'un dictionnaire retourne une ligne""" + cols = d + cols.sort() + return "".join([d[colno]for colno in cols]) diff --git a/Traducteur3/visiteur.py b/Traducteur3/visiteur.py new file mode 100644 index 00000000..d3584b16 --- /dev/null +++ b/Traducteur3/visiteur.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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. +# +# 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 re +from ast import NodeVisitor +debug=1 + +class MatchFinder (NodeVisitor): + """Visiteur de base : gestion des matches """ + def reset(self,line): + self.matches=[] + self._matches = [] + self.words = re.split("(\w+)", line) # every other one is a non word + self.positions = [] + i = 0 + for word in self.words: + self.positions.append(i) + i+=len(word) + self.index = 0 + if debug : print ('fin reset', self.words) + + def popWordsUpTo(self, word): + if word == "*": + return # won't be able to find this + posInWords = self.words.index(word) + idx = self.positions[posInWords] + self.words = self.words[posInWords+1:] + self.positions = self.positions[posInWords+1:] + + def appendMatch(self,name): + idx = self.getNextIndexOfWord(name) + self._matches.append((idx, name)) + + def getNextIndexOfWord(self,name): + return self.positions[self.words.index(name)] + + +class KeywordFinder(MatchFinder): + """Visiteur pour les keywords d'une commande """ + + def visit_keyword(self,node): + if debug : print (' visit_keyword', node.arg) + idx = self.getNextIndexOfWord(node.arg) + self.popWordsUpTo(node.arg) + prevmatches=self._matches + self._matches = [] + #for child in node.getChildNodes(): + # self.visit(child) + self.generic_visit(node) + prevmatches.append((idx, node.arg,self._matches)) + self._matches=prevmatches + #on ne garde que les matches du niveau Keyword le plus haut + self.matches=self._matches + + def visit_Tuple(self,node): + matchlist=[] + # Pour eviter les tuples et listes ordinaires, + if not hasattr(node,'getChildNodes') : return + print ('*********************************************************************') + print ("_____________ visit_Tuple", node) + for child in node.getChildNodes(): + self._matches = [] + self.visit(child) + if self._matches: + # Pour eviter les tuples et listes ordinaires, + # on ne garde que les visites fructueuses + matchlist.append(self._matches) + self._matches=matchlist + #self.generic_visit(node) + + visit_List=visit_Tuple + + def visit_Name(self,node): + if debug : print ('visit_Name', node.id) + self.popWordsUpTo(node.id) + self.generic_visit(node) + + def visit_AssName(self,node): + if debug : print ('visit_AssName', node.id) + self.popWordsUpTo(node.id) + self.generic_visit(node) diff --git a/UiQT5/Tuple10.ui b/UiQT5/Tuple10.ui index 102166a1..c8149784 100644 --- a/UiQT5/Tuple10.ui +++ b/UiQT5/Tuple10.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 @@ -174,7 +174,7 @@ border:0px; - + 0 @@ -210,7 +210,7 @@ border:0px; - + 0 @@ -246,7 +246,7 @@ border:0px; - + 0 @@ -282,7 +282,7 @@ border:0px; - + 0 @@ -318,7 +318,7 @@ border:0px; - + 0 @@ -347,7 +347,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple2.ui b/UiQT5/Tuple2.ui index fb7c2ab6..9a17ce5f 100644 --- a/UiQT5/Tuple2.ui +++ b/UiQT5/Tuple2.ui @@ -43,7 +43,7 @@ - + 0 @@ -84,7 +84,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple3.ui b/UiQT5/Tuple3.ui index 9d777483..de3d4528 100644 --- a/UiQT5/Tuple3.ui +++ b/UiQT5/Tuple3.ui @@ -43,7 +43,7 @@ - + 0 @@ -81,7 +81,7 @@ border:0px; - + 0 @@ -117,7 +117,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple4.ui b/UiQT5/Tuple4.ui index d551c2b8..e2db8728 100644 --- a/UiQT5/Tuple4.ui +++ b/UiQT5/Tuple4.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple5.ui b/UiQT5/Tuple5.ui index b3013390..e8b64bfd 100644 --- a/UiQT5/Tuple5.ui +++ b/UiQT5/Tuple5.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 @@ -174,7 +174,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple6.ui b/UiQT5/Tuple6.ui index 192bf670..c870ea9a 100644 --- a/UiQT5/Tuple6.ui +++ b/UiQT5/Tuple6.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 @@ -174,7 +174,7 @@ border:0px; - + 0 @@ -210,7 +210,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple7.ui b/UiQT5/Tuple7.ui index 242b5b17..47df62d6 100644 --- a/UiQT5/Tuple7.ui +++ b/UiQT5/Tuple7.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 @@ -174,7 +174,7 @@ border:0px; - + 0 @@ -210,7 +210,7 @@ border:0px; - + 0 @@ -246,7 +246,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple8.ui b/UiQT5/Tuple8.ui index 169b2608..b3d0f63a 100644 --- a/UiQT5/Tuple8.ui +++ b/UiQT5/Tuple8.ui @@ -28,7 +28,7 @@ - + 0 @@ -66,7 +66,7 @@ border:0px; - + 0 @@ -102,7 +102,7 @@ border:0px; - + 0 @@ -138,7 +138,7 @@ border:0px; - + 0 @@ -174,7 +174,7 @@ border:0px; - + 0 @@ -210,7 +210,7 @@ border:0px; - + 0 @@ -246,7 +246,7 @@ border:0px; - + 0 @@ -282,7 +282,7 @@ border:0px; - + 0 diff --git a/UiQT5/Tuple9.ui b/UiQT5/Tuple9.ui index 6a7f25a1..7f8e3f03 100644 --- a/UiQT5/Tuple9.ui +++ b/UiQT5/Tuple9.ui @@ -40,7 +40,7 @@ - + 0 @@ -78,7 +78,7 @@ border:0px; - + 0 @@ -114,7 +114,7 @@ border:0px; - + 0 @@ -150,7 +150,7 @@ border:0px; - + 0 @@ -186,7 +186,7 @@ border:0px; - + 0 @@ -222,7 +222,7 @@ border:0px; - + 0 @@ -258,7 +258,7 @@ border:0px; - + 0 @@ -294,7 +294,7 @@ border:0px; - + 0 @@ -330,7 +330,7 @@ border:0px; - + 0 diff --git a/UiQT5/desWidgetFact.ui b/UiQT5/desWidgetFact.ui index c50a7421..d57b619e 100644 --- a/UiQT5/desWidgetFact.ui +++ b/UiQT5/desWidgetFact.ui @@ -47,7 +47,7 @@ 0 - 0 + 2 @@ -484,7 +484,7 @@ 0 - 1 + 2 diff --git a/UiQT5/desWidgetFactHorizon.ui b/UiQT5/desWidgetFactHorizon.ui new file mode 100644 index 00000000..0ccdf54f --- /dev/null +++ b/UiQT5/desWidgetFactHorizon.ui @@ -0,0 +1,428 @@ + + + WidgetFactHorizon + + + + 0 + 0 + 949 + 53 + + + + Qt::StrongFocus + + + Form + + + QGroupBox { + border: 1px solid gray; + border-radius: 5px; + margin-top: 1ex; /* leave space at the top for the title */ + } + + QGroupBox::title { + padding: 0 3px; + } + + + + 0 + + + 0 + + + 2 + + + 0 + + + 0 + + + + + 0 + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 5 + + + + + + + + + 21 + 15 + + + + + 21 + 21 + + + + border : 0px + + + ... + + + + ../Editeur/icons/minusnode.png../Editeur/icons/minusnode.png + + + + 21 + 21 + + + + + + + + + + Qt::Vertical + + + + + + + + + + + 0 + + + + + + 17 + 25 + + + + + 21 + 25 + + + + border : 0px + + + ... + + + + ../Editeur/icons/ast-green-ball.png../Editeur/icons/ast-green-ball.png + + + + 21 + 25 + + + + + + + + 0 + + + + + + 0 + 0 + + + + + 0 + 25 + + + + + 12121213 + 25 + + + + <html><head/><body><p><span style=" font-style:italic;">TextLabel</span></p></body></html> + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 1500 + 16 + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + 0 + + + QLayout::SetFixedSize + + + + + + 21 + 31 + + + + + 21 + 31 + + + + Qt::ClickFocus + + + Lance un script associé à la commande + + + border : 0px + + + ... + + + + ../Editeur/icons/roue.png../Editeur/icons/roue.png + + + + 21 + 31 + + + + + + + + + 21 + 25 + + + + + 21 + 25 + + + + border : 0px + + + ... + + + + ../Editeur/icons/point-interrogation30.png../Editeur/icons/point-interrogation30.png + + + + 21 + 25 + + + + + + + + + 21 + 25 + + + + + 21 + 25 + + + + border : 0px + + + ... + + + + ../Editeur/icons/lettreRblanc30.png../Editeur/icons/lettreRblanc30.png + + + + 21 + 25 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + + 21 + 25 + + + + + 21 + 25 + + + + border : 0px + + + ... + + + + ../Editeur/icons/deleteRond.png../Editeur/icons/deleteRond.png + + + + 21 + 25 + + + + + + + + + + 0 + + + 2 + + + + + + + + + + + + MonBoutonValide + QToolButton +
monBoutonValide.h
+
+ + MonLabelClic + QLabel +
monLabelClic.h
+
+
+ + +
diff --git a/UiQT5/desWidgetMatrice.ui b/UiQT5/desWidgetMatrice.ui index 378b9d7f..192f5e46 100644 --- a/UiQT5/desWidgetMatrice.ui +++ b/UiQT5/desWidgetMatrice.ui @@ -6,8 +6,8 @@ 0 0 - 399 - 226 + 624 + 490 @@ -25,7 +25,7 @@ Dialog - + @@ -124,8 +124,7 @@ - - + ..
@@ -144,79 +143,134 @@ - - - - - 0 - 0 - - - - - 100 - 25 - - - - - 100 - 16777215 - - - - QFrame::NoFrame - - - <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 2 - 2 - - - - - - - - 200 - 200 - - - - QFrame::Box - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - true + + + + + + 0 + 0 + + + + + 100 + 25 + + + + + 100 + 16777215 + + + + QFrame::NoFrame + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 13 + 13 + + + + + + + + + + 0 - + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 13 + 13 + + + + + + + + + 0 + 0 + + + + + 40 + 40 + + + + + 40 + 2500 + + + + QFrame::Box + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 13 + 13 + + + + + @@ -224,18 +278,40 @@ Qt::Vertical - QSizePolicy::Ignored + QSizePolicy::Expanding 20 - 2 + 68 + + + + + 200 + 200 + + + + QFrame::Box + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + true + + + @@ -255,7 +331,9 @@ label horizontalSpacer_2 - TBMatrice + lesCouleurs + horizontalSpacer_4 + horizontalSpacer_5 diff --git a/UiQT5/desWidgetPlusieursBase.ui b/UiQT5/desWidgetPlusieursBase.ui index b4d801dc..660efa2a 100644 --- a/UiQT5/desWidgetPlusieursBase.ui +++ b/UiQT5/desWidgetPlusieursBase.ui @@ -769,6 +769,13 @@ + + + + TextLabel + + + diff --git a/UiQT5/desWidgetPlusieursTuple.ui b/UiQT5/desWidgetPlusieursTuple.ui index a47fb9e9..c2aefeab 100644 --- a/UiQT5/desWidgetPlusieursTuple.ui +++ b/UiQT5/desWidgetPlusieursTuple.ui @@ -612,9 +612,9 @@ - + - Valide + TextLabel @@ -631,6 +631,13 @@ + + + + Valide + + + diff --git a/UiQT5/desWidgetSimpBase.ui b/UiQT5/desWidgetSimpBase.ui index 60c7dce5..1169925d 100644 --- a/UiQT5/desWidgetSimpBase.ui +++ b/UiQT5/desWidgetSimpBase.ui @@ -6,8 +6,8 @@ 0 0 - 743 - 60 + 613 + 56 @@ -175,7 +175,7 @@ - + 0 0 @@ -199,7 +199,7 @@ border:0px; - + Qt::Horizontal @@ -208,23 +208,68 @@ border:0px; - 3 + 5 20 + + + + + 0 + 0 + + + + TextLabel + + + Qt::Horizontal - QSizePolicy::Expanding + QSizePolicy::Minimum - 58 + 5 + 20 + + + + + + + + + 0 + 0 + + + + Active le parametre comme variable UQ + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 3 20 diff --git a/UiQT5/desWidgetSimpComplexe.ui b/UiQT5/desWidgetSimpComplexe.ui index 4e9db7e6..5d21e156 100644 --- a/UiQT5/desWidgetSimpComplexe.ui +++ b/UiQT5/desWidgetSimpComplexe.ui @@ -6,8 +6,8 @@ 0 0 - 1242 - 87 + 940 + 97 @@ -45,13 +45,13 @@ border:0px; 0 - 1 + 0 0 - 1 + 0 @@ -178,74 +178,6 @@ border:0px; - - - - - - 0 - 0 - - - - - 0 - 29 - - - - - 16777215 - 29 - - - - Complexe : a+bj - - - - - - - Qt::Horizontal - - - - 19 - 20 - - - - - - - - - - false - - - - - - - - 0 - 0 - - - - - 50 - 24 - - - - <html><head/><body><p align="center">OU </p></body></html> - - - - 4 @@ -269,7 +201,7 @@ border:0px; - + @@ -300,22 +232,59 @@ border:0px; - - - - Qt::Vertical - - - - 17 - 20 - - - - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 25 + 25 + + + + + 178 + 16777215 + + + + QFrame::NoFrame + + + <html><head/><body><p>aaa</p></body></html> + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + @@ -380,8 +349,6 @@ border:0px; - LEComp - RBRI RBMP RBPoubelle diff --git a/UiQT5/desWidgetTuple10.ui b/UiQT5/desWidgetTuple10.ui index e3c04710..ef748cf4 100644 --- a/UiQT5/desWidgetTuple10.ui +++ b/UiQT5/desWidgetTuple10.ui @@ -161,6 +161,12 @@ + + 2 + + + 2 + @@ -276,7 +282,7 @@ border:0px; - + 0 @@ -312,7 +318,7 @@ border:0px; - + 0 @@ -348,7 +354,7 @@ border:0px; - + 0 @@ -384,7 +390,7 @@ border:0px; - + 0 @@ -420,7 +426,7 @@ border:0px; - + 0 @@ -456,7 +462,7 @@ border:0px; - + 0 @@ -498,6 +504,45 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -579,11 +624,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple2.ui b/UiQT5/desWidgetTuple2.ui index 9c45154b..d540c457 100644 --- a/UiQT5/desWidgetTuple2.ui +++ b/UiQT5/desWidgetTuple2.ui @@ -36,13 +36,13 @@ 0
- 1 + 2 0 - 1 + 2 @@ -261,7 +261,27 @@ border:0px; - 58 + 5 + 20 + + +
+
+ + + + TextLabel + + + + + + + Qt::Horizontal + + + + 80 20 @@ -315,7 +335,7 @@ border:0px; 20 - 5 + 13 diff --git a/UiQT5/desWidgetTuple3.ui b/UiQT5/desWidgetTuple3.ui index a31e9b55..3e0fc3c2 100644 --- a/UiQT5/desWidgetTuple3.ui +++ b/UiQT5/desWidgetTuple3.ui @@ -33,13 +33,13 @@ 1 - 0 + 2 0 - 1 + 2 @@ -275,6 +275,29 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + diff --git a/UiQT5/desWidgetTuple4.ui b/UiQT5/desWidgetTuple4.ui index c939a9fb..ef4d83cc 100644 --- a/UiQT5/desWidgetTuple4.ui +++ b/UiQT5/desWidgetTuple4.ui @@ -33,13 +33,13 @@ 1 - 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px; - + 0 @@ -311,6 +311,29 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + @@ -392,11 +415,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple5.ui b/UiQT5/desWidgetTuple5.ui index c592ac6d..b687f748 100644 --- a/UiQT5/desWidgetTuple5.ui +++ b/UiQT5/desWidgetTuple5.ui @@ -33,13 +33,13 @@ 1
- 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px; - + 0 @@ -312,7 +312,7 @@ border:0px; - + 0 @@ -347,6 +347,29 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + @@ -428,11 +451,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple6.ui b/UiQT5/desWidgetTuple6.ui index 92aac0af..b90b6fb1 100644 --- a/UiQT5/desWidgetTuple6.ui +++ b/UiQT5/desWidgetTuple6.ui @@ -33,13 +33,13 @@ 1
- 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px; - + 0 @@ -312,7 +312,7 @@ border:0px; - + 0 @@ -348,7 +348,7 @@ border:0px; - + 0 @@ -383,6 +383,29 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + @@ -464,11 +487,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple7.ui b/UiQT5/desWidgetTuple7.ui index 43b719de..cb871f51 100644 --- a/UiQT5/desWidgetTuple7.ui +++ b/UiQT5/desWidgetTuple7.ui @@ -33,13 +33,13 @@ 1
- 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px; - + 0 @@ -312,7 +312,7 @@ border:0px; - + 0 @@ -348,7 +348,7 @@ border:0px; - + 0 @@ -384,7 +384,7 @@ border:0px; - + 0 @@ -432,6 +432,42 @@ border:0px;
+ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -500,11 +536,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple8.ui b/UiQT5/desWidgetTuple8.ui index 6cbb52dd..a7c44b12 100644 --- a/UiQT5/desWidgetTuple8.ui +++ b/UiQT5/desWidgetTuple8.ui @@ -33,13 +33,13 @@ 1
- 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px;
- + 0 @@ -312,7 +312,7 @@ border:0px; - + 0 @@ -348,7 +348,7 @@ border:0px; - + 0 @@ -384,7 +384,7 @@ border:0px; - + 0 @@ -420,7 +420,7 @@ border:0px; - + 0 @@ -455,6 +455,22 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -468,6 +484,29 @@ border:0px; + + + + TextLabel + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -536,11 +575,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/desWidgetTuple9.ui b/UiQT5/desWidgetTuple9.ui index 7dde5439..87644824 100644 --- a/UiQT5/desWidgetTuple9.ui +++ b/UiQT5/desWidgetTuple9.ui @@ -30,16 +30,16 @@ 0
- 1 + 0 - 0 + 2 0 - 1 + 2 @@ -276,7 +276,7 @@ border:0px;
- + 0 @@ -312,7 +312,7 @@ border:0px; - + 0 @@ -348,7 +348,7 @@ border:0px; - + 0 @@ -384,7 +384,7 @@ border:0px; - + 0 @@ -420,7 +420,7 @@ border:0px; - + 0 @@ -456,7 +456,7 @@ border:0px; - + 0 @@ -491,6 +491,45 @@ border:0px; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + TextLabel + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -572,11 +611,6 @@ border:0px; QLabel
monLabelClic.h
- - LECustomTuple - QLineEdit -
gereListe.h
-
diff --git a/UiQT5/eficas_en.qm b/UiQT5/eficas_en.qm new file mode 100644 index 00000000..a081280e Binary files /dev/null and b/UiQT5/eficas_en.qm differ diff --git a/UiQT5/eficas_fr.qm b/UiQT5/eficas_fr.qm new file mode 100644 index 00000000..9dad8dff Binary files /dev/null and b/UiQT5/eficas_fr.qm differ diff --git a/UiQT5/myMain.ui.pn b/UiQT5/myMain.ui.pn new file mode 100644 index 00000000..9661a101 --- /dev/null +++ b/UiQT5/myMain.ui.pn @@ -0,0 +1,497 @@ + + + Eficas + + + + 0 + 0 + 1676 + 811 + + + + + 0 + 0 + + + + MainWindow + + + /* QMenuBar { + background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, + stop:0 rgb(226,255,253), stop:1 rgb(191,237,255)); + }*/ + +QMenuBar { + background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, + stop:0 rgb(164,165,178), stop:1 rgb(55,66,126)); + } + QMenuBar::item { + spacing: 3px; /* spacing between menu bar items */ + color: white; + padding: 1px 4px; + background: transparent; + border-radius: 4px; + } + + QMenuBar::item:selected { /* when selected using mouse or keyboard */ + background: #a8a8a8; + } + + QMenuBar::item:pressed { + background: #888888; + } + + + + + + + + + + + + + QComboBox{combobox-popup:0;} + + + + + 0 + 0 + 129 + 120 + + + + + + + + 0 + 60 + + + + + 16777215 + 60 + + + + /*background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, + stop:0 rgb(218,229,248), stop:1 rgb(9,86,109));*/ +/*background-color:rgb(208,225,238)*/ + + + QFrame::NoFrame + + + QFrame::Raised + + + 2 + + + + + + + background-color:rgb(224,223,222) + + + QTabWidget::North + + + 0 + + + true + + + + Tab 1 + + + + + + + + + + + 0 + 0 + 1676 + 21 + + + + + &Fichier + + + + + + + + + + + + + + + + &Edition + + + + + + + + + + + + + &JeuDeDonnées + + + + + + + + + + + + + + + &Aide + + + + + + + + + + + + + + toolBar + + + + 36 + 36 + + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + toolBar_2 + + + TopToolBarArea + + + false + + + + + + ../../../.designer/backup../../../.designer/backup + + + &Nouveau + + + Ctrl+N + + + + + Nouvel Include + + + Shift+I + + + + + &bad + + + + + + ../../../.designer/backup../../../.designer/backup + + + &Ouvrir + + + Ctrl+O + + + + + + ../../../.designer/backup../../../.designer/backup + + + Enregistrer + + + Ctrl+S + + + + + Parametres Eficas + + + + + + ../../../.designer/backup../../../.designer/backup + + + Enregistrer sous + + + Ctrl+Shift+S + + + + + Fermer + + + Ctrl+W + + + + + Fermer tout + + + + + + ../../../.designer/backup../../../.designer/backup + + + Couper + + + Ctrl+X + + + Qt::ApplicationShortcut + + + + + + ../../../.designer/backup../../../.designer/backup + + + Copier + + + Ctrl+C + + + Qt::ApplicationShortcut + + + + + + ../../../.designer/backup../../../.designer/backup + + + Coller + + + Ctrl+V + + + Qt::ApplicationShortcut + + + + + Quitter + + + Ctrl+Q + + + + + Rapport de Validation + + + Shift+V + + + false + + + + + Fichier Source + + + + + Fichier Résultat + + + + + + ../../../.designer/backup../../../.designer/backup + + + Lecteur documentation + + + + + Eficas + + + + + Version + + + + + + ../../../.designer/backup../../../.designer/backup + + + Supprimer + + + + + Chercher Mot-Clef + + + Rechercher dans le catalogue + + + Shift+F + + + Qt::ApplicationShortcut + + + + + + ../../../.designer/backup../../../.designer/backup + + + Rechercher + + + Rechercher dans l'arbre d'etude + + + Ctrl+F + + + Qt::ApplicationShortcut + + + + + Replier/Deplier + + + Shift+D + + + + + Commentaire + + + Shift+C + + + + + + ../../../.designer/Editeur/icons/parametres.png../../../.designer/Editeur/icons/parametres.png + + + Paramètres + + + Gestion des paramètres + + + Shift+P + + + + + Parametre Eficas + + + + + Régles du JdC + + + + + Cacher l'Arbre + + + + + Afficher l'Arbre + + + + + + diff --git a/Vimmp/cata_CSAndCPS_v16.py b/Vimmp/cata_CSAndCPS_v16.py index 1fb59bc1..e6cc46db 100644 --- a/Vimmp/cata_CSAndCPS_v16.py +++ b/Vimmp/cata_CSAndCPS_v16.py @@ -1,3 +1,4 @@ + from Accas import * VERSION_CATALOGUE='VimmpV16' @@ -63,7 +64,7 @@ dictCodeModeleNumerique = { 'STAR_CCM+' : ('FV', 'Particles',), 'Code Nill' : ('Spectral method', ), } -# Le Code Nill est ajouté en dur au Solver +# Le Code Nill est ajoute en dur au Solver dictCodeFormat = { 'Code_Saturne' : ('Med', 'cgns', 'msh', 'des', 'unv', ), @@ -195,8 +196,7 @@ def prepareBlocAmbiantMediaField(condition, nomDuFact, nomDelaContante) : dicoDesBlocs = {} dicoDuFact = {} dicoDuFact[nomDelaContante] = SIMP(typ='TXM', statut='o', defaut = nomDelaContante, homo='constant') - monFact = FACT ( statut ='o', - **dicoDuFact, + monFact = FACT ( statut='o', **dicoDuFact, SteadyState = SIMP(typ=bool, statut ='o', defaut = True,), blocSteadyState = BLOC(condition = 'SteadyState == True', FieldOrigin = SIMP(statut='o', into =['File', 'Value','Interaction'], typ ='TXM',), diff --git a/Vimmp/cata_CSAndCPS_v16.xsd b/Vimmp/cata_CSAndCPS_v16.xsd new file mode 100644 index 00000000..1bf9423d --- /dev/null +++ b/Vimmp/cata_CSAndCPS_v16.xsd @@ -0,0 +1,4058 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nanotube length [m] + + + + + + + + + radius length [m] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {'T_SubgridScaleModel': {'_SubgridScaleModel_blocOnePoint_blocOneSpatial_TurbulenceForFlowDynamics_blocFlowNatureTurbulent_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel', '_SubgridScaleModel_blocFDF_blocOneSpatial_TurbulenceForFlowDynamics_blocFlowNatureTurbulent_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel', '_SubgridScaleModel_blocOnePoint_blocOneSpatial_ScalarsTurbulenceModelling_blocAsTFFD_blocFlowNatureTurbulentForScalars_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel_3', '_SubgridScaleModel_blocFDF_blocOneSpatial_ScalarsTurbulenceModelling_blocAsTFFD_blocFlowNatureTurbulentForScalars_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel_3', '_SubgridScaleModel_blocOnePoint_blocOneSpatial_ScalarFluxModel_blocScalarFluidTurbulentAndNonComplexe_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel_6', '_SubgridScaleModel_blocFDF_blocOneSpatial_ScalarFluxModel_blocScalarFluidTurbulentAndNonComplexe_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_SubgridScaleModel_6'}, 'T_ChoiceOfDescription': {'_ChoiceOfDescription_blocOneSpatial_TurbulenceForFlowDynamics_blocFlowNatureTurbulent_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription', '_ChoiceOfDescription_blocOnePointPdf_TurbulenceForFlowDynamics_blocFlowNatureTurbulent_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription', '_ChoiceOfDescription_blocOneSpatial_ScalarsTurbulenceModelling_blocAsTFFD_blocFlowNatureTurbulentForScalars_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription_2', '_ChoiceOfDescription_blocOnePointPdf_ScalarsTurbulenceModelling_blocAsTFFD_blocFlowNatureTurbulentForScalars_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription_2', '_ChoiceOfDescription_blocOneSpatial_ScalarFluxModel_blocScalarFluidTurbulentAndNonComplexe_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription_4', '_ChoiceOfDescription_blocOnePointPdf_ScalarFluxModel_blocScalarFluidTurbulentAndNonComplexe_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_ChoiceOfDescription_4', '_ChoiceOfDescription_blocOneSpatial_blocTurbulent_NatureOfFluidForce_DefineForceOnParticle_blocHydro_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_ChoiceOfDescription_6', '_ChoiceOfDescription_blocOnePointPdf_blocTurbulent_NatureOfFluidForce_DefineForceOnParticle_blocHydro_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_ChoiceOfDescription_6'}, 'T_Density': {'_Density_blocDensityValue_DensityInitialisation_blocFluideMacro_PhysicalDescription_Component': 'T_Density', '_Density_Weight_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_Density_1'}, 'T_RANSModel': {'_RANSModel_blocOnePoint_TurbulenceForFlowDynamics_blocFlowNatureTurbulent_blocFluideMacro_PhysicalDescription_Component': 'T_RANSModel', '_RANSModel_blocOnePoint_ScalarsTurbulenceModelling_blocAsTFFD_blocFlowNatureTurbulentForScalars_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_RANSModel_1', '_RANSModel_blocOnePoint_ScalarFluxModel_blocScalarFluidTurbulentAndNonComplexe_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_RANSModel_1', '_RANSModel_blocOnePoint_blocTurbulent_NatureOfFluidForce_DefineForceOnParticle_blocHydro_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_RANSModel'}, 'T_InteractionName': {'_InteractionName_blocInteractionPressure_blocSteadyState_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Origin_blocNoSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocByInteraction_Origin_blocNotSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocInteractionVelocity_blocSteady_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocKInteraction_blocSteady_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocEpsilonInteraction_blocSteady_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocOmegaInteraction_blocSteady_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocRijInteraction_blocSteady_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocInteractionInit_Initialisation_blocSimulatedScalar_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocInteractionScalar_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocInteraction_blocSteadyState_DefineElectricForce_blocElectric_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_blocInteraction_blocSteadyState_DefineMagneticForce_blocMagnetic_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_InteractionName', '_InteractionName_Interaction_Interactions': 'T_InteractionName_10'}, 'T_Initialisation': {'_Initialisation_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation', '_Initialisation_blocSimulatedScalar_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_Initialisation_6', '_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_Initialisation_7', '_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_Initialisation_7', '_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_Initialisation_7', '_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_Initialisation_7', '_Initialisation_blocSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_Initialisation_9'}, 'T_InitialisationType': {'_InitialisationType_Initialisation_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_Initialisation_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_Initialisation_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_Initialisation_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_Initialisation_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_Initialisation_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_InitialisationType', '_InitialisationType_DefineGravityForce_blocGravite_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_1', '_InitialisationType_BlocInitialisationLangevin_blocTMD_blocTurbulent_NatureOfFluidForce_DefineForceOnParticle_blocHydro_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_2', '_InitialisationType_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_3', '_InitialisationType_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_3', '_InitialisationType_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_3', '_InitialisationType_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_3', '_InitialisationType_Initialisation_blocSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_InitialisationType_3'}, 'T_FileFormat': {'_FileFormat_blocByFile_Initialisation_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_BlocInitialisationLangevin_blocTMD_blocTurbulent_NatureOfFluidForce_DefineForceOnParticle_blocHydro_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_FileFormat_1', '_FileFormat_blocByFile_Origin_blocNoSimulatedPosition_ParticlePosition_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_blocByFile_Origin_blocNotSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_FileFormat', '_FileFormat_monBlocFormat_FileTransfer_IOAspects_Interactions': 'T_FileFormat'}, 'T_OriginOfSourceTerm': {'_OriginOfSourceTerm_blocSourceTerm_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_TemperatureScalar_blocThermalEffectsOn_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_blocSimulatedScalar_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_OriginOfSourceTerm', '_OriginOfSourceTerm_blocSourceTerm_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_OriginOfSourceTerm_1', '_OriginOfSourceTerm_blocSourceTerm_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_OriginOfSourceTerm_1', '_OriginOfSourceTerm_blocSourceTerm_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_OriginOfSourceTerm_1', '_OriginOfSourceTerm_blocSourceTerm_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_OriginOfSourceTerm_1'}, 'T_TakenFrom': {'_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedPressure_PressureDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedVelocity_VelocityDefinition_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedKDefinition_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedEpsilonDefinition_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedOmegaDefinition_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedRijDefinition_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_TemperatureScalar_blocThermalEffectsOn_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_blocSimulatedScalar_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_TakenFrom', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_Initialisation_blocSimulatedDiameter_ParticleDiameter_StateVector_blocCPS_PhysicalDescription_Component': 'T_TakenFrom_1', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_Initialisation_blocSimulatedMass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_TakenFrom_1', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_Initialisation_blocSimulatedVelocity_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_TakenFrom_1', '_TakenFrom_blocOriginOfSourceTermOtherScalar_blocSourceTerm_Initialisation_blocHydrodynamicVelocity_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_TakenFrom_1'}, 'T_Name': {'_Name_KDefinition_blocTurbulenceTWMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Name', '_Name_EpsilonDefinition_blocTurbulenceTWMChoice2_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Name_1', '_Name_OmegaDefinition_blocTurbulenceTWMChoice3_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Name_2', '_Name_RijDefinition_blocTurbulenceRSMChoice1_BFlowNatureTurbulent_DynamicalVariables_blocFluideMacro_PhysicalDescription_Component': 'T_Name_3', '_Name_TemperatureScalar_blocThermalEffectsOn_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_Name_4', '_Name_Scalar_blocwithScalars_Scalars_blocScalarFluidTurbulentOrLaminar_blocFluideMacro_PhysicalDescription_Component': 'T_Name_5'}, 'T_Shape': {'_Shape_blocMolecule_Particles_blocCPS_PhysicalDescription_Component': 'T_Shape', '_Shape_SystemGeometry_SpatialAspects': 'T_Shape_1'}, 'T_BondedParticles': {'_BondedParticles_blocDissipative_Particles_blocCPS_PhysicalDescription_Component': 'T_BondedParticles', '_BondedParticles_b_SolidAggregateBonded_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_BondedParticles_1', '_BondedParticles_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedParticles', '_BondedParticles_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedParticles_3'}, 'T_FractalDimension': {'_FractalDimension_Morphology_b_SolidAggregate_blocTypeDPSolid_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_FractalDimension', '_FractalDimension_Morphological_b_SolidAggregate_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_FractalDimension_1'}, 'T_EquivalentSize': {'_EquivalentSize_Morphology_b_SolidAggregate_blocTypeDPSolid_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_EquivalentSize', '_EquivalentSize_Morphological_b_SolidAggregate_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_EquivalentSize_1'}, 'T_Porosity': {'_Porosity_Morphology_b_SolidAggregate_blocTypeDPSolid_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_Porosity', '_Porosity_Morphological_b_SolidAggregate_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_Porosity_1'}, 'T_Mass': {'_Mass_Weight_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_Mass', '_Mass_ParticleMass_StateVector_blocCPS_PhysicalDescription_Component': 'T_Mass_1'}, 'T_ListOfBondedParticles': {'_ListOfBondedParticles_BondedParticles_b_SolidAggregateBonded_Properties_blocDiscrete_Particles_blocCPS_PhysicalDescription_Component': 'T_ListOfBondedParticles', '_ListOfBondedParticles_FENEParameters_blocFENE_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_ListOfBondedParticles_1', '_ListOfBondedParticles_BondHarmonicParameters_blocharmonic_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_ListOfBondedParticles_2', '_ListOfBondedParticles_FENEParameters_blocFENE_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_ListOfBondedParticles_3', '_ListOfBondedParticles_BondHarmonicParameters_blocharmonic_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_ListOfBondedParticles_4'}, 'T_Direction': {'_Direction_blocInitValue_DefineGravityForce_blocGravite_blocMomentum_MomentumExchange_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_Direction', '_Direction_blocPeriodique_BoundaryCondition_BoundaryConditions_Component': 'T_Direction_1'}, 'T_LevelOfDescription': {'_LevelOfDescription_bAmbientInducedProcessesType_blocAmbientInducedProcesses_AmbientInducedProcesses_AmbiantMediaInteraction_blocCPS_PhysicalDescription_Component': 'T_LevelOfDescription', '_LevelOfDescription_bwithContact_ContactPhenomena_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_LevelOfDescription_1', '_LevelOfDescription_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_LevelOfDescription_2', '_LevelOfDescription_bwithContact_ContactPhenomena_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_LevelOfDescription_1', '_LevelOfDescription_blocWall_BoundaryCondition_BoundaryConditions_Component': 'T_LevelOfDescription_4'}, 'T_BondedInteractions': {'_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedInteractions', '_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedInteractions_1'}, 'T_BondedInteraction': {'_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedInteraction', '_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_BondedInteraction_1'}, 'T_FENEParameters': {'_FENEParameters_blocFENE_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_FENEParameters', '_FENEParameters_blocFENE_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_FENEParameters_1'}, 'T_BondHarmonicParameters': {'_BondHarmonicParameters_blocharmonic_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_BondHarmonicParameters', '_BondHarmonicParameters_blocharmonic_bBondStretching_BondedInteraction_blocNoTopologyFile_blocBonded_BondedInteractions_bDiscretized_TypeOfWall_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_BondHarmonicParameters_1'}, 'T_ActionsAtDistance': {'_ActionsAtDistance_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_ActionsAtDistance', '_ActionsAtDistance_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_ActionsAtDistance_1'}, 'T_ContactPhenomena': {'_ContactPhenomena_ParticleParticleInteraction_blocCPS_PhysicalDescription_Component': 'T_ContactPhenomena', '_ContactPhenomena_bwithParticleWallInteraction_ParticleWallInteraction_blocCPS_PhysicalDescription_Component': 'T_ContactPhenomena_1'}, 'T_ParticleVelocity': {'_ParticleVelocity_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_ParticleVelocity', '_ParticleVelocity_blocNoBrownianDynamics_blocInlet2_BoundaryCondition_BoundaryConditions_Component': 'T_ParticleVelocity_1'}, 'T_FluidVelocitySeenByParticles': {'_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_StateVector_blocCPS_PhysicalDescription_Component': 'T_FluidVelocitySeenByParticles', '_FluidVelocitySeenByParticles_blocHydrodynamic_blocNoBrownianDynamics_blocInlet2_BoundaryCondition_BoundaryConditions_Component': 'T_FluidVelocitySeenByParticles_1'}, 'T_TransferId': {'_TransferId_FileTransfer_IOAspects_Interactions': 'T_TransferId', '_TransferId_MemoryTransfer_IOAspects_Interactions': 'T_TransferId_1', '_TransferId_CorbaTransfer_IOAspects_Interactions': 'T_TransferId_2'}} + + + + + \ No newline at end of file diff --git a/Vimmp/generateXSD.py b/Vimmp/generateXSD.py new file mode 100755 index 00000000..3f8ad835 --- /dev/null +++ b/Vimmp/generateXSD.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 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. +# +# 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 +# +""" + cree le .xsd associe au .py + generateXSD.py -c leCatalogueAVECSONNOMCOMPLET POUR TROUVER LE DRIVER + 23 avril +""" +# Modules Python +# Modules Eficas +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +from InterfaceQT4 import eficas_go +eficas_go.genereXSD(code='NonConnu')