# jntcf.c

Aller à la documentation de ce fichier.

    00001 /*  This file is part of MED.
    00002  *
    00003  *  COPYRIGHT (C) 1999 - 2012  EDF R&D, CEA/DEN
    00004  *  MED is free software: you can redistribute it and/or modify
    00005  *  it under the terms of the GNU Lesser General Public License as published by
    00006  *  the Free Software Foundation, either version 3 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  MED is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Lesser General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Lesser General Public License
    00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
    00016  */
    00017
    00018
    00019 #include <med.h>
    00020 #include <med_config.h>
    00021 #include <med_outils.h>
    00022 #include <stdlib.h>
    00023 #include <string.h>
    00024
    00025 #define nedfjntc F77_FUNC(edfjntc,EDFJNTC)
    00026 #define nedfnjnt F77_FUNC(edfnjnt,EDFNJNT)
    00027 #define nedfjnti F77_FUNC(edfjnti,EDFJNTI)
    00028 #define nedfjnte F77_FUNC(edfjnte,EDFJNTE)
    00029 #define nedfjntl F77_FUNC(edfjntl,EDFJNTL)
    00030 #define nedfjnco F77_FUNC(edfjnco,EDFJNCO)
    00031 #define nedfjtco F77_FUNC(edfjtco,EDFJTCO)
    00032 #define nedfgnme F77_FUNC(edfgnme,EDFGNME)
    00033 #define nedfgnml F77_FUNC(edfgnml,EDFGNML)
    00034
    00035 /* creation d'un joint */
    00036
    00037 #ifdef PPRO_NT
    00038 med_int
    00039  EDFJNTC (med_int *fid,
    00040                    char *maa_lcl,  unsigned int bidon1, med_int *lon1,
    00041                    char *jn,   unsigned int bidon2, med_int *lon2,
    00042                    char *desc, unsigned int bidon3, med_int *lon3,
    00043                    med_int *dom,
    00044                    char *maa_dist,  unsigned int bidon4, med_int *lon4
    00045                    )
    00046 #else
    00047 med_int
    00048 nedfjntc (med_int *fid,
    00049           char *maa_lcl,med_int *lon1,
    00050           char *jn,med_int *lon2,
    00051           char *desc, med_int *lon3,
    00052           med_int *dom,
    00053           char *maa_dist, med_int *lon4
    00054           )
    00055 #endif
    00056 {
    00057   med_int ret;
    00058   char *fn1, *fn2, *fn3, *fn4;
    00059
    00060   fn1 = _MED2cstring(maa_lcl, (int) * lon1);
    00061   fn2 = _MED2cstring(jn,  (int) * lon2);
    00062   fn3 = _MED1cstring(desc, (int) * lon3,MED_TAILLE_DESC);
    00063   fn4 = _MED2cstring(maa_dist, (int) * lon4);
    00064
    00065   if (!fn1 || !fn2 || !fn3 || !fn4)
    00066     return(-1);
    00067
    00068   ret = (med_int) MEDjointCr((med_idt) *fid,
    00069                              (char *)fn1,(char *)fn2,
    00070                              (char *)fn3,(med_int) *dom,
    00071                              (char *)fn4);
    00072
    00073   _MEDcstringFree(fn1);
    00074   _MEDcstringFree(fn2);
    00075   _MEDcstringFree(fn3);
    00076   _MEDcstringFree(fn4);
    00077
    00078   return(ret);
    00079 }
    00080
    00081
    00082
    00083 /* Lecture du nombre de joints dans un maillage */
    00084
    00085 #ifdef PPRO_NT
    00086 med_int
    00087  EDFNJNT (med_int *fid,
    00088                    char *maa_lcl,  unsigned int bidon1, med_int *lon1,
    00089                    med_int *n
    00090                    )
    00091 #else
    00092 med_int
    00093 nedfnjnt (med_int *fid,
    00094           char *maa_lcl,med_int *lon1,
    00095           med_int *n
    00096           )
    00097 #endif
    00098 {
    00099   char *fn1;
    00100
    00101   fn1 = _MED2cstring(maa_lcl, (int) * lon1);
    00102
    00103
    00104   if (!fn1)
    00105     return(-1);
    00106
    00107   *n = (med_int) MEDnJoint((med_idt) *fid,
    00108                            (char *)fn1);
    00109
    00110   _MEDcstringFree(fn1);
    00111
    00112   return(*n);
    00113 }
    00114
    00115
    00116 /* Lecture des informations relatives à un joint */
    00117
    00118
    00119 #ifdef PPRO_NT
    00120 med_int
    00121  EDFJNTI (med_int *fid,
    00122                    char *maa_lcl,  unsigned int bidon1, med_int *lon1,
    00123                    med_int *ind,
    00124                    char *jn, unsigned int bidon2,
    00125                    char *desc, unsigned int bidon3,
    00126                    med_int *dom,
    00127                    char *maa_dist, unsigned int bidon4
    00128                    )
    00129 #else
    00130 med_int
    00131 nedfjnti (med_int *fid,
    00132           char *maa_lcl,med_int *lon1,
    00133           med_int *ind,
    00134           char *jn,
    00135           char *desc,
    00136           med_int *dom,
    00137           char *maa_dist
    00138           )
    00139 #endif
    00140 {
    00141   med_int ret;
    00142   char *fn1;
    00143   char fs1[MED_TAILLE_NOM+1];   /* nom du joint OUT */
    00144   char fs2[MED_TAILLE_DESC+1];  /* nom de la description   OUT */
    00145   char fs3[MED_TAILLE_NOM+1];   /* nom du maillage distant OUT */
    00146
    00147
    00148   /* nom maillage IN */
    00149   fn1 = _MED2cstring(maa_lcl, (int) * lon1);
    00150
    00151   if (!fn1)
    00152     return(-1);
    00153
    00154   ret = (med_int) MEDjointInfo((med_idt) *fid,
    00155                                (char *)   fn1,     /* maillage local IN */
    00156                                (med_int) *ind,      /* indice du joint dans le maillage IN */
    00157                                (char *)fs1,        /* nom joint OUT */
    00158                                (char *)fs2,        /* desc joint OUT */
    00159                                (med_int * ) dom,   /* numero ss domaine distant OUT */
    00160                                (char *)fs3);        /* nom maillage distant OUT */
    00161
    00162   strncpy(jn,fs1,MED_TAILLE_NOM);
    00163   _MEDfstring(jn,MED_TAILLE_NOM);
    00164   strncpy(desc,fs2,MED_TAILLE_DESC);
    00165   _MEDfstring(desc,MED_TAILLE_DESC);
    00166   strncpy(maa_dist,fs3,MED_TAILLE_NOM);
    00167   _MEDfstring(maa_dist,MED_TAILLE_NOM);
    00168
    00169
    00170   _MEDcstringFree(fn1);
    00171
    00172
    00173   return(ret);
    00174 }
    00175
    00176
    00177
    00178
    00179
    00180
    00181
    00182 /* ecriture du contenu d'une correspondance */
    00183
    00184 #ifdef PPRO_NT
    00185 med_int
    00186  EDFJNTE (med_int *fid,
    00187                    char *maa_local,unsigned int bidon1, med_int *lon1,
    00188                    char *jn,     unsigned int bidon2, med_int *lon2,
    00189                    med_int *corrtab, med_int *n,
    00190                    med_int * typ_ent_local, med_int * typ_geo_local,
    00191                    med_int * typ_ent_distant, med_int * typ_geo_distant)
    00192 #else
    00193 med_int
    00194 nedfjnte (med_int *fid,
    00195           char *maa_local,med_int *lon1,
    00196           char *jn,med_int *lon2,
    00197           med_int *corrtab, med_int *n,
    00198           med_int * typ_ent_local, med_int * typ_geo_local,
    00199           med_int * typ_ent_distant, med_int * typ_geo_distant)
    00200 #endif
    00201 {
    00202   med_int ret;
    00203   char *fn1, *fn2;
    00204
    00205   fn1 = _MED2cstring(maa_local, (int) *lon1);
    00206   fn2 = _MED2cstring(jn,  (int) *lon2);
    00207
    00208   if (!fn1 || !fn2)
    00209     return(-1);
    00210
    00211   ret = (med_int) MEDjointEcr((med_idt) *fid, (char *)fn1, (char *) fn2,  (med_int *) corrtab, (med_int) *n,
    00212                                   (med_entite_maillage) *typ_ent_local,   (med_geometrie_element) *typ_geo_local,
    00213                                   (med_entite_maillage) *typ_ent_distant, (med_geometrie_element) *typ_geo_distant);
    00214
    00215   _MEDcstringFree(fn1);
    00216   _MEDcstringFree(fn2);
    00217
    00218   return(ret);
    00219 }
    00220
    00221
    00222 /* lecture du contenu d'une correspondance */
    00223
    00224
    00225 #ifdef PPRO_NT
    00226 med_int
    00227  EDFJNTL (med_int *fid,
    00228                    char *maa_local,unsigned int bidon1, med_int *lon1,
    00229                    char *jn,     unsigned int bidon2, med_int *lon2,
    00230                    med_int *corrtab, med_int *n,
    00231                    med_int * typ_ent_local, med_int * typ_geo_local,
    00232                    med_int * typ_ent_distant, med_int * typ_geo_distant)
    00233 #else
    00234 med_int
    00235 nedfjntl (med_int *fid,
    00236           char *maa_local,med_int *lon1,
    00237           char *jn,med_int *lon2,
    00238           med_int *corrtab, med_int *n,
    00239           med_int * typ_ent_local, med_int * typ_geo_local,
    00240           med_int * typ_ent_distant, med_int * typ_geo_distant)
    00241 #endif
    00242 {
    00243   med_int ret;
    00244   char *fn1, *fn2;
    00245
    00246   fn1 = _MED2cstring(maa_local, (int) * lon1);
    00247   fn2 = _MED2cstring(jn,  (int) * lon2);
    00248
    00249   if (!fn1 || !fn2 )
    00250     return(-1);
    00251
    00252   ret = (med_int) MEDjointLire((med_idt) *fid, (char *)fn1, (char *) fn2, (med_int *) corrtab, (med_int) *n,
    00253                                (med_entite_maillage) *typ_ent_local,   (med_geometrie_element) *typ_geo_local,
    00254                                (med_entite_maillage) *typ_ent_distant, (med_geometrie_element) *typ_geo_distant);
    00255
    00256   _MEDcstringFree(fn1);
    00257   _MEDcstringFree(fn2);
    00258
    00259 /* _MEDobjetsOuverts(*fid); */
    00260
    00261   return(ret);
    00262 }
    00263
    00264
    00265
    00266
    00267 /* Lecture du nombre de correspondances pour deux types en regard dans   un joint */
    00268
    00269
    00270 #ifdef PPRO_NT
    00271 med_int
    00272  EDFJNCO (med_int *fid,
    00273                    char *maa_lcl,  unsigned int bidon1, med_int *lon1,
    00274                    char *jn,   unsigned int bidon2, med_int *lon2,
    00275                    med_int * typ_ent_local, med_int * typ_geo_local,
    00276                    med_int * typ_ent_distant, med_int * typ_geo_distant
    00277                    )
    00278 #else
    00279 med_int
    00280 nedfjnco (med_int *fid,
    00281           char *maa_lcl,med_int *lon1,
    00282           char *jn, med_int *lon2,
    00283           med_int * typ_ent_local, med_int * typ_geo_local,
    00284           med_int * typ_ent_distant, med_int * typ_geo_distant
    00285           )
    00286 #endif
    00287 {
    00288   med_int ret;
    00289   char *fn1;
    00290   char *fn2;                   /* nom joint IN */
    00291
    00292
    00293   /* nom maillage IN */
    00294   fn1 = _MED2cstring(maa_lcl, (int) * lon1);
    00295
    00296   /* nom joint IN */
    00297   fn2 = _MED2cstring(jn, (int) * lon2);
    00298
    00299   if (!fn1)
    00300     return(-1);
    00301
    00302   ret = (med_int) MEDjointnCorres((med_idt) *fid,
    00303                                   (char *)   fn1,     /* maillage local IN */
    00304                                   (char *)   fn2,    /* nom du joint IN */
    00305                                   (med_entite_maillage)   *typ_ent_local,
    00306                                   (med_geometrie_element) *typ_geo_local,
    00307                                   (med_entite_maillage)   *typ_ent_distant,
    00308                                   (med_geometrie_element) *typ_geo_distant
    00309                                   );
    00310
    00311
    00312
    00313   _MEDcstringFree(fn1);
    00314   _MEDcstringFree(fn2);
    00315
    00316
    00317   return(ret);
    00318 }
    00319
    00320
    00321
    00322
    00323
    00324
    00325
    00326 /* Lecture du type des elements en regard dans un joint */
    00327
    00328
    00329 #ifdef PPRO_NT
    00330 med_int
    00331  EDFJTCO (med_int *fid,
    00332                    char *maa_lcl,  unsigned int bidon1, med_int *lon1,
    00333                    char *jn,   unsigned int bidon2, med_int *lon2,
    00334                    int *ind,
    00335                    med_int * typ_ent_local, med_int * typ_geo_local,
    00336                    med_int * typ_ent_distant, med_int * typ_geo_distant
    00337                    )
    00338 #else
    00339 med_int
    00340 nedfjtco (med_int *fid,
    00341           char *maa_lcl,med_int *lon1,
    00342           char *jn, med_int *lon2,
    00343           int *ind,
    00344           med_int * typ_ent_local,   med_int * typ_geo_local,
    00345           med_int * typ_ent_distant, med_int * typ_geo_distant
    00346           )
    00347 #endif
    00348 {
    00349   med_int ret;
    00350   char *fn1;
    00351   char *fn2;            /* nom joint IN */
    00352   med_entite_maillage   _typ_ent_local;
    00353   med_geometrie_element _typ_geo_local;
    00354   med_entite_maillage   _typ_ent_distant;
    00355   med_geometrie_element _typ_geo_distant;
    00356
    00357   /* nom maillage IN */
    00358   fn1 = _MED2cstring(maa_lcl, (int) * lon1);
    00359
    00360   /* nom joint IN */
    00361   fn2 = _MED2cstring(jn, (int) * lon2);
    00362
    00363   if (!fn1) return(-1);
    00364
    00365   ret = (med_int) MEDjointTypeCorres((med_idt) *fid,
    00366                                      (char *)   fn1,    /* maillage local IN */
    00367                                      (char *)   fn2,    /* nom du joint IN */
    00368                                      (int) *ind,        /* numero de la correspondance  IN*/
    00369                                      &_typ_ent_local,   /* type entite local OUT */
    00370                                      &_typ_geo_local,   /* type geometrie local OUT */
    00371                                      &_typ_ent_distant, /* type entite distant OUT */
    00372                                      &_typ_geo_distant  /* type geometrie distant OUT */
    00373                                   );
    00374    *typ_ent_local = (med_int) _typ_ent_local;
    00375    *typ_geo_local = (med_int) _typ_geo_local;
    00376    *typ_ent_distant = (med_int) _typ_ent_distant;
    00377    *typ_geo_distant = (med_int) _typ_geo_distant;
    00378
    00379   _MEDcstringFree(fn1);
    00380   _MEDcstringFree(fn2);
    00381
    00382
    00383   return(ret);
    00384
    00385 }
    00386
    00387
    00388 /* ecriture d'une numerotation globale */
    00389
    00390 #ifdef PPRO_NT
    00391 med_int
    00392  EDFGNME (med_int *fid,
    00393                    char *maa, unsigned int bidon1, med_int *lon1,
    00394                    med_int *numtab, med_int *n,
    00395                    med_int * typ_ent, med_int * typ_geo)
    00396 #else
    00397 med_int
    00398 nedfgnme (med_int *fid,
    00399           char *maa,med_int *lon1,
    00400           med_int *numtab, med_int *n,
    00401           med_int * typ_ent, med_int * typ_geo)
    00402
    00403 #endif
    00404 {
    00405   med_int ret;
    00406   char *fn1;
    00407
    00408   fn1 = _MED2cstring(maa, (int) * lon1);
    00409
    00410   if (!fn1 )
    00411     return(-1);
    00412
    00413   ret = (med_int) MEDglobalNumEcr((med_idt) *fid, (char *)fn1,
    00414                                   (med_int *) numtab, (med_int) *n,
    00415                                   (med_entite_maillage) *typ_ent,   (med_geometrie_element) *typ_geo);
    00416
    00417   _MEDcstringFree(fn1);
    00418
    00419   return(ret);
    00420 }
    00421
    00422
    00423
    00424 /* lecture d'une numerotation globale */
    00425
    00426 #ifdef PPRO_NT
    00427 med_int
    00428  EDFGNML (med_int *fid,
    00429                    char *maa, unsigned int bidon1, med_int *lon1,
    00430                    med_int *numtab, med_int *n,
    00431                    med_int * typ_ent, med_int * typ_geo)
    00432 #else
    00433 med_int
    00434 nedfgnml (med_int *fid,
    00435           char *maa,med_int *lon1,
    00436           med_int *numtab, med_int *n,
    00437           med_int * typ_ent, med_int * typ_geo)
    00438
    00439 #endif
    00440 {
    00441   med_int ret;
    00442   char *fn1;
    00443
    00444   fn1 = _MED2cstring(maa, (int) * lon1);
    00445
    00446   if (!fn1 )
    00447     return(-1);
    00448
    00449   ret = (med_int) MEDglobalNumLire((med_idt) *fid, (char *)fn1,
    00450                                   (med_int *) numtab, (med_int) *n,
    00451                                   (med_entite_maillage) *typ_ent,   (med_geometrie_element) *typ_geo);
    00452
    00453   _MEDcstringFree(fn1);
    00454
    00455   return(ret);
    00456 }
    00457
    00458
    00459
    00460
    00461