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

Généré le Mon May 16 17:10:22 2011 pour MED fichier par  doxygen 1.6.1