DEBUT(LANG='FR')

mesh0 = LIRE_MAILLAGE(FORMAT='MED',
                      UNITE=20)

model = AFFE_MODELE(AFFE=_F(MODELISATION=('3D', ),
                            PHENOMENE='MECANIQUE',
                            TOUT='OUI'),
                    MAILLAGE=mesh0)

mater = DEFI_MATERIAU(ELAS=_F(E=195000.0,
                              NU=0.3,
                              RHO=7.8e-09))

fieldmat = AFFE_MATERIAU(AFFE=_F(MATER=(mater, ),
                                 TOUT='OUI'),
                         MAILLAGE=mesh0,
                         MODELE=model)

listr = DEFI_LIST_REEL(DEBUT=0.0,
                       INTERVALLE=_F(JUSQU_A=100.0,
                                     PAS=0.01))

func0 = DEFI_FONCTION(NOM_PARA='INST',
                      VALE=(0.0, 0.0, 14.99, 0.0, 15.0, 1.0, 15.01, 0.0, 100.0, 0.0))

func = DEFI_FONCTION(NOM_PARA='INST',
                     VALE=(0.0, 0.0, 5.0, 1.0, 100.0, 1.0))

load = AFFE_CHAR_MECA(DDL_IMPO=(_F(DX=0.0,
                                   DY=0.0,
                                   GROUP_MA=('hippari', )),
                                _F(DX=0.0,
                                   DY=0.0,
                                   DZ=0.0,
                                   GROUP_MA=('kotei', ))),
                      MODELE=model)

load0 = AFFE_CHAR_MECA(FORCE_ARETE=_F(FY=212.2065908,
                                      GROUP_MA=('saika', )),
                       MODELE=model)

load1 = AFFE_CHAR_MECA(FORCE_FACE=_F(FZ=181.082957,
                                     GROUP_MA=('hippari', )),
                       MODELE=model)

ASSEMBLAGE(CHAM_MATER=fieldmat,
           CHARGE=(load, ),
           MATR_ASSE=(_F(MATRICE=CO('mass'),
                         OPTION='MASS_MECA'),
                      _F(MATRICE=CO('stifness'),
                         OPTION='RIGI_MECA')),
           MODELE=model,
           NUME_DDL=CO('nddl'))

resharm = DYNA_VIBRA(BASE_CALCUL='PHYS',
                     CHAM_MATER=fieldmat,
                     EXCIT=(_F(CHARGE=load),
                            _F(CHARGE=load1,
                               FONC_MULT=func),
                            _F(CHARGE=load0,
                               FONC_MULT=func0)),
                     INCREMENT=_F(LIST_INST=listr),
                     MATR_MASS=mass,
                     MATR_RIGI=stifness,
                     MODELE=model,
                     SCHEMA_TEMPS=_F(BETA=0.25,
                                     GAMMA=0.5,
                                     SCHEMA='NEWMARK'),
                     SOLVEUR=_F(METHODE='MUMPS',
                                NPREC=8),
                     TYPE_CALCUL='TRAN')

IMPR_RESU(FORMAT='MED',
          RESU=(_F(NOM_CHAM=('DEPL', ),
                   RESULTAT=resharm),
                _F(GROUP_NO=('ten9', 'ten1', 'ten2', 'ten3', 'ten4', 'ten5', 'ten6', 'ten7', 'ten8'),
                   NOM_CHAM=('VITE', ),
                   RESULTAT=resharm),
                _F(GROUP_NO=('ten9', 'ten1', 'ten2', 'ten3', 'ten4', 'ten5', 'ten6', 'ten7', 'ten8'),
                   NOM_CHAM=('ACCE', ),
                   RESULTAT=resharm)),
          UNITE=80)

FIN()
