import sys sys.path.append('/opt/aster/13.6/lib/aster/Utilitai/') from Utilitai import partition from Utilitai import Table import numpy as N import math evalue =[] nlimit = 30 DEBUT(DEBUG=_F(SDVERI='OUI'), PAR_LOT='NON', ) mesh2 = LIRE_MAILLAGE(FORMAT='MED', UNITE=20) model2 = AFFE_MODELE(AFFE=_F(GROUP_MA=('web', 'top'), MODELISATION=('DKT', ), PHENOMENE='MECANIQUE'), MAILLAGE=mesh2) carac2 = AFFE_CARA_ELEM(COQUE=(_F(EPAIS=10.0, GROUP_MA=('top', )), _F(EPAIS=0.2, GROUP_MA=('web', ))), MODELE=model2) steel = DEFI_MATERIAU(ELAS=_F(E=210000.0, NU=0.3)) fieldma2 = AFFE_MATERIAU(AFFE=_F(MATER=(steel, ), TOUT='OUI'), MAILLAGE=mesh2) list0 = DEFI_LIST_REEL(DEBUT=0.0, INTERVALLE=_F(JUSQU_A=0.3, NOMBRE=nlimit)) func = DEFI_FONCTION(NOM_PARA='INST', VALE=(0.0, 0.0, 1.0, 1.0)) list = DEFI_LIST_INST(DEFI_LIST=_F(LIST_INST=list0), ECHEC=_F(ACTION='CONTINUE', EVENEMENT='INSTABILITE')) clim2 = AFFE_CHAR_MECA(DDL_IMPO=_F(DRX=0.0, DRY=0.0, DRZ=0.0, DX=0.0, DY=0.0, DZ=0.0, GROUP_NO=('fix', )), MODELE=model2) charge_2 = AFFE_CHAR_MECA(FORCE_NODALE=_F(FZ=-98.01, GROUP_NO=('load', )), MODELE=model2) resu = STAT_NON_LINE( MODELE=model2, CHAM_MATER=fieldma2, CARA_ELEM=carac2, CONVERGENCE=_F(ITER_GLOB_ELAS=25, ITER_GLOB_MAXI=20), # CRIT_STAB=_F(NB_FREQ=1), EXCIT=(_F(CHARGE=clim2, TYPE_CHARGE='FIXE_CSTE'), _F(CHARGE=charge_2, FONC_MULT=func)), COMPORTEMENT=_F(RELATION='ELAS', DEFORMATION='PETIT', ), INCREMENT=_F(LIST_INST=list0, NUME_INST_INIT=0, NUME_INST_FIN=1), METHODE='NEWTON', NEWTON=_F(MATRICE='TANGENTE', REAC_INCR=1, REAC_ITER=10)) ii = 1 FLAG = True while FLAG: resu = STAT_NON_LINE( reuse = resu, MODELE=model2, CHAM_MATER=fieldma2, CARA_ELEM=carac2, CONVERGENCE=_F(ITER_GLOB_ELAS=25, ITER_GLOB_MAXI=20), CRIT_STAB=_F(CHAR_CRIT=(-1., 0.), ), EXCIT=(_F(CHARGE=clim2, TYPE_CHARGE='FIXE_CSTE'), _F(CHARGE=charge_2, FONC_MULT=func)), COMPORTEMENT=_F(RELATION='ELAS', DEFORMATION='PETIT', ), INCREMENT=_F(LIST_INST=list0, NUME_INST_INIT=ii, NUME_INST_FIN=ii+1), ETAT_INIT=_F( EVOL_NOLI = resu), METHODE='NEWTON', NEWTON=_F(MATRICE='TANGENTE', REAC_INCR=1, REAC_ITER=10) ) ccc = resu.LIST_CHAMPS()['MODE_FLAMB'] if len(ccc) > 0: FLAG=False if ii >= nlimit: FLAG=False else: ii = ii+1 aaa = resu.LIST_VARI_ACCES()['INST'] print aaa bbb = resu.LIST_CHAMPS()['DEPL'] print bbb print ccc IMPR_RESU(FORMAT='MED', RESU=_F(RESULTAT=resu, TOUT='OUI'), UNITE=80) defo =CREA_CHAMP(TYPE_CHAM='NOEU_DEPL_R', OPERATION='EXTR', RESULTAT=resu, NOM_CHAM='DEPL', INST= aaa[ccc[0]],); mesh2 =MODI_MAILLAGE(reuse =mesh2, MAILLAGE=mesh2, DEFORME=_F(OPTION='TRAN', DEPL=defo,),); resuSI = CREA_CHAMP(NOM_CHAM='SIEF_ELGA', OPERATION='EXTR', RESULTAT=resu, INST= aaa[ccc[0]], TYPE_CHAM='ELGA_SIEF_R') Smesh = CALC_MATR_ELEM(CARA_ELEM=carac2, CHAM_MATER=fieldma2, CHARGE=(clim2, charge_2), MODELE=model2, OPTION='RIGI_MECA') NUMEDDL = NUME_DDL(MATR_RIGI=(Smesh, )) SAmech = ASSE_MATRICE(MATR_ELEM=Smesh, NUME_DDL=NUMEDDL) Sgeom = CALC_MATR_ELEM(CARA_ELEM=carac2, CHAM_MATER=fieldma2, MODELE=model2, OPTION='RIGI_GEOM', SIEF_ELGA=resuSI) SAgeom = ASSE_MATRICE(MATR_ELEM=Sgeom, NUME_DDL=NUMEDDL) resum = CALC_MODES(CALC_CHAR_CRIT=_F(CHAR_CRIT=(-1.1, 0.0)), MATR_RIGI=SAmech, MATR_RIGI_GEOM=SAgeom, OPTION='BANDE', SOLVEUR_MODAL=_F(), TYPE_RESU='MODE_FLAMB', VERI_MODE=_F(STOP_ERREUR='NON')) IMPR_RESU(FORMAT='MED', RESU=_F(RESULTAT=resum, TOUT='OUI'), UNITE=81) FIN()