DEBUT(LANG='FR')

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

#comment: mesh1 = LIRE_MAILLAGE(FORMAT='MED',
#comment:                       UNITE=20)

#comment: mesh2 = LIRE_MAILLAGE(FORMAT='MED',
#comment:                       UNITE=3)

model = AFFE_MODELE(AFFE=(_F(GROUP_MA=('beam', ),
                             MODELISATION=('POU_D_E', ),
                             PHENOMENE='MECANIQUE'),
                          _F(GROUP_MA=('cable', ),
                             MODELISATION=('POU_D_E', ),
                             PHENOMENE='MECANIQUE'),
                          _F(GROUP_MA=('hinge', ),
                             MODELISATION=('DIS_TR', ),
                             PHENOMENE='MECANIQUE')),
                    MAILLAGE=mesh0)

#comment: fiber = DEFI_GEOM_FIBRE(SECTION=_F(COOR_AXE_POUTRE=(0.0, 0.0),
#comment:                                    GROUP_FIBRE='kesec',
#comment:                                    GROUP_MA_SECT=('ketadanmen', ),
#comment:                                    MAILLAGE_SECT=mesh1))

elemprop = AFFE_CARA_ELEM(DISCRET=(_F(CARA='K_TR_D_L',
                                      GROUP_MA=('hinge', ),
                                      REPERE='GLOBAL',
                                      VALE=(100000.0, 100000.0, 100000.0, 1.0, 1.0, 1.0)),
                                   _F(CARA='M_TR_D_L',
                                      GROUP_MA=('hinge', ),
                                      REPERE='GLOBAL',
                                      VALE=(0.0, 0.0, 0.0, 0.0))),
                          MODELE=model,
                          POUTRE=(_F(CARA=('EPY', 'EPZ', 'HY', 'HZ'),
                                     GROUP_MA=('beam', ),
                                     SECTION='RECTANGLE',
                                     VALE=(2.0, 2.0, 10.0, 50.0)),
                                  _F(CARA=('R', ),
                                     GROUP_MA=('cable', ),
                                     SECTION='CERCLE',
                                     VALE=(4.0, ))))

beam1 = DEFI_MATERIAU(ELAS=_F(E=200000.0,
                              NU=0.3,
                              RHO=7.9e-09))

cable = DEFI_MATERIAU(ELAS=_F(ALPHA=1.25e-05,
                              E=195000.0,
                              NU=0.3,
                              RHO=7.9e-09))

fieldmat = AFFE_MATERIAU(AFFE=(_F(GROUP_MA=('beam', ),
                                  MATER=(beam1, )),
                               _F(GROUP_MA=('cable', ),
                                  MATER=(cable, ))),
                         MAILLAGE=mesh0,
                         MODELE=model)

force = DEFI_FONCTION(NOM_PARA='INST',
                      PROL_DROITE='EXCLU',
                      PROL_GAUCHE='EXCLU',
                      VALE=(0.0, 0.0, 50.0, 1.0, 100.0, 1.0))

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

times = DEFI_LIST_INST(DEFI_LIST=_F(LIST_INST=listr),
                       METHODE='MANUEL')

Calfor = DEFI_FONCTION(NOM_PARA='INST',
                       PROL_DROITE='EXCLU',
                       PROL_GAUCHE='EXCLU',
                       VALE=(0.0, 0.0, 50.0, 1.0, 100.0, 1.0))

pres = DEFI_FONCTION(NOM_PARA='INST',
                     PROL_DROITE='EXCLU',
                     PROL_GAUCHE='EXCLU',
                     VALE=(0.0, 0.0, 50.0, 1.0, 100.0, 1.0))

Calpres = DEFI_FONCTION(NOM_PARA='INST',
                        PROL_DROITE='EXCLU',
                        PROL_GAUCHE='EXCLU',
                        VALE=(0.0, 0.0, 50.0, 1.0, 100.0, 1.0))

load = 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=('kotei', )),
                      MODELE=model)

