MED fichier: Fichier source de MAJ_320_330_champs.c

MED fichier

MAJ_320_330_champs.c
Aller à la documentation de ce fichier.
1 /* This file is part of MED.
2 *
3 * COPYRIGHT (C) 1999 - 2023 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_config.h"
20 #include "med_outils.h"
21 #include "med.h"
22
23 #include <string.h>
24
25 #include "MAJ_320_330.h"
26 #include "MAJ_version.h"
27
28 #define USER_MODE MED_COMPACT_STMODE
29
30 med_err getFieldsOn(med_idt fid,
31 const char * const nommaa,
32 med_int nmodels,
33 const med_geometry_type* geotype_elst,
34 const char * geotypename_elst,
35 const char * const nomcha,
36 const char * const dtunit,
37 const med_field_type typcha,
38 const med_int ncomp,
39 const char * const comp,
40 const char * const unit,
41 const med_entity_type entite,
42 const med_switch_mode stockage,
43 const med_int ncstp) {
44
45 int i,j,k,l,m,n,nb_geo=0;
46 med_int nbpdtnor=0,pflsize,*pflval,ngauss=0,ngroup,nval;
47 med_int numdt=0,numo=0,nprofile=0;
48 med_int meshnumdt=0, meshnumit=0 ;
49 med_size medtype_size=0;
50 med_size _sizei=0,_sizef=0,_sizeNbr=0;
51 med_float dt=0.0;
52 unsigned char *val = NULL;
53 med_err ret=0;
54 char pflname [MED_NAME_SIZE+1]="";
55 char _profilename [MED_NAME_SIZE+1]="";
56 char locname [MED_NAME_SIZE+1]="";
57 char _pathi[(MED_FIELD_GRP_SIZE +MED_NAME_SIZE+1)+2*MED_MAX_PARA+1] = MED_FIELD_GRP;
58 char _pathf[(MED_FIELD_GRP_SIZE+1+MED_NAME_SIZE+1)+2*MED_MAX_PARA+1] = "/CHA_/";
59 char _pathtmp[MED_FIELD_GRP_SIZE+3]="/CHA__/";
60 char _getNBR[(MED_FIELD_GRP_SIZE+1+MED_NAME_SIZE+1)+(2*MED_MAX_PARA+1)+(2*MED_TAILLE_NOM_ENTITE+2)+(MED_NAME_SIZE+1)+MED_TAILLE_NOM_ENTITE+1] = MED_FIELD_GRP;
61 char _entitygeotypename[2*MED_TAILLE_NOM_ENTITE+2]="";
62 char * lien = NULL;
63 med_bool _fieldexist = MED_FALSE;
64 med_bool _meshexist = MED_FALSE;
65 med_int _nentFromMesh = 0;
66 med_int _nentFromField = 0;
67 med_int _nent = 0;
68 med_geometry_type *type_geo;
69 med_data_type meddatatype = MED_CONNECTIVITY;
70 med_bool changement = MED_FALSE;
71 med_bool transformation = MED_FALSE;
72 htri_t _datasetexist;
73
74 const char * const * AFF;
75 const char * const * AFF_ENT=MED_GET_ENTITY_TYPENAME+1;
76 const char * * AFF_STRUCT = NULL;
77
78 switch (entite) {
79 case MED_NODE :
80 type_geo = MED_GET_NODE_GEOMETRY_TYPE;
81 nb_geo = MED_N_NODE_FIXED_GEO;
82 AFF = MED_GET_NODE_GEOMETRY_TYPENAME;
83 meddatatype = MED_COORDINATE;
84 break;
85 case MED_CELL :
86 case MED_NODE_ELEMENT :
87 type_geo = MED_GET_CELL_GEOMETRY_TYPE;
88 nb_geo = MED_N_CELL_FIXED_GEO;
89 AFF = MED_GET_CELL_GEOMETRY_TYPENAME;
90 break;
91 case MED_DESCENDING_FACE :
92 type_geo = MED_GET_FACE_GEOMETRY_TYPE;
93 nb_geo = MED_N_FACE_FIXED_GEO;
94 AFF = MED_GET_FACE_GEOMETRY_TYPENAME;
95 break;
96 case MED_DESCENDING_EDGE :
97 type_geo = MED_GET_EDGE_GEOMETRY_TYPE;
98 nb_geo = MED_N_EDGE_FIXED_GEO;
99 AFF = MED_GET_EDGE_GEOMETRY_TYPENAME;
100 break;
101 case MED_STRUCT_ELEMENT :
102 AFF_STRUCT = (const char * *) calloc(sizeof(const char * ),nmodels+1);
103 for(i=0;i<nmodels;++i) AFF_STRUCT[i+1]= &geotypename_elst[(MED_NAME_SIZE+1)*i];
104 type_geo = (med_geometry_type*)(geotype_elst)-1;
105 nb_geo = nmodels;
106 AFF = AFF_STRUCT;
107 break;
108
109 }
110
111
112 for (k=1;k<=nb_geo;k++) {
113
114 /* Combien de séquences (PDT,NOR) a lire */
115 nbpdtnor = ncstp;
116 if (nbpdtnor < 1 ) continue;
117
118 for (j=0;j<nbpdtnor;j++) {
119
120 if ( MEDfieldComputingStepMeshInfo(fid, nomcha, j+1, &numdt, &numo,
121 &dt, &meshnumdt, &meshnumit) < 0 ) {
122 MESSAGE("Erreur a l'appel de MEDfieldComputingStepMeshInfo : ");
123 EXIT_IF(NULL == NULL,NULL,NULL);
124 }
125
126 if ( (nprofile = MEDfieldnProfile(fid,nomcha,numdt,numo,entite,type_geo[k],
127 pflname,locname ) ) < 0 ) {
128 MESSAGE("Erreur a la demande du nombre de profils referencés par le champ : ");
129 SSCRUTE(nomcha);
130 ISCRUTE(numdt); ISCRUTE(numo);
131 ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
132 SSCRUTE(AFF_ENT[(int)entite]);SSCRUTE(AFF[k]);
133 EXIT_IF(NULL == NULL,NULL,NULL);
134 };
135
136
137 for (l=0;l<nprofile;l++) {
138
139 if ( (nval = MEDfieldnValueWithProfile(fid, nomcha, numdt, numo, entite, type_geo[k],
140 l+1, USER_MODE, pflname, &pflsize,
141 locname, &ngauss) ) < 0 ) {
142 MESSAGE("Erreur a la lecture du nombre de valeurs du champ : ");
143 SSCRUTE(nomcha);ISCRUTE(numdt);ISCRUTE(numo);
144 ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
145 ISCRUTE_int(USER_MODE);
146 EXIT_IF(NULL == NULL,NULL,NULL);
147 };
148
149 /* printf("\n +Pas de Temps n."IFORMAT" (%f) [%s], n. d'ordre "IFORMAT", avec "IFORMAT" valeur(s) par entité.\n",numdt,dt,dtunit,numo,ngauss); */
150 /* printf("\t- Il y a "IFORMAT" entités qui portent des valeurs en mode %i. Chaque entite %s\ */
151 /* de type geometrique %s associes au profile |%s| a "IFORMAT" valeurs associées \n", */
152 /* nval,USER_MODE,AFF_ENT[(int)entite],AFF[k],pflname,ngauss); */
153
154 /*Lecture des valeurs du champ */
155 switch(typcha) {
156 case MED_FLOAT64: medtype_size=sizeof(med_float64); break;
157 case MED_FLOAT32: medtype_size=sizeof(med_float32); break;
158 case MED_INT32 : medtype_size=sizeof(med_int32 ); break;
159 case MED_INT64 : medtype_size=sizeof(med_int64 );
160 break;
161 case MED_INT : medtype_size=sizeof(med_int) ; break;
162 default:
163 MESSAGE("Erreur a la lecture du type de champ : ");
164 ISCRUTE_int(typcha);
165 EXIT_IF(NULL == NULL,NULL,NULL);
166 }
167
168 val = (unsigned char*) calloc(ncomp*nval*ngauss,medtype_size);
169 EXIT_IF(val == NULL,"L'appel de calloc a échoué ",NULL);
170
171 if (MEDfieldValueWithProfileRd(fid, nomcha, numdt, numo, entite,type_geo[k],
172 USER_MODE, pflname, stockage, MED_ALL_CONSTITUENT, val) < 0 ) {
173 MESSAGE("Erreur a la lecture des valeurs du champ : ");
174 SSCRUTE(nomcha);ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
175 ISCRUTE(numdt);ISCRUTE(numo);
176 EXIT_IF(NULL == NULL,NULL,NULL);
177 }
178
179 strncpy(&_getNBR[MED_FIELD_GRP_SIZE],nomcha,MED_NAME_SIZE+1);
180 _sizeNbr = MED_FIELD_GRP_SIZE+strlen(nomcha);
181 _getNBR[_sizeNbr]='/';++_sizeNbr;
182 MED_ERR_EXIT_IF(_MEDgetComputationStepName(MED_SORT_DTIT,numdt,numo,&_getNBR[_sizeNbr])<0,
183 MED_ERR_CALL,MED_ERR_API,"_MEDgetEntityGeoTypeName");
184 _sizeNbr += 2*MED_MAX_PARA;
185 _getNBR[_sizeNbr]='/';++_sizeNbr;
186 MED_ERR_EXIT_IF(_MEDgetFieldEntityGeoTypeName(fid,_entitygeotypename,entite,type_geo[k])<0,
187 MED_ERR_CALL,MED_ERR_API,"_MEDgetFieldEntityGeoTypeName");
188 strncpy(&_getNBR[_sizeNbr],_entitygeotypename,2*MED_TAILLE_NOM_ENTITE+2);
189 _sizeNbr += strlen(_entitygeotypename);
190 _getNBR[_sizeNbr]='/';++_sizeNbr;
191 if ( strlen(pflname) )
192 strncpy(_profilename,pflname,MED_NAME_SIZE+1);
193 else
194 strncpy(_profilename,MED_NO_PROFILE_INTERNAL,MED_NAME_SIZE+1);
195 strncpy(&_getNBR[_sizeNbr],_profilename,MED_NAME_SIZE+1);
196 _sizeNbr += strlen(_profilename);
197
198 /* SSCRUTE(_getNBR); */
199 MED_ERR_EXIT_IF(_MEDattributeNumRdByName( fid, _getNBR, MED_NOM_NBR, MED_INTERNAL_INT, (unsigned char *) &_nentFromField) <0,
200 MED_ERR_CALL,MED_ERR_API,"_MEDattributeStringRdByName");
201 /* ISCRUTE_int(_nentFromField); */
202
203 EXIT_IF( H5Gmove(fid, _pathi, _pathtmp ) < 0,"Switch to ",_pathtmp);
204 /* Nous sommes dans une boucle sur les champs :
205 On récupère donc les champs en cours de transformation dans _pathtmp
206 et on les replace ds _pathi pour y travailler.
207 */
208 _datasetexist=H5Lexists( fid, _pathf, H5P_DEFAULT );
209 if (_datasetexist ) { EXIT_IF( (H5Gmove(fid, _pathf, _pathi ) < 0) ,"Switch to ",_pathi); }
210
211 /* Création du champ destination */
212 /* ATTENTION appel de MAJ_version avec fid,num
213 et non juste fid --> futures procédures de MAJ_330_... */
214 /* MAJ_version(fid); */
215 MAJ_version_num(fid,3,3,0);
216
217 /* Ajout du champ au nouveau format dans le _pathi */
218 /* Le champ peut déjà avoir été crée s'il y a plusieurs étapes de calcul */
219 MEDfileObjectExist(fid,MED_FIELD,nomcha,&_fieldexist);
220 if (!_fieldexist) {
221 MED_ERR_EXIT_IF( MEDfieldCr(fid,nomcha,typcha,ncomp,comp,unit,dtunit,nommaa ) < 0,
222 MED_ERR_CREATE,MED_ERR_FIELD,nomcha);
223 }
224
225 MEDfileObjectExist(fid,MED_MESH,nommaa,&_meshexist);
226 if (_meshexist) {
227 if ( (_nentFromMesh = MEDmeshnEntity( fid, nommaa, meshnumdt, meshnumit, entite, type_geo[k],
228 meddatatype, MED_NODAL, &changement, &transformation )
229 ) < 0 )
230 if ( (_nentFromMesh = MEDmeshnEntity( fid, nommaa, meshnumdt, meshnumit, entite, type_geo[k],
231 meddatatype, MED_DESCENDING, &changement, &transformation )
232 ) < 0 ) {
233 MESSAGE("Erreur a la lecture du nombre total d'entités supports au champ : ");
234 SSCRUTE(nomcha); ISCRUTE(numdt); ISCRUTE(numo);
235 SSCRUTE(nommaa); ISCRUTE(meshnumdt); ISCRUTE(meshnumit);
236 ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
237 SSCRUTE(AFF_ENT[(int)entite]);SSCRUTE(AFF[k]);
238 EXIT_IF(_nentFromMesh < 0, NULL,NULL);
239 }
240 MED_ERR_EXIT_IF ( _nentFromMesh != _nentFromField, MED_ERR_INVALID, MED_ERR_ATTRIBUTE,
241 "Le nombre global d'entités support au champ ne correspond pas au nombre d'entitées"
242 " du maillage associé !" );
243 _nent = _nentFromMesh;
244 /* ISCRUTE_int(_nentFromMesh); */
245
246 } else {
247 _nent = _nentFromField;
248 fprintf(stdout," ... Le maillage [%s] associé au champ n'est pas local,"
249 " utilisation du champ pour déterminer le nbre global d'entités [%s] : "IFORMAT" ...\n",
250 nommaa,_entitygeotypename,_nent);
251 }
252
253
254 MED_ERR_EXIT_IF( MEDfieldValueWithProfileWr(fid, nomcha ,numdt, numo , dt,
255 entite, type_geo[k], USER_MODE, pflname,
256 locname, stockage, MED_ALL_CONSTITUENT,
257 _nent, (unsigned char*) val) < 0,
258 MED_ERR_WRITE,MED_ERR_FIELD,_pathf);
259
260 MED_ERR_EXIT_IF( MEDfieldComputingStepMeshWr(fid, nomcha, numdt, numo, meshnumdt, meshnumit ) < 0,
261 MED_ERR_WRITE,MED_ERR_FIELD,nomcha);
262
263
264 EXIT_IF( H5Gmove(fid, _pathi , _pathf ) < 0,"Switch to ",_pathf);
265 EXIT_IF( H5Gmove(fid, _pathtmp, _pathi ) < 0,"Switch to ",_pathi);
266
267 if ( val ) {free(val);val = NULL;}
268
269 MAJ_version_num(fid,3,2,1);
270 fprintf(stdout," ... Normalisation des données de type entier effectuée...\n");
271
272 } /* fin for sur les différents profils */
273 } /* fin for sur les étapes de calcul */
274 } /* fin for sur les types géométriques de maille */
275
276 free(AFF_STRUCT);
277 return ret;
278 }
279
280
281
282 void MAJ_320_330_champs(med_idt fid)
283 {
284 med_err ret=0,lret=0;
285 med_field_type typcha;
286 char nomcha [MED_NAME_SIZE+1]="";
287 char meshname [MED_NAME_SIZE+1]="";
288 char dtunit [MED_SNAME_SIZE+1]="";
289 char *comp= NULL, *unit= NULL;
290 med_int ncomp,ncha;
291 med_int ncstp=0;
292 med_bool local=MED_FALSE;
293 htri_t _datasetexist;
294 char _pathi[(MED_FIELD_GRP_SIZE +MED_NAME_SIZE+1)+2*MED_MAX_PARA+1] = MED_FIELD_GRP;
295 char _pathf[(MED_FIELD_GRP_SIZE+1+MED_NAME_SIZE+1)+2*MED_MAX_PARA+1] = "/CHA_/";
296 char _pathtmp[MED_FIELD_GRP_SIZE+3]="/CHA__/";
297 int i=0,_num=0;
298 /* char _cstpname[2*MED_MAX_PARA+1]=""; */
299 med_int _nmodels=0;
300 med_switch_mode mode_coo = MED_NO_INTERLACE;
301
302 med_geometry_type * geotype_elst;
303 char * geotypename_elst;
304
305 med_geometry_type _geotype=MED_NONE;
306 char _elementname[MED_NAME_SIZE+1]="";
307 med_int _elementdim=0;
308 char _supportmeshname[MED_NAME_SIZE+1]="";
309 med_entity_type _entitytype=MED_UNDEF_ENTITY_TYPE;
310 med_int _nnode=0;
311 med_int _ncell=0;
312 med_geometry_type _geocelltype=MED_NONE;
313 char _geocelltypename[MED_SNAME_SIZE+1]="";
314 med_int _nconstantattribute=0;
315 med_bool _anyprofile=MED_FALSE;
316 med_int _nvariableattribute=0;
317
318 MAJ_version_num(fid,3,2,1);
319
320 _nmodels = MEDnStructElement(fid);
321 EXIT_IF(_nmodels < 0,"lors de la lecture du nombre d'éléments de structure",NULL);
322
323 /* nmailles_elst = (med_int *) malloc(_nmodels*sizeof(med_int)); */
324 geotype_elst = (med_geometry_type *) malloc(_nmodels*sizeof(med_geometry_type));
325 geotypename_elst = (char *) malloc(_nmodels*sizeof(char)*(MED_NAME_SIZE+1));
326
327 for (i=0; i < _nmodels; i++) {
328 ret= MEDstructElementInfo(fid, i+1, &geotypename_elst[i*(MED_NAME_SIZE+1)], &geotype_elst[i],
329 &_elementdim, _supportmeshname,
330 &_entitytype, &_nnode, &_ncell, &_geocelltype,
331 &_nconstantattribute, &_anyprofile, &_nvariableattribute );
332 EXIT_IF(ret < 0,"lors de la demande d'information sur les éléments de structure",NULL);
333
334 }
335
336 /* combien de champs dans le fichier */
337 ncha = MEDnField(fid);
338 EXIT_IF(ncha < 0,"lors de la lecture du nombre de champs",NULL);
339
340 /* MAJ des champs */
341 for (i=0;i<ncha;i++) {
342
343 /* Lecture du nombre de composantes */
344 ncomp = MEDfieldnComponent(fid,i+1);
345 if (ncomp < 0) {
346 MESSAGE("Erreur à la lecture du nombre de composantes : "); ISCRUTE(ncomp);
347 exit(1);
348 }
349
350 /* Lecture du type du champ, des noms des composantes et du nom de l'unité*/
351 comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
352 EXIT_IF(comp == NULL,NULL,NULL);
353 unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
354 EXIT_IF(unit == NULL,NULL,NULL);
355
356 ret = MEDfieldInfo(fid,i+1,nomcha,meshname,&local,&typcha,comp,unit,dtunit,&ncstp);
357 MED_ERR_EXIT_IF(ret,MED_ERR_ACCESS,MED_ERR_FIELD,nomcha);
358
359 if ( (typcha != MED_INT32) && (typcha != MED_INT64) ) goto CONT;
360
361 fprintf(stdout," >>> Normalisation du champ [%s] \n",nomcha);
362
363 /* champs aux noeuds */
364 lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst,geotypename_elst,
365 nomcha, dtunit, typcha, ncomp, comp, unit, MED_NODE, mode_coo, ncstp);
366
367 /* champs sur les elements et aux points de Gauss */
368 if (lret == 0) lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst, geotypename_elst,
369 nomcha, dtunit, typcha, ncomp, comp, unit, MED_CELL, mode_coo, ncstp);
370 else { MESSAGE("Erreur à la lecture des champs aux noeuds "); ret = -1; continue;}
371
372 if (lret == 0) lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst, geotypename_elst,
373 nomcha, dtunit, typcha, ncomp, comp, unit, MED_DESCENDING_FACE, mode_coo, ncstp);
374 else { MESSAGE("Erreur à la lecture des champs aux mailles "); ret = -1; continue;}
375
376 if (lret == 0) lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst, geotypename_elst,
377 nomcha, dtunit, typcha, ncomp, comp, unit, MED_DESCENDING_EDGE, mode_coo, ncstp);
378 else {MESSAGE("Erreur à la lecture des champs aux faces "); ret = -1; continue;}
379
380 if (lret == 0) lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst, geotypename_elst,
381 nomcha, dtunit, typcha, ncomp, comp, unit, MED_NODE_ELEMENT,mode_coo, ncstp);
382 else {MESSAGE("Erreur a la lecture des champs aux aretes "); ret = -1; continue;}
383
384 if (lret != 0) {MESSAGE("Erreur a la lecture des champs aux noeuds des mailles "); ret = -1;};
385
386 if (_nmodels)
387 lret = getFieldsOn(fid, meshname, _nmodels, geotype_elst,geotypename_elst,
388 nomcha, dtunit, typcha, ncomp, comp, unit, MED_STRUCT_ELEMENT,mode_coo, ncstp);
389 if (lret != 0) {MESSAGE("Erreur a la lecture des champs aux éléments de sructure "); ret = -1;};
390
391 /*A ce stade _pathf contient les champs au nouveau format */
392 /*A ce stade _pathi contient les champs initiaux */
393 strncpy(&_pathi[MED_FIELD_GRP_SIZE] ,nomcha,MED_NAME_SIZE+1);
394 strncpy(&_pathf[MED_FIELD_GRP_SIZE+1],nomcha,MED_NAME_SIZE+1);
395
396 EXIT_IF( (H5Ldelete(fid, _pathi , H5P_DEFAULT) < 0) ,"Delete " ,_pathi);
397 /* if ( H5Ldelete(fid, _pathi , H5P_DEFAULT) < 0) H5Eprint(stderr); */
398 EXIT_IF( (H5Gmove (fid, _pathf , _pathi ) < 0) ,"Moving ",_pathf);
399 /* if (H5Gmove (fid, _pathf , _pathi ) < 0) H5Eprint(stdout); */
400
401 fprintf(stdout," >>> Normalisation du champ [%s] : ... OK ... \n",nomcha);
402
403 strncpy(_pathi,MED_FIELD_GRP,MED_FIELD_GRP_SIZE+1 );
404 strncpy(_pathf,"/CHA_/" ,MED_FIELD_GRP_SIZE+1 +1);
405
406 CONT:
407
408 free(comp);
409 free(unit);
410 /* MAJ_version_num(fid,3,2,1); */
411 }
412
413 _datasetexist=H5Lexists( fid, _pathf, H5P_DEFAULT );
414 if (_datasetexist ) {
415 /* EXIT_IF( (H5Ldelete(fid,_pathi, H5P_DEFAULT) < 0) ,"Delete ",_pathi); */
416 /* EXIT_IF( (H5Gmove(fid, _pathf, _pathi ) < 0) ,"Switch to ",_pathf); */
417 EXIT_IF( (H5Ldelete(fid,_pathf, H5P_DEFAULT) < 0) ,"Delete ",_pathf);
418 }
419 free(geotype_elst);
420 free(geotypename_elst);
421
422 /* _MEDobjetsOuverts(fid); */
423
424 }
MEDfieldInfo
MEDC_EXPORT med_err MEDfieldInfo(const med_idt fid, const int ind, char *const fieldname, char *const meshname, med_bool *const localmesh, med_field_type *const fieldtype, char *const componentname, char *const componentunit, char *const dtunit, med_int *const ncstp)
Cette fonction permet de lire les informations concernant le champ d'indice ind .
Definition: MEDfieldInfo.c:42
MED_FIELD_GRP_SIZE
#define MED_FIELD_GRP_SIZE
Definition: med_outils.h:170
MED_ERR_API
#define MED_ERR_API
Definition: med_err.h:111
MED_ERR_CREATE
#define MED_ERR_CREATE
Definition: med_err.h:27
MED_ERR_FIELD
#define MED_ERR_FIELD
Definition: med_err.h:91
MAJ_version_num
void MAJ_version_num(med_idt fid, const int majeur, const int mineur, const int release)
Definition: MAJ_version.c:23
MEDfieldnValueWithProfile
MEDC_EXPORT med_int MEDfieldnValueWithProfile(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, const int profileit, const med_storage_mode storagemode, char *const profilename, med_int *const profilesize, char *const localizationname, med_int *const nintegrationpoint)
Cette fonction permet de lire le nombre de valeurs à lire dans un champ pour une étape de calcul,...
Definition: MEDfieldnValueWithProfile.c:45
med_geometry_type
int med_geometry_type
Definition: med.h:196
MED_SNAME_SIZE
#define MED_SNAME_SIZE
Definition: med.h:84
med_int64
int64_t med_int64
Definition: med.h:346
ISCRUTE_int
#define ISCRUTE_int(entier)
Definition: med_utils.h:314
med_size
hsize_t med_size
Definition: med.h:331
MED_NO_INTERLACE
Definition: med.h:100
med_idt
hid_t med_idt
Definition: med.h:333
MED_FALSE
Definition: med.h:262
MEDstructElementInfo
MEDC_EXPORT med_err MEDstructElementInfo(const med_idt fid, const int mit, char *const modelname, med_geometry_type *const mgeotype, med_int *const modeldim, char *const supportmeshname, med_entity_type *const sentitytype, med_int *const snnode, med_int *const sncell, med_geometry_type *const sgeotype, med_int *const nconstantattribute, med_bool *const anyprofile, med_int *const nvariableattribute)
Cette routine décrit les caractéristiques d'un modèle d'élément de structure par itération.
Definition: MEDstructElementInfo.c:50
MED_ERR_ACCESS
#define MED_ERR_ACCESS
Definition: med_err.h:31
_MEDgetFieldEntityGeoTypeName
MEDC_EXPORT med_err _MEDgetFieldEntityGeoTypeName(med_idt fid, char *const entitygeotypename, const med_entity_type entitytype, const med_geometry_type geotype)
MED_ERR_ATTRIBUTE
#define MED_ERR_ATTRIBUTE
Definition: med_err.h:100
MED_ERR_INVALID
#define MED_ERR_INVALID
Definition: med_err.h:40
med_err
herr_t med_err
Definition: med.h:334
MED_DESCENDING_EDGE
Definition: med.h:145
MED_N_NODE_FIXED_GEO
#define MED_N_NODE_FIXED_GEO
Definition: med.h:253
med_outils.h
med_entity_type
med_entity_type
Definition: med.h:145
MED_MAX_PARA
#define MED_MAX_PARA
Definition: med.h:78
MED_MESH
Definition: med.h:190
MED_UNDEF_ENTITY_TYPE
Definition: med.h:147
MESSAGE
#define MESSAGE(chaine)
Definition: med_utils.h:324
MED_GET_FACE_GEOMETRY_TYPENAME
const char *const MED_GET_FACE_GEOMETRY_TYPENAME[MED_N_FACE_FIXED_GEO+2]
Definition: MEDiterators.c:127
med_int
int med_int
Definition: med.h:344
MED_GET_CELL_GEOMETRY_TYPE
med_geometry_type MED_GET_CELL_GEOMETRY_TYPE[MED_N_CELL_FIXED_GEO+2]
Definition: MEDiterators.c:55
MED_STRUCT_ELEMENT
Definition: med.h:146
MED_SORT_DTIT
Definition: med.h:311
MED_FIELD
Definition: med.h:190
med_field_type
med_field_type
Definition: med.h:167
MEDnStructElement
MEDC_EXPORT med_int MEDnStructElement(const med_idt fid)
Cette routine renvoie le nombre de modèles d'éléments de structure.
Definition: MEDnStructElement.c:35
MED_GET_NODE_GEOMETRY_TYPENAME
const char * MED_GET_NODE_GEOMETRY_TYPENAME[MED_N_NODE_FIXED_GEO+2]
Definition: MEDiterators.c:162
_MEDgetComputationStepName
MEDC_EXPORT med_err _MEDgetComputationStepName(const med_sorting_type sortingtype, const med_int numdt, const med_int numit, char *const datagroupname)
MED_GET_NODE_GEOMETRY_TYPE
med_geometry_type MED_GET_NODE_GEOMETRY_TYPE[MED_N_NODE_FIXED_GEO+2]
Definition: MEDiterators.c:156
ISCRUTE
#define ISCRUTE(entier)
Definition: med_utils.h:313
MED_GET_CELL_GEOMETRY_TYPENAME
const char *const MED_GET_CELL_GEOMETRY_TYPENAME[MED_N_CELL_FIXED_GEO+2]
Definition: MEDiterators.c:84
med_float32
float med_float32
Definition: med.h:341
MEDfieldValueWithProfileWr
MEDC_EXPORT med_err MEDfieldValueWithProfileWr(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_float dt, const med_entity_type entitype, const med_geometry_type geotype, const med_storage_mode storagemode, const char *const profilename, const char *const localizationname, const med_switch_mode switchmode, const med_int componentselect, const med_int nentity, const unsigned char *const value)
Cette fonction permet d'écrire les valeurs d'un champ définies sur des entités d'un maillage pour une...
Definition: MEDfieldValueWithProfileWr.c:48
MED_ERR_WRITE
#define MED_ERR_WRITE
Definition: med_err.h:29
med_config.h
MED_NO_PROFILE_INTERNAL
#define MED_NO_PROFILE_INTERNAL
Definition: med.h:298
med_bool
med_bool
Definition: med.h:262
MED_ERR_CALL
#define MED_ERR_CALL
Definition: med_err.h:48
MEDfieldnComponent
MEDC_EXPORT med_int MEDfieldnComponent(const med_idt fid, const int ind)
Cette fonction lit le nombre de composantes d'un champ.
Definition: MEDfieldnComponent.c:34
MEDmeshnEntity
MEDC_EXPORT med_int MEDmeshnEntity(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, const med_data_type datatype, const med_connectivity_mode cmode, med_bool *const changement, med_bool *const transformation)
Cette routine permet de lire le nombre d'entités dans un maillage pour une étape de calcul donnée.
Definition: MEDmeshnEntity.c:44
MAJ_version.h
MED_ERR_EXIT_IF
#define MED_ERR_EXIT_IF(expression, r1, r2, arg)
Definition: med_utils.h:356
MEDfieldComputingStepMeshInfo
MEDC_EXPORT med_err MEDfieldComputingStepMeshInfo(const med_idt fid, const char *const fieldname, const int csit, med_int *const numdt, med_int *const numit, med_float *const dt, med_int *const meshnumdt, med_int *const meshnumit)
Cette fonction permet de lire les informations caractérisant une étape de calcul : numéro de pas de t...
Definition: MEDfieldComputingStepMeshInfo.c:39
med_float
double med_float
Definition: med.h:338
MED_COORDINATE
Definition: med.h:151
_MEDattributeNumRdByName
MEDC_EXPORT med_err _MEDattributeNumRdByName(med_idt pid, const char *const path, const char *const attname, const med_internal_type type, unsigned char *const val)
IFORMAT
#define IFORMAT
Definition: med_utils.h:145
MEDfieldnProfile
MEDC_EXPORT med_int MEDfieldnProfile(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_entity_type enttype, const med_geometry_type geotype, char *const defaultprofilename, char *const defaultlocalizationname)
Cette fonction permet de lire le nombre de profils référencés dans un champ pour une étape de calcul,...
Definition: MEDfieldnProfile.c:40
MED_NONE
#define MED_NONE
Definition: med.h:233
MED_TAILLE_NOM_ENTITE
#define MED_TAILLE_NOM_ENTITE
Definition: med_outils.h:38
MED_N_FACE_FIXED_GEO
#define MED_N_FACE_FIXED_GEO
Definition: med.h:245
MED_FLOAT32
Definition: med.h:169
MED_INT32
Definition: med.h:170
MED_N_CELL_FIXED_GEO
#define MED_N_CELL_FIXED_GEO
Definition: med.h:241
MED_INT
Definition: med.h:172
SSCRUTE
#define SSCRUTE(chaine)
Definition: med_utils.h:323
MAJ_320_330.h
MED_FLOAT64
Definition: med.h:168
MED_CELL
Definition: med.h:145
MED_NAME_SIZE
#define MED_NAME_SIZE
Definition: med.h:83
MEDfileObjectExist
MEDC_EXPORT med_err MEDfileObjectExist(const med_idt fid, const med_class medclass, const char *const objectname, med_bool *const objectexist)
Interroge le fichier fid pour tester l'existence de l'objet objectname de type medclass.
Definition: MEDfileObjectExist.c:47
getFieldsOn
med_err getFieldsOn(med_idt fid, const char *const nommaa, med_int nmodels, const med_geometry_type *geotype_elst, const char *geotypename_elst, const char *const nomcha, const char *const dtunit, const med_field_type typcha, const med_int ncomp, const char *const comp, const char *const unit, const med_entity_type entite, const med_switch_mode stockage, const med_int ncstp)
Definition: MAJ_320_330_champs.c:30
med_data_type
med_data_type
Definition: med.h:151
med_switch_mode
med_switch_mode
Definition: med.h:98
MEDfieldValueWithProfileRd
MEDC_EXPORT med_err MEDfieldValueWithProfileRd(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, const med_storage_mode storagemode, const char *const profilename, const med_switch_mode switchmode, const med_int componentselect, unsigned char *const value)
Cette fonction permet de lire les valeurs d'un champ définies sur des entités d'un maillage pour une ...
Definition: MEDfieldValueWithProfileRd.c:42
MED_NODE_ELEMENT
Definition: med.h:146
USER_MODE
#define USER_MODE
Definition: MAJ_320_330_champs.c:28
MED_GET_EDGE_GEOMETRY_TYPE
med_geometry_type MED_GET_EDGE_GEOMETRY_TYPE[MED_N_EDGE_FIXED_GEO+2]
Definition: MEDiterators.c:140
MED_N_EDGE_FIXED_GEO
#define MED_N_EDGE_FIXED_GEO
Definition: med.h:249
MED_INT64
Definition: med.h:171
MED_ALL_CONSTITUENT
#define MED_ALL_CONSTITUENT
Definition: med.h:301
MED_NODE
Definition: med.h:145
MEDfieldCr
MEDC_EXPORT med_err MEDfieldCr(const med_idt fid, const char *const fieldname, const med_field_type fieldtype, const med_int ncomponent, const char *const componentname, const char *const componentunit, const char *const dtunit, const char *const meshname)
Cette fonction crée un champ dans un fichier.
Definition: MEDfieldCr.c:44
EXIT_IF
#define EXIT_IF(expression, message, arg)
Definition: med_utils.h:343
MED_NOM_NBR
#define MED_NOM_NBR
Definition: med_outils.h:40
med.h
MED_GET_ENTITY_TYPENAME
const char *const MED_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2]
Definition: MEDiterators.c:36
MED_CONNECTIVITY
Definition: med.h:151
MED_DESCENDING
Definition: med.h:257
MED_GET_FACE_GEOMETRY_TYPE
med_geometry_type MED_GET_FACE_GEOMETRY_TYPE[MED_N_FACE_FIXED_GEO+2]
Definition: MEDiterators.c:114
MED_GET_EDGE_GEOMETRY_TYPENAME
const char * MED_GET_EDGE_GEOMETRY_TYPENAME[MED_N_EDGE_FIXED_GEO+2]
Definition: MEDiterators.c:148
med_int32
int32_t med_int32
Definition: med.h:345
MED_FIELD_GRP
#define MED_FIELD_GRP
Definition: med_outils.h:169
MED_INTERNAL_INT
Definition: med.h:160
MEDfieldComputingStepMeshWr
MEDC_EXPORT med_err MEDfieldComputingStepMeshWr(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_int meshnumdt, const med_int meshnumit)
Cette fonction permet de définir l'étape de calcul ( meshnumdit , meshnumit ) à utiliser pour le mail...
Definition: MEDfieldComputingStepMeshWr.c:36
MEDnField
MEDC_EXPORT med_int MEDnField(const med_idt fid)
Cette fonction permet de lire le nombre de champs dans un fichier.
Definition: MEDnField.c:35
med_float64
double med_float64
Definition: med.h:339
MAJ_320_330_champs
void MAJ_320_330_champs(med_idt fid)
Definition: MAJ_320_330_champs.c:282
MED_NODAL
Definition: med.h:257
MED_DESCENDING_FACE
Definition: med.h:145