-#@ MODIF macr_cara_poutre_ops Macro DATE 27/02/2006 AUTEUR DURAND C.DURAND
+#@ MODIF macr_cara_poutre_ops Macro DATE 16/10/2007 AUTEUR REZETTE C.REZETTE
# -*- coding: iso-8859-1 -*-
# CONFIGURATION MANAGEMENT OF EDF VERSION
# ======================================================================
"""
Ecriture de la macro MACR_CARA_POUTRE
"""
- import types
+ import types,string
from Accas import _F
- from Utilitai.Utmess import UTMESS
+ import aster
+ from Utilitai.Utmess import UTMESS
ier=0
# On importe les definitions des commandes a utiliser dans la macro
# Le nom de la variable doit etre obligatoirement le nom de la commande
# if GROUP_MA_BORD and GROUP_MA:
# if not LIAISON:
-# UTMESS('F', "MACR_CARA_POUTRE", "Avec GROUP_MA, il faut obligatoirement preciser LIAISON, LONGUEUR ET MATERIAU")
#
__nomlma=LIRE_MAILLAGE(UNITE=UNITE_MAILLAGE,)
motscles={}
- if args.has_key('NOEUD'):
- motscles['TEMP_IMPO']=(_F(NOEUD=args['NOEUD'],TEMP=__fnsec0))
+ if args['NOEUD']!=None:
+ nthno = args['NOEUD']
+ if type(nthno)!=types.StringType : UTMESS('F','POUTRE0_3')
+ motscles['TEMP_IMPO']=(_F(NOEUD=nthno,TEMP=__fnsec0))
+ if args['GROUP_NO']!=None:
+ collgrno=aster.getcolljev(string.ljust(__nomapi.nom,8)+'.GROUPENO')
+ nomnoe =aster.getvectjev(string.ljust(__nomapi.nom,8)+'.NOMNOE')
+ l_no=collgrno[string.ljust(args['GROUP_NO'],8)]
+ if len(l_no)!=1 : UTMESS('F','POUTRE0_3')
+ nthno=nomnoe[l_no[0]-1]
+ motscles['TEMP_IMPO']=(_F(NOEUD=nthno,TEMP=__fnsec0))
__chart2=AFFE_CHAR_THER_F(MODELE=__nomoth,
SOURCE=_F(TOUT='OUI',
SOUR=__fnsec1,),
# --------------------------------------------------
motscles={}
- if args.has_key('NOEUD'):
- motscles['TEMP_IMPO']=_F(NOEUD=args['NOEUD'],TEMP=__fnsec0)
+ if args['NOEUD']!=None:
+ nthno = args['NOEUD']
+ motscles['TEMP_IMPO']=_F(NOEUD=nthno,TEMP=__fnsec0)
+ if args['GROUP_NO']!=None:
+ collgrno=aster.getcolljev(string.ljust(__nomapi.nom,8)+'.GROUPENO')
+ nomnoe =aster.getvectjev(string.ljust(__nomapi.nom,8)+'.NOMNOE')
+ l_no=collgrno[string.ljust(args['GROUP_NO'],8)]
+ if len(l_no)!=1 : UTMESS('F','POUTRE0_3')
+ nthno=nomnoe[l_no[0]-1]
+ motscles['TEMP_IMPO']=_F(NOEUD=nthno,TEMP=__fnsec0)
__chart3=AFFE_CHAR_THER_F(MODELE=__nomoth,
SOURCE=_F(TOUT='OUI',
SOUR=__fnsec2,),
else:
l_group_ma= GROUP_MA
- if args.has_key('NOEUD'):
+ l_noeud=None
+
+ if args['NOEUD']!=None:
if type(args['NOEUD'])==types.StringType :
l_noeud=[args['NOEUD'],]
else:
l_noeud= args['NOEUD']
+ if args['GROUP_NO']!=None:
+ collgrno=aster.getcolljev(string.ljust(__nomlma.nom,8)+'.GROUPENO')
+ nomnoe =aster.getvectjev(string.ljust(__nomlma.nom,8)+'.NOMNOE')
+ l_nu_no =[]
+ if type(args['GROUP_NO'])==types.StringType :
+ l_gr_no=[args['GROUP_NO'],]
+ else:
+ l_gr_no= args['GROUP_NO']
+ for grno in l_gr_no:
+ l_nu_no =l_nu_no+list(collgrno[string.ljust(grno,8)])
+ l_noeud =[nomnoe[no_i-1] for no_i in l_nu_no]
+
if len(l_group_ma)!=len(l_group_ma_bord):
- UTMESS('F', "MACR_CARA_POUTRE", "GROUP_MA et GROUP_MA_BORD incoherents")
- if args.has_key('NOEUD') and (len(l_group_ma)!=len(l_noeud)):
- UTMESS('F', "MACR_CARA_POUTRE", "GROUP_MA et NOEUD incoherents")
+ UTMESS('F','POUTRE0_1')
+ if l_noeud!=None and (len(l_group_ma)!=len(l_noeud)):
+ UTMESS('F','POUTRE0_2')
__catp2=__cageo
for i in range(0,len(l_group_ma_bord)):