#Two fibers break

DEBUT();

import sys
sys.path.append('/home/denis/Documents/disser/model/scripts')
from materials import *

empty=DEFI_MATERIAU(ELAS=_F(E=m_empty['E'],          
                          NU=m_empty['NU'],),);

mat=DEFI_MATERIAU(ELAS=_F(E=m_matrix['E'],              
                          NU=m_matrix['NU'],),);

fib=DEFI_MATERIAU(ELAS=_F(E=m_fibers['E'],              
                          NU=m_fibers['NU'],),);

MAIL=LIRE_MAILLAGE(FORMAT='MED',);

MAIL=MODI_MAILLAGE(reuse =MAIL,
                   MAILLAGE=MAIL,
                   ORIE_PEAU_3D=_F(GROUP_MA=('ZY_Side','XY_Side',),),);

MODE=AFFE_MODELE(MAILLAGE=MAIL,
                 AFFE=_F(TOUT='OUI',
                         PHENOMENE='MECANIQUE',
                         MODELISATION='3D',),);

#Cont=DEFI_CONTACT(MODELE=MODE,
#                  FORMULATION='DISCRETE',
#                  ZONE=_F(GROUP_MA_MAIT='Matrix',
#                          GROUP_MA_ESCL='fShell',
#                          ALGO_CONT='CONTRAINTE',),);

MATE=AFFE_MATERIAU(MAILLAGE=MAIL,
                   AFFE=(_F(GROUP_MA='Matrix',
                            MATER=mat,),
                         _F(GROUP_MA='Fibers',
                            MATER=fib,),
                         _F(GROUP_MA='fs1',
                            MATER=mat,),
                         _F(GROUP_MA='fs2',
                            MATER=mat,),
                        ),
                   );
                   
CHAR=AFFE_CHAR_MECA(MODELE=MODE,
                    DDL_IMPO=(
                              _F(GROUP_MA='YX_Side',
                                 DZ=0.0,),
                              _F(GROUP_MA='YZ_Side',
                                 DX=0.0,),
                              _F(GROUP_MA='ZX_Bott',
                                 DY=0,),
                              _F(GROUP_MA='ZY_Side',
                                 DX=-1.0),
                              _F(GROUP_MA='XY_Side',
                                 DZ=1.0),
                              ),
                    LIAISON_MAIL=_F(GROUP_MA_MAIT='Matrix',
                                    GROUP_MA_ESCL='fShell',
                                    TYPE_RACCORD='MASSIF',),
                    );                   

RESU=MECA_STATIQUE(MODELE=MODE,
                   CHAM_MATER=MATE,
                   EXCIT=_F(CHARGE=CHAR,),);

RESU=CALC_CHAMP(reuse =RESU,
               MODELE=MODE,
               CHAM_MATER=MATE,
               RESULTAT=RESU,
               CONTRAINTE=('SIGM_ELNO','SIEF_ELNO',),
               DEFORMATION=('EPME_ELNO',),
               CRITERES=('SIEQ_ELNO',),
               EXCIT=_F(CHARGE=CHAR,),);

RESU=CALC_CHAMP(reuse =RESU,
             RESULTAT=RESU,
             CONTRAINTE=('SIEF_NOEU','SIGM_NOEU',),
             DEFORMATION=('EPME_NOEU',),
             CRITERES=('SIEQ_NOEU',),
             );

IMPR_RESU(FORMAT='MED',
          UNITE=80,
          RESU=_F(MAILLAGE=MAIL,
                  RESULTAT=RESU,
                  NOM_CHAM=('SIGM_NOEU','SIEQ_NOEU','SIGM_ELNO','DEPL',),),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=22,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIGM_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='Matrix',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=23,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIEQ_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='Matrix',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=24,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIGM_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='Fibers',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=25,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIEQ_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='Fibers',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=26,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIGM_NOEU',
                  FORM_TABL='OUI',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=27,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIEQ_NOEU',
                  FORM_TABL='OUI',
                  IMPR_COOR='OUI',),);
                  
IMPR_RESU(FORMAT='RESULTAT',
          UNITE=28,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIEQ_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='fs1',
                  IMPR_COOR='OUI',),);
       
IMPR_RESU(FORMAT='RESULTAT',
          UNITE=29,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIEQ_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='fs2',
                  IMPR_COOR='OUI',),);

IMPR_RESU(FORMAT='RESULTAT',
          UNITE=30,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIGM_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='fs1',
                  IMPR_COOR='OUI',),);
       
IMPR_RESU(FORMAT='RESULTAT',
          UNITE=31,
          RESU=_F(RESULTAT=RESU,
                  NOM_CHAM='SIGM_NOEU',
                  FORM_TABL='OUI',
                  GROUP_MA='fs2',
                  IMPR_COOR='OUI',),);

FIN();