# _MEDsubdomainJointInfo236.c

Aller à la documentation de ce fichier.

    00001 /*  This file is part of MED.
    00002  *
    00003  *  COPYRIGHT (C) 1999 - 2011  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
    00023 #include <string.h>
    00024 #include <stdlib.h>
    00025
    00026 #include <2.3.6/med23v30.h>
    00027 #include <2.3.6/med23v30_proto.h>
    00028 #include "2.3.6/med23v30_misc.h"
    00029
    00030 void _MEDsubdomainJointInfo236(int dummy, ...) {
    00031
    00032
    00033   med_idt  _jntid=0;
    00034   med_err  _ret=-1,_err=-1;
    00035   char     _path[MED_TAILLE_MAA+MED_TAILLE_JNT+MED_TAILLE_NOM+1]=MED_MAA;
    00036   int      _num;
    00037   med_size _nstep=0,_nocstpncorrespondence=0;
    00038
    00039
    00040   MED_VARGS_DECL(const, med_idt      , , fid                   );
    00041   MED_VARGS_DECL(const, char * , const , localmeshname         );
    00042   MED_VARGS_DECL(const, int          , , jointit               );
    00043   MED_VARGS_DECL(, char *, const       , jointname             );
    00044   MED_VARGS_DECL(, char *, const       , description           );
    00045   MED_VARGS_DECL(, med_int *, const    , domainnumber          );
    00046   MED_VARGS_DECL(, char *, const       , remotemeshname        );
    00047   MED_VARGS_DECL(, med_int *, const    , nstep                 );
    00048   MED_VARGS_DECL(, med_int *, const    , nocstpncorrespondence );
    00049   MED_VARGS_DECL(, med_err *                  ,, fret          );
    00050
    00051   va_list params;
    00052   va_start(params,dummy);
    00053
    00054   MED_VARGS_DEF(const, med_idt      , , fid                   );
    00055   MED_VARGS_DEF(const, char * , const , localmeshname         );
    00056   MED_VARGS_DEF(const, int          , , jointit               );
    00057   MED_VARGS_DEF(, char *, const       , jointname             );
    00058   MED_VARGS_DEF(, char *, const       , description           );
    00059   MED_VARGS_DEF(, med_int *, const    , domainnumber          );
    00060   MED_VARGS_DEF(, char *, const       , remotemeshname        );
    00061   MED_VARGS_DEF(, med_int *, const    , nstep                 );
    00062   MED_VARGS_DEF(, med_int *, const    , nocstpncorrespondence );
    00063   MED_VARGS_DEF(, med_err *                  ,, fret          );
    00064
    00065   _num=jointit-1;
    00066
    00067   /*
    00068    * On inhibe le gestionnaire d'erreur HDF 5
    00069    */
    00070   _MEDmodeErreurVerrouiller();
    00071
    00072
    00073   /*
    00074    * On recupere le nom du joint
    00075    */
    00076   strcat(_path,localmeshname);
    00077   strcat(_path,MED_JNT);
    00078   if ( _MEDobjectGetName(fid, _path ,_num, jointname) < 0 ) {
    00079     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(jointit);
    00080     SSCRUTE(_path);
    00081     goto ERROR;
    00082   }
    00083
    00084
    00085   /*
    00086    * Si le Data Group JNT n'existe pas => erreur
    00087    */
    00088   strcat(_path,jointname);
    00089   if ((_jntid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
    00090     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_SUBDOMAINJOINT_MSG);
    00091     SSCRUTE(_path);
    00092     goto ERROR;
    00093   }
    00094
    00095   /*
    00096    * L'attribut "DES"
    00097    */
    00098   if ( _MEDattrStringLire(_jntid,MED_NOM_DES,MED_TAILLE_DESC,description) < 0) {
    00099       MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
    00100       SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_DES);
    00101       goto ERROR;
    00102   }
    00103   /*
    00104    * L'attribut "MAI"
    00105    */
    00106   if ( _MEDattrStringLire(_jntid,MED_NOM_MAI,MED_TAILLE_NOM,remotemeshname) < 0) {
    00107     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
    00108     SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_MAI);SSCRUTE(remotemeshname);
    00109     goto ERROR;
    00110   }
    00111
    00112   /*
    00113    * L'attribut "DOM"
    00114    */
    00115   if (_MEDattrEntierLire(_jntid,MED_NOM_DOM,domainnumber) < 0){
    00116     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
    00117     SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_DOM);ISCRUTE(*domainnumber);
    00118     goto ERROR;
    00119   }
    00120
    00121   /*
    00122    * Nombre du nombre de correspondances dans le joint
    00123    */
    00124
    00125   if ((_err=_MEDnObjects(_jntid, _path, &_nocstpncorrespondence)) < 0 )
    00126     if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
    00127       MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
    00128       goto ERROR;
    00129     }
    00130
    00131   *nocstpncorrespondence = (med_int) _nocstpncorrespondence;
    00132
    00133
    00134   *nstep=1;
    00135
    00136  _ret = 0;
    00137
    00138  ERROR:
    00139
    00140   if (_jntid>0)            if (_MEDdatagroupFermer(_jntid) < 0) {
    00141     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
    00142     ISCRUTE_id(_jntid);
    00143   }
    00144
    00145   va_end(params);
    00146   *fret = _ret;
    00147   return;
    00148 }
    00149
    00150