load0 = AFFE_CHAR_MECA(FORCE_POUTRE=_F(FY=-0.0183456,
                                       GROUP_MA=('beam', )),
                       MODELE=model)

pinko = AFFE_CHAR_MECA(DDL_IMPO=_F(DX=0.0,
                                   DY=0.0,
                                   DZ=0.0,
                                   GROUP_NO=('pin', )),
                       MODELE=model)

calkotei = 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=('kotei', )),
                          MODELE=model)

calload = AFFE_CHAR_MECA(FORCE_POUTRE=_F(FY=-0.0183456,
                                         GROUP_MA=('beam', )),
                         MODELE=model)

calpin = AFFE_CHAR_MECA(DDL_IMPO=_F(DX=0.0,
                                    DY=0.0,
                                    DZ=0.0,
                                    GROUP_NO=('pin', )),
                        MODELE=model)

pre = AFFE_CHAR_MECA(MODELE=model,
                     PRE_EPSI=_F(EPX=-0.00125,
                                 GROUP_MA=('cable', )))

calpre = AFFE_CHAR_MECA(MODELE=model,
                        PRE_EPSI=_F(EPX=-0.00125,
                                    GROUP_MA=('cable', )))

ASSEMBLAGE(CARA_ELEM=elemprop,
           CHAM_MATER=fieldmat,
           CHARGE=(load, load0, pinko),
           INST=100.0,
           MATR_ASSE=(_F(MATRICE=CO('mass'),
                         OPTION='MASS_MECA'),
                      _F(MATRICE=CO('rigi'),
                         OPTION='RIGI_MECA')),
           MODELE=model,
           NUME_DDL=CO('nddl'))

#comment: resnonl = DYNA_NON_LINE(CARA_ELEM=elemprop,
#comment:                         CHAM_MATER=fieldmat,
#comment:                         EXCIT=(_F(CHARGE=load),
#comment:                                _F(CHARGE=load0,
#comment:                                   FONC_MULT=force),
#comment:                                _F(CHARGE=pinko)),
#comment:                         INCREMENT=_F(LIST_INST=times),
#comment:                         MODELE=model,
#comment:                         SCHEMA_TEMPS=_F(BETA=0.25,
#comment:                                         FORMULATION='DEPLACEMENT',
#comment:                                         SCHEMA='NEWMARK'))

resharm = DYNA_LINE(BASE_CALCUL='PHYS',
                    CARA_ELEM=elemprop,
                    CHAM_MATER=fieldmat,
                    CHARGE=(load, pinko),
                    EXCIT=(_F(CHARGE=load0,
                              FONC_MULT=force),
                           _F(CHARGE=pre,
                              FONC_MULT=pres)),
                    INCREMENT=_F(INST_FIN=100.0,
                                 INST_INIT=0.0,
                                 PAS=0.1),
                    MODELE=model,
                    SCHEMA_TEMPS=_F(BETA=0.25,
                                    SCHEMA='NEWMARK'),
                    TYPE_CALCUL='TRAN')

resharm = CALC_CHAMP(reuse=resharm,
                     CARA_ELEM=elemprop,
                     CHAM_MATER=fieldmat,
                     EXCIT=(_F(CHARGE=calkotei),
                            _F(CHARGE=calload,
                               FONC_MULT=Calfor),
                            _F(CHARGE=calpin),
                            _F(CHARGE=calpre,
                               FONC_MULT=Calpres)),
                     FORCE=('FORC_NODA', 'REAC_NODA'),
                     MODELE=model,
                     RESULTAT=resharm)

IMPR_RESU(FORMAT='MED',
          RESU=(_F(CARA_ELEM=elemprop,
                   IMPR_NOM_VARI='OUI',
                   MAILLAGE=mesh0,
                   NOM_CHAM=('DEPL', ),
                   RESULTAT=resharm),
                _F(CARA_ELEM=elemprop,
                   MAILLAGE=mesh0,
                   NOM_CHAM=('REAC_NODA', 'FORC_NODA'),
                   RESULTAT=resharm)),
          UNITE=3)

FIN()
