00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #include <med.h>
00019 #include <med_config.h>
00020 #include <med_outils.h>
00021 
00022 #include <string.h>
00023 #include <stdlib.h>
00024 
00025 extern int mode_interlace; 
00026 
00027 med_err
00028 MEDjointTypeCorres(med_idt fid, char *maa, char *jn,int ind,
00029                     med_entite_maillage *typ_ent_local,   med_geometrie_element *typ_geo_local,
00030                     med_entite_maillage *typ_ent_distant, med_geometrie_element *typ_geo_distant)
00031 {
00032   med_int nent;
00033 
00034   static med_int geo_ent_local=0,geo_ent_distant=0;
00035   static int ind_type_courrant=0;
00036   int ind_type_a_trouver=ind;
00037 
00038   const med_int nb_geo_ent=1+MED_NBR_GEOMETRIE_MAILLE+MED_NBR_GEOMETRIE_ARETE+MED_NBR_GEOMETRIE_FACE;
00039 
00040   med_geometrie_element typ_geo_ent[1+MED_NBR_GEOMETRIE_MAILLE+MED_NBR_GEOMETRIE_ARETE+MED_NBR_GEOMETRIE_FACE][2]=
00041     {
00042       {MED_NOEUD,0},
00043       {MED_MAILLE,MED_POINT1   },
00044       {MED_MAILLE,MED_SEG2     },
00045       {MED_MAILLE,MED_SEG3     },
00046       {MED_MAILLE,MED_TRIA3    },
00047       {MED_MAILLE,MED_TRIA6    },
00048       {MED_MAILLE,MED_QUAD4    },
00049       {MED_MAILLE,MED_QUAD8    },
00050       {MED_MAILLE,MED_TETRA4   },
00051       {MED_MAILLE,MED_TETRA10  },
00052       {MED_MAILLE,MED_HEXA8    },
00053       {MED_MAILLE,MED_HEXA20   },
00054       {MED_MAILLE,MED_PENTA6   },
00055       {MED_MAILLE,MED_PENTA15  },
00056       {MED_MAILLE,MED_PYRA5    },
00057       {MED_MAILLE,MED_PYRA13   },
00058       {MED_ARETE ,MED_SEG2     },
00059       {MED_ARETE ,MED_SEG3     },
00060       {MED_FACE  ,MED_TRIA3    },
00061       {MED_FACE  ,MED_TRIA6    },
00062       {MED_FACE  ,MED_QUAD4    },
00063       {MED_FACE  ,MED_QUAD8    }
00064     };
00065 
00066   if (ind != -1) {
00067     geo_ent_local=0;geo_ent_distant=0;
00068     ind_type_courrant=0;
00069     ind_type_a_trouver=ind;
00070   }
00071   else {
00072     ind_type_a_trouver=ind_type_courrant+1;
00073   }
00074 
00075 
00076   
00077 
00078 
00079   for (;ind_type_courrant!=ind_type_a_trouver && geo_ent_local<nb_geo_ent;geo_ent_local++) {
00080     *typ_ent_local = typ_geo_ent[geo_ent_local][0];
00081     *typ_geo_local = typ_geo_ent[geo_ent_local][1];
00082     geo_ent_distant=0;
00083     for (;ind_type_courrant!=ind_type_a_trouver && geo_ent_distant<nb_geo_ent;geo_ent_distant++) {
00084       *typ_ent_distant = typ_geo_ent[geo_ent_distant][0];
00085       *typ_geo_distant = typ_geo_ent[geo_ent_distant][1];
00086 
00087       if ( (nent=MEDjointnCorres(fid,maa,jn,*typ_ent_local,*typ_geo_local,
00088                                 *typ_ent_distant,*typ_geo_distant)
00089             ) >0 ) {
00090         ind_type_courrant ++;
00091       }
00092     }
00093   }
00094 
00095 
00096   if (ind_type_courrant!=ind_type_a_trouver) {
00097     MESSAGE("Can't find attended corresponding type for the given correspondence number.");
00098     ISCRUTE_int(ind_type_courrant);ISCRUTE_int(ind_type_a_trouver);
00099     return -1;
00100   }
00101 
00102   return 0;
00103 
00104 }
00105 
00106 
00107