# _MEDsubdomainCorrespondenceSizeInfo30.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 #include <string.h>
    00023 #include <stdlib.h>
    00024
    00025 void _MEDsubdomainCorrespondenceSizeInfo30(int dummy, ...) {
    00026
    00027
    00028   med_err  _ret=-1;
    00029   med_idt  _datagroup1=0,_dataset=0;
    00030   int      _num;
    00031   char     _path[MED_TAILLE_JNT+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+4*MED_TAILLE_NOM_ENTITE+4]=MED_JNT;
    00032   char     _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]="";
    00033   char     _cstpname[2*MED_MAX_PARA+1]="";
    00034   med_sorting_type  _sortingtype=0;
    00035   med_int   _intlocalentitype;
    00036   med_int   _intlocalgeotype;
    00037   med_int   _intremoteentitype;
    00038   med_int   _intremotegeotype;
    00039
    00040
    00041   MED_VARGS_DECL(const, med_idt              , , fid            );
    00042   MED_VARGS_DECL(const, char * , const         , meshname       );
    00043   MED_VARGS_DECL(const, char * , const         , jointname      );
    00044   MED_VARGS_DECL(const, med_int              , , numdt          );
    00045   MED_VARGS_DECL(const, med_int              , , numit          );
    00046   MED_VARGS_DECL(const, int                  , , corit          );
    00047   MED_VARGS_DECL(, med_entity_type   *, const  , localentitype  );
    00048   MED_VARGS_DECL(, med_geometry_type *, const  , localgeotype   );
    00049   MED_VARGS_DECL(, med_entity_type   *, const  , remoteentitype );
    00050   MED_VARGS_DECL(, med_geometry_type *, const  , remotegeotype  );
    00051   MED_VARGS_DECL(, med_int *, const            , nentitycor     );
    00052   MED_VARGS_DECL(, med_err *                  ,, fret           );
    00053
    00054   va_list params;
    00055   va_start(params,dummy);
    00056
    00057   MED_VARGS_DEF(const, med_idt              , , fid            );
    00058   MED_VARGS_DEF(const, char * , const         , meshname       );
    00059   MED_VARGS_DEF(const, char * , const         , jointname      );
    00060   MED_VARGS_DEF(const, med_int              , , numdt          );
    00061   MED_VARGS_DEF(const, med_int              , , numit          );
    00062   MED_VARGS_DEF(const, int                  , , corit          );
    00063   MED_VARGS_DEF(, med_entity_type   *, const  , localentitype  );
    00064   MED_VARGS_DEF(, med_geometry_type *, const  , localgeotype   );
    00065   MED_VARGS_DEF(, med_entity_type   *, const  , remoteentitype );
    00066   MED_VARGS_DEF(, med_geometry_type *, const  , remotegeotype  );
    00067   MED_VARGS_DEF(, med_int *, const            , nentitycor     );
    00068   MED_VARGS_DEF(, med_err *                  ,, fret           );
    00069
    00070   _num = corit -1;
    00071
    00072   /*
    00073    * On inhibe le gestionnaire d'erreur
    00074    */
    00075
    00076   _MEDmodeErreurVerrouiller();
    00077
    00078
    00079   if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) {
    00080     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd");
    00081     SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR;
    00082   }
    00083
    00084
    00085   strcat( _path, meshname);
    00086   strcat( _path, "/");
    00087   strcat( _path, jointname);
    00088   strcat( _path, "/");
    00089   _MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]);
    00090   strcat( _path, "/");
    00091
    00092   /*
    00093    * On recupere le nom de <localentitype>[.<localgeotype>].<remoteentitype>[.<remotegeotype>]
    00094    */
    00095   if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
    00096     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
    00097     goto ERROR;
    00098   }
    00099
    00100   if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) {
    00101     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
    00102     goto ERROR;
    00103   }
    00104
    00105   /*lecture localentitype et localgeotype */
    00106   if (_MEDattrEntierLire(_datagroup1,MED_NOM_ENT,&_intlocalentitype) < 0) {
    00107     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
    00108     ISCRUTE(_intlocalentitype);goto ERROR;
    00109   }
    00110   *localentitype = (med_entity_type) _intlocalentitype;
    00111
    00112   if (_MEDattrEntierLire(_datagroup1,MED_NOM_GEO,&_intlocalgeotype) < 0) {
    00113     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    00114     ISCRUTE(_intlocalgeotype);goto ERROR;
    00115   }
    00116   *localgeotype = (med_geometry_type) _intlocalgeotype;
    00117
    00118   /*lecture remoteentitype et remotegeotype */
    00119   if (_MEDattrEntierLire(_datagroup1,MED_NOM_END,&_intremoteentitype) < 0) {
    00120     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
    00121     ISCRUTE(_intremoteentitype);goto ERROR;
    00122   }
    00123   *remoteentitype = (med_entity_type) _intremoteentitype;
    00124
    00125   if (_MEDattrEntierLire(_datagroup1,MED_NOM_GED,&_intremotegeotype) < 0) {
    00126     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    00127     ISCRUTE(_intremotegeotype);goto ERROR;
    00128   }
    00129   *remotegeotype = (med_geometry_type) _intremotegeotype;
    00130
    00131   if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) {
    00132     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR);
    00133     SSCRUTE(_path);
    00134     goto ERROR;
    00135   }
    00136
    00137   if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentitycor) < 0) {
    00138     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
    00139     SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentitycor);
    00140     goto ERROR;
    00141   }
    00142
    00143   _ret = 0;
    00144  ERROR:
    00145
    00146   if (_dataset>0)     if (_MEDdatasetFermer(_dataset) < 0) {
    00147     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR);
    00148     ISCRUTE_id(_dataset);
    00149   }
    00150
    00151   if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
    00152     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
    00153     ISCRUTE_id(_datagroup1);
    00154   }
    00155
    00156   va_end(params);
    00157   *fret = _ret;
    00158   return;
    00159 }