Debian Codegraph @

src/ci/_MEDequivalenceCorrespondenceSizeInfo30.c

raw symbols SCIP
1 /* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4 * MED is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * MED is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with MED. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19 #include <med.h>
20 #include <med_config.h>
21 #include <med_outils.h>
22 #include <string.h>
23 #include <stdlib.h>
24
25 void _MEDequivalenceCorrespondenceSizeInfo30( int dummy, ...) {
26
27
28 med_err _ret=-1;
29 med_idt _eqid=0,_datagroup1=0,_dataset=0;
30 int _num;
31 char _path[MED_EQUIVALENCE_GRP_SIZE+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+2*MED_TAILLE_NOM_ENTITE+2]=MED_EQUIVALENCE_GRP;
32 char _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]="";
33 char _cstpname[2*MED_MAX_PARA+1]="";
34 med_size _nequivarray=0;
35 med_sorting_type _sortingtype=0;
36 med_int _intentitytype;
37 med_int _intgeotype;
38
39
40 MED_VARGS_DECL(const, med_idt , , fid );
41 MED_VARGS_DECL(const, char * , const , meshname );
42 MED_VARGS_DECL(const, char * , const , equivname);
43 MED_VARGS_DECL(const, med_int , , numdt );
44 MED_VARGS_DECL(const, med_int , , numit );
45 MED_VARGS_DECL(const, int , , corit );
46 MED_VARGS_DECL(, med_entity_type *, const , entitype );
47 MED_VARGS_DECL(, med_geometry_type*, const , geotype );
48 MED_VARGS_DECL(, med_int *, const , nentity );
49 MED_VARGS_DECL(, med_err * ,, fret );
50
51 va_list params;
52 va_start(params,dummy);
53
54 MED_VARGS_DEF(const, med_idt , , fid );
55 MED_VARGS_DEF(const, char * , const , meshname );
56 MED_VARGS_DEF(const, char * , const , equivname);
57 MED_VARGS_DEF(const, med_int , , numdt );
58 MED_VARGS_DEF(const, med_int , , numit );
59 MED_VARGS_DEF(const, int , , corit );
60 MED_VARGS_DEF(, med_entity_type *, const , entitype );
61 MED_VARGS_DEF(, med_geometry_type*, const , geotype );
62 MED_VARGS_DEF(, med_int *, const , nentity );
63 MED_VARGS_DEF(, med_err * ,, fret );
64
65 _num = corit -1;
66
67 /*
68 * On inhibe le gestionnaire d'erreur
69 */
70
71 _MEDmodeErreurVerrouiller();
72
73
74 if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) {
75 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd");
76 SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR;
77 }
78
79
80 strcat( _path, meshname);
81 strcat( _path, "/");
82 strcat( _path, equivname);
83 strcat( _path, "/");
84 _MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]);
85 strcat( _path, "/");
86
87 /*
88 * On recupere le nom de <entitype>[.<geotype>]
89 */
90 if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
91 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
92 goto ERROR;
93 }
94
95 if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) {
96 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
97 goto ERROR;
98 }
99
100 /*lecture typent et geotype */
101 if (_MEDattrEntierLire(_datagroup1,MED_NOM_ENT,&_intentitytype) < 0) {
102 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
103 ISCRUTE(_intentitytype);goto ERROR;
104 }
105 *entitype = (med_entity_type) _intentitytype;
106
107 if (_MEDattrEntierLire(_datagroup1,MED_NOM_GEO,&_intgeotype) < 0) {
108 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
109 ISCRUTE(_intgeotype);goto ERROR;
110 }
111 *geotype = (med_geometry_type) _intgeotype;
112
113 if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) {
114 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR);
115 SSCRUTE(_path);
116 goto ERROR;
117 }
118
119 if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentity) < 0) {
120 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
121 SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentity);
122 goto ERROR;
123 }
124
125 _ret = 0;
126 ERROR:
127
128 if (_dataset>0) if (_MEDdatasetFermer(_dataset) < 0) {
129 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR);
130 ISCRUTE_id(_dataset);
131 }
132
133 if (_datagroup1>0) if (_MEDdatagroupFermer(_datagroup1) < 0) {
134 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
135 ISCRUTE_id(_datagroup1);
136 }
137
138
139 va_end(params);
140 *fret = _ret;
141
142 return;
143 }