# gausscf.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
    00026 #define nedfngau F77_FUNC(edfngau,EDFNGAU)
    00027 #define nedfgaui F77_FUNC(edfgaui,EDFGAUI)
    00028 #define nedfgaue F77_FUNC(edfgaue,EDFGAUE)
    00029 #define nedfgaul F77_FUNC(edfgaul,EDFGAUL)
    00030
    00031 #ifdef PPRO_NT
    00032 med_int
    00033  EDFGAUI(med_int *fid, med_int *indice, char * locname, unsigned int bidon,
    00034                   med_int *typ_geo, med_int *ngauss)
    00035 #else
    00036 med_int
    00037 nedfgaui(med_int *fid,med_int *indice, char * locname,
    00038          med_int *typ_geo, med_int *ngauss)
    00039 #endif
    00040 {
    00041   med_int ret;
    00042   char fs1[MED_TAILLE_NOM+1];
    00043   med_geometrie_element type;
    00044
    00045   ret = (med_int) MEDgaussInfo((med_idt)*fid,(med_int) *indice, (char *) fs1,
    00046                                &type, (med_int *) ngauss);
    00047
    00048   strncpy(locname,fs1,MED_TAILLE_NOM);
    00049   _MEDfstring(locname,MED_TAILLE_NOM);
    00050   *typ_geo = (med_int) type;
    00051
    00052   return(ret);
    00053 }
    00054
    00055
    00056 #ifdef PPRO_NT
    00057 med_int
    00058  EDFNGAU(med_int *fid)
    00059 #else
    00060 med_int
    00061 nedfngau(med_int *fid)
    00062 #endif
    00063 {
    00064   med_int ret;
    00065
    00066   ret = (med_int) MEDnGauss((med_idt) *fid);
    00067
    00068   return(ret);
    00069 }
    00070
    00071
    00072 #ifdef PPRO_NT
    00073 med_int
    00074  EDFGAUE(med_int *fid,med_int *typ_geo,
    00075                   med_float *refcoo, med_int *mode_coo,
    00076                   med_int *ngauss, med_float *gscoo, med_float *wg,
    00077                   char *locname, unsigned int bidon1, med_int *lon1)
    00078 #else
    00079 med_int
    00080 nedfgaue(med_int *fid,med_int *typ_geo,
    00081                   med_float *refcoo, med_int *mode_coo,
    00082                   med_int *ngauss, med_float *gscoo, med_float *wg,
    00083                   char *locname, med_int *lon1)
    00084 #endif
    00085 {
    00086   med_int ret;
    00087   char *fn1;
    00088   med_geometrie_element type = (med_geometrie_element) *typ_geo;
    00089   med_mode_switch mode = (med_mode_switch) *mode_coo;
    00090
    00091   fn1 = _MED2cstring(locname, (int) * lon1);
    00092
    00093   if (!fn1) return(-1);
    00094
    00095   ret = (med_int) MEDgaussEcr( (med_idt) *fid, type,
    00096                                (med_float *) refcoo, mode,
    00097                                (med_int) *ngauss, (med_float *) gscoo, (med_float *) wg,
    00098                                (char *) fn1);
    00099
    00100   _MEDcstringFree(fn1);
    00101
    00102   return (ret);
    00103 }
    00104
    00105
    00106 #ifdef PPRO_NT
    00107 med_int
    00108  EDFGAUL(med_int * fid, med_float *refcoo, med_float *gscoo, med_float * wg,
    00109                   med_int *mode_coo, char *locname, unsigned int bidon1, med_int *lon1)
    00110 #else
    00111 med_int
    00112 nedfgaul(med_int * fid, med_float *refcoo, med_float *gscoo, med_float * wg,
    00113          med_int *mode_coo, char *locname, med_int *lon1)
    00114 #endif
    00115 {
    00116   med_int ret;
    00117   char *fn1;
    00118   med_mode_switch mode = (med_mode_switch) *mode_coo;
    00119
    00120   fn1 = _MED2cstring(locname, (int) * lon1);
    00121
    00122   if (!fn1) return(-1);
    00123
    00124   ret = (med_int) MEDgaussLire( (med_idt) *fid, (med_float *) refcoo, (med_float *)gscoo,
    00125                                 (med_float *) wg, mode,
    00126                                 (char *) fn1);
    00127
    00128   _MEDcstringFree(fn1);
    00129
    00130   return (ret);
    00131 }
    00132