
DEBUT(PAR_LOT='NON');

# on ajout les commandes correspondantes au modèle expérimental
INCLUDE(UNITE=2)

EP__=0.5
MP__=50000.

PRE_GIBI(UNITE_GIBI=22);

MAIL1=LIRE_MAILLAGE(VERI_MAIL=_F(VERIF='OUI',),);


MAIL1=DEFI_GROUP(reuse=MAIL1,
                 MAILLAGE=MAIL1,
                 CREA_GROUP_NO=_F(
                                  NOM='NO_MA',
                                  OPTION='ENV_SPHERE',
                                  POINT=(2.0,3.0),
                                  RAYON=0.1,
                                  PRECISION=0.1,
                                  ),)

MAIL1=DEFI_GROUP(reuse =MAIL1,
                   MAILLAGE=MAIL1,
                   CREA_GROUP_NO=_F(GROUP_MA='BORDS',
                                    NOM='BORDS',),);

MAIL2= CREA_MAILLAGE(MAILLAGE=MAIL1,
                     CREA_POI1 =(_F(NOM_GROUP_MA = 'MASS',
                                GROUP_NO = 'NO_MA'),
                                                                
                                )       
                     )


MODEL=AFFE_MODELE(MAILLAGE=MAIL2,
                  AFFE=(_F(GROUP_MA = 'TOUT_ELT',
                          PHENOMENE='MECANIQUE',
                          MODELISATION='DST',),
                        _F(GROUP_MA = 'MASS',
                          PHENOMENE='MECANIQUE',
                          MODELISATION='DIS_T',),
  
                          ),);

#
#---------------------------------------------------------------------
#                     CARACTERISTIQUES ELEMENTAIRES 
#---------------------------------------------------------------------

CARA_ELE=AFFE_CARA_ELEM(MODELE=MODEL,
                        COQUE=_F(GROUP_MA='SURF',
                                 EPAIS=EP__,),
                        DISCRET= _F(  GROUP_MA = 'MASS',
                                     CARA = 'M_T_D_N',
                                     VALE = MP__,),
         
                        );
                         

#---------------------------------------------------------------------
#                     CARACTERISTIQUES MATERIAUX 
#---------------------------------------------------------------------

ACIER2=DEFI_MATERIAU(ELAS=_F(E=2.E11,
                            NU=0.3,
                            RHO=7800.0,),);
#

MAT=AFFE_MATERIAU(MAILLAGE=MAIL2,
                  AFFE=_F(GROUP_MA='SURF',
                          MATER=ACIER2,),);

#---------------------------------------------------------------------
#                   CHARGEMENT
#---------------------------------------------------------------------
CHAR = AFFE_CHAR_MECA(MODELE=MODEL,
                   DDL_IMPO=_F(GROUP_NO='BORDS',
                    DX=0.,  DY=0. , DZ=0.,
                    DRX=0., DRY=0., DRZ=0.,))

#---------------------------------------------------------------------
#                     RESOLUTION 
#---------------------------------------------------------------------

M_EL_RIG=CALC_MATR_ELEM(OPTION='RIGI_MECA',
                        MODELE=MODEL,
                        CHAM_MATER=MAT,
                        CARA_ELEM=CARA_ELE,
                        CHARGE=CHAR,
                        );

M_EL_MAS=CALC_MATR_ELEM(OPTION='MASS_MECA',
                        MODELE=MODEL,
                        CHAM_MATER=MAT,
                        CARA_ELEM=CARA_ELE,
                        CHARGE=CHAR,
                        );

NU=NUME_DDL(MATR_RIGI=M_EL_RIG,);

M_AS_RIG=ASSE_MATRICE(MATR_ELEM=M_EL_RIG,
                      NUME_DDL=NU,);

M_AS_MAS=ASSE_MATRICE(MATR_ELEM=M_EL_MAS,
                      NUME_DDL=NU,);
#
#nombre de frequences
NF=8

MODES=MODE_ITER_SIMULT(MATR_A=M_AS_RIG,
                       MATR_B=M_AS_MAS,
                       METHODE='SORENSEN',
                       CALC_FREQ=_F(OPTION='PLUS_PETITE',
                                    NMAX_FREQ=NF),
                       VERI_MODE=_F(STOP_ERREUR='NON'),             
                                    );
#on projete le concept mode_meca calcule sur le maillage experimental

MODNUM = PROJ_CHAMP(RESULTAT=MODES,
                    MODELE_1=MODEL,
                    MODELE_2=MODEXP,
                    NUME_DDL=NUMEXP
                    )


# le tableau des frequences numeriques

REPONSE1=RECU_TABLE(CO=MODES,
                    NOM_PARA='FREQ');


# calcul et stockage des MAC entre la base experimentale et celle calculee


REPONSE2=MAC_MODES(BASE_1=MODNUM,
                  BASE_2=MODMES,
                  );



FIN();





