def crea_sd_mail(self, mailString): from Utilitai.UniteAster import UniteAster LIRE_MAILLAGE = self.get_cmd('LIRE_MAILLAGE') nomFichierSortie = os.path.join(os.getcwd(), 'maillage.mail') fproc = open(nomFichierSortie, 'w') fproc.write(mailString) fproc.close() UL = UniteAster() uniteMail = UL.Libre(action='ASSOCIER', nom=nomFichierSortie) _MAI = LIRE_MAILLAGE(FORMAT='ASTER', UNITE=uniteMail) UL.EtatInit(uniteMail) return _MAI
def post_endo_fiss_ops(self, TABLE, OUVERTURE, NOM_CMP, NOM_CHAM, RECHERCHE, **args): import aster from Utilitai.Utmess import UTMESS, MasquerAlarme, RetablirAlarme from code_aster.Cata.Syntax import _F # -------------------------------------------------- # DEVELOPER OPTIONS # # "strong_flag" must be set to True if computing crack opening with the "strong" method strong_flag = False ier = 0 # La macro compte pour 1 dans la numerotation des commandes self.set_icmd(1) MasquerAlarme('CALCULEL5_48') MasquerAlarme('ALGORITH12_43') MasquerAlarme('CALCULEL2_12') MasquerAlarme('CALCULEL5_7') # -------------------------------------------------- # OUTPUT DECLARATION # self.DeclareOut('MAFISS', self.sd) self.DeclareOut('tabRes', TABLE) # -------------------------------------------------- # IMPORT OF ASTER COMMANDS # LIRE_MAILLAGE = self.get_cmd('LIRE_MAILLAGE') IMPR_TABLE = self.get_cmd('IMPR_TABLE') CREA_TABLE = self.get_cmd('CREA_TABLE') CREA_CHAMP = self.get_cmd('CREA_CHAMP') CO = self.get_cmd('CO') IMPR_RESU = self.get_cmd('IMPR_RESU') RECU_TABLE = self.get_cmd('RECU_TABLE') # -------------------------------------------------- # INPUT PARAMETERS # l_dRECHERCHE = [] for recherche in RECHERCHE: dRECHERCHE = recherche.cree_dict_valeurs(recherche.mc_liste) for i in dRECHERCHE.keys(): if dRECHERCHE[i] == None: del dRECHERCHE[i] l_dRECHERCHE.append(dRECHERCHE) # -------------------------------------------------- # INPUT PARAMETERS, MESH AND MODEL # motscles = {} for dRECHERCHE in l_dRECHERCHE: if (OUVERTURE == 'OUI') and ('BORNE_MAX' not in dRECHERCHE.keys()): UTMESS('F', 'POST0_44') if args['CHAM_GD'] != None: build = 'champ' __ENDO = args['CHAM_GD'] inst = 1. motscles['INST'] = inst n_mail = __ENDO.sdj.REFE.get()[0].strip() __mail = self.get_concept(n_mail) else: build = 'resu' __RESUIN = args['RESULTAT'] nomresu = __RESUIN.nom dicResu = __RESUIN.LIST_PARA() dicVarAcc = __RESUIN.LIST_VARI_ACCES() if args['NUME_ORDRE'] != None: nume_ordre = args['NUME_ORDRE'] if nume_ordre not in dicVarAcc['NUME_ORDRE']: UTMESS('F', 'POST0_41') else: inst = (dicVarAcc['INST'])[nume_ordre] motscles['NUME_ORDRE'] = nume_ordre else: inst = args['INST'] motscles['INST'] = inst nume_ordre = None for champ_inst_index, champ_inst in enumerate(dicVarAcc['INST']): if round(champ_inst, 12) == round(inst, 12): nume_ordre = dicVarAcc['NUME_ORDRE'][champ_inst_index] break if nume_ordre is None: UTMESS('F', 'POST0_41') # Maillage pour projections iret, ibid, n_mail = aster.dismoi('NOM_MAILLA', __RESUIN.nom, 'RESULTAT', 'F') __mail = self.get_concept(n_mail) dime = __mail.sdj.DIME.get()[5] # -------------------------------------------------- # CONTROLS ON THE INPUT FIELDS # if build == 'resu': ChampsResu = __RESUIN.LIST_CHAMPS() lstChampsResu = ChampsResu.keys() if (NOM_CHAM not in lstChampsResu): UTMESS('F', 'POST0_42') elif (nume_ordre not in ChampsResu[NOM_CHAM]): UTMESS('F', 'POST0_41') else: pass if build == 'champ' and OUVERTURE == 'OUI': UTMESS('F', 'POST0_43') if ('NOEU' in NOM_CHAM) or (NOM_CHAM == 'DEPL'): typeChampTrajet = 'NOEU' + '_' + NOM_CHAM[0:4] + '_R' if NOM_CHAM == 'VARI_NOEU': typeChampTrajet = 'NOEU_VAR2_R' else: UTMESS('F', 'POST0_35') # -------------------------------------------------- # QUANTITIES FOR THE 2D PROCEDURE # __TABG = RECU_TABLE( CO=__mail, NOM_TABLE='CARA_GEOM', ) xmin = __TABG['X_MIN', 1] xmax = __TABG['X_MAX', 1] ymin = __TABG['Y_MIN', 1] ymax = __TABG['Y_MAX', 1] zmin = __TABG['Z_MIN', 1] zmax = __TABG['Z_MAX', 1] nbPrec = NP.finfo(NP.float).precision delta_x = NP.round(xmax - xmin, nbPrec) delta_y = NP.round(ymax - ymin, nbPrec) delta_z = NP.round(zmax - zmin, nbPrec) Ddim = [delta_x, delta_y, delta_z] delta_min = min(Ddim) if NP.round(delta_min, nbPrec - 2) != 0.: UTMESS('F', 'POST0_34') else: idx_plan = Ddim.index(delta_min) # PLAN == 'XY' : if idx_plan == 2: coorIni1 = 0 coorIni2 = 1 dnor = NP.array([0., 0., 1.], float) dplan1 = NP.array([1., 0., 0.], float) dplan2 = NP.array([0., 1., 0.], float) # PLAN == 'XZ': elif idx_plan == 1: coorIni1 = 0 coorIni2 = 2 dnor = NP.array([0., 1., 0.], float) dplan1 = NP.array([1., 0., 0.], float) dplan2 = NP.array([0., 0., 1.], float) # PLAN == 'YZ': else: coorIni1 = 1 coorIni2 = 2 dnor = NP.array([1., 0., 0.], float) dplan1 = NP.array([0., 1., 0.], float) dplan2 = NP.array([0., 0., 1.], float) infoPlan = (coorIni1, coorIni2, dnor, dplan1, dplan2) # -------------------------------------------------- # FIELD FOR CRACK PATH SEARCH # if build == 'resu': __ENDO = CREA_CHAMP(TYPE_CHAM=typeChampTrajet, OPERATION='EXTR', RESULTAT=__RESUIN, NOM_CHAM=NOM_CHAM, **motscles) # -------------------------------------------------- # LOOP ON THE FPZs (INSTANCES OF KEYWORD "RECHERCHE") # XcreteTot = [] YcreteTot = [] ZcreteTot = [] ConnTot = [] EndocreteTot = [] lstFissure = [] lstOuverture = [] lstErreur = [] lstNomFiss = [] for idxRech in range(len(l_dRECHERCHE)): dRECHERCHE = l_dRECHERCHE[idxRech] (CoxCrete, CoyCrete, CozCrete, EndoCrete, Connex) = cherche_trajet(self, NOM_CMP, NOM_CHAM, dRECHERCHE, __ENDO, __mail, typeChampTrajet, infoPlan, inst) if OUVERTURE == 'OUI': if strong_flag == False: lstOuvFiss = calcul_ouverture(self, NOM_CHAM, NOM_CMP, dRECHERCHE, __RESUIN, __mail, infoPlan, inst, CoxCrete, CoyCrete, CozCrete, dime, strong_flag) else: lstOuvFiss, lstErr = calcul_ouverture(self, NOM_CHAM, NOM_CMP, dRECHERCHE, __RESUIN, __mail, infoPlan, inst, nume_ordre, CoxCrete, CoyCrete, CozCrete, dime, strong_flag) XcreteTot.append(CoxCrete) YcreteTot.append(CoyCrete) ZcreteTot.append(CozCrete) EndocreteTot.append(EndoCrete) ConnTot.append(Connex) if 'GROUP_MA' in dRECHERCHE.keys(): nomFissure = dRECHERCHE['GROUP_MA'] else: nomFissure = 'FISS' + str(idxRech + 1) lstFissure = lstFissure + ([nomFissure] * len(CoxCrete)) lstNomFiss.append(nomFissure) if OUVERTURE == 'OUI': if '-' in lstOuvFiss: UTMESS('A', 'POST0_33', nomFissure) lstOuverture.append(lstOuvFiss) if strong_flag == True: lstErreur.append(lstErr) lstX = [] lstY = [] lstZ = [] lstEndo = [] if OUVERTURE == 'OUI': lstO = [] if strong_flag == True: lstE = [] for i in range(len(XcreteTot)): lstX = lstX + XcreteTot[i] lstY = lstY + YcreteTot[i] lstZ = lstZ + ZcreteTot[i] lstEndo = lstEndo + EndocreteTot[i] if OUVERTURE == 'OUI': lstO = lstO + lstOuverture[i] if strong_flag == True: lstE = lstE + lstErreur[i] # ----------------------------------------------------- # CREATION OF A TABLE TO STOCK CRACK PATH COORDINATES # AND CRACK OPENING # if OUVERTURE == 'NON': tabRes = CREA_TABLE(LISTE=( _F(PARA='FISSURE', LISTE_K=lstFissure), _F(PARA='COORX', LISTE_R=lstX), _F(PARA='COORY', LISTE_R=lstY), _F(PARA='COORZ', LISTE_R=lstZ), _F(PARA='CHAMP', LISTE_R=lstEndo), ), ) else: if strong_flag == False: tabRes = CREA_TABLE(LISTE=( _F(PARA='FISSURE', LISTE_K=lstFissure), _F(PARA='COORX', LISTE_R=lstX), _F(PARA='COORY', LISTE_R=lstY), _F(PARA='COORZ', LISTE_R=lstZ), _F(PARA='CHAMP', LISTE_R=lstEndo), _F(PARA='OUVERTURE', LISTE_R=lstO), ), ) else: # STRONG Method tabRes = CREA_TABLE(LISTE=( _F(PARA='FISSURE', LISTE_K=lstFissure), _F(PARA='COORX', LISTE_R=lstX), _F(PARA='COORY', LISTE_R=lstY), _F(PARA='COORZ', LISTE_R=lstZ), _F(PARA='CHAMP', LISTE_R=lstEndo), _F(PARA='OUVERTURE', LISTE_R=lstO), _F(PARA='ERREUR', LISTE_R=lstE), ), ) # -------------------------------------------------- # CREATION OF DATA STRUCTURE "MESH" # resu_mail0 = crea_mail_lin(XcreteTot, YcreteTot, ZcreteTot, ConnTot, lstNomFiss, dime) nomFichierSortie = os.path.join(os.getcwd(), 'maillage.mail') fproc = open(nomFichierSortie, 'w') fproc.write(resu_mail0) fproc.close() UL = UniteAster() uniteMail = UL.Libre(action='ASSOCIER', nom=nomFichierSortie) MAFISS = LIRE_MAILLAGE( FORMAT='ASTER', UNITE=uniteMail, ) UL.EtatInit(uniteMail) RetablirAlarme('CALCULEL5_48') RetablirAlarme('ALGORITH12_43') RetablirAlarme('CALCULEL2_12') RetablirAlarme('CALCULEL5_7') return ier
class MISS_PARAMETER(object): """Stocke les paramètres nécessaires au calcul à partir des mots-clés. """ def __init__(self, initial_dir, **kwargs): """Enregistrement des valeurs des mots-clés. - Comme il n'y a qu'une occurrence de PARAMETRE, cela permet de remonter tous les mots-clés dans un seul dictionnaire. - On peut ajouter des vérifications infaisables dans le capy. - On ajoute des paramètres internes. """ # defauts hors du mot-clé PARAMETRE self._defaults = { '_INIDIR': initial_dir, '_WRKDIR': osp.join(initial_dir, 'tmp_miss3d'), '_NBM_DYN': None, '_NBM_STAT': None, '_exec_Miss': False, 'EXCIT_HARMO': None, 'INST_FIN': None, 'PAS_INST': None, 'FICHIER_SOL_INCI': 'NON', # tâches élémentaires à la demande '_calc_impe': False, '_calc_forc': False, '_hasPC': False, '_nbPC': 0, '_nbfreq': 0, '_auto_first_LT': None, } self._keywords = {} # une seule occurence du mcfact mcfact = kwargs.get('PARAMETRE') if mcfact is not None: mcfact = mcfact[0] self._keywords.update(mcfact.cree_dict_valeurs(mcfact.mc_liste)) # autres mots-clés others = kwargs.keys() others.remove('PARAMETRE') for key in others + self._defaults.keys(): val = kwargs.get(key) if val is None: val = self._defaults.get(key) self._keywords[key] = val if self['REPERTOIRE']: self._keywords['_WRKDIR'] = self['REPERTOIRE'] self.UL = UniteAster() self.check() def __del__(self): """A la destruction.""" self.UL.EtatInit() def check(self): """Vérification des règles impossible à écrire dans le .capy""" # tâches à la demande if self['TYPE_RESU'] in ('HARM_GENE', 'TRAN_GENE', 'TABLE', 'CHARGE'): self.set('_calc_impe', True) self.set('_calc_forc', True) elif self['TYPE_RESU'] in ('FICHIER', 'TABLE_CONTROL'): if self.get('UNITE_RESU_IMPE') is not None: self.set('_calc_impe', True) if self.get('UNITE_RESU_FORC') is not None: self.set('_calc_forc', True) else: if self['EXCIT_SOL'] is not None: self.set('_calc_forc', True) self.set('_hasPC', self.get('GROUP_MA_CONTROL') is not None) # unités logiques if self.get('UNITE_RESU_IMPE') is None: self.set('_exec_Miss', True) self['UNITE_RESU_IMPE'] = self.UL.Libre(action='ASSOCIER') if self.get('UNITE_RESU_FORC') is None: self.set('_exec_Miss', True) self['UNITE_RESU_FORC'] = self.UL.Libre(action='ASSOCIER') # fréquences if self['TYPE_RESU'] not in ('CHARGE'): if self['LIST_FREQ'] is not None \ and self['TYPE_RESU'] not in ('FICHIER', 'HARM_GENE', 'TABLE_CONTROL'): raise aster.error('MISS0_17') # si base modale, vérifier/compléter les amortissements réduits if self['TYPE_RESU'] not in ('CHARGE'): if self['BASE_MODALE']: res = aster.dismoi('NB_MODES_DYN', self['BASE_MODALE'].nom, 'RESULTAT', 'C') ASSERT(res[0] == 0) self['_NBM_DYN'] = res[1] res = aster.dismoi('NB_MODES_STA', self['BASE_MODALE'].nom, 'RESULTAT', 'C') ASSERT(res[0] == 0) self['_NBM_STAT'] = res[1] if self['AMOR_REDUIT']: self.set('AMOR_REDUIT', force_list(self['AMOR_REDUIT'])) nval = len(self['AMOR_REDUIT']) if nval < self['_NBM_DYN']: # complète avec le dernier nadd = self['_NBM_DYN'] - nval self._keywords['AMOR_REDUIT'].extend([ self['AMOR_REDUIT'][-1], ] * nadd) nval = self['_NBM_DYN'] if nval < self['_NBM_DYN'] + self['_NBM_STAT']: # on ajoute 0. self._keywords['AMOR_REDUIT'].append(0.) # la règle ENSEMBLE garantit que les 3 GROUP_MA_xxx sont tous absents # ou tous présents if self['TYPE_RESU'] not in ('CHARGE'): if self['ISSF'] != 'NON': if self['GROUP_MA_FLU_STR'] is None: UTMESS('F', 'MISS0_22') if self['MATER_FLUIDE'] is None: UTMESS('F', 'MISS0_23') def __iter__(self): """Itérateur simple sur le dict des mots-clés""" return iter(self._keywords) def __getitem__(self, key): return self._keywords[key] def __setitem__(self, key, value): ASSERT(self.get(key) is None) self.set(key, value) def set(self, key, value): self._keywords[key] = value def get(self, key): return self._keywords.get(key) def __repr__(self): return pprint.pformat(self._keywords)
def simu_point_mat_ops(self, MATER, INCREMENT, SIGM_IMPOSE, EPSI_IMPOSE, SIGM_INIT, EPSI_INIT, VARI_INIT, NEWTON, CONVERGENCE, MASSIF, ANGLE, COMPORTEMENT, INFO, ARCHIVAGE, SUPPORT, **args): """Simulation de la reponse d'un point materiel""" ier = 0 # La macro compte pour 1 dans la numerotation des commandes self.set_icmd(1) import math # On importe les definitions des commandes a utiliser dans la macro # Le nom de la variable doit etre obligatoirement le nom de la commande AFFE_CARA_ELEM = self.get_cmd('AFFE_CARA_ELEM') AFFE_CHAR_MECA = self.get_cmd('AFFE_CHAR_MECA') AFFE_MATERIAU = self.get_cmd('AFFE_MATERIAU') AFFE_MODELE = self.get_cmd('AFFE_MODELE') CALC_CHAMP = self.get_cmd('CALC_CHAMP') CALC_TABLE = self.get_cmd('CALC_TABLE') CREA_CHAMP = self.get_cmd('CREA_CHAMP') CREA_RESU = self.get_cmd('CREA_RESU') DEFI_FONCTION = self.get_cmd('DEFI_FONCTION') IMPR_TABLE = self.get_cmd('IMPR_TABLE') LIRE_MAILLAGE = self.get_cmd('LIRE_MAILLAGE') MODI_MAILLAGE = self.get_cmd('MODI_MAILLAGE') MODI_REPERE = self.get_cmd('MODI_REPERE') POST_RELEVE_T = self.get_cmd('POST_RELEVE_T') STAT_NON_LINE = self.get_cmd('STAT_NON_LINE') IMPR_RESU = self.get_cmd('IMPR_RESU') from Contrib.calc_point_mat import CALC_POINT_MAT from code_aster.Cata.Syntax import _F from Utilitai.UniteAster import UniteAster from Utilitai.Utmess import UTMESS, MasquerAlarme, RetablirAlarme from Noyau.N_types import is_sequence # alarme de STAT_NON_LINE si les mot-cles de COMPORTEMENT sont renseignes # a tort MasquerAlarme('COMPOR4_70') # -- Tests de cohérence __fonczero = DEFI_FONCTION(NOM_PARA='INST', VALE=(0, 0, 10, 0), PROL_DROITE='CONSTANT', PROL_GAUCHE='CONSTANT') EPS = {} SIG = {} itetra = 0 CMP_EPS = ['EPXX', 'EPYY', 'EPZZ', 'EPXY', 'EPXZ', 'EPYZ'] CMP_SIG = ['SIXX', 'SIYY', 'SIZZ', 'SIXY', 'SIXZ', 'SIYZ'] if COMPORTEMENT: lcomp = COMPORTEMENT.List_F()[0] if SUPPORT != None: if SUPPORT == 'ELEMENT': itetra = 1 if itetra == 0: if lcomp['DEFORMATION'] != 'PETIT': if args.has_key('GRAD_IMPOSE'): if args['GRAD_IMPOSE'] != None: if lcomp['DEFORMATION'] != 'SIMO_MIEHE': UTMESS('F', 'COMPOR2_22', valk=lcomp['DEFORMATION']) itetra = 0 else: itetra = 1 UTMESS('A', 'COMPOR2_1', valk=lcomp['DEFORMATION']) #=============================================================== # cas ou il n'y a pas d'élement fini : appel à CALC_POINT_MAT #=============================================================== if itetra == 0: isig = 0 ieps = 0 igrd = 0 ic1c2 = 0 if SIGM_IMPOSE: SIG = SIGM_IMPOSE[0].cree_dict_valeurs(SIGM_IMPOSE[0].mc_liste) isig = 1 if EPSI_IMPOSE: EPS = EPSI_IMPOSE[0].cree_dict_valeurs(EPSI_IMPOSE[0].mc_liste) ieps = 1 if args.has_key('GRAD_IMPOSE'): if args['GRAD_IMPOSE'] != None: FIJ = args['GRAD_IMPOSE'][0].cree_dict_valeurs( args['GRAD_IMPOSE'][0].mc_liste) igrd = 1 if args.has_key('MATR_C1'): if args['MATR_C1'] != None: ic1c2 = 1 if args.has_key('MATR_C2'): if args['MATR_C2'] != None: ic1c2 = 1 motscles = {} if igrd: for i in FIJ.keys(): motscles[i] = FIJ[i] elif ic1c2: if args.has_key('MATR_C1'): if args['MATR_C1'] != None: motscles['MATR_C1'] = args['MATR_C1'].List_F() if args.has_key('MATR_C2'): if args['MATR_C2'] != None: motscles['MATR_C2'] = args['MATR_C2'].List_F() if args.has_key('VECT_IMPO'): if args['VECT_IMPO'] != None: motscles['VECT_IMPO'] = args['VECT_IMPO'].List_F() else: nbsig = 6 for index in range(nbsig): iks = CMP_SIG[index] ike = CMP_EPS[index] inds = 0 inde = 0 if ieps: if EPS[ike] != None: inde = 1 if isig: if SIG[iks] != None: inds = 1 if inde * inds != 0: UTMESS('F', 'COMPOR2_2', valk=iks) if inde == 1: motscles[ike] = EPS[ike] elif inds == 1: motscles[iks] = SIG[iks] else: motscles[iks] = __fonczero # Etat initial etatinit = 0 if SIGM_INIT != None: motscles['SIGM_INIT'] = SIGM_INIT.List_F() if EPSI_INIT != None: motscles['EPSI_INIT'] = EPSI_INIT.List_F() if VARI_INIT != None: motscles['VARI_INIT'] = VARI_INIT.List_F() if NEWTON != None: motscles['NEWTON'] = NEWTON.List_F() if CONVERGENCE != None: motscles['CONVERGENCE'] = CONVERGENCE.List_F() if MASSIF != None: motscles['MASSIF'] = MASSIF.List_F() if COMPORTEMENT: motscles['COMPORTEMENT'] = COMPORTEMENT.List_F() # -- Deroulement du calcul motscles['INCREMENT'] = INCREMENT.List_F() if args.has_key('FORMAT_TABLE'): if args['FORMAT_TABLE'] != None: motscles['FORMAT_TABLE'] = args['FORMAT_TABLE'] if args.has_key('OPER_TANGENT'): if args['OPER_TANGENT'] != None: motscles['OPER_TANGENT'] = args['OPER_TANGENT'] if args.has_key('NB_VARI_TABLE'): if args['NB_VARI_TABLE'] != None: motscles['NB_VARI_TABLE'] = args['NB_VARI_TABLE'] if ARCHIVAGE: motscles['ARCHIVAGE'] = ARCHIVAGE.List_F() # variables de commande if args.has_key('AFFE_VARC'): if args['AFFE_VARC'] != None: lvarc = args['AFFE_VARC'].List_F() nbvarc = len(lvarc) lmotcle = [] for ivarc in range(nbvarc): dico = {} if (str(lvarc[ivarc]['NOM_VARC']) == 'M_ZIRC'): dico['NOM_VARC'] = 'ALPHPUR' dico['VALE_FONC'] = lvarc[ivarc]['V1'] lmotcle.append(dico) dico = {} dico['NOM_VARC'] = 'ALPHBETA' dico['VALE_FONC'] = lvarc[ivarc]['V2'] lmotcle.append(dico) elif (str(lvarc[ivarc]['NOM_VARC']) == 'M_ACIER'): dico['NOM_VARC'] = 'PFERRITE' dico['VALE_FONC'] = lvarc[ivarc]['V1'] lmotcle.append(dico) dico = {} dico['NOM_VARC'] = 'PPERLITE' dico['VALE_FONC'] = lvarc[ivarc]['V2'] lmotcle.append(dico) dico = {} dico['NOM_VARC'] = 'PBAINITE' dico['VALE_FONC'] = lvarc[ivarc]['V3'] lmotcle.append(dico) dico = {} dico['NOM_VARC'] = 'PMARTENS' dico['VALE_FONC'] = lvarc[ivarc]['V4'] lmotcle.append(dico) else: dico['NOM_VARC'] = lvarc[ivarc]['NOM_VARC'] dico['VALE_FONC'] = lvarc[ivarc]['VALE_FONC'] if str(lvarc[ivarc]['NOM_VARC']) == 'TEMP' or str( lvarc[ivarc]['NOM_VARC']) == 'SECH': dico['VALE_REF'] = lvarc[ivarc]['VALE_REF'] lmotcle.append(dico) motscles['AFFE_VARC'] = lmotcle if lcomp['RELATION'] == 'META_LEMA_ANI': UTMESS('F', 'COMPOR2_91', valk=lcomp['RELATION']) self.DeclareOut('REPONSE', self.sd) Titre = 'CALC_POINT_MAT' if ARCHIVAGE != None: # on ne prend en compte que ARCHIVAGE / LIST_INST if ARCHIVAGE['LIST_INST'] != None: __REP1 = CALC_POINT_MAT(INFO=INFO, MATER=MATER, ANGLE=ANGLE, **motscles) lr8 = ARCHIVAGE['LIST_INST'] lr = lr8.Valeurs() REPONSE = CALC_TABLE( TABLE=__REP1, TITRE=Titre, ACTION=_F(OPERATION='FILTRE', NOM_PARA='INST', VALE=lr, PRECISION=ARCHIVAGE['PRECISION']), ) else: REPONSE = CALC_POINT_MAT(INFO=INFO, MATER=MATER, ANGLE=ANGLE, **motscles) else: REPONSE = CALC_POINT_MAT(INFO=INFO, MATER=MATER, ANGLE=ANGLE, **motscles) #=============================================================== # cas ou on fait le calcul sur un TETRA4 A UN SEUL POINT DE GAUSS #=============================================================== elif itetra == 1: EPS = {} SIG = {} MODELISATION = "3D" if args.has_key('MODELISATION'): if args['MODELISATION'] != None: MODELISATION = args['MODELISATION'] if MODELISATION == "3D": nbsig = 6 CMP_EPS = ['EPXX', 'EPYY', 'EPZZ', 'EPXY', 'EPXZ', 'EPYZ'] CMP_SIG = ['SIXX', 'SIYY', 'SIZZ', 'SIXY', 'SIXZ', 'SIYZ'] else: nbsig = 3 CMP_EPS = ['EPXX', 'EPYY', 'EPXY'] CMP_SIG = ['SIXX', 'SIYY', 'SIXY'] if SIGM_IMPOSE: SIG = SIGM_IMPOSE[0].cree_dict_valeurs(SIGM_IMPOSE[0].mc_liste) for i in SIG.keys(): if SIG[i] == None: SIG[i] = __fonczero else: for i in range(nbsig): SIG[CMP_SIG[i]] = __fonczero if EPSI_IMPOSE: EPS = EPSI_IMPOSE[0].cree_dict_valeurs(EPSI_IMPOSE[0].mc_liste) else: for i in range(nbsig): EPS[CMP_EPS[i]] = None for index in range(nbsig): iks = CMP_SIG[index] ike = CMP_EPS[index] if EPS[ike] != None and SIG[iks] != __fonczero: UTMESS('F', 'COMPOR2_3', valk=str(iks) + ' ' + str(ike)) # -- Definition du maillage if MODELISATION == "3D": texte_ma = """ COOR_3D P0 0.0 0.0 0.0 P1 1.0 0.0 0.0 P2 0.0 1.0 0.0 P3 0.0 0.0 1.0 FINSF TRIA3 F1 P0 P3 P2 F2 P0 P1 P3 F3 P0 P2 P1 F4 P1 P2 P3 FINSF TETRA4 VOLUME = P0 P1 P2 P3 FINSF GROUP_MA TOUT VOLUME FINSF GROUP_NO TOUT P1 P2 P0 P3 FINSF FIN """ else: texte_ma = """ COOR_2D P0 0.0 0.0 P1 1.0 0.0 P2 0.0 1.0 FINSF SEG2 S1 P2 P0 S2 P0 P1 S3 P1 P2 FINSF TRIA3 VOLUME = P0 P1 P2 FINSF GROUP_MA TOUT VOLUME FINSF GROUP_NO TOUT P1 P2 P0 FINSF FIN """ fi_mail = open('simu.mail', 'w') fi_mail.write(texte_ma) fi_mail.close() UL = UniteAster() umail = UL.Libre(action='ASSOCIER', nom='simu.mail') __MA = LIRE_MAILLAGE(FORMAT='ASTER', UNITE=umail) UL.EtatInit() if MODELISATION == "3D": __MO = AFFE_MODELE(MAILLAGE=__MA, AFFE=_F( MAILLE=('VOLUME', 'F1', 'F2', 'F3', 'F4'), PHENOMENE='MECANIQUE', MODELISATION='3D', )) # ANGLE : rotation de ANGLE autour de Z uniquement, et seulement pour les déformations # imposées. if ANGLE != 0.: __MA = MODI_MAILLAGE( reuse=__MA, MAILLAGE=__MA, ROTATION=_F(POIN_1=(0., 0.), ANGLE=ANGLE), ) c = math.cos(ANGLE * math.pi / 180.) s = math.sin(ANGLE * math.pi / 180.) __C_RIGIDE = AFFE_CHAR_MECA( MODELE=__MO, DDL_IMPO=_F(NOEUD='P0', DX=0, DY=0., DZ=0.), LIAISON_DDL=( _F(NOEUD=('P1', 'P1', 'P2', 'P2'), DDL=('DX', 'DY', 'DX', 'DY'), COEF_MULT=(s, -c, c, s), COEF_IMPO=0), _F(NOEUD=('P1', 'P3', 'P3'), DDL=('DZ', 'DX', 'DY'), COEF_MULT=(-1.0, c, s), COEF_IMPO=0), _F(NOEUD=('P2', 'P3', 'P3'), DDL=('DZ', 'DX', 'DY'), COEF_MULT=(-1.0, -s, c), COEF_IMPO=0), ), ) else: # -- Mouvement de corps rigide __C_RIGIDE = AFFE_CHAR_MECA(MODELE=__MO, DDL_IMPO=_F(NOEUD='P0', DX=0, DY=0, DZ=0), LIAISON_DDL=( _F(NOEUD=('P2', 'P1'), DDL=('DX', 'DY'), COEF_MULT=(1, -1), COEF_IMPO=0), _F(NOEUD=('P3', 'P1'), DDL=('DX', 'DZ'), COEF_MULT=(1, -1), COEF_IMPO=0), _F(NOEUD=('P3', 'P2'), DDL=('DY', 'DZ'), COEF_MULT=(1, -1), COEF_IMPO=0), )) else: # MODELISATION 2D __MO = AFFE_MODELE(MAILLAGE=__MA, AFFE=_F(MAILLE=('VOLUME', 'S1', 'S2', 'S3'), PHENOMENE='MECANIQUE', MODELISATION=MODELISATION)) # ANGLE : rotation de ANGLE autour de Z uniquement, et seulement pour les déformations # imposées. if ANGLE != 0.: __MA = MODI_MAILLAGE( reuse=__MA, MAILLAGE=__MA, ROTATION=_F(POIN_1=(0., 0.), ANGLE=ANGLE), ) c = math.cos(ANGLE * math.pi / 180.) s = math.sin(ANGLE * math.pi / 180.) __C_RIGIDE = AFFE_CHAR_MECA( MODELE=__MO, DDL_IMPO=_F(NOEUD='P0', DX=0, DY=0.), LIAISON_DDL=(_F(NOEUD=('P1', 'P1', 'P2', 'P2'), DDL=('DX', 'DY', 'DX', 'DY'), COEF_MULT=(s, -c, c, s), COEF_IMPO=0), ), ) else: __C_RIGIDE = AFFE_CHAR_MECA(MODELE=__MO, DDL_IMPO=_F(NOEUD='P0', DX=0, DY=0), LIAISON_DDL=(_F(NOEUD=('P2', 'P1'), DDL=('DX', 'DY'), COEF_MULT=(1, -1), COEF_IMPO=0), )) # --MASSIF : orientation du materiau (monocristal, orthotropie) if MASSIF: ANGMAS = MASSIF[0].cree_dict_valeurs(MASSIF[0].mc_liste) if ANGMAS["ANGL_REP"] == None: __CARA = AFFE_CARA_ELEM( MODELE=__MO, MASSIF=_F(MAILLE='VOLUME', ANGL_EULER=ANGMAS["ANGL_EULER"]), ) else: __CARA = AFFE_CARA_ELEM( MODELE=__MO, MASSIF=_F(MAILLE='VOLUME', ANGL_REP=ANGMAS["ANGL_REP"]), ) # -- Chargement en deformation __E = [None] * nbsig __E[0] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P1', DX=1, ANGL_NAUT=ANGLE)) __E[1] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P2', DY=1, ANGL_NAUT=ANGLE)) if MODELISATION == "3D": __E[2] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P3', DZ=1, ANGL_NAUT=ANGLE)) __E[3] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P1', DY=1, ANGL_NAUT=ANGLE)) __E[4] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P1', DZ=1, ANGL_NAUT=ANGLE)) __E[5] = AFFE_CHAR_MECA(MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P2', DZ=1, ANGL_NAUT=ANGLE)) else: c = math.cos(ANGLE * math.pi / 180.) s = math.sin(ANGLE * math.pi / 180.) __E[2] = AFFE_CHAR_MECA( MODELE=__MO, LIAISON_OBLIQUE=_F(NOEUD='P1', DY=1, ANGL_NAUT=ANGLE), ) # -- Chargement en contrainte __S = [None] * nbsig if MODELISATION == "3D": r33 = 3**-0.5 __S[0] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F1', FX=-1), _F(MAILLE='F4', FX=r33), )) __S[1] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F2', FY=-1), _F(MAILLE='F4', FY=r33), )) __S[2] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F3', FZ=-1), _F(MAILLE='F4', FZ=r33), )) __S[3] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F1', FY=-1), _F(MAILLE='F2', FX=-1), _F(MAILLE='F4', FX=r33, FY=r33), )) __S[4] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F1', FZ=-1), _F(MAILLE='F3', FX=-1), _F(MAILLE='F4', FX=r33, FZ=r33), )) __S[5] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_FACE=( _F(MAILLE='F2', FZ=-1), _F(MAILLE='F3', FY=-1), _F(MAILLE='F4', FY=r33, FZ=r33), )) else: r22 = 2**-0.5 __S[0] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_CONTOUR=( _F(MAILLE='S1', FX=-1), _F(MAILLE='S3', FX=r22), )) __S[1] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_CONTOUR=( _F(MAILLE='S2', FY=-1), _F(MAILLE='S3', FY=r22), )) __S[2] = AFFE_CHAR_MECA(MODELE=__MO, FORCE_CONTOUR=( _F(MAILLE='S1', FY=-1), _F(MAILLE='S2', FX=-1), _F(MAILLE='S3', FX=r22, FY=r22), )) # -- Construction de la charge l_char = [_F(CHARGE=__C_RIGIDE)] for i in xrange(nbsig): ike = CMP_EPS[i] if EPS[ike]: l_char.append(_F(CHARGE=__E[i], FONC_MULT=EPS[ike])) for i in xrange(nbsig): iks = CMP_SIG[i] l_char.append(_F(CHARGE=__S[i], FONC_MULT=SIG[iks])) # variables de commande mcvarc = [] if args.has_key('AFFE_VARC'): if args['AFFE_VARC'] != None: lvarc = args['AFFE_VARC'].List_F() nbvarc = len(lvarc) for ivarc in range(nbvarc): dico = {} if (str(lvarc[ivarc]['NOM_VARC']) == 'SECH'): typech = 'NOEU_TEMP_R' labsc = lvarc[ivarc]['VALE_FONC'].Absc() lordo = lvarc[ivarc]['VALE_FONC'].Ordo() l_affe_cham = [] __CHV = [None] * len(labsc) for it, time in enumerate(labsc): __CHV[it] = CREA_CHAMP( TYPE_CHAM=typech, OPERATION='AFFE', MAILLAGE=__MA, AFFE=_F( MAILLE='VOLUME', NOM_CMP='TEMP', VALE=lordo[it], ), ), dicoch = {} dicoch["CHAM_GD"] = __CHV[it] dicoch["INST"] = time l_affe_cham.append(dicoch) __EVOV = CREA_RESU(OPERATION='AFFE', TYPE_RESU='EVOL_VARC', NOM_CHAM='TEMP', AFFE=l_affe_cham) elif (str(lvarc[ivarc]['NOM_VARC']) == 'M_ZIRC'): typech = 'ELNO_NEUT_R' labsc = lvarc[ivarc]['V1'].Absc() lordo1 = lvarc[ivarc]['V1'].Ordo() lordo2 = lvarc[ivarc]['V2'].Ordo() lordo3 = lvarc[ivarc]['V3'].Ordo() lordo4 = lvarc[ivarc]['V4'].Ordo() l_affe_cham = [] __CHV = [None] * len(labsc) __CHN = [None] * len(labsc) for it, time in enumerate(labsc): __CHN[it] = CREA_CHAMP( TYPE_CHAM=typech, OPERATION='AFFE', PROL_ZERO='OUI', MODELE=__MO, AFFE=( _F( MAILLE='VOLUME', NOM_CMP='X1', VALE=lordo1[it], ), _F( MAILLE='VOLUME', NOM_CMP='X2', VALE=lordo2[it], ), _F( MAILLE='VOLUME', NOM_CMP='X3', VALE=lordo3[it], ), _F( MAILLE='VOLUME', NOM_CMP='X4', VALE=lordo4[it], ), ), ), dicoch = {} __CHV[it] = CREA_CHAMP(OPERATION='ASSE', TYPE_CHAM='ELNO_VARI_R', MODELE=__MO, PROL_ZERO='OUI', ASSE=( _F(CHAM_GD=__CHN[it], NOM_CMP='X1', NOM_CMP_RESU='V1', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X2', NOM_CMP_RESU='V2', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X3', NOM_CMP_RESU='V3', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X4', NOM_CMP_RESU='V4', GROUP_MA='TOUT'), )) dicoch["CHAM_GD"] = __CHV[it] dicoch["INST"] = time l_affe_cham.append(dicoch) __EVOV = CREA_RESU(OPERATION='AFFE', TYPE_RESU='EVOL_THER', NOM_CHAM=str('META_ELNO'), AFFE=l_affe_cham) IMPR_RESU(FORMAT='RESULTAT', RESU=_F(RESULTAT=__EVOV)) elif (str(lvarc[ivarc]['NOM_VARC']) == 'M_ACIER'): typech = 'ELNO_NEUT_R' labsc = lvarc[ivarc]['V1'].Absc() lordo1 = lvarc[ivarc]['V1'].Ordo() lordo2 = lvarc[ivarc]['V2'].Ordo() lordo3 = lvarc[ivarc]['V3'].Ordo() lordo4 = lvarc[ivarc]['V4'].Ordo() lordo5 = lvarc[ivarc]['V5'].Ordo() lordo6 = lvarc[ivarc]['V6'].Ordo() lordo7 = lvarc[ivarc]['V7'].Ordo() l_affe_cham = [] __CHV = [None] * len(labsc) __CHN = [None] * len(labsc) for it, time in enumerate(labsc): __CHN[it] = CREA_CHAMP( TYPE_CHAM=typech, OPERATION='AFFE', PROL_ZERO='OUI', MODELE=__MO, AFFE=( _F( MAILLE='VOLUME', NOM_CMP='X1', VALE=lordo1[it], ), _F( MAILLE='VOLUME', NOM_CMP='X2', VALE=lordo2[it], ), _F( MAILLE='VOLUME', NOM_CMP='X3', VALE=lordo3[it], ), _F( MAILLE='VOLUME', NOM_CMP='X4', VALE=lordo4[it], ), _F( MAILLE='VOLUME', NOM_CMP='X5', VALE=lordo5[it], ), _F( MAILLE='VOLUME', NOM_CMP='X6', VALE=lordo6[it], ), _F( MAILLE='VOLUME', NOM_CMP='X7', VALE=lordo7[it], ), ), ), dicoch = {} __CHV[it] = CREA_CHAMP(OPERATION='ASSE', TYPE_CHAM='ELNO_VARI_R', MODELE=__MO, PROL_ZERO='OUI', ASSE=( _F(CHAM_GD=__CHN[it], NOM_CMP='X1', NOM_CMP_RESU='V1', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X2', NOM_CMP_RESU='V2', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X3', NOM_CMP_RESU='V3', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X4', NOM_CMP_RESU='V4', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X5', NOM_CMP_RESU='V5', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X6', NOM_CMP_RESU='V6', GROUP_MA='TOUT'), _F(CHAM_GD=__CHN[it], NOM_CMP='X7', NOM_CMP_RESU='V7', GROUP_MA='TOUT'), )) dicoch["CHAM_GD"] = __CHV[it] dicoch["INST"] = time l_affe_cham.append(dicoch) __EVOV = CREA_RESU(OPERATION='AFFE', TYPE_RESU='EVOL_THER', NOM_CHAM=str('META_ELNO'), AFFE=l_affe_cham) IMPR_RESU(FORMAT='RESULTAT', RESU=_F(RESULTAT=__EVOV)) else: typech = 'NOEU_' + str(lvarc[ivarc]['NOM_VARC']) + '_R' labsc = lvarc[ivarc]['VALE_FONC'].Absc() lordo = lvarc[ivarc]['VALE_FONC'].Ordo() l_affe_cham = [] __CHV = [None] * len(labsc) for it, time in enumerate(labsc): __CHV[it] = CREA_CHAMP( TYPE_CHAM=typech, OPERATION='AFFE', MAILLAGE=__MA, AFFE=_F( MAILLE='VOLUME', NOM_CMP=lvarc[ivarc]['NOM_VARC'], VALE=lordo[it], ), ), dicoch = {} dicoch["CHAM_GD"] = __CHV[it] dicoch["INST"] = time l_affe_cham.append(dicoch) __EVOV = CREA_RESU(OPERATION='AFFE', TYPE_RESU='EVOL_VARC', NOM_CHAM=str( lvarc[ivarc]['NOM_VARC']), AFFE=l_affe_cham) dico["MAILLE"] = 'VOLUME' dico["EVOL"] = __EVOV if (str(lvarc[ivarc]['NOM_VARC']) == 'M_ZIRC'): dico["NOM_VARC"] = "M_ZIRC" elif (str(lvarc[ivarc]['NOM_VARC']) == 'M_ACIER'): dico["NOM_VARC"] = "M_ACIER" else: dico["NOM_VARC"] = lvarc[ivarc]['NOM_VARC'] if lvarc[ivarc]['VALE_REF'] != None: dico["VALE_REF"] = lvarc[ivarc]['VALE_REF'] mcvarc.append(dico) # -- Materiau et modele if len(mcvarc) > 0: __CHMAT = AFFE_MATERIAU( MAILLAGE=__MA, AFFE=_F(MAILLE='VOLUME', MATER=MATER), AFFE_VARC=mcvarc, ) else: __CHMAT = AFFE_MATERIAU(MAILLAGE=__MA, AFFE=_F(MAILLE='VOLUME', MATER=MATER)) # Etat initial SIGINI = {} VARINI = {} LCSIG = [] LVSIG = [] init_dico = {} etatinit = 0 # --contraintes initiales if SIGM_INIT: etatinit = 1 SIGINI = SIGM_INIT[0].cree_dict_valeurs(SIGM_INIT[0].mc_liste) for i in SIGINI.keys(): if SIGINI[i] != None: LCSIG.append(i) LVSIG.append(SIGINI[i]) __SIG_INIT = CREA_CHAMP(MAILLAGE=__MA, OPERATION='AFFE', TYPE_CHAM='CART_SIEF_R', AFFE=_F( TOUT='OUI', NOM_CMP=LCSIG, VALE=LVSIG, )) init_dico['SIGM'] = __SIG_INIT # --variables internes initiales if VARI_INIT: etatinit = 1 lnomneu = [] lnomvar = [] VARINI = VARI_INIT[0].cree_dict_valeurs(VARI_INIT[0].mc_liste) if (not is_sequence(VARINI['VALE'])): VARINI['VALE'] = [ VARINI['VALE'], ] nbvari = len(VARINI['VALE']) for i in range(nbvari): lnomneu.append('X' + str(i + 1)) lnomvar.append('V' + str(i + 1)) __NEUT = CREA_CHAMP(OPERATION='AFFE', TYPE_CHAM='CART_N480_R', MAILLAGE=__MA, AFFE=_F(MAILLE='VOLUME', NOM_CMP=lnomneu, VALE=VARINI['VALE'])) __VAR_INIT = CREA_CHAMP(MODELE=__MO, OPERATION='ASSE', TYPE_CHAM='ELGA_VARI_R', ASSE=_F(TOUT='OUI', CHAM_GD=__NEUT, NOM_CMP=lnomneu, NOM_CMP_RESU=lnomvar)) init_dico['VARI'] = __VAR_INIT # --deformations initiales if EPSI_INIT: etatinit = 1 EPSINI = {} LCDEPL = [] LNDEPL = [] LVDEPL = [] LIST_AFFE = [] mon_dico = {} mon_dico["NOEUD"] = 'P0' mon_dico["NOM_CMP"] = ("DX", "DY", "DZ") mon_dico["VALE"] = (0., 0., 0.) LIST_AFFE.append(mon_dico) EPSINI = EPSI_INIT[0].cree_dict_valeurs(EPSI_INIT[0].mc_liste) mon_dico = {} mon_dico["NOEUD"] = 'P1' mon_dico["NOM_CMP"] = 'DX' mon_dico["VALE"] = EPSINI['EPXX'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P2' mon_dico["NOM_CMP"] = 'DY' mon_dico["VALE"] = EPSINI['EPYY'] LIST_AFFE.append(mon_dico) if MODELISATION == "3D": mon_dico = {} mon_dico["NOEUD"] = 'P3' mon_dico["NOM_CMP"] = 'DZ' mon_dico["VALE"] = EPSINI['EPZZ'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P1' mon_dico["NOM_CMP"] = 'DY' mon_dico["VALE"] = EPSINI['EPXY'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P2' mon_dico["NOM_CMP"] = 'DX' mon_dico["VALE"] = EPSINI['EPXY'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P1' mon_dico["NOM_CMP"] = 'DZ' mon_dico["VALE"] = EPSINI['EPXZ'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P3' mon_dico["NOM_CMP"] = 'DX' mon_dico["VALE"] = EPSINI['EPXZ'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P2' mon_dico["NOM_CMP"] = 'DZ' mon_dico["VALE"] = EPSINI['EPYZ'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P3' mon_dico["NOM_CMP"] = 'DY' mon_dico["VALE"] = EPSINI['EPYZ'] LIST_AFFE.append(mon_dico) else: mon_dico = {} mon_dico["NOEUD"] = 'P1', mon_dico["NOM_CMP"] = 'DY' mon_dico["VALE"] = EPSINI['EPXY'] LIST_AFFE.append(mon_dico) mon_dico = {} mon_dico["NOEUD"] = 'P2' mon_dico["NOM_CMP"] = 'DX' mon_dico["VALE"] = EPSINI['EPXY'] LIST_AFFE.append(mon_dico) __DEP_INI = CREA_CHAMP(MAILLAGE=__MA, OPERATION='AFFE', TYPE_CHAM='NOEU_DEPL_R', AFFE=LIST_AFFE) init_dico['DEPL'] = __DEP_INI # -- Deroulement du calcul motscles = {} if COMPORTEMENT: motscles['COMPORTEMENT'] = COMPORTEMENT.List_F() if lcomp['RELATION'] == 'META_LEMA_ANI': UTMESS('A', 'COMPOR2_92', valk=lcomp['RELATION']) motscles['CONVERGENCE'] = CONVERGENCE.List_F() motscles['NEWTON'] = NEWTON.List_F() if args.has_key('RECH_LINEAIRE'): if args['RECH_LINEAIRE'] != None: motscles['RECH_LINEAIRE'] = args['RECH_LINEAIRE'].List_F() motscles['INCREMENT'] = INCREMENT.List_F() if ARCHIVAGE: motscles['ARCHIVAGE'] = ARCHIVAGE.List_F() if args.has_key('SUIVI_DDL'): if args['SUIVI_DDL'] != None: motscles['SUIVI_DDL'] = args['SUIVI_DDL'].List_F() if etatinit == 1: if MASSIF: __EVOL1 = STAT_NON_LINE(INFO=INFO, CARA_ELEM=__CARA, MODELE=__MO, CHAM_MATER=__CHMAT, ETAT_INIT=init_dico, EXCIT=l_char, **motscles) else: __EVOL1 = STAT_NON_LINE(INFO=INFO, MODELE=__MO, CHAM_MATER=__CHMAT, ETAT_INIT=init_dico, EXCIT=l_char, **motscles) else: if MASSIF: __EVOL1 = STAT_NON_LINE(INFO=INFO, MODELE=__MO, CARA_ELEM=__CARA, CHAM_MATER=__CHMAT, EXCIT=l_char, **motscles) else: __EVOL1 = STAT_NON_LINE(INFO=INFO, MODELE=__MO, CHAM_MATER=__CHMAT, EXCIT=l_char, **motscles) if lcomp['DEFORMATION'] != 'PETIT': nomepsi = 'EPSG_ELNO' else: nomepsi = 'EPSI_ELNO' __EVOL1 = CALC_CHAMP( reuse=__EVOL1, RESULTAT=__EVOL1, CONTRAINTE='SIGM_ELNO', DEFORMATION=nomepsi, VARI_INTERNE='VARI_ELNO', ) if MODELISATION == "3D": angles = (ANGLE, 0, 0) __EVOL = MODI_REPERE( RESULTAT=__EVOL1, MODI_CHAM=( _F( NOM_CHAM='DEPL', NOM_CMP=('DX', 'DY', 'DZ'), TYPE_CHAM='VECT_3D', ), _F( NOM_CHAM='SIGM_ELNO', NOM_CMP=('SIXX', 'SIYY', 'SIZZ', 'SIXY', 'SIXZ', 'SIYZ'), TYPE_CHAM='TENS_3D', ), _F( NOM_CHAM=nomepsi, NOM_CMP=('EPXX', 'EPYY', 'EPZZ', 'EPXY', 'EPXZ', 'EPYZ'), TYPE_CHAM='TENS_3D', ), ), REPERE='UTILISATEUR', AFFE=_F(ANGL_NAUT=angles), ) else: angles = ANGLE __EVOL = MODI_REPERE( RESULTAT=__EVOL1, MODI_CHAM=( _F( NOM_CHAM='DEPL', NOM_CMP=('DX', 'DY'), TYPE_CHAM='VECT_2D', ), _F( NOM_CHAM='SIGM_ELNO', NOM_CMP=('SIXX', 'SIYY', 'SIZZ', 'SIXY'), TYPE_CHAM='TENS_2D', ), _F( NOM_CHAM=nomepsi, NOM_CMP=('EPXX', 'EPYY', 'EPZZ', 'EPXY'), TYPE_CHAM='TENS_2D', ), ), REPERE='UTILISATEUR', AFFE=_F(ANGL_NAUT=angles), ) # -- Recuperation des courbes __REP_VARI = POST_RELEVE_T(ACTION=(_F(INTITULE='VARI_INT', RESULTAT=__EVOL1, NOM_CHAM='VARI_ELNO', TOUT_CMP='OUI', OPERATION='EXTRACTION', NOEUD='P0'), )) __REP_EPSI = POST_RELEVE_T(ACTION=(_F(INTITULE='EPSILON', RESULTAT=__EVOL, NOM_CHAM=nomepsi, TOUT_CMP='OUI', OPERATION='EXTRACTION', NOEUD='P0'), )) __REP_SIGM = POST_RELEVE_T(ACTION=(_F(INTITULE='SIGMA', RESULTAT=__EVOL, NOM_CHAM='SIGM_ELNO', TOUT_CMP='OUI', OPERATION='EXTRACTION', NOEUD='P0'), )) __REP_INV = POST_RELEVE_T(ACTION=(_F(INTITULE='INV', RESULTAT=__EVOL, NOM_CHAM='SIGM_ELNO', INVARIANT='OUI', OPERATION='EXTRACTION', NOEUD='P0'), )) __REP_INV = CALC_TABLE(TABLE=__REP_INV, reuse=__REP_INV, ACTION=_F( OPERATION='EXTR', NOM_PARA=('INST', 'TRACE', 'VMIS'), )) self.DeclareOut('REPONSE', self.sd) REPONSE = CALC_TABLE(TABLE=__REP_EPSI, TITRE='TABLE ', ACTION=( _F( OPERATION='COMB', TABLE=__REP_SIGM, NOM_PARA=('INST'), ), _F( OPERATION='COMB', TABLE=__REP_INV, NOM_PARA=('INST'), ), _F( OPERATION='COMB', TABLE=__REP_VARI, NOM_PARA=('INST'), ), )) RetablirAlarme('COMPOR4_70') return ier