DEBUT(LANG='FR')

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

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

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

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

elemprop = AFFE_CARA_ELEM(BARRE=_F(CARA=('R', ),
                                   GROUP_MA=('cable', ),
                                   SECTION='CERCLE',
                                   VALE=(4.0, )),
                          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)),
                          GEOM_FIBRE=fiber,
                          MODELE=model,
                          MULTIFIBRE=_F(GROUP_FIBRE=('kesec', ),
                                        GROUP_MA=('beam', ),
                                        PREC_AIRE=0.01,
                                        PREC_INERTIE=16.0),
                          POUTRE=_F(CARA=('EPY', 'EPZ', 'HY', 'HZ'),
                                    GROUP_MA=('beam', ),
                                    SECTION='RECTANGLE',
                                    VALE=(2.0, 2.0, 10.0, 50.0)))

beam1 = DEFI_MATERIAU(ECRO_LINE=_F(D_SIGM_EPSI=0.01,
                                   SY=235.0),
                      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))

func = DEFI_FONCTION(NOM_PARA='INST',
                     PROL_DROITE='EXCLU',
                     PROL_GAUCHE='EXCLU',
                     VALE=(0.0, 0.0, 1.0, 1.0))

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

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

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', )),
                                _F(DX=0.0,
                                   DY=0.0,
                                   DZ=0.0,
                                   GROUP_NO=('pin', ))),
                      MODELE=model)

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

tension = CREA_CHAMP(AFFE=_F(GROUP_MA=('cable', ),
                             NOM_CMP=('TEMP', ),
                             VALE=(-100.0, )),
                     MODELE=model,
                     OPERATION='AFFE',
                     TYPE_CHAM='NOEU_TEMP_R')

beambeha = DEFI_COMPOR(GEOM_FIBRE=fiber,
                       MATER_SECT=beam1,
                       MULTIFIBRE=_F(GROUP_FIBRE=('kesec', ),
                                     MATER=beam1,
                                     RELATION='VMIS_ISOT_LINE'))

fieldmat = AFFE_MATERIAU(AFFE=(_F(GROUP_MA=('beam', ),
                                  MATER=(beam1, )),
                               _F(GROUP_MA=('cable', ),
                                  MATER=(cable, ))),
                         AFFE_COMPOR=_F(COMPOR=beambeha,
                                        GROUP_MA=('beam', )),
                         AFFE_VARC=_F(CHAM_GD=tension,
                                      GROUP_MA=('cable', ),
                                      NOM_VARC='TEMP',
                                      VALE_REF=0.0),
                         MAILLAGE=mesh0,
                         MODELE=model)

resnonl = STAT_NON_LINE(CARA_ELEM=elemprop,
                        CHAM_MATER=fieldmat,
                        COMPORTEMENT=_F(DEFORMATION='PETIT',
                                        GROUP_MA=('beam', ),
                                        RELATION='MULTIFIBRE'),
                        CONVERGENCE=_F(ITER_GLOB_MAXI=100,
                                       RESI_GLOB_RELA=0.0001),
                        EXCIT=(_F(CHARGE=load),
                               _F(CHARGE=load0,
                                  FONC_MULT=func)),
                        INCREMENT=_F(LIST_INST=times),
                        MODELE=model,
                        NEWTON=_F(MATRICE='TANGENTE',
                                  REAC_ITER=1))

unnamed = CALC_CHAMP(CARA_ELEM=elemprop,
                     CHAM_MATER=fieldmat,
                     CONTRAINTE=('SIGM_ELGA', ),
                     CRITERES=('SIEQ_ELGA', ),
                     DEFORMATION=('EPSI_ELGA', ),
                     FORCE=('FORC_NODA', 'REAC_NODA'),
                     MODELE=model,
                     RESULTAT=resnonl)

IMPR_RESU(FORMAT='MED',
          RESU=(_F(CARA_ELEM=elemprop,
                   IMPR_NOM_VARI='OUI',
                   MAILLAGE=mesh0,
                   NOM_CHAM=('DEPL', ),
                   RESULTAT=resnonl),
                _F(CARA_ELEM=elemprop,
                   IMPR_NOM_VARI='OUI',
                   MAILLAGE=mesh0,
                   NOM_CHAM=('SIGM_ELGA', 'SIEQ_ELGA', 'EPSI_ELGA', 'FORC_NODA', 'REAC_NODA'),
                   RESULTAT=unnamed)),
          UNITE=80)

FIN()
