MED fichier
mdump3.c
Aller à la documentation de ce fichier.
1 /* This file is part of MED.
2  *
3  * COPYRIGHT (C) 1999 - 2016 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  * - Nom du fichier : mdump.c
20  *
21  * - Description : utilitaire de dump pour fichier MED
22  * Ce fichier contient les fonctions suivantes
23  * qui constituent des modeles de programmation
24  * pour une lecture generique d'un fichier MED :
25  * - lecture_maillage_non_structure () :
26  * 1. Noeuds.
27  * 2. Mailles.
28  * 3. Faces (connectivite descendante).
29  * 4. Aretes (connectivite descendante).
30  * 5. Familles.
31  * 6. Equivalences.
32  * 7. Joints.
33  * - lecture_maillage_structure () :
34  * 1. Noeuds.
35  * 2. Mailles.
36  * 3. Familles.
37  * 4. Equivalences.
38  * 5. Joints.
39  * - lecture_resultats () :
40  * 1. Champs de resultats relatifs à un maillage.
41  * - Entites :
42  * - Noeuds
43  * - Mailles
44  * - Faces
45  * - Aretes
46  * - Gestion des pas de temps et numeros d'ordre :
47  * valeurs associees a un ou plusieurs maillages sous
48  * un meme pas de temps.
49  * - Gestion des profils.
50  * - Gestion des liens vers des maillages distants
51  * - Gestion des points de Gauss :
52  * - localisation des points de Gauss.
53  * - lecture_parametres_scalaires () :
54  * - Valeurs scalaires entieres ou flottantes.
55  * - Gestion des pas de temps et numeros d'ordre.
56  * - main() : infos generales + lecture de tous les champs et
57  * du fichier MED passe en parametre.
58  *
59  *****************************************************************************/
60 
61 #ifndef MESGERR
62 #define MESGERR 1
63 #endif
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 #include <med.h>
70 #include <med_config.h>
71 #include <med_utils.h>
72 #include <med_misc.h>
73 #include <stdio.h>
74 #include <string.h>
75 #include <stdlib.h>
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #ifdef PPRO_NT
82 #define F_OK 0
83 #define snprintf _snprintf
84 #else
85 #include <unistd.h>
86 #endif
87 
88 
90 extern const char * const MED23MESH_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2];
99 
101 extern const char * const MED23FIELD_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2];
110 
111 
112 /* Indique si on vérifie seulement la structure
113  Lecture complète du fichier mais pas d'affichage des données volumineuses
114 */
115 int structure = 0;
116 
117 /* types geometriques des mailles references dans le modele MED */
121 
125 
126 #define MED_LECTURE_MAILLAGE_SUPPORT_UNIQUEMENT 2
127 #define MED_LECTURE_ENTETE_SEULEMENT 1
128 
129 #define USER_MODE MED_COMPACT_STMODE
130 
131 #define xstr(s) str(s)
132 #define str(s) #s
133 
134 #define MIN(a,b) ((a) < (b) ? (a) : (b))
135 #define MAX(a,b) ((a) > (b) ? (a) : (b))
136 
137 #define MAXBANNERLEN 255
138 
139 void affd(const void *pva)
140 {
141  const double *pa = pva;
142  printf(" %f ",*pa);
143 }
144 
145 void affi(const void *pva)
146 {
147  const med_int *pa = pva;
148 /* La ligne suivante ne fonctionne pas à cause du % contenu dans IFORMAT*/
149 /* printf(" %9"IFORMAT" " ,*pa); */
150  printf(" "IFORMAT" " ,*pa);
151 }
152 
153 void affs(const void *pva)
154 {
155  const char *pa = pva;
156  printf(" %.*s ",MED_NAME_SIZE,pa);
157 }
158 
159 typedef void (*_myfuncptr)(const void*);
160 
162  switch (atttype) {
163  case MED_ATT_INT :
164  return affi;
165  break;
166  case MED_ATT_FLOAT64:
167  return affd;
168  break;
169  case MED_ATT_NAME:
170  return affs;
171  break;
172  default:
173  EXIT_IF(-1,"lors de la lecture du type d'attribut à afficher.",NULL);
174  return NULL;
175 
176  }
177  return NULL;
178 
179 }
180 
181 med_int lecture_nombre_famille(med_idt fid,const char * const nommaa)
182 {
183  med_int nfam = MEDnFamily(fid,nommaa);
184  EXIT_IF(nfam < 0,"lors de la lecture du nombre de familles",NULL);
185  fprintf(stdout,"- Nombre de familles : "IFORMAT" \n",nfam);
186 
187  return nfam;
188 }
189 
190 void lecture_famille_maillage(med_idt fid,const char * const nommaa,med_int nfam)
191 {
192  med_int i,j;
193  med_int natt,ngro;
194  char *attdes=NULL,*gro=NULL;
195  med_int *attval=NULL,*attide=NULL;
196  char nomfam[MED_NAME_SIZE+1];
197  med_int numfam;
198  char str1[MED_COMMENT_SIZE+1];
199  char str2[MED_LNAME_SIZE+1];
200  med_err ret = 0;
201  int famille_0 = 0;
202 
203  if (nfam) {
204  fprintf(stdout,"\n(**************************)\n");
205  fprintf(stdout,"(* FAMILLES DU MAILLAGE : *)\n");
206  fprintf(stdout,"(**************************)\n");
207  }
208 
209  for (i=0;i<nfam;i++) {
210 
211  /* nombre de groupes */
212  ngro = MEDnFamilyGroup(fid,nommaa,i+1);
213  EXIT_IF(ngro < 0,"lors de la lecture du nombre de groupe d'une famille",
214  NULL);
215 
216  /* nombre d'attributs */
217  natt = MEDnFamily23Attribute(fid,nommaa,i+1);
218  EXIT_IF(natt < 0,"lors de la lecture du nombre d'attributs d'une famille",
219  NULL);
220 
221  fprintf(stdout,"- Famille "IFORMAT" a "IFORMAT" attributs et "IFORMAT" groupes \n",i+1,natt,
222  ngro);
223 
224  /* nom,numero,attributs,groupes */
225 
226  /* allocation memoire */
227  attide = (med_int*) malloc(sizeof(med_int)*natt);
228  EXIT_IF(attide == NULL,NULL,NULL);
229  attval = (med_int*) malloc(sizeof(med_int)*natt);
230  EXIT_IF(attval == NULL,NULL,NULL);
231  attdes = (char *) malloc(MED_COMMENT_SIZE*natt+1);
232  EXIT_IF(attdes == NULL,NULL,NULL);
233  gro = (char*) malloc(MED_LNAME_SIZE*ngro+1);
234  EXIT_IF(gro == NULL,NULL,NULL);
235  ret = MEDfamily23Info(fid,nommaa,i+1,nomfam,attide,attval,
236  attdes,&numfam,gro);
237  EXIT_IF(ret < 0,"lors de la lecture des informations d'une famille",
238  NULL);
239  if (numfam == 0)
240  famille_0 = 1;
241 
242  if (!structure) {
243  /* affichage des resultats */
244  fprintf(stdout," - Famille de nom %s et de numero "IFORMAT" : \n",nomfam,numfam);
245  fprintf(stdout," - Attributs : \n");
246  for (j=0;j<natt;j++) {
247  strncpy(str1,attdes+j*MED_COMMENT_SIZE,MED_COMMENT_SIZE);
248  str1[MED_COMMENT_SIZE] = '\0';
249  fprintf(stdout," ide = "IFORMAT" - val = "IFORMAT" - des = %s\n",*(attide+j),
250  *(attval+j),str1);
251  }
252  }
253 
254  /* on libere la memoire */
255  if (attide) {free(attide);attide=NULL;}
256  if (attval) {free(attval);attval=NULL;}
257  if (attdes) {free(attdes);attdes=NULL;}
258 
259  if (!structure) {
260  fprintf(stdout," - Groupes :\n");
261  for (j=0;j<ngro;j++) {
262  strncpy(str2,gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
263  str2[MED_LNAME_SIZE] = '\0';
264  fprintf(stdout," gro = %s\n",str2);
265  }
266  }
267 
268  /* on libere la memoire */
269  if (gro) {free(gro);gro=NULL;}
270  }
271 
272  if (famille_0 != 1) {
273  MESSAGE("Erreur : La famille FAMILLE_ZERO n'a pas été trouvée, elle est obligatoire. ");
274  }
275 
276  return;
277 }
278 
279 med_int lecture_nombre_equivalence(med_idt fid,const char * const nommaa)
280 {
281  med_int nequ = MEDnEquivalence(fid,nommaa);
282  EXIT_IF(nequ < 0,"lors de la lecture du nombre d'equivalences",NULL);
283  fprintf(stdout,"- Nombre d'equivalences : "IFORMAT" \n",nequ);
284 
285  return nequ;
286 }
287 
288 /* nombre de mailles concernees par les equivalences */
289 void lecture_equivalence_maillage(med_idt fid,const char * const nommaa,med_int nequ)
290 {
291  med_int i,j,k;
292  med_int ncor;
293  med_int *cor;
294  char equ[MED_NAME_SIZE+1];
295  char des[MED_COMMENT_SIZE+1];
296  med_err ret = 0;
297  med_int nstep=0,nocstpncor=0;
298  int _cstpit=0;
299  med_int _numdt,_numit;
300 
301 
302  if ( (nequ != 0) ) {
303  fprintf(stdout,"\n(******************************)\n");
304  fprintf(stdout,"(* EQUIVALENCES DU MAILLAGE : *)\n");
305  fprintf(stdout,"(******************************)\n");
306  }
307 
308  /* lecture de toutes les equivalences associes a nommaa */
309  for (i = 0;i<nequ;i++) {
310 
311  /* lecture des infos sur l'equivalence */
312  ret = MEDequivalenceInfo(fid,nommaa,i+1,equ,des,&nstep,&nocstpncor);
313  EXIT_IF(ret < 0,"lors de la lecture des informations sur une equivalence",
314  NULL);
315 
316 /* if (!structure) { */
317  fprintf(stdout,"- Equivalence numero : "IFORMAT" ",i+1);
318  fprintf(stdout,"\n - Nom de l'equivalence: %s \n",equ);
319  fprintf(stdout,"\n - Description de l'equivalence : %s \n",des);
320  if (nstep > 1)
321  fprintf(stdout,"\n - L'equivalence est définie sur "IFORMAT" étapes de calcul\n",nstep);
322 /* } */
323 
324  for (_cstpit=1; _cstpit <= nstep; ++_cstpit) {
325 
326  ret = MEDequivalenceComputingStepInfo (fid, nommaa, equ, _cstpit,
327  & _numdt, &_numit,&nocstpncor);
328  EXIT_IF(ret < 0,
329  "lors de la lecture des valeurs de séquence de calcul d'une equivalence",
330  NULL);
331 
332  if ( (_numdt != MED_NO_DT) || (_numit != MED_NO_IT) )
333  fprintf(stdout,"\n - Séquence de calcul définie sur (numdt,numit) ("IFORMAT","IFORMAT") :\n",_numdt,_numit);
334 
335  /* lecture des correspondances sur les differents types d'entites */
336 
337  /* les noeuds */
338  ret = MEDequivalenceCorrespondenceSize(fid,nommaa,equ,_numdt,_numit,MED_NODE,MED_NONE,&ncor);
339  EXIT_IF(ret < 0,
340  "lors de la lecture du nombre de correspondances d'une equivalence",
341  NULL);
342  fprintf(stdout,"\n - Il y a "IFORMAT" correspondances sur les noeuds \n",ncor);
343 
344  if (ncor > 0) {
345 
346  /* allocation memoire */
347  cor = (med_int*) malloc(sizeof(med_int)*ncor*2);
348  EXIT_IF(cor == NULL,NULL,NULL);
349  ret= MEDequivalenceCorrespondenceRd(fid,nommaa,equ,_numdt,_numit,
350  MED_NODE,MED_NONE,cor);
351  EXIT_IF(ret < 0,"lors de la lecture du tableau des correspondances",
352  NULL);
353  if (!structure) {
354  for (j=0;j<ncor;j++)
355  fprintf(stdout,"\n - Correspondance "IFORMAT" : "IFORMAT" et "IFORMAT" \n",j+1,*(cor+2*j),
356  *(cor+2*j+1));
357  }
358  free(cor);
359  }
360 
361  /* sur les mailles : */
362  for (j=0;j<MED_N_CELL_FIXED_GEO;j++) {
363 
364  ret = MEDequivalenceCorrespondenceSize(fid,nommaa,equ,_numdt,_numit,MED_CELL,typmai[j],&ncor);
365  EXIT_IF(ret < 0,
366  "lors de la lecture du nombre de correspondances dans une equivalence",
367  NULL);
368  fprintf(stdout,"\n - Il y a "IFORMAT" correspondances sur les mailles %s \n",ncor,
369  nommai[j]);
370 
371  if (ncor > 0) {
372 
373  /* allocation memoire */
374  cor = (med_int*) malloc(sizeof(med_int)*ncor*2);
375  EXIT_IF(cor == NULL,NULL,NULL);
376  ret = MEDequivalenceCorrespondenceRd(fid,nommaa,equ,_numdt,_numit,
377  MED_CELL,typmai[j],cor);
378  EXIT_IF(ret < 0,"lors de la lecture du tableau des equivalences",
379  NULL);
380 
381  if (!structure) {
382  for (k=0;k<ncor;k++)
383  fprintf(stdout,"\n - Correspondance "IFORMAT" : "IFORMAT" et "IFORMAT" \n",k+1,
384  *(cor+2*k),*(cor+2*k+1));
385  }
386  free(cor);
387  }
388  }
389 
390 
391  /* sur les faces */
392  for (j=0;j<MED_N_FACE_FIXED_GEO;j++) {
393 
394  ret = MEDequivalenceCorrespondenceSize(fid,nommaa,equ,_numdt,_numit,
395  MED_DESCENDING_FACE,typfac[j],&ncor);
396 
397  EXIT_IF(ret < 0,
398  "lors de la lecture du nombre de correspondances dans une equivalence",
399  NULL);
400  fprintf(stdout,"\n - Il y a "IFORMAT" correspondances sur les faces %s\n",ncor,
401  nomfac[j]);
402 
403  if (ncor > 0) {
404 
405  /* allocation memoire */
406  cor = (med_int*) malloc(sizeof(med_int)*ncor*2);
407  EXIT_IF(cor == NULL,NULL,NULL);
408  ret = MEDequivalenceCorrespondenceRd(fid,nommaa,equ,_numdt,_numit,
409  MED_DESCENDING_FACE,typfac[j],cor);
410  EXIT_IF(ret < 0,"lors de la lecture du tableau des equivalences",
411  NULL);
412 
413  if (!structure) {
414  for (k=0;k<ncor;k++)
415  fprintf(stdout,"\n - Correspondance "IFORMAT" : "IFORMAT" et "IFORMAT" \n",k+1,*(cor+2*k),
416  *(cor+2*k+1));
417  }
418  free(cor);
419  }
420  }
421 
422 
423  /* sur les aretes */
424  for (j=0;j<MED_N_NODE_FIXED_GEO;j++) {
425 
426  ret = MEDequivalenceCorrespondenceSize(fid,nommaa,equ,_numdt,_numit,
427  MED_DESCENDING_EDGE,typare[j],&ncor);
428  EXIT_IF(ret < 0,"lors de la lecture du nombre de correspondances",
429  NULL);
430  fprintf(stdout,"\n - Il y a "IFORMAT" correspondances sur les aretes %s \n",
431  ncor,nomare[j]);
432 
433  if (ncor > 0) {
434 
435  /* allocation memoire */
436  cor = (med_int*) malloc(sizeof(med_int)*ncor*2);
437  EXIT_IF(cor == NULL,NULL,NULL);
438  ret =MEDequivalenceCorrespondenceRd(fid,nommaa,equ,_numdt,_numit,
439  MED_DESCENDING_EDGE,typare[j],cor);
440  EXIT_IF(ret < 0,"lors de la lecture du tableau des equivalences",
441  NULL);
442 
443  if (!structure) {
444  for (k=0;k<ncor;k++)
445  fprintf(stdout,"\n Correspondance "IFORMAT" : "IFORMAT" et "IFORMAT" \n",k+1,*(cor+2*k),
446  *(cor+2*k+1));
447  }
448 
449  free(cor);
450  }
451  }
452  }
453  }
454 
455  return;
456 }
457 
458 
459 med_int lecture_nombre_joint(med_idt fid,const char * const nommaa)
460 {
461  med_int njnt = MEDnSubdomainJoint(fid,nommaa);
462  EXIT_IF(njnt < 0,"lors de la lecture du nombre de joints",NULL);
463  fprintf(stdout,"- Nombre de joints : "IFORMAT" \n",njnt);
464 
465  return njnt;
466 }
467 
468 
469 void lecture_joint_maillage(med_idt fid,const char * const nommaa,med_int njnt)
470 {
471  med_int i,k;
472  char des[MED_COMMENT_SIZE+1];
473  med_int ndom,nent;
474  med_int typ_ent_local,typ_geo_local,typ_ent_distant,typ_geo_distant;
475 /* med_int geo_ent_local,geo_ent_distant; */
476 
477  char jn [MED_NAME_SIZE+1]="";
478  char maa_dist [MED_NAME_SIZE+1]="";
479  char nom_geo_ent_local [MED_NAME_SIZE+1]="";
480  char nom_geo_ent_distant [MED_NAME_SIZE+1]="";
481  med_int *cortab;
482 
483  med_err ret = 0;
484  med_int njstep=0,ncor=0,nodtitncor=0;
485  int corit=0,csit=0;
486  med_int _numdt,_numit;
487 
488  if ( (njnt != 0) ) {
489  fprintf(stdout,"\n(******************************)\n");
490  fprintf(stdout,"(* JOINTS DU MAILLAGE : *)\n");
491  fprintf(stdout,"(******************************)\n");
492  }
493 
494  /* lecture de touts les joints associes a nommaa */
495  for (i = 0;i<njnt;i++) {
496  fprintf(stdout,"- Joint numero : "IFORMAT" ",i+1);
497 
498  /* lecture des infos sur le joint */
499  ret = MEDsubdomainJointInfo(fid,nommaa,i+1,jn,des,&ndom,maa_dist,&njstep,&nodtitncor);
500  EXIT_IF(ret < 0,"lors de la lecture des informations sur un joint",
501  NULL);
502 
503  fprintf(stdout,"\n - Nom du joint: %s \n",jn);
504  fprintf(stdout,"\n - Description du joint : %s ",des);
505  fprintf(stdout,"\n - Domaine en regard : "IFORMAT" ",ndom);
506  fprintf(stdout,"\n - Maillage distant : %s ",maa_dist);
507  if (njstep > 1 ) {
508  printf("Nombre d'étapes de calcul : "IFORMAT" \n",njstep);
509  printf("Nombre de correspondance pour (NO_DT,NO_IT) : "IFORMAT" \n",nodtitncor);
510  }
511 
512  for (csit=1; csit <= njstep; ++csit) {
513 
514  ret = MEDsubdomainComputingStepInfo( fid, nommaa, jn, csit, &_numdt, &_numit, &ncor);
515  EXIT_IF(ret < 0,"Erreur a la lecture des valeurs (numdt,numit) dans les joints",
516  NULL);
517  if ( (_numdt != MED_NO_DT) || (_numit != MED_NO_IT) ) {
518  printf("Séquence de calcul (numdt,numit) : ("IFORMAT","IFORMAT")\n",_numdt,_numit);
519  }
520  corit=1;
521  while ( corit <= ncor ) {
522 
523  ret = MEDsubdomainCorrespondenceSizeInfo(fid,nommaa,jn,_numdt,_numit,corit,
524  (med_entity_type *) &typ_ent_local, (med_geometry_type *) &typ_geo_local,
525  (med_entity_type *) &typ_ent_distant,(med_geometry_type *)&typ_geo_distant,
526  &nent);
527  EXIT_IF(ret < 0,"Erreur a la lecture des infos sur le nombre d'entite en regard",
528  NULL);
529  if (nent > 0) {
530  if (typ_ent_local == MED_NODE) strcpy(nom_geo_ent_local,"MED_NOEUD");
531  else ret = _MEDgetInternalGeometryTypeName(nom_geo_ent_local,typ_geo_local);
532  EXIT_IF(ret < 0,"Erreur à l'appel de _MEDgetInternalGeometryTypeName", NULL);
533  if (typ_ent_distant == MED_NODE) strcpy(nom_geo_ent_distant,"MED_NOEUD");
534  else ret = _MEDgetInternalGeometryTypeName(nom_geo_ent_distant,typ_geo_distant);
535  EXIT_IF(ret < 0,"Erreur à l'appel de _MEDgetInternalGeometryTypeName", NULL);
536  fprintf(stdout,"\n\t\t- nb de couples d'entites en regard (local,distant)=(%s,%s) : "IFORMAT" \n",
537  nom_geo_ent_local,nom_geo_ent_distant, nent);
538  /*TODO : Supprimer la ligne suivante*/
539 /* fprintf(stdout," %d \n",nent); */
540  cortab = (med_int*) malloc(sizeof(med_int)*nent*2);
541  if ( (ret=MEDsubdomainCorrespondenceRd(fid,nommaa,jn,_numdt,_numit,
542  typ_ent_local,typ_geo_local,typ_ent_distant,typ_geo_distant,
543  cortab)) < 0) {
544  fprintf(stdout,"\n\t\t- Erreur a la lecture des correspondances sur (%s,%s,%s,%s)",
545  MED23MESH_GET_ENTITY_TYPENAME[typ_ent_local+1],nom_geo_ent_local,
546  MED23MESH_GET_ENTITY_TYPENAME[typ_ent_distant+1],nom_geo_ent_distant);
547  } else {
548  if (!structure) {
549  for (k=0;k<nent;k++)
550  fprintf(stdout,"\n\t\t- Correspondance "IFORMAT" : "IFORMAT" et "IFORMAT" ",k+1,
551  *(cortab+2*k),*(cortab+2*k+1));
552  }
553  }
554  free(cortab);
555  }
556 
557  corit++;
558  }
559  }
560  }
561 
562  return;
563 }
564 
565 
567  const char * nommaa,
568  const med_int numdt,
569  const med_int numit)
570 {
571 
572 
573  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
574 
575  med_int nnoe = MEDmeshnEntity(fid,nommaa,numdt,numit,
577  MED_COORDINATE,MED_NODAL,&chgt,&trsf);
578  EXIT_IF(nnoe < 0,"lors de la lecture du nombre de noeuds",NULL);
579  fprintf(stdout,"- Nombre de noeuds : "IFORMAT" \n",nnoe);
580 
581  return nnoe;
582 }
583 
584 
586  const char * const nommaa,
587  const med_int numdt,
588  const med_int numit,
589  const med_int mdim,
590  const med_int edim,
591  const med_int nnoe,
592  const med_switch_mode mode_coo,
593  const char * const nomcoo,
594  const char * const unicoo,
595  const med_axis_type *const rep)
596 {
597  med_float *coo;
598  char *nomnoe;
599  med_int *numnoe;
600  med_int *nufano;
601  med_bool inonoe,inunoe,ifano;
602  med_err ret = 0;
603  med_int i;
604  char str[MED_SNAME_SIZE+1];
605 
606 
607  /* Allocations memoires */
608  /* table des coordonnees
609  profil : (dimension * nombre de noeuds ) */
610  coo = (med_float*) malloc(sizeof(med_float)*nnoe*edim);
611  EXIT_IF(coo == NULL,NULL,NULL);
612  /* table des numeros, des numeros de familles des noeuds
613  profil : (nombre de noeuds) */
614  numnoe = (med_int*) malloc(sizeof(med_int)*nnoe);
615  EXIT_IF(numnoe == NULL,NULL,NULL);
616  nufano = (med_int*) malloc(sizeof(med_int)*nnoe);
617  EXIT_IF(nufano == NULL,NULL,NULL);
618  /* table des noms des noeuds
619  profil : (nnoe*MED_SNAME_SIZE+1) */
620  nomnoe = (char*) malloc(MED_SNAME_SIZE*nnoe+1);
621  EXIT_IF(nomnoe == NULL,NULL,NULL);
622 
623  /* lecture des noeuds :
624  - coordonnees
625  - noms (optionnel dans un fichier MED)
626  - numeros (optionnel dans un fichier MED)
627  - numeros des familles */
628  ret = MEDmeshNodeRd(fid,nommaa,numdt,numit, mode_coo, coo,
629  &inonoe,nomnoe,&inunoe,numnoe,&ifano,nufano);
630 
631 
632  EXIT_IF(ret < 0,"lors de la lecture des noeuds du maillage \n",NULL);
633 
634  /* affichage des resultats */
635  if (nnoe) {
636  fprintf(stdout,"\n(************************)\n");
637  fprintf(stdout,"(* NOEUDS DU MAILLAGE : *)\n");
638  fprintf(stdout,"(************************)\n\n");
639  }
640  if (!structure) {
641  fprintf(stdout,"- Type de repere des coordonnees : %d \n",*rep);
642  fprintf(stdout,"- Nom des coordonnees : \n");
643  for (i=0;i<edim;i++) {
644  strncpy(str,nomcoo+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
645  str[MED_SNAME_SIZE] = '\0';
646  fprintf(stdout," %s ",str);
647  }
648  fprintf(stdout,"\n- Unites des coordonnees : \n");
649  for (i=0;i<edim;i++) {
650  strncpy(str,unicoo+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
651  str[MED_SNAME_SIZE] = '\0';
652  fprintf(stdout," %s ",str);
653  }
654  fprintf(stdout,"\n- Coordonnees des noeuds : ");
655  for (i=0;i<nnoe*edim;i++) {
656  if (mode_coo == MED_FULL_INTERLACE && !(i % edim))
657  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (i/edim + 1) );
658  if (mode_coo == MED_NO_INTERLACE && ! (i % nnoe))
659  fprintf(stdout,"\n\n ");
660  fprintf(stdout," %-+9.6f ",*(coo+i));
661  }
662 
663  if (inonoe) {
664  fprintf(stdout,"\n- Noms des noeuds : \n");
665  for (i=0;i<nnoe;i++) {
666  strncpy(str,nomnoe+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
667  str[MED_SNAME_SIZE] = '\0';
668  fprintf(stdout," %s ",str);
669  }
670  }
671  if (inunoe) {
672  fprintf(stdout,"\n- Numeros des noeuds : \n");
673  for (i=0;i<nnoe;i++)
674  fprintf(stdout," "IFORMAT" ",*(numnoe+i));
675  }
676 
677  fprintf(stdout,"\n- Numeros des familles des noeuds : \n");
678  for (i=0;i<nnoe;i++) {
679  if (ifano)
680  fprintf(stdout," "IFORMAT" ",*(nufano+i));
681  else
682  fprintf(stdout," %d ",0);
683  }
684  fprintf(stdout,"\n");
685  }
686 
687 
688  /* liberation memoire */
689  free(coo);
690  free(nomnoe);
691  free(numnoe);
692  free(nufano);
693 
694  return;
695 }
696 
697 
699  const char * const nommaa,
700  const med_int numdt,
701  const med_int numit,
702  const med_geometry_type typ_geo,
703  const med_connectivity_mode typ_con,
704  const int indice)
705 {
706 
707  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
708 
709  med_int nmailles = MEDmeshnEntity(fid,nommaa,numdt,numit,
710  MED_CELL,typ_geo,
711  MED_CONNECTIVITY,typ_con,&chgt,&trsf);
712  EXIT_IF(nmailles < 0," lors de la lecture du nombre de mailles",NULL);
713 
714  if ( (indice < (MED_N_CELL_GEO_FIXED_CON-5) ) ||
715  (indice >= (MED_N_CELL_GEO_FIXED_CON-5) && (nmailles > 0) ) )
716  if (nmailles)
717  fprintf (stdout,"- Nombre de mailles de type %s : "IFORMAT" \n",nommai[indice],
718  nmailles);
719 
720  return nmailles;
721 }
722 
724  const char * const nommaa,
725  const med_int numdt,
726  const med_int numit,
727  const int indice,
728  med_geometry_type* geotype,
729  char* geotypename
730  )
731 {
732  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
733  med_err _ret=-1;
734  med_int _nmailles=0;
735 
736  _ret = MEDmeshEntityInfo(fid,nommaa,numdt,numit, MED_STRUCT_ELEMENT,
737  indice+1,geotypename,geotype );
738  EXIT_IF(_ret<0,
739  "Erreur à la demande d'informations pour le type d'entités MED_STRUCT_ELEMENT",NULL);
740 
741  _nmailles = MEDmeshnEntity(fid,nommaa,numdt,numit,
742  MED_STRUCT_ELEMENT,*geotype,
743  MED_CONNECTIVITY,MED_NODAL,&chgt,&trsf);
744 
745  EXIT_IF(_nmailles < 0," lors de la lecture du nombre de mailles",NULL);
746 
747  if (_nmailles)
748  fprintf (stdout,"- Nombre de mailles de type %s : "IFORMAT" \n",geotypename, _nmailles);
749 
750  return _nmailles;
751 }
752 
754  const char * const nommaa,
755  const med_int numdt,
756  const med_int numit,
757  const med_int nmodels,
758  const med_geometry_type* const geotype,
759  const char* const geotypename,
760  const med_int * const nmailles,
761  const med_switch_mode mode_coo)
762 {
763  med_err _ret=-1;
764  med_int taille=0;
765  char str[MED_SNAME_SIZE+1];
766 
767  med_int *connectivite;
768  char *nomele;
769  med_int *numele;
770  med_int *nufael;
771  med_bool inoele=MED_FALSE, inuele=MED_FALSE, inufael=MED_FALSE;
772 
773  med_geometry_type _geotype=MED_NONE;
774  med_int _elementdim=0;
775  char _supportmeshname[MED_NAME_SIZE+1]="";
777  med_int _nnode=0;
778  med_int _ncell=0;
779  med_entity_type _geocelltype=MED_NONE;
780  med_int _nconstantatribute=0;
781  med_bool _anyprofile=0;
782  med_int _nvariableattribute=0;
783 
784  char _attname[MED_NAME_SIZE+1]="";
785  med_attribute_type _atttype;
786  med_int _atttypesize=0;
787  med_int _attvaluesize=0;
788  med_int _nattcomp=0;
789  void *_attvalue=NULL;
790  void (*_printf)(const void*);
791  int i=0,j=0,k=0;
792  med_int dispbanner=MED_FALSE;
793 
794  for (i=0; i<nmodels; i++ ) {
795 
796  _ret = MEDstructElementInfoByName(fid, &geotypename[i*(MED_NAME_SIZE+1)],
797  &_geotype,&_elementdim,
798  _supportmeshname,&_entitytype,&_nnode,&_ncell,
799  &_geocelltype,&_nconstantatribute,&_anyprofile,&_nvariableattribute);
800 
801  if (_ncell > 0 )
802  taille=_ncell*_geocelltype%100;
803  else
804  taille = _nnode;
805 
806 /* SSCRUTE(&geotypename[i*(MED_NAME_SIZE+1)]); */
807 /* ISCRUTE(_nnode); */
808 /* ISCRUTE(_ncell); */
809 /* ISCRUTE(taille); */
810 
811  /* allocation memoire */
812  connectivite = (med_int*) calloc(taille*nmailles[i],sizeof(med_int));
813  EXIT_IF(connectivite == NULL,NULL,NULL);
814  nomele = (char*) malloc(sizeof(char)*MED_SNAME_SIZE*nmailles[i]+1);
815  EXIT_IF(nomele == NULL,NULL,NULL);
816  numele = (med_int*) malloc(sizeof(med_int)*nmailles[i]);
817  EXIT_IF(numele == NULL,NULL,NULL);
818  nufael = (med_int*) malloc(sizeof(med_int)*nmailles[i]);
819  EXIT_IF(nufael == NULL,NULL,NULL);
820 
821  /* lecture des données */
822  _ret = MEDmeshElementRd( fid,nommaa,numdt,numit,MED_STRUCT_ELEMENT,geotype[i],
823  MED_NODAL, mode_coo, connectivite,
824  &inoele,nomele,&inuele,numele,&inufael,nufael );
825 
826  EXIT_IF(_ret < 0,"lors de la lecture des mailles",NULL);
827 
828 
829  if ( !dispbanner) {
830  fprintf(stdout,"\n(***************************************)\n");
831  fprintf(stdout, "(* ELEMENTS DE STRUCTURE DU MAILLAGE : *)\n");
832  fprintf(stdout, "(***************************************)\n");
833  dispbanner=MED_TRUE;
834  }
835  if (!structure) {
836  /* affichage des resultats */
837  fprintf(stdout,"\n- Mailles de type %s : ", &geotypename[i*(MED_NAME_SIZE+1)]);
838  if (strcmp(&geotypename[i*(MED_NAME_SIZE+1)],"MED_PARTICLE") ) {
839  fprintf(stdout,"\n - Connectivité : ");
840  for (j=0;j<nmailles[i]*taille;j++) {
841  if (mode_coo == MED_FULL_INTERLACE && !(j % taille))
842  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/taille +1) );
843  if (mode_coo == MED_NO_INTERLACE && !(j % nmailles[i]))
844  fprintf(stdout,"\n");
845  fprintf(stdout," %9"MED_IFORMAT" ",*(connectivite+j));
846  }
847  }
848 
849  if (inoele) {
850  fprintf(stdout,"\n - Noms : \n");
851  for (j=0;j<nmailles[i];j++) {
852  strncpy(str,nomele+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
853  str[MED_SNAME_SIZE] = '\0';
854  fprintf(stdout," %s ",str);
855  }
856  }
857  if (inuele) {
858  fprintf(stdout,"\n - Numeros :\n");
859  for (j=0;j<nmailles[i];j++)
860  fprintf(stdout," "IFORMAT" ",*(numele+j));
861  }
862  fprintf(stdout,"\n - Numéros de familles : \n");
863  for (j=0;j<nmailles[i];j++)
864  if (inufael)
865  fprintf(stdout," "IFORMAT" ",*(nufael+j));
866  else
867  fprintf(stdout," %d ",0);
868  fprintf(stdout,"\n");
869  }
870 
871 
872  /* Read variable attribute(s) */
873  for (k=0; k<_nvariableattribute; k++) {
874 
875  /* read informations about the attribute */
876  _ret = MEDstructElementVarAttInfo(fid, &geotypename[i*(MED_NAME_SIZE+1)], k+1,
877  _attname, &_atttype, &_nattcomp);
878  EXIT_IF(_ret < 0,"lors de la lecture des caractéristiques de attributs variables",NULL);
879 
880 
881  /* Memory allocation */
882  EXIT_IF(_atttype == MED_ATT_UNDEF,"à la lecture du type (valeur : MED_ATT_UNDEF) de l'attribut variable ",_attname);
883  _atttypesize = MEDstructElementAttSizeof(_atttype);
884 
885  _attvaluesize = nmailles[i]*_nattcomp*_atttypesize;
886  if ( _atttype == MED_ATT_NAME) ++_attvaluesize;
887  _attvalue = (void *) malloc( _attvaluesize*sizeof(char));
888  --_attvaluesize;
889 
890  /* read attribute values */
891  _ret =MEDmeshStructElementVarAttRd(fid, nommaa, numdt, numit,
892  *(geotype+i), _attname, _attvalue );
893  if (_ret < 0 ) free(_attvalue);
894  EXIT_IF(_ret < 0,"lors de la lecture des attributs variables",NULL);
895 
896  _printf=MEDstructPrintFunction(_atttype);
897 
898  if (!structure) {
899  fprintf(stdout,"\n - Valeurs de l'attribut |%s| pour le type géométrique |%s| : \n",_attname,
900  &geotypename[i*(MED_NAME_SIZE+1)]);
901  for (j=0;j<nmailles[i]*_nattcomp;j++) {
902  if ( ( _nattcomp > 1 ) && !(j % _nattcomp) )
903  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/_nattcomp +1) );
904  _printf( (void *)( (char *)(_attvalue) + j*_atttypesize) );
905  }
906  }
907  /* free memory */
908  free(_attvalue);
909 
910  }
911 
912  /* liberation memoire */
913  free(connectivite);
914  free(nomele);
915  free(numele);
916  free(nufael);
917  }
918 
919  return;
920 }
921 
923  const char *nommaa,
924  const med_int numdt,
925  const med_int numit,
926  const med_int mdim,
927  const med_int * const nmailles,
928  const med_switch_mode mode_coo,
929  const med_connectivity_mode typ_con)
930 {
931  med_int taille;
932  med_int *connectivite;
933  char *nomele;
934  med_int *numele;
935  med_int *nufael;
936  med_bool inoele=MED_FALSE, inuele=MED_FALSE, inufael=MED_FALSE;
937  med_int entdim;
938  med_int nnodes;
939  med_int nndes;
940  med_int i,j;
941  med_err ret = 0;
942  char str[MED_SNAME_SIZE+1];
943  med_int dispbanner=MED_FALSE;
944 
945  /* Lecture des connectivites, noms, numeros des mailles */
946  for (i=0;i<MED_N_CELL_GEO_FIXED_CON;i++)
947  if (nmailles[i] > 0) {
948 
949  ret=_MEDgetGeometricParameter(MED_CELL, typmai[i],&entdim,&nnodes,&nndes);
950  EXIT_IF(ret < 0,"lors de la lecture des caractéristiques des mailles",NULL);
951 
952  switch(typ_con) {
953  case MED_NODAL :
954  taille = nnodes;
955  break;
956 
957  case MED_DESCENDING :
958  taille = nndes;
959  break;
960 
961  default :
962  ret = -1;
963  }
964 
965  /* allocation memoire */
966  connectivite = (med_int*) malloc(sizeof(med_int)*taille*nmailles[i]);
967  EXIT_IF(connectivite == NULL,NULL,NULL);
968  nomele = (char*) malloc(sizeof(char)*MED_SNAME_SIZE*nmailles[i]+1);
969  EXIT_IF(nomele == NULL,NULL,NULL);
970  numele = (med_int*) malloc(sizeof(med_int)*nmailles[i]);
971  EXIT_IF(numele == NULL,NULL,NULL);
972  nufael = (med_int*) malloc(sizeof(med_int)*nmailles[i]);
973  EXIT_IF(nufael == NULL,NULL,NULL);
974 
975  /* lecture des données */
976  ret = MEDmeshElementRd( fid,nommaa,numdt,numit,MED_CELL,typmai[i],
977  typ_con, mode_coo, connectivite,
978  &inoele,nomele,&inuele,numele,&inufael,nufael );
979 
980  EXIT_IF(ret < 0,"lors de la lecture des mailles",NULL);
981 
982  if ( !dispbanner) {
983  fprintf(stdout,"\n(**************************)\n");
984  fprintf(stdout,"(* ELEMENTS DU MAILLAGE : *)\n");
985  fprintf(stdout,"(**************************)\n");
986  dispbanner=MED_TRUE;
987  }
988  if (!structure) {
989  /* affichage des resultats */
990  fprintf(stdout,"\n- Mailles de type %s : ", nommai[i]);
991  fprintf(stdout,"\n - Connectivité : ");
992  for (j=0;j<nmailles[i]*taille;j++) {
993  if (mode_coo == MED_FULL_INTERLACE && !(j % taille))
994  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/taille +1) );
995  if (mode_coo == MED_NO_INTERLACE && !(j % nmailles[i]))
996  fprintf(stdout,"\n");
997  fprintf(stdout," %9"MED_IFORMAT" ",*(connectivite+j));
998  }
999 
1000  if (inoele) {
1001  fprintf(stdout,"\n - Noms : \n");
1002  for (j=0;j<nmailles[i];j++) {
1003  strncpy(str,nomele+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
1004  str[MED_SNAME_SIZE] = '\0';
1005  fprintf(stdout," %s ",str);
1006  }
1007  }
1008  if (inuele) {
1009  fprintf(stdout,"\n - Numeros :\n");
1010  for (j=0;j<nmailles[i];j++)
1011  fprintf(stdout," "IFORMAT" ",*(numele+j));
1012  }
1013  fprintf(stdout,"\n - Numéros de familles : \n");
1014  for (j=0;j<nmailles[i];j++)
1015  if (inufael)
1016  fprintf(stdout," "IFORMAT" ",*(nufael+j));
1017  else
1018  fprintf(stdout," %d ",0);
1019  fprintf(stdout,"\n");
1020  }
1021 
1022  /* liberation memoire */
1023  free(connectivite);
1024  free(nomele);
1025  free(numele);
1026  free(nufael);
1027  }
1028 
1029  return;
1030 }
1031 
1032 
1034  const char * const nommaa,
1035  const med_int numdt,
1036  const med_int numit,
1037  const med_geometry_type polytype,
1038  const med_connectivity_mode typ_con)
1039 {
1040 
1041  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1042  char polytypename[MED_NAME_SIZE+1]="Undefined GeoType";
1043  med_int nmpolygones;
1044 
1045  EXIT_IF( (( polytype != MED_POLYGON) &&
1046  ( polytype != MED_POLYGON2) ),
1048 
1049 
1050  nmpolygones = MEDmeshnEntity(fid,nommaa,numdt,numit,
1051  MED_CELL,polytype,
1052  MED_INDEX_NODE,typ_con,&chgt,&trsf);
1053 
1054  EXIT_IF(nmpolygones < 0,"lors de la lecture du nombre de mailles polygone\n",
1055  NULL);
1056  if (nmpolygones > 0 ) nmpolygones--; else nmpolygones=0;
1057  if (nmpolygones) {
1058  MEDmeshGeotypeName(fid,polytype,polytypename);
1059  fprintf(stdout,"- Nombre de mailles de type %s : "IFORMAT" \n",
1060  polytypename,nmpolygones);
1061  }
1062  polytypename[0]='\0';
1063  return nmpolygones;
1064 }
1065 
1067  const char * const nommaa,
1068  const med_int numdt,
1069  const med_int numit,
1070  const med_geometry_type polytype,
1071  const med_int nmpolygones,
1072  const med_switch_mode mode_coo,
1073  const med_connectivity_mode typ_con)
1074 {
1075  med_int i,j;
1076  med_err ret = 0;
1077  med_int taille;
1078  med_int *connectivite;
1079  char *nomele;
1080  med_int *numele;
1081  med_int *nufael;
1082  med_int *indexp;
1083  int ind1,ind2;
1084  char tmp[MED_NAME_SIZE+1];
1085  med_err ret1,ret2,ret3;
1086  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1087  char polytypename[MED_NAME_SIZE+1]="Undefined GeoType";
1088 
1089  EXIT_IF( (( polytype != MED_POLYGON) &&
1090  ( polytype != MED_POLYGON2) ),
1092 
1093  /* lecture des mailles de type MED_POLYGONE */
1094 
1095  /* quelle taille pour le tableau des connectivites ? */
1096  taille=MEDmeshnEntity(fid,nommaa,numdt,numit,
1097  MED_CELL,polytype,MED_CONNECTIVITY,typ_con,
1098  &chgt,&trsf);
1099  EXIT_IF(taille < 0,"lors de la lecture des parametres des mailles polygones",
1100  NULL);
1101 
1102  /* allocation memoire */
1103  indexp = (med_int *) malloc(sizeof(med_int)*(nmpolygones+1));
1104  EXIT_IF(indexp == NULL,NULL,NULL);
1105  connectivite = (med_int *) malloc(sizeof(med_int)*taille);
1106  EXIT_IF(connectivite == NULL,NULL,NULL);
1107  numele = (med_int *) malloc(sizeof(med_int)*nmpolygones);
1108  EXIT_IF(numele == NULL,NULL,NULL);
1109  nufael = (med_int *) malloc(sizeof(med_int)*nmpolygones);
1110  EXIT_IF(nufael == NULL,NULL,NULL);
1111  nomele = (char *) malloc(sizeof(char)*MED_SNAME_SIZE*nmpolygones+1);
1112  EXIT_IF(nomele == NULL,NULL,NULL);
1113 
1114  /* lecture de la connectivite des mailles polygones */
1115  ret = MEDmeshPolygon2Rd(fid,nommaa,numdt,numit,MED_CELL,polytype,typ_con,
1116  indexp,connectivite);
1117 
1118  EXIT_IF(ret < 0,"lors de la lecture des connectivites des mailles polygones",
1119  NULL);
1120 
1121  /* lecture noms */
1122  ret1 = MEDmeshEntityNameRd(fid,nommaa,numdt,numit,
1123  MED_CELL,polytype, nomele);
1124 
1125  /* lecture des numeros */
1126  ret2 = (med_int) MEDmeshEntityNumberRd(fid,nommaa,numdt,numit,
1127  MED_CELL, polytype, numele);
1128 
1129  /* lecture des numeros de familles */
1130  ret3 = MEDmeshEntityFamilyNumberRd(fid, nommaa, MED_NO_DT, MED_NO_IT,
1131  MED_CELL, polytype, nufael);
1132 
1133  if (!structure) {
1134  /* affichage des resultats */
1135  MEDmeshGeotypeName(fid,polytype,polytypename);
1136  fprintf(stdout,"\n\n- Mailles de type %s : ",polytypename);
1137  for (i=0;i<nmpolygones;i++) {
1138  fprintf(stdout,"\n >> Maille MED_POLYGONE "IFORMAT" : \n",i+1);
1139  fprintf(stdout,"\n - Connectivité : ");
1140  ind1 = *(indexp+i)-1;
1141  ind2 = *(indexp+i+1)-1;
1142  for (j=ind1;j<ind2;j++)
1143  printf(" "IFORMAT" ",*(connectivite+j));
1144  if (ret1 == 0) {
1145  strncpy(tmp,nomele+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
1146  tmp[MED_SNAME_SIZE] = '\0';
1147  fprintf(stdout,"\n - Nom : %s \n",tmp);
1148  }
1149  if (ret2 == 0)
1150  fprintf(stdout,"\n - Numero : "IFORMAT" \n",*(numele+i));
1151 
1152  if ( ret3 >= 0 )
1153  fprintf(stdout,"\n - Numéro de famille : "IFORMAT" \n",*(nufael+i));
1154  else
1155  fprintf(stdout,"\n - Numéro de famille : %d \n",0);
1156  }
1157  polytypename[0]='\0';
1158  }
1159 
1160  /* on libere la memoire */
1161  free(indexp);
1162  free(connectivite);
1163  free(numele);
1164  free(nufael);
1165  free(nomele);
1166 
1167  return;
1168 }
1169 
1170 
1172  const char * const nommaa,
1173  const med_int numdt,
1174  const med_int numit,
1175  const med_connectivity_mode typ_con)
1176 {
1177  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1178 
1179  med_int npolyedres = MEDmeshnEntity(fid,nommaa,numdt,numit,
1181  MED_INDEX_FACE,typ_con,&chgt,&trsf);
1182 
1183  EXIT_IF(npolyedres < 0,"lors de la lecture du nombre de mailles polyedre \n",
1184  NULL);
1185  if ( npolyedres > 0 ) npolyedres--; else npolyedres=0;
1186  if (npolyedres)
1187  fprintf(stdout,"- Nombre de mailles de type MED_POLYEDRE : "IFORMAT" \n",
1188  npolyedres);
1189 
1190  return npolyedres;
1191 }
1192 
1193 
1195  const char * const nommaa,
1196  const med_int numdt,
1197  const med_int numit,
1198  const med_int npolyedres,
1199  const med_switch_mode mode_coo,
1200  const med_connectivity_mode typ_con)
1201 {
1202  med_int i,j,k;
1203  med_err ret = 0;
1204  med_int taille;
1205  med_int *connectivite;
1206  char *nomele;
1207  med_int *numele;
1208  med_int *nufael;
1209  med_int *indexf, *indexn;
1210  int ind1,ind2;
1211  char tmp[MED_SNAME_SIZE+1];
1212  med_err ret1,ret2,ret3;
1213  med_int nfa;
1214  med_int nnoe;
1215  med_int nindn;
1216  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1217 
1218 
1219  /* lecture des parametres de base */
1220  taille = MEDmeshnEntity(fid,nommaa,numdt,numit,
1222  &chgt,&trsf);
1223  EXIT_IF(taille < 0,"lors de la lecture des parametres des mailles polyedres",
1224  NULL);
1225 
1226  nindn = MEDmeshnEntity(fid,nommaa,numdt,numit,
1228  &chgt,&trsf);
1229  EXIT_IF(nindn < 0,"lors de la lecture des parametres des mailles polyedres",
1230  NULL);
1231 
1232  /* allocation memoire */
1233  /* nindf == npolyedres+1 */
1234  indexf = (med_int *) malloc(sizeof(med_int)*(npolyedres+1));
1235  EXIT_IF(indexf == NULL,NULL,NULL);
1236  indexn = (med_int *) malloc(sizeof(med_int)*nindn);
1237  EXIT_IF(indexn == NULL,NULL,NULL);
1238  connectivite = (med_int *) malloc(sizeof(med_int)*taille);
1239  EXIT_IF(connectivite == NULL,NULL,NULL);
1240  numele = (med_int *) malloc(sizeof(med_int)*npolyedres);
1241  EXIT_IF(numele == NULL,NULL,NULL);
1242  nufael = (med_int *) malloc(sizeof(med_int)*npolyedres);
1243  EXIT_IF(nufael == NULL,NULL,NULL);
1244  nomele = (char *) malloc(sizeof(char)*MED_SNAME_SIZE*npolyedres+1);
1245  EXIT_IF(nomele == NULL,NULL,NULL);
1246 
1247  ret = MEDmeshPolyhedronRd(fid,nommaa,numdt,numit,MED_CELL,typ_con,
1248  indexf,indexn,connectivite);
1249  EXIT_IF(ret < 0,
1250  "lors de la lecture de la connectivite des mailles polyedres",
1251  NULL);
1252 
1253  /* lecture des noms */
1254  ret1 = MEDmeshEntityNameRd(fid,nommaa,numdt,numit,MED_CELL,MED_POLYHEDRON,nomele);
1255 
1256  /* lecture des numeros */
1257  ret2 = MEDmeshEntityNumberRd(fid,nommaa,numdt,numit,MED_CELL,MED_POLYHEDRON,numele);
1258 
1259  /* lecture des numeros de familles */
1260  ret3 = MEDmeshEntityFamilyNumberRd(fid,nommaa,numdt,numit,MED_CELL,MED_POLYHEDRON,nufael);
1261 
1262  if (!structure) {
1263  /* affichage des resultats */
1264  fprintf(stdout,"\n\n- Mailles de type MED_POLYEDRE : ");
1265  for (i=0;i<npolyedres;i++) {
1266  fprintf(stdout,"\n >> Maille MED_POLYEDRE "IFORMAT" : \n",i+1);
1267  fprintf(stdout,"\n - Connectivité : \n");
1268  nfa = *(indexf+i+1) - *(indexf+i);
1269  /* ind1 = indice dans "faces" pour acceder aux numeros des faces */
1270  ind1 = *(indexf+i) - 1;
1271  for (j=0;j<nfa;j++) {
1272  if (typ_con == MED_NODAL) {
1273  /* ind2 = indice dans "connectivite"
1274  pour acceder au premier noeud de la face */
1275  ind2 = *(indexn+ind1+j) - 1;
1276  nnoe = *(indexn+ind1+j+1) - *(indexn+ind1+j);
1277  fprintf(stdout," - Face "IFORMAT" : [ ", j+1);
1278  for (k=0;k<nnoe;k++)
1279  printf(" "IFORMAT" ",*(connectivite+ind2+k));
1280  printf(" ] \n");
1281  }
1282  else {
1283  nfa = *(indexf+i+1) - *(indexf+i);
1284  /* ind1 = indice dans "connectivite"
1285  pour acceder aux numeros des faces */
1286  ind1 = *(indexf+i) - 1;
1287  for (j=0;j<nfa;j++)
1288  fprintf(stdout," - Face "IFORMAT" de numero : "IFORMAT" et de type "IFORMAT" \n", j+1,
1289  *(connectivite+ind1+j),*(indexn+ind1+j));
1290  }
1291  }
1292  if (ret1 == 0) {
1293  strncpy(tmp,nomele+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
1294  tmp[MED_SNAME_SIZE] = '\0';
1295  fprintf(stdout,"\n - Nom : %s \n",tmp);
1296  }
1297  if (ret2 == 0)
1298  fprintf(stdout,"\n - Numero : "IFORMAT" \n",*(numele+i));
1299  if (ret3 >= 0)
1300  fprintf(stdout,"\n - Numéro de famille : "IFORMAT" \n",*(nufael+i));
1301  else
1302  fprintf(stdout,"\n - Numéro de famille : %d \n",0);
1303 
1304  }
1305  }
1306 
1307  /* on libere la memoire */
1308  free(indexf);
1309  free(indexn);
1310  free(connectivite);
1311  free(numele);
1312  free(nufael);
1313  free(nomele);
1314 
1315  return;
1316 }
1317 
1319  const char * const nommaa,
1320  const med_int numdt,
1321  const med_int numit,
1322  const med_geometry_type typ_geo,
1323  const med_int indice
1324  )
1325 {
1326 
1327  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1328 
1329  med_int nfaces = MEDmeshnEntity(fid,nommaa,numdt,numit,
1330  MED_DESCENDING_FACE,typ_geo,
1331  MED_CONNECTIVITY,MED_DESCENDING,&chgt,&trsf);
1332  EXIT_IF(nfaces < 0,"lors de la lecture du nombre de faces",NULL);
1333 
1334  if ( (indice < (MED_N_FACE_GEO_FIXED_CON-2) ) ||
1335  (indice >= (MED_N_FACE_GEO_FIXED_CON-2) && (nfaces > 0) ) )
1336  if (nfaces)
1337  fprintf (stdout,"- Nombre de faces de type %s : "IFORMAT" \n",
1338  nomfac[indice],nfaces);
1339 
1340  return nfaces;
1341 }
1342 
1344  const char * const nommaa,
1345  const med_int numdt,
1346  const med_int numit,
1347  const med_int mdim,
1348  const med_int *const nfaces,
1349  const med_switch_mode mode_coo)
1350 {
1351  med_int taille;
1352  med_int *connectivite;
1353  char *nomele;
1354  med_int *numele;
1355  med_int *nufael;
1356  med_bool inoele,inuele,inufael;
1357  med_int i,j;
1358  med_err ret = 0;
1359  char str[MED_SNAME_SIZE+1];
1360  med_int entdim;
1361  med_int nnodes;
1362 
1363  for (i=0;i<MED_N_FACE_GEO_FIXED_CON;i++)
1364  if (nfaces[i] > 0 ) {
1365 
1366  /* taille de la description : nombre d'aretes */
1367  ret=_MEDgetGeometricParameter(MED_DESCENDING_FACE, typfac[i],&entdim,&nnodes,&taille);
1368  EXIT_IF(ret < 0,"lors de la lecture des caractéristiques des mailles",NULL);
1369 
1370  /* allocation memoire */
1371  connectivite = (med_int*)malloc(sizeof(med_int)*taille*nfaces[i]);
1372  EXIT_IF(connectivite == NULL,NULL,NULL);
1373  nomele = (char*)malloc(sizeof(char)*MED_SNAME_SIZE*nfaces[i]+1);
1374  EXIT_IF(nomele == NULL,NULL,NULL);
1375  numele = (med_int*)malloc(sizeof(med_int)*nfaces[i]);
1376  EXIT_IF(numele == NULL,NULL,NULL);
1377  nufael = (med_int*)malloc(sizeof(med_int)*nfaces[i]);
1378  EXIT_IF(nufael == NULL,NULL,NULL);
1379 
1380  /* lecture des données */
1381  ret = MEDmeshElementRd( fid,nommaa,numdt,numit,MED_DESCENDING_FACE,typmai[i],
1382  MED_DESCENDING, mode_coo, connectivite,
1383  &inoele,nomele,&inuele,numele,&inufael,nufael );
1384  EXIT_IF(ret < 0,"lors de la lecture des faces",NULL);
1385 
1386  if (!structure) {
1387  /* affichage des resultats */
1388  fprintf(stdout,"\n- Faces de type %s : ", nomfac[i]);
1389  fprintf(stdout,"\n - Connectivité : ");
1390  for (j=0;j<nfaces[i]*taille;j++) {
1391  if (mode_coo == MED_FULL_INTERLACE && !(j % taille))
1392  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/taille+1) );
1393  if (mode_coo == MED_NO_INTERLACE && !(j % nfaces[i]))
1394  fprintf(stdout,"\n");
1395  fprintf(stdout," %9"MED_IFORMAT" ",*(connectivite+j));
1396  }
1397 
1398  if (inoele) {
1399  fprintf(stdout,"\n - Noms : \n");
1400  for (j=0;j<nfaces[i];j++) {
1401  strncpy(str,nomele+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
1402  str[MED_SNAME_SIZE] = '\0';
1403  fprintf(stdout," %s ",str);
1404  }
1405  }
1406  if (inuele) {
1407  fprintf(stdout,"\n - Numeros :\n");
1408  for (j=0;j<nfaces[i];j++)
1409  fprintf(stdout," "IFORMAT" ",*(numele+j));
1410  }
1411  fprintf(stdout,"\n - Numéros de familles : \n");
1412  for (j=0;j<nfaces[i];j++)
1413  if ( inufael )
1414  fprintf(stdout," "IFORMAT" ",*(nufael+j));
1415  else
1416  fprintf(stdout," %d ",0);
1417  }
1418 
1419  /* liberation memoire */
1420  free(connectivite);
1421  free(nomele);
1422  free(numele);
1423  free(nufael);
1424  }
1425 
1426  return;
1427 }
1428 
1430  const char * const nommaa,
1431  const med_int numdt,
1432  const med_int numit)
1433 {
1434 
1435  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1436 
1437  med_int nfpolygones = MEDmeshnEntity(fid,nommaa,numdt,numit,
1439  MED_INDEX_NODE,MED_DESCENDING,&chgt,&trsf);
1440 
1441  EXIT_IF(nfpolygones < 0,"lors de la lecture du nombre de faces polygone \n",
1442  NULL);
1443  if (nfpolygones > 0 ) nfpolygones--; else nfpolygones=0;
1444  if (nfpolygones)
1445  fprintf(stdout,"- Nombre de faces de type MED_POLYGONE : "IFORMAT" \n",
1446  nfpolygones);
1447 
1448  return nfpolygones;
1449 }
1450 
1452  const char * const nommaa,
1453  const med_int numdt,
1454  const med_int numit,
1455  const med_int nfpolygones,
1456  const med_switch_mode mode_coo)
1457 {
1458  med_int i,j;
1459  med_err ret = 0;
1460  char *nomele;
1461  med_int *numele;
1462  med_int *nufael;
1463  med_int *connectivite;
1464  med_int taille;
1465  med_int *indexp;
1466  int ind1,ind2;
1467  char tmp[MED_NAME_SIZE+1];
1468  med_err ret1,ret2,ret3;
1469  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1470 
1471  /* quelle taille pour le tableau des connectivites ? */
1472  taille=MEDmeshnEntity(fid,nommaa,numdt,numit,
1474  &chgt,&trsf);
1475  EXIT_IF(taille < 0,"lors de la lecture des parametres des faces polygones",
1476  NULL);
1477 
1478  /* allocation memoire */
1479  indexp = (med_int *) malloc(sizeof(med_int)*(nfpolygones+1));
1480  EXIT_IF(indexp == NULL,NULL,NULL);
1481  connectivite = (med_int *) malloc(sizeof(med_int)*taille);
1482  EXIT_IF(connectivite == NULL,NULL,NULL);
1483  numele = (med_int *) malloc(sizeof(med_int)*nfpolygones);
1484  EXIT_IF(numele == NULL,NULL,NULL);
1485  nufael = (med_int *) malloc(sizeof(med_int)*nfpolygones);
1486  EXIT_IF(nufael == NULL,NULL,NULL);
1487  nomele = (char *) malloc(sizeof(char)*MED_SNAME_SIZE*nfpolygones+1);
1488  EXIT_IF(nomele == NULL,NULL,NULL);
1489 
1490  /* lecture de la connectivite des faces polygones */
1491  ret = MEDmeshPolygonRd(fid,nommaa,numdt,numit,MED_DESCENDING_FACE,MED_DESCENDING,
1492  indexp,connectivite);
1493  EXIT_IF(ret < 0,"lors de la lecture des connectivites des faces polygones", NULL);
1494 
1495  /* lecture noms */
1496  ret1 = MEDmeshEntityNameRd(fid,nommaa,numdt,numit,
1498 
1499  /* lecture des numeros */
1500  ret2 = (med_int) MEDmeshEntityNumberRd(fid,nommaa,numdt,numit,
1501  MED_DESCENDING_FACE, MED_POLYGON, numele);
1502 
1503  /* lecture des numeros de familles */
1504  ret3 = MEDmeshEntityFamilyNumberRd(fid, nommaa, MED_NO_DT, MED_NO_IT,
1505  MED_DESCENDING_FACE, MED_POLYGON, nufael);
1506 
1507  if (!structure) {
1508  /* affichage des resultats */
1509  fprintf(stdout,"\n\n- Faces de type MED_POLYGONE : ");
1510  for (i=0;i<nfpolygones;i++) {
1511  fprintf(stdout,"\n >> Face MED_POLYGONE "IFORMAT" : \n",i+1);
1512  fprintf(stdout,"\n - Connectivité : ");
1513  ind1 = *(indexp+i)-1;
1514  ind2 = *(indexp+i+1)-1;
1515  for (j=ind1;j<ind2;j++)
1516  fprintf(stdout," "IFORMAT" ",*(connectivite+j));
1517  if (ret1 == 0) {
1518  strncpy(tmp,nomele+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
1519  tmp[MED_SNAME_SIZE] = '\0';
1520  fprintf(stdout,"\n - Nom : %s \n",tmp);
1521  }
1522  if (ret2 == 0)
1523  fprintf(stdout,"\n - Numero : "IFORMAT" \n",*(numele+j));
1524  if ( ret3 > 0 )
1525  fprintf(stdout,"\n - Numéro de famille : "IFORMAT" \n",*(nufael+i));
1526  else
1527  fprintf(stdout,"\n - Numéro de famille : %d \n",0);
1528  }
1529  }
1530 
1531  /* on libere la memoire */
1532  free(indexp);
1533  free(connectivite);
1534  free(numele);
1535  free(nufael);
1536  free(nomele);
1537 
1538  return;
1539 }
1540 
1541 
1543  const char *const nommaa,
1544  const med_int numdt,
1545  const med_int numit,
1546  const med_geometry_type typ_geo,
1547  const med_int indice)
1548 {
1549 
1550  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1551 
1552  med_int naretes = MEDmeshnEntity(fid,nommaa,numdt,numit,
1553  MED_DESCENDING_EDGE, typ_geo,
1554  MED_CONNECTIVITY,MED_DESCENDING,&chgt,&trsf);
1555  EXIT_IF(naretes < 0,"lors de la lecture du nombre d'aretes",NULL);
1556  if ( (indice < (MED_N_EDGE_GEO_FIXED_CON-1) ) ||
1557  (indice >= (MED_N_EDGE_GEO_FIXED_CON-1) && (naretes > 0) ) )
1558  if (naretes)
1559  fprintf (stdout,
1560  "- Nombre d'aretes de type %s : "IFORMAT" \n",nomare[indice],naretes);
1561 
1562  return naretes;
1563 }
1564 
1566  const char * const nommaa,
1567  const med_int numdt,
1568  const med_int numit,
1569  const med_int mdim,
1570  const med_int * const naretes,
1571  const med_switch_mode mode_coo)
1572 {
1573  med_int taille;
1574  med_int *connectivite;
1575  char *nomele;
1576  med_int *numele;
1577  med_int *nufael;
1578  med_bool inoele,inuele,inufael;
1579  med_int i,j;
1580  med_err ret = 0;
1581  char str[MED_SNAME_SIZE+1];
1582  med_int entdim;
1583  med_int nnodes;
1584 
1585  for (i=0;i<MED_N_EDGE_GEO_FIXED_CON;i++)
1586  if (naretes[i] > 0) {
1587 
1588  ret=_MEDgetGeometricParameter(MED_DESCENDING_EDGE, typare[i],&entdim,&nnodes,&taille);
1589  EXIT_IF(ret < 0,"lors de la lecture des caractéristiques des mailles",NULL);
1590 
1591  /* allocation memoire */
1592  connectivite = (med_int*)malloc(sizeof(med_int)*taille*naretes[i]);
1593  EXIT_IF(connectivite == NULL,NULL,NULL);
1594  nomele = (char*)malloc(sizeof(char)*MED_SNAME_SIZE*naretes[i]+1);
1595  EXIT_IF(nomele == NULL,NULL,NULL);
1596  numele = (med_int*)malloc(sizeof(med_int)*naretes[i]);
1597  EXIT_IF(numele == NULL,NULL,NULL);
1598  nufael = (med_int*)malloc(sizeof(med_int)*naretes[i]);
1599  EXIT_IF(nufael == NULL,NULL,NULL);
1600 
1601  /* lecture des données */
1602  ret = MEDmeshElementRd( fid,nommaa,numdt,numit,MED_DESCENDING_EDGE,typare[i],
1603  MED_DESCENDING, mode_coo, connectivite,
1604  &inoele,nomele,&inuele,numele,&inufael,nufael );
1605  EXIT_IF(ret < 0,"lors de la lecture des aretes",
1606  NULL);
1607 
1608  if (!structure) {
1609  /* affichage des resultats */
1610  fprintf(stdout,"\n- Aretes de type %s : ", nomare[i]);
1611  fprintf(stdout,"\n - Connectivité : ");
1612  for (j=0;j<naretes[i]*taille;j++) {
1613  if (mode_coo == MED_FULL_INTERLACE && !(j % taille))
1614  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/taille+1) );
1615  if (mode_coo == MED_NO_INTERLACE && !(j % naretes[i]))
1616  fprintf(stdout,"\n");
1617  fprintf(stdout," %9"MED_IFORMAT" ",*(connectivite+j));
1618  }
1619 
1620  if (inoele) {
1621  fprintf(stdout,"\n - Noms : \n");
1622  for (j=0;j<naretes[i];j++) {
1623  strncpy(str,nomele+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
1624  str[MED_SNAME_SIZE] = '\0';
1625  fprintf(stdout," %s ",str);
1626  }
1627  }
1628  if (inuele) {
1629  fprintf(stdout,"\n - Numeros :\n");
1630  for (j=0;j<naretes[i];j++)
1631  fprintf(stdout," "IFORMAT" ",*(numele+j));
1632  }
1633  fprintf(stdout,"\n - Numéros de familles : \n");
1634  for (j=0;j<naretes[i];j++)
1635  if ( inufael )
1636  fprintf(stdout," "IFORMAT" ",*(nufael+j));
1637  else
1638  fprintf(stdout," %d ",0);
1639  }
1640 
1641  /* liberation memoire */
1642  free(connectivite);
1643  free(nomele);
1644  free(numele);
1645  free(nufael);
1646  }
1647 
1648  return;
1649 }
1650 
1651 
1652 /******************************************************************************
1653  * - Nom de la fonction : lecture_maillage_non_structure
1654  * - Description : lecture et affichage d'un maillage MED_NON_STRUCTURE.
1655  * - Parametres :
1656  * - fid (IN) : ID du fichier MED.
1657  * - nommaa (IN) : nom du maillage a lire.
1658  * - mdim (IN) : dimension du maillage.
1659  * - mode_coo (IN) : mode de stockage en memoire :
1660  * MED_FULL_INTERLACE : entrelace |
1661  * MED_NO_INTERLACE : non entrelace.
1662  * - typ_con (IN) : mode de connectivite :
1663  * MED_DESCENDING : descendante |
1664  * MED_NODAL : nodale.
1665  * - lecture_en_tete_seulement (IN) : mode de lecture et d'affichage.
1666  ******************************************************************************/
1667 
1669  const char *nommaa,
1670  const med_int numdt,
1671  const med_int numit,
1672  const med_int mdim,
1673  const med_int edim,
1674  const med_switch_mode mode_coo,
1675  const med_connectivity_mode typ_con,
1676  const char * const nomcoo,
1677  const char * const unicoo,
1678  const med_axis_type *const rep,
1679  med_int* nmodels,
1680  med_geometry_type** geotype_elst,
1681  char** geotypename_elst,
1682  const int lecture_en_tete_seulement)
1683 {
1684  med_int i;
1685  /* nombre d'objets MED : noeuds, mailles, faces, aretes , ... */
1686  med_int nnoe;
1690  /* polygones et polyedres */
1691  med_int nmpolygones,nmpolygones2, npolyedres, nfpolygones;
1692  /* familles */
1693  med_int nfam;
1694  /* equivalences */
1695  med_int nequ;
1696  /* joints */
1697  med_int njnt;
1698  /* Eléments de structure */
1699  med_int _nmodels=0,*_nmailles_elst = NULL;
1700  med_geometry_type *_geotype_elst = NULL;
1701  char *_geotypename_elst = NULL;
1702  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1703 
1704  /* Combien de noeuds dans le maillage ? */
1705  nnoe = lecture_nombre_noeuds_maillage_non_structure(fid,nommaa,numdt,numit);
1706 
1707  /* Combien de types d'éléments de structure utilisés dans le maillage */
1708  _nmodels = MEDmeshnEntity(fid,nommaa,numdt,numit,
1710  &chgt,&trsf);
1711  EXIT_IF(_nmodels<0,
1712  "Erreur à la lecture du nombre de type géométrique pour le type d'entités MED_STRUCT_ELEMENT",NULL);
1713 
1714  _nmailles_elst = (med_int *) malloc(_nmodels*sizeof(med_int));
1715  _geotype_elst = (med_geometry_type *) malloc(_nmodels*sizeof(med_geometry_type));
1716  _geotypename_elst = (char *) malloc(_nmodels*sizeof(char)*(MED_NAME_SIZE+1));
1717  /* Combien mailles par types d'éléments de structure */
1718  for (i=0; i < _nmodels; i++) {
1719  _nmailles_elst[i]=lecture_nombre_et_type_mailles_elstruct(fid,nommaa,numdt,numit,i,
1720  &_geotype_elst[i],&_geotypename_elst[i*(MED_NAME_SIZE+1)]);
1721  }
1722  if (_nmodels) {
1723  *nmodels = _nmodels;
1724  *geotype_elst = _geotype_elst;
1725  *geotypename_elst = _geotypename_elst;
1726  } else *nmodels=0;
1727 
1728  /*TODO : AFFICHER DT ( DTUNIT ) */
1729  /* Combien de mailles, faces ou aretes pour chaque type geometrique ? */
1730  for (i=0;i<MED_N_CELL_GEO_FIXED_CON;i++)
1731  nmailles[i] = lecture_nombre_mailles_standards(fid,nommaa,numdt,numit,typmai[i],
1732  typ_con,i);
1733 
1734  /* Combien de mailles polygones simples */
1735  nmpolygones = lecture_nombre_mailles_polygones(fid,nommaa,numdt,numit,MED_POLYGON,typ_con);
1736 
1737  /* Combien de mailles polygones quadratiques */
1738  nmpolygones2 = lecture_nombre_mailles_polygones(fid,nommaa,numdt,numit,MED_POLYGON2,typ_con);
1739 
1740  /* Combien de mailles polyedres quelconques ? */
1741  npolyedres = lecture_nombre_mailles_polyedres(fid,nommaa,numdt,numit,typ_con);
1742 
1743  /* Pour la connectivite descendante */
1744  if (typ_con == MED_DESCENDING) {
1745 
1746  /* Combien de faces : types geometriques standards ? */
1747  for (i=0;i<MED_N_FACE_GEO_FIXED_CON;i++)
1748  nfaces[i] = lecture_nombre_faces_standards(fid,nommaa,numdt,numit,typfac[i],i);
1749 
1750  /* Combien de faces polygones quelconques ? */
1751  nfpolygones = lecture_nombre_faces_polygones(fid,nommaa,numdt,numit);
1752 
1753  /* Combien d'aretes */
1754  for (i=0;i<MED_N_EDGE_GEO_FIXED_CON;i++)
1755  naretes[i] = lecture_nombre_aretes_standards(fid,nommaa,numdt,numit,typare[i],i);
1756  }
1757 
1758  if (lecture_en_tete_seulement != MED_LECTURE_MAILLAGE_SUPPORT_UNIQUEMENT) {
1759  /* combien de familles ? */
1760  nfam = lecture_nombre_famille(fid,nommaa);
1761 
1762  /* combien d'equivalences ? */
1763  nequ = lecture_nombre_equivalence(fid,nommaa);
1764 
1765  /* combien de joints ? */
1766  njnt = lecture_nombre_joint(fid,nommaa);
1767  }
1768 
1769  /* en fonction du mode de lecture, on continue ou non */
1770  if (lecture_en_tete_seulement == MED_LECTURE_ENTETE_SEULEMENT) {
1771 /* Ces desallocations sont effectuées
1772  après la lecture des champs sur ces éléments de structure */
1773 /* free(_nmailles_elst); */
1774 /* free(_geotype_elst); */
1775 /* free(_geotypename_elst); */
1776  return;
1777  }
1778  /****************************************************************************
1779  * LECTURE DES NOEUDS *
1780  ****************************************************************************/
1781  lecture_noeuds_maillage_non_structure(fid,nommaa,numdt,numit,mdim,edim,nnoe,mode_coo,nomcoo,unicoo,rep);
1782  /*ICI;_MEDobjetsOuverts(fid);*/
1783 
1784 
1785  /****************************************************************************
1786  * LECTURE DES ELEMENTS *
1787  * Mailles : *
1788  * - Types geometriques classiques : MED_SEG2, MED_SEG3, MED_TRIA3, ... *
1789  * - Elements de structure *
1790  * - Polygones quelconques. *
1791  * - Polyedres quelconques. *
1792  * Faces (connectivite descendante uniquement) : *
1793  * - Types geometriques classiques. *
1794  * - Polygones quelconques. *
1795  ****************************************************************************/
1796 
1797  /* lecture et affichage des mailles */
1798  lecture_mailles_standards(fid,nommaa,numdt,numit,mdim,nmailles,mode_coo,typ_con);
1799  /*ICI;_MEDobjetsOuverts(fid);*/
1800 
1801  if (lecture_en_tete_seulement == MED_LECTURE_MAILLAGE_SUPPORT_UNIQUEMENT) return;
1802 
1803  if (_nmodels>0) {
1804  lecture_mailles_elstruct(fid,nommaa,numdt,numit,_nmodels,
1805  _geotype_elst,_geotypename_elst,_nmailles_elst,mode_coo);
1806  /* Ces desallocations sont effectuées
1807  après la lecture des champs sur ces éléments de structure */
1808 /* free(_nmailles_elst); */
1809 /* free(_geotype_elst); */
1810 /* free(_geotypename_elst); */
1811  }
1812  /*ICI;_MEDobjetsOuverts(fid);*/
1813 
1814  if (nmpolygones > 0)
1815  lecture_mailles_polygones(fid,nommaa,numdt,numit,MED_POLYGON,nmpolygones,mode_coo,typ_con);
1816  /*ICI;_MEDobjetsOuverts(fid);*/
1817 
1818  if (nmpolygones2 > 0)
1819  lecture_mailles_polygones(fid,nommaa,numdt,numit,MED_POLYGON2,nmpolygones2,mode_coo,typ_con);
1820  /*ICI;_MEDobjetsOuverts(fid);*/
1821 
1822  if (npolyedres > 0)
1823  lecture_mailles_polyedres(fid,nommaa,numdt,numit,npolyedres,mode_coo,typ_con);
1824  /*ICI;_MEDobjetsOuverts(fid);*/
1825 
1826  /* lecture et affichage des faces en connectivite descendante uniquement */
1827  if (typ_con == MED_DESCENDING) {
1828  lecture_faces_standard(fid,nommaa,numdt,numit,mdim,nfaces,mode_coo);
1829  if (nfpolygones > 0)
1830  lecture_faces_polygones(fid,nommaa,numdt,numit,nfpolygones,mode_coo);
1831  }
1832  /*ICI;_MEDobjetsOuverts(fid);*/
1833 
1834  /* lecture et affichage des aretes en connectivite descendante uniquement */
1835  if (typ_con == MED_DESCENDING)
1836  lecture_aretes_standards(fid,nommaa,numdt,numit,mdim,naretes,mode_coo);
1837  /*ICI;_MEDobjetsOuverts(fid);*/
1838 
1839  /****************************************************************************
1840  * LECTURE DES FAMILLES *
1841  ****************************************************************************/
1842  lecture_famille_maillage(fid,nommaa,nfam);
1843  /*ICI;_MEDobjetsOuverts(fid);*/
1844 
1845 
1846  /****************************************************************************
1847  * LECTURE DES EQUIVALENCES *
1848  ****************************************************************************/
1849  lecture_equivalence_maillage(fid,nommaa,nequ);
1850  /*ICI;_MEDobjetsOuverts(fid);*/
1851 
1852 
1853  /****************************************************************************
1854  * LECTURE DES JOINTS *
1855  ****************************************************************************/
1856  lecture_joint_maillage(fid,nommaa,njnt);
1857  /*ICI;_MEDobjetsOuverts(fid);*/
1858 
1859  return;
1860 }
1861 
1862 
1864  const char * const nommaa,
1865  const med_int numdt,
1866  const med_int numit,
1867  const med_int mdim,
1868  med_int *nind,
1869  med_int *nnoe,
1870  med_int *nmai,
1871  med_grid_type *type)
1872 {
1873  med_err ret = 0;
1874  med_int axe;
1875  med_int *structure_grille;
1876  med_data_type quoi;
1877  med_int j;
1878  med_bool chgt=MED_FALSE,trsf=MED_FALSE;
1879 
1880  /* lecture de la nature du maillage structure : MED_GRILLE_CARTESIENNE ,...*/
1881  ret = MEDmeshGridTypeRd(fid,nommaa,type);
1882  EXIT_IF(ret < 0,"a la lecture du type d'une grille ",NULL);
1883 
1884  switch(*type) {
1885 
1886  case MED_CARTESIAN_GRID :
1887  case MED_POLAR_GRID :
1888  if (*type == MED_CARTESIAN_GRID)
1889  fprintf(stdout,"- Type de grille : MED_GRILLE_CARTESIENNE \n");
1890  else
1891  fprintf(stdout,"- Type de grille : MED_GRILLE_POLAIRE \n");
1892  for (axe=1;axe<=mdim;axe++) {
1893  switch(axe) {
1894 
1895  case 1:
1896  quoi = MED_COORDINATE_AXIS1;
1897  break;
1898 
1899  case 2:
1900  quoi = MED_COORDINATE_AXIS2;
1901  break;
1902 
1903  case 3:
1904  quoi = MED_COORDINATE_AXIS3;
1905  break;
1906  }
1907  nind[axe - 1] = MEDmeshnEntity(fid,nommaa, numdt, numit,
1908  MED_NODE, MED_NONE, quoi, MED_NO_CMODE, &chgt, &trsf);
1909 
1910  EXIT_IF(nind[axe - 1] < 0,
1911  "lors de la lecture de la taille d'un indice d'une grille",
1912  NULL);
1913  *nnoe = nind[axe - 1] * (*nnoe);
1914  *nmai = (nind[axe - 1] - 1) * (*nmai);
1915  fprintf(stdout,
1916  "- Taille de l'indice de l'axe "IFORMAT" des coordonnees : "IFORMAT" \n",
1917  axe,nind[axe - 1]);
1918  }
1919  break;
1920 
1921  case MED_CURVILINEAR_GRID:
1922  fprintf(stdout,"- Type de grille : MED_GRILLE_DESTRUCTUREE \n");
1923  *nnoe = MEDmeshnEntity(fid, nommaa, numdt, numit,
1924  MED_NODE, MED_NONE, MED_COORDINATE, MED_NO_CMODE, &chgt, &trsf);
1925  EXIT_IF(*nnoe < 0,"lors de la lecture du nombre de noeuds du maillage "
1926  ,nommaa);
1927 
1928  /* on alloue la memoire */
1929  structure_grille = (med_int *) malloc(sizeof(med_int)*mdim);
1930  EXIT_IF(structure_grille == NULL,NULL,NULL);
1931  /* on lit la structure de la grille
1932  et on affiche le resultat */
1933  ret = MEDmeshGridStructRd(fid,nommaa,numdt, numit, structure_grille);
1934  EXIT_IF(ret < 0,"lors de la lecture de la structure de la grille",
1935  NULL);
1936  fprintf(stdout,"- Structure de la grille : [ ");
1937  for (j=0;j<mdim;j++) {
1938  *nmai = (*(structure_grille+j) - 1) * (*nmai);
1939  fprintf(stdout," "IFORMAT" ",*(structure_grille+j));
1940  }
1941  fprintf(stdout," ] \n");
1942  /* on nettoie la memoire */
1943  free(structure_grille);
1944  break;
1945 
1946  case MED_UNDEF_GRID_TYPE:
1947  default:
1948  EXIT_IF(-1,"Type de grille non reconnu.",nommaa);
1949 
1950  }
1951 
1952  fprintf(stdout,"- Nombre de noeuds : "IFORMAT" \n",*nnoe);
1953  fprintf(stdout,"- Nombre de mailles : "IFORMAT" \n",*nmai);
1954 
1955  return;
1956 }
1957 
1958 
1960  const char * const nommaa,
1961  const med_int numdt,
1962  const med_int numit,
1963  const med_int mdim,
1964  const med_int edim,
1965  const med_int * const nind,
1966  const med_int nnoe,
1967  const char * const comp,
1968  const char * const unit,
1969  const med_grid_type type,
1970  const med_switch_mode mode_coo)
1971 {
1972  med_err ret = 0;
1973  med_int axe,i,j;
1974  char str[MED_SNAME_SIZE+1];
1975  med_float *coo = NULL;
1976  med_float *indices = NULL;
1977  med_int *nufano = NULL;
1978  med_int *numnoe = NULL;
1979  char *nomnoe = NULL;
1980  med_bool inufael=MED_FALSE;
1981 
1982  fprintf(stdout,"\n(*************************)\n");
1983  fprintf(stdout,"(* NOEUDS DE LA GRILLE : *)\n");
1984  fprintf(stdout,"(*************************)\n");
1985 
1986  switch(type) {
1987 
1988  case MED_CARTESIAN_GRID :
1989  case MED_POLAR_GRID :
1990  /* on affiche les coordonnees de chacun des axes */
1991  for (axe = 1; axe<=mdim; axe++) {
1992  /* on alloue la memoire */
1993  indices = (med_float *) malloc(sizeof(med_float)*nind[axe - 1]);
1994  EXIT_IF(indices == NULL,NULL,NULL);
1995  /* on lit le tableau des indices de coordonnees
1996  et on affiche le resultat */
1997  ret = MEDmeshGridIndexCoordinateRd(fid,nommaa,numdt,numit, axe,indices);
1998  EXIT_IF(ret < 0,"lors de la lecture d'un tableau d'indice",
1999  NULL);
2000  fprintf(stdout,"\n - Axe %." xstr(MED_SNAME_SIZE) "s [%." xstr(MED_SNAME_SIZE) "s] : [ ",
2001  &comp[MED_SNAME_SIZE*(axe-1)],&unit[MED_SNAME_SIZE*(axe-1)]);
2002  for (j=0;j<nind[axe - 1];j++)
2003  fprintf(stdout," %f ",*(indices+j));
2004  printf(" ] \n");
2005  /* on nettoie la memoire */
2006  free(indices);
2007  }
2008  break;
2009 
2010  case MED_CURVILINEAR_GRID:
2011  /* on alloue la memoire */
2012  coo = (med_float *) malloc(sizeof(med_float)*nnoe*edim);
2013  EXIT_IF(coo == NULL,NULL,NULL);
2014  /* on va lire les coordonnees des noeuds */
2015  ret = MEDmeshNodeCoordinateRd(fid,nommaa,numdt,numit, MED_FULL_INTERLACE,coo);
2016 
2017  EXIT_IF(ret < 0,"lors de la lecture des noeuds du maillage",NULL);
2018  /* on affiche le resultat */
2019  fprintf(stdout,"- Nom des coordonnees : \n");
2020  for (i=0;i<edim;i++) {
2021  strncpy(str,comp+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
2022  str[MED_SNAME_SIZE] = '\0';
2023  fprintf(stdout," %s ",str);
2024  }
2025  fprintf(stdout,"\n- Unites des coordonnees : \n");
2026  for (i=0;i<edim;i++) {
2027  strncpy(str,unit+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
2028  str[MED_SNAME_SIZE] = '\0';
2029  fprintf(stdout," %s ",str);
2030  }
2031  if (!structure) {
2032  fprintf(stdout,"\n - Coordonnees des noeuds : [ ");
2033  for (j=0;j<nnoe*edim;j++)
2034  fprintf(stdout," %f ",*(coo+j));
2035  fprintf(stdout," ] \n");
2036  }
2037 
2038  /* on nettoie la memoire */
2039  free(coo);
2040  break;
2041 
2042  case MED_UNDEF_GRID_TYPE:
2043  default:
2044  EXIT_IF(-1,"Type de grille non reconnu.",nommaa);
2045 
2046  }
2047 
2048  /* lecture et affichage des :
2049  - numeros de familles des noeuds
2050  - noms des noeuds (optionnel)
2051  - numeros des noeuds (optionnel) */
2052 
2053  /* on alloue la memoire */
2054  numnoe = (med_int *) malloc(sizeof(med_int)*nnoe);
2055  EXIT_IF(numnoe == NULL,NULL,NULL);
2056  nomnoe = (char*) malloc(MED_SNAME_SIZE*nnoe+1);
2057  EXIT_IF(nomnoe == NULL,NULL,NULL);
2058  nufano = (med_int *) malloc(sizeof(med_int)*nnoe);
2059  EXIT_IF(nufano == NULL,NULL,NULL);
2060 
2061  /* on va lire les numeros de familles des noeuds */
2062  ret = MEDmeshEntityFamilyNumberRd(fid,nommaa,numdt,numit,MED_NODE,MED_NO_GEOTYPE,nufano);
2063  if (ret < 0) ret=0; else inufael=MED_TRUE;
2064 
2065  EXIT_IF(ret < 0,"lors de la lecture des numeros de familles des noeuds",
2066  NULL);
2067  if (!structure) {
2068  /* on affiche le resultat */
2069  fprintf(stdout,"\n- Numeros des familles des noeuds : \n");
2070  for (i=0;i<nnoe;i++)
2071  if (inufael)
2072  fprintf(stdout," "IFORMAT" ",*(nufano+i));
2073  else
2074  fprintf(stdout," %d ",0);
2075  fprintf(stdout,"\n");
2076  }
2077 
2078  /* on va lire et afficher les noms des noeuds */
2079  if (MEDmeshEntityNameRd(fid,nommaa,numdt,numit,MED_NODE,MED_NO_GEOTYPE,nomnoe) == 0) {
2080  if (!structure) {
2081  fprintf(stdout,"\n- Noms des noeuds : \n");
2082  for (i=0;i<nnoe;i++) {
2083  strncpy(str,nomnoe+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
2084  str[MED_SNAME_SIZE] = '\0';
2085  fprintf(stdout," %s ",str);
2086  }
2087  }
2088  }
2089 
2090  /* on va lire et afficher les numeros des noeuds */
2091  if (MEDmeshEntityNumberRd(fid,nommaa,numdt,numit,MED_NODE,MED_NO_GEOTYPE,numnoe) == 0) {
2092  if (!structure) {
2093  fprintf(stdout,"\n- Numeros des noeuds : \n");
2094  for (i=0;i<nnoe;i++)
2095  fprintf(stdout," "IFORMAT" ",*(numnoe+i));
2096  }
2097  }
2098 
2099  /* on nettoie la memoire */
2100  free(nufano);
2101  free(numnoe);
2102  free(nomnoe);
2103 
2104  return;
2105 }
2106 
2107 
2109  const char * const nommaa,
2110  const med_int numdt,
2111  const med_int numit,
2112  const med_int mdim,
2113  const med_int nmai)
2114 
2115 {
2116  med_err ret = 0;
2117  med_int i;
2118  med_int *nufael = NULL;
2119  char *nomele = NULL;
2120  med_int *numele = NULL;
2121  char str[MED_SNAME_SIZE+1];
2122  /* type geometrique des elements */
2123  med_geometry_type typgeo;
2124 
2125  fprintf(stdout,"\n(***************************)\n");
2126  fprintf(stdout,"(* ELEMENTS DE LA GRILLE : *)\n");
2127  fprintf(stdout,"(***************************)\n");
2128 
2129  /* type des mailles */
2130  switch(mdim) {
2131  case 0 :
2132  typgeo = MED_POINT1;
2133  break;
2134  case 1 :
2135  typgeo = MED_SEG2;
2136  break;
2137  case 2 :
2138  typgeo = MED_QUAD4;
2139  break;
2140  default :
2141  typgeo = MED_HEXA8;
2142  }
2143 
2144  /* On va lire et afficher :
2145  * - Les numeros de familles
2146  * - Les noms (optionnel)
2147  * - Les numeros (optionnel)
2148  */
2149 
2150  /* on alloue la memoire */
2151  numele = (med_int *) malloc(sizeof(med_int)*nmai);
2152  EXIT_IF(numele == NULL,NULL,NULL);
2153  nomele = (char *) malloc(sizeof(char)*MED_SNAME_SIZE*nmai+1);
2154  EXIT_IF(nomele == NULL,NULL,NULL);
2155  nufael = (med_int *) malloc(sizeof(med_int)*nmai);
2156  EXIT_IF(nufael == NULL,NULL,NULL);
2157 
2158  /* lecture des numeros de famille */
2159  ret = MEDmeshEntityFamilyNumberRd(fid,nommaa,numdt,numit,MED_CELL,typgeo,nufael);
2160  if (ret < 0)
2161  for (i=0;i<nmai;i++)
2162  *(nufael+i) = 0;
2163 
2164  if (!structure) {
2165  /* on affiche le resultat */
2166  fprintf(stdout,"\n- Numeros des familles des mailles : \n");
2167  for (i=0;i<nmai;i++)
2168  fprintf(stdout," "IFORMAT" ",*(nufael+i));
2169  fprintf(stdout,"\n");
2170  }
2171 
2172  /* on va lire et afficher les noms des mailles */
2173  if (MEDmeshEntityNameRd(fid,nommaa,numdt,numit,MED_CELL,typgeo,nomele) == 0) {
2174  if (!structure) {
2175  fprintf(stdout,"\n - Noms : \n");
2176  for (i=0;i<nmai;i++) {
2177  strncpy(str,nomele+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
2178  str[MED_SNAME_SIZE] = '\0';
2179  fprintf(stdout," %s ",str);
2180  }
2181  }
2182  }
2183 
2184  /* on va lire et afficher les numeros des mailles */
2185  if (MEDmeshEntityNumberRd(fid,nommaa,numdt,numit,MED_CELL,typgeo,numele) == 0) {
2186  if (!structure) {
2187  fprintf(stdout,"\n - Numeros :\n");
2188  for (i=0;i<nmai;i++)
2189  fprintf(stdout," "IFORMAT" ",*(numele+i));
2190  }
2191  }
2192 
2193  /* on libere la memoire */
2194  free(nufael);
2195  free(nomele);
2196  free(numele);
2197 
2198  return;
2199 }
2200 
2202  const char * const nommaa,
2203  const med_int numdt,
2204  const med_int numit,
2205  const med_int mdim,
2206  const med_int edim,
2207  const med_switch_mode mode_coo,
2208  const char * const comp,
2209  const char * const unit,
2210  const int lecture_en_tete_seulement)
2211 {
2212  /* nombre de valeurs selon les axes du repere */
2213  med_int nind[3];
2214  med_int nnoe = 1;
2215  med_int nmai = 1;
2216  /* type de la grille */
2217  med_grid_type type;
2218  /* nombre de familles */
2219  med_int nfam;
2220  /* nombre d'equivalences */
2221  med_int nequ;
2222  /* nombre de joints */
2223  med_int njnt;
2224 
2225  /* lecture selon la nature de la grille des caracteristiques
2226  du maillage :
2227  - nombre de noeuds
2228  - nombre de mailles
2229  */
2230  lecture_caracteristiques_grille(fid,nommaa,numdt,numit,mdim,nind,&nnoe,&nmai,&type);
2231 
2232  /* nombre de familles */
2233  nfam = lecture_nombre_famille(fid,nommaa);
2234 
2235  /* nombre d'equivalences */
2236  nequ = lecture_nombre_equivalence(fid,nommaa);
2237 
2238  /* combien de joints */
2239  njnt = lecture_nombre_joint(fid,nommaa);
2240 
2241  if (lecture_en_tete_seulement)
2242  return ;
2243 
2244  /****************************************************************************
2245  * LECTURE DES NOEUDS *
2246  ****************************************************************************/
2247  lecture_noeuds_maillage_structure(fid,nommaa,numdt,numit,mdim,edim,nind,nnoe,comp,unit,type,mode_coo);
2248 
2249  /****************************************************************************
2250  * LECTURE DES ELEMENTS *
2251  ****************************************************************************/
2252  lecture_mailles_maillage_structure(fid,nommaa,numdt,numit,mdim,nmai);
2253 
2254  /****************************************************************************
2255  * LECTURE DES FAMILLES *
2256  ****************************************************************************/
2257  lecture_famille_maillage(fid,nommaa,nfam);
2258 
2259  /****************************************************************************
2260  * LECTURE DES EQUIVALENCES *
2261  ****************************************************************************/
2262  lecture_equivalence_maillage(fid,nommaa,nequ);
2263 
2264  /****************************************************************************
2265  * LECTURE DES JOINTS *
2266  ****************************************************************************/
2267  lecture_joint_maillage(fid,nommaa,njnt);
2268 
2269  return ;
2270 }
2271 
2273  const char * const maillage,
2274  const med_int mnumdt,
2275  const med_int mnumit,
2276  const med_int nmodels,
2277  const med_geometry_type* const geotype_elst,
2278  const char* const geotypename_elst,
2279  const char * const nomcha,
2280  const char * const dtunit,
2281  const med_field_type typcha,
2282  const med_int ncomp,
2283  const char * const comp,
2284  const char * const unit,
2285  const med_entity_type entite,
2286  const med_switch_mode stockage,
2287  const med_int ncstp) {
2288 
2289  int i,j,k,l,m,n,nb_geo=0;
2290  med_int nbpdtnor=0,pflsize,*pflval,ngauss=0,ngroup,*vale=NULL,nval;
2291  med_int numdt=0,numo=0,_nprofile;
2292  med_int meshnumdt=0,meshnumit=0;
2293  med_float *valr=NULL,dt=0.0;
2294  med_err ret=0;
2295  char pflname [MED_NAME_SIZE+1]="";
2296  char locname [MED_NAME_SIZE+1]="";
2297  char meshname [MED_NAME_SIZE+1]="";
2298  char maa_ass [MED_NAME_SIZE+1]="";
2299  char * lien = NULL;
2300  med_bool localmesh;
2301  med_int nmesh=0;
2302  med_int lnsize=0;
2303  med_geometry_type * type_geo;
2304 
2305  size_t _bannerlen=255;
2306  size_t _bannerlen1=0,_bannershift1=0;
2307  char _temp1[MAXBANNERLEN+1]="";
2308  char * _bannerstr1=NULL;
2309  size_t _bannerlen2=0,_bannershift2=0;
2310  char _temp2[MAXBANNERLEN+1]="";
2311  char * _bannerstr2=NULL;
2312 
2313  const char * const * AFF;
2314  const char * const * AFF_ENT=MED23FIELD_GET_ENTITY_TYPENAME+1;
2315  const char * * AFF_STRUCT = NULL;
2316 
2317  switch (entite) {
2318  case MED_NODE :
2320  nb_geo = MED_N_NODE_FIXED_GEO;
2322  break;
2323  case MED_CELL :
2324  case MED_NODE_ELEMENT :
2326  nb_geo = MED_N_CELL_FIXED_GEO;
2328  break;
2329  case MED_DESCENDING_FACE :
2331  nb_geo = MED_N_FACE_FIXED_GEO;
2333  break;
2334  case MED_DESCENDING_EDGE :
2336  nb_geo = MED_N_EDGE_FIXED_GEO;
2338  break;
2339  case MED_STRUCT_ELEMENT :
2340  AFF_STRUCT = (const char * *) calloc(sizeof(const char * ),nmodels+1);
2341  for(i=0;i<nmodels;++i) AFF_STRUCT[i+1]= &geotypename_elst[(MED_NAME_SIZE+1)*i];
2342  type_geo = (med_geometry_type*)(geotype_elst)-1;
2343  nb_geo = nmodels;
2344  AFF = AFF_STRUCT;
2345  break;
2346  }
2347 
2348  for (k=1;k<=nb_geo;k++) {
2349 
2350  /* Combien de (PDT,NOR) a lire */
2351  nbpdtnor = ncstp;
2352  if (nbpdtnor < 1 ) continue;
2353 
2354  for (j=0;j<nbpdtnor;j++) {
2355 
2356  if ( MEDfield23ComputingStepMeshInfo(fid, nomcha,j+1, &numdt, &numo, &dt,
2357  &nmesh, maa_ass, &localmesh, &meshnumdt, &meshnumit ) <0) {
2358  MESSAGE("Erreur a la demande d'information sur (pdt,nor) : ");
2359  ISCRUTE(numdt); ISCRUTE(numo);ISCRUTE(nmesh);SSCRUTE(meshname);ISCRUTE_int(localmesh);
2360  ISCRUTE(meshnumdt);ISCRUTE(meshnumit);
2361  ret = -1; continue;
2362  }
2363 
2364  for (i=0;i< nmesh;++i) {
2365 
2366  if ( (_nprofile = MEDfield23nProfile(fid,nomcha,numdt,numo,entite,type_geo[k],i+1,
2367  meshname,pflname,locname ) ) < 0 ) {
2368  MESSAGE("Erreur a la demande du nombre de profils referencés par le champ : ");
2369  SSCRUTE(nomcha); ISCRUTE(numdt); ISCRUTE(numo);SSCRUTE(meshname);
2370  ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);SSCRUTE(pflname);SSCRUTE(locname);
2371  SSCRUTE(AFF_ENT[(int)entite]);SSCRUTE(AFF[k]);
2372  ret = -1; continue;
2373  };
2374 
2375  for (l=0;l<_nprofile;l++) {
2376 
2377  if ( (nval = MEDfield23nValueWithProfile(fid, nomcha, numdt, numo, entite, type_geo[k],meshname,
2378  l+1, USER_MODE, pflname,&pflsize,
2379  locname, &ngauss) ) < 0 ) {
2380  MESSAGE("Erreur a la lecture du nombre de valeurs du champ : ");
2381  SSCRUTE(nomcha);ISCRUTE(numdt);ISCRUTE(numo);SSCRUTE(meshname);
2382  ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
2384  ret = -1; continue;
2385  };
2386 
2387  if ( (!strcmp(meshname,maillage)) && (meshnumdt == mnumdt) && (meshnumit == mnumit) ) {
2388 
2389  /*4 caractères spéciaux*/
2390  _bannerstr1 = "(* CHAMP |%s| A L'ÉTAPE DE CALCUL (n°dt,n°it)="
2391  "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT") , %.*s*)\n";
2392  /*4 caractères spéciaux */
2393  _bannerstr2 = "(* SUR LE MAILLAGE |%s| A L'ÉTAPE DE CALCUL (n°dt,n°it)="
2394  "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT") : %.*s*)\n";
2395  snprintf(_temp1,MAXBANNERLEN+1,_bannerstr1,nomcha,numdt,numo,0,"");
2396  snprintf(_temp2,MAXBANNERLEN+1,_bannerstr2,meshname,meshnumdt,meshnumit,0,"");
2397  _bannerlen1 = strlen(_temp1);
2398  _bannerlen2 = strlen(_temp2);
2399  _bannerlen=MAX(_bannerlen1,_bannerlen2);
2400  if (_bannerlen1>_bannerlen2) {
2401  _bannershift1 = 0; _bannershift2 = _bannerlen1-_bannerlen2;
2402  } else {
2403  _bannershift2 = 0; _bannershift1 = _bannerlen2-_bannerlen1;
2404  }
2405  fprintf(stdout,"\n(");
2406  for (i=0;i< _bannerlen-6; i++) fprintf(stdout,"*");
2407  fprintf(stdout,")\n");
2408  fprintf(stdout,_bannerstr1,nomcha,numdt,numo,_bannershift1,MED_NAME_BLANK);
2409  fprintf(stdout,_bannerstr2,meshname,meshnumdt,meshnumit,_bannershift2,MED_NAME_BLANK);
2410  fprintf(stdout,"(");
2411  for (i=0;i< _bannerlen-6; i++) fprintf(stdout,"*");
2412  fprintf(stdout,")\n");
2413 
2414 
2415 
2416 /* fprintf(stdout,"\n(********************************************************************************)\n"); */
2417 /* fprintf(stdout,"(* CHAMP |%s| A L'ÉTAPE DE CALCUL (n°dt,n°it)=" */
2418 /* "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT") : *)\n", */
2419 /* nomcha,numdt,numo); */
2420 /* fprintf(stdout,"(* SUR LE MAILLAGE |%s| A L'ÉTAPE DE CALCUL (n°dt,n°it)=" */
2421 /* "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT") : *)\n", */
2422 /* meshname,meshnumdt,meshnumit); */
2423 /* fprintf(stdout,"(********************************************************************************)\n\n"); */
2424  fprintf(stdout,"- Valeur de la date du champ %f [%s] : \n",dt,dtunit);
2425  fprintf(stdout,"- Type des composantes du champ : %d\n",typcha);
2426  fprintf(stdout,"- Nombre de composantes par valeur : "IFORMAT"\n",ncomp);
2427  fprintf(stdout,"- Unité des composantes : |%s|\n",unit);
2428  fprintf(stdout,"- Nom des composantes : |%s|\n",comp);
2429 
2430  printf("\t- Il y a "IFORMAT" entités qui portent des valeurs en mode %i."
2431  "\n\t Chaque entite %s de type geometrique %s associes au profil |%s| a "IFORMAT" point(s) d'intégration \n",
2432  nval,USER_MODE,AFF_ENT[(int)entite],AFF[k],pflname,ngauss);
2433 
2434  /* Le maillage reference est-il porte par un autre fichier */
2435  if ( !localmesh ) {
2436 
2437  if ( (lnsize=MEDlinkInfoByName(fid,maa_ass) ) < 0 ) {
2438  MESSAGE("Erreur a la lecture de la taille du lien : ");
2439  SSCRUTE(maa_ass);
2440  ret = -1;
2441  } else {
2442  lien = (char *)malloc(lnsize*sizeof(char) + 1);
2443  EXIT_IF(lien == NULL,NULL,NULL);
2444 
2445  if ( MEDlinkRd(fid, maa_ass, lien) < 0 ) {
2446  MESSAGE("Erreur a la lecture du lien : ");
2447  SSCRUTE(maa_ass);SSCRUTE(lien);
2448  ret = -1;
2449  } else {
2450  lien[lnsize] = '\0';
2451  printf("\tLe maillage |%s| est porte par un fichier distant |%s|\n",maa_ass,lien);
2452  }
2453  free(lien);
2454  }
2455  }
2456 
2457  /*Lecture des valeurs du champ */
2458  if (typcha == MED_FLOAT64) {
2459 
2460  valr = (med_float*) calloc(ncomp*nval*ngauss,sizeof(med_float));
2461  EXIT_IF(valr == NULL,NULL,NULL);
2462 
2463  if (MEDfield23ValueWithProfileRd(fid, nomcha, numdt,numo, entite,type_geo[k],meshname,
2464  USER_MODE, pflname, stockage,MED_ALL_CONSTITUENT,
2465  (unsigned char*) valr) < 0 ) {
2466  MESSAGE("Erreur a la lecture des valeurs du champ : ");
2467  SSCRUTE(nomcha);ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
2468  ISCRUTE(numdt);ISCRUTE(numo);
2469  ret = -1;
2470  }
2471  } else {
2472 
2473  vale = (med_int*) calloc(ncomp*nval*ngauss,sizeof(med_int));
2474  EXIT_IF(vale == NULL,NULL,NULL);
2475 
2476  if (MEDfield23ValueWithProfileRd(fid, nomcha, numdt,numo, entite,type_geo[k],meshname,
2477  USER_MODE, pflname, stockage,MED_ALL_CONSTITUENT,
2478  (unsigned char*) vale) < 0 ) {
2479  MESSAGE("Erreur a la lecture des valeurs du champ : ");
2480  SSCRUTE(nomcha);ISCRUTE_int(entite);ISCRUTE_int(type_geo[k]);
2481  ISCRUTE(numdt);ISCRUTE(numo);
2482  ret = -1;
2483  }
2484  }
2485 
2486  if ( strlen(locname) && (_nprofile > 1) )
2487  printf("\t- Modèle de localisation des points de Gauss de nom |%s|\n",locname);
2488 
2489  if (entite == MED_NODE_ELEMENT)
2490  ngroup = (type_geo[k] % 100);
2491  else
2492  ngroup = ngauss;
2493 
2494  switch (stockage) {
2495 
2496  case MED_FULL_INTERLACE :
2497  if (!structure) {
2498  printf("\t- Valeurs :\n\t");
2499  for (m=0;m<(nval*ngauss)/ngroup;m++) {
2500  printf("|");
2501  for (n=0;n<ngroup*ncomp;n++)
2502  if (typcha == MED_FLOAT64)
2503  printf(" %f ",*(valr+(m*ngroup*ncomp)+n));
2504  else
2505  printf(" "IFORMAT" ",*(vale+(m*ngroup*ncomp)+n));
2506  }
2507  }
2508  break;
2509 
2510  /*??? Affichage en fonction du profil à traiter ???*/
2511  case MED_NO_INTERLACE :
2512  if (!structure) {
2513  printf("\t- Valeurs :\n\t");
2514  for (m=0;m<ncomp;m++) {
2515  printf("|");
2516  for (n=0;n<(nval*ngauss);n++)
2517  if (typcha == MED_FLOAT64)
2518  printf(" %f ",*(valr+(m*nval)+n));
2519  else
2520  printf(" "IFORMAT" ",*(vale+(m*nval)+n));
2521  }
2522  }
2523  break;
2524  }
2525 
2526  if (!structure) {
2527  printf("|\n");
2528  }
2529 
2530  if (typcha == MED_FLOAT64) {
2531  if ( valr ) {free(valr);valr = NULL;}}
2532  else
2533  if (vale) { free(vale);vale = NULL; }
2534 
2535  /*Lecture du profil associe */
2536  if (strcmp(pflname,MED_NO_PROFILE) == 0 ) {
2537  printf("\t- Profil : MED_NOPFL\n");
2538  } else {
2539  if ( (pflsize = MEDprofileSizeByName(fid,pflname)) <0 ) {
2540  MESSAGE("Erreur a la lecture du nombre de valeurs du profil : ");
2541  SSCRUTE(pflname);
2542  ret = -1; continue;
2543  }
2544 
2545  printf("\t- Profil : |%s| de taille "IFORMAT"\n",pflname,pflsize);
2546 
2547  pflval = (med_int*) malloc(sizeof(med_int)*pflsize);
2548  EXIT_IF(pflval == NULL,NULL,NULL);
2549  if ( MEDprofileRd(fid,pflname,pflval) <0) {
2550  MESSAGE("Erreur a la lecture des valeurs du profil : ");
2551  SSCRUTE(pflname);
2552  ret = -1;
2553  }
2554  if (!structure) {
2555  printf("\t");
2556  for (m=0;m<pflsize;m++) printf(" "IFORMAT" ",*(pflval+m));
2557  printf("\n");
2558  }
2559  free(pflval);
2560  }
2561  }
2562  }
2563  }
2564  }
2565  } /* fin for sur les mailles*/
2566 
2567  free(AFF_STRUCT);
2568  return ret;
2569 }
2570 
2571 /******************************************************************************
2572  *
2573  * - Nom de la fonction : lecture_resultats
2574  * - Description : lecture et affichage des champs de resultats
2575  * associe a un maillage MED.
2576  * - Parametres :
2577  * - fid (IN) : ID du fichier MED.
2578  * - maillage (IN) : nom du maillage maillage.
2579  * - mode_coo (IN) : mode de stockage en memoire :
2580  * MED_FULL_INTERLACE |
2581  * MED_NO_INTERLACE.
2582  * - lecture_en_tete_seulement (IN) : mode de lecture.
2583  ******************************************************************************/
2584 
2586  const char * const maillage,
2587  const med_int mnumdt,
2588  const med_int mnumit,
2589  const med_switch_mode mode_coo,
2590  const med_int nmodels,
2591  const med_geometry_type* geotype_elst,
2592  const char* geotypename_elst,
2593  const int lecture_en_tete_seulement)
2594 {
2595  med_err ret,lret;
2596  char *comp, *unit;
2597  char nomcha [MED_NAME_SIZE+1]="";
2598  med_int ncomp,ncha;
2599  med_field_type typcha;
2600  int i;
2601 
2602  char nommaa[MED_NAME_SIZE+1]="";
2603  med_bool localmaa = MED_FALSE;
2604  char dtunit[MED_SNAME_SIZE+1]="";
2605  med_int ncstp=0;
2606 
2607 
2608  /* combien de champs dans le fichier */
2609  ncha = MEDnField(fid);
2610  EXIT_IF(ncha < 0,"lors de la lecture du nombre de champs",NULL);
2611 
2612  if ( !strlen(maillage) || lecture_en_tete_seulement ) {
2613  fprintf(stdout,"\n(************************)\n");
2614  fprintf(stdout,"(* CHAMPS DU MAILLAGE : *)\n");
2615  fprintf(stdout,"(************************)\n");
2616  fprintf(stdout,"- Nombre de champs : "IFORMAT" \n",ncha);
2617  }
2618 
2619  /****************************************************************************
2620  * LECTURE DES CHAMPS *
2621  ****************************************************************************/
2622  ret = 0;
2623 
2624  /* lecture de tous les champs pour le maillage selectionne */
2625  for (i =0;i<ncha;i++) {
2626  lret = 0;
2627 
2628  /* Lecture du nombre de composantes */
2629  if ((ncomp = MEDfieldnComponent(fid,i+1)) < 0) {
2630  MESSAGE("Erreur à la lecture du nombre de composantes : ");
2631  ISCRUTE(ncomp);
2632  ret = -1; continue;
2633  }
2634 
2635  /* Lecture du type du champ, des noms des composantes et du nom de
2636  l'unité*/
2637  comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
2638  EXIT_IF(comp == NULL,NULL,NULL);
2639  unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
2640  EXIT_IF(unit == NULL,NULL,NULL);
2641 
2642  if ( MEDfieldInfo(fid, i+1, nomcha, nommaa, &localmaa,
2643  &typcha, comp, unit, dtunit, &ncstp) < 0 ) {
2644  MESSAGE("Erreur à la demande d'information sur les champs : ");
2645  ret = -1; continue;
2646  }
2647 
2648 
2649  if ( !strlen(maillage) || lecture_en_tete_seulement ) {
2650  printf("\nChamp numero : |%d| \n",i+1);
2651  printf("Nom du champ : |%s| de type |%d|\n",nomcha,typcha);
2652  printf("Nom des composantes : |%s|\n",comp);
2653  printf("Unites des composantes : |%s| \n",unit);
2654  if (strlen(dtunit))
2655  printf("Unité des dates : |%s|\n",dtunit);
2656  if ( ncstp > 1 )
2657  printf("Nombre d'étapes de calcul : |"IFORMAT"| \n",ncstp);
2658  }
2659 
2660 
2661  if (lecture_en_tete_seulement) {
2662  free(comp);
2663  free(unit);
2664  continue;
2665  }
2666 
2667  /* champs aux noeuds */
2668  lret = getFieldsOn(fid, maillage, mnumdt, mnumit, nmodels,geotype_elst,geotypename_elst,
2669  nomcha, dtunit, typcha, ncomp, comp, unit, MED_NODE,mode_coo, ncstp);
2670 
2671  /* champs sur les elements et aux points de Gauss */
2672  if (lret == 0) lret = getFieldsOn(fid, maillage, mnumdt, mnumit , nmodels,geotype_elst,geotypename_elst,
2673  nomcha, dtunit, typcha, ncomp, comp, unit, MED_CELL,mode_coo, ncstp);
2674  else { MESSAGE("Erreur à la lecture des champs aux noeuds "); ret = -1; continue;}
2675 
2676  if (lret == 0) lret = getFieldsOn(fid, maillage, mnumdt, mnumit , nmodels,geotype_elst,geotypename_elst,
2677  nomcha, dtunit, typcha, ncomp, comp, unit, MED_DESCENDING_FACE,mode_coo, ncstp);
2678  else { MESSAGE("Erreur à la lecture des champs aux mailles "); ret = -1; continue;}
2679 
2680  if (lret == 0) lret = getFieldsOn(fid, maillage, mnumdt, mnumit , nmodels,geotype_elst,geotypename_elst,
2681  nomcha, dtunit, typcha, ncomp, comp, unit, MED_DESCENDING_EDGE,mode_coo, ncstp);
2682  else {MESSAGE("Erreur à la lecture des champs aux faces "); ret = -1; continue;}
2683 
2684  if (lret == 0) lret = getFieldsOn(fid, maillage, mnumdt, mnumit , nmodels,geotype_elst,geotypename_elst,
2685  nomcha, dtunit, typcha, ncomp, comp, unit, MED_NODE_ELEMENT,mode_coo, ncstp);
2686  else {MESSAGE("Erreur a la lecture des champs aux aretes "); ret = -1; continue;}
2687 
2688  if (lret != 0) {MESSAGE("Erreur a la lecture des champs aux noeuds des mailles "); ret = -1;};
2689 
2690  if (nmodels)
2691  lret = getFieldsOn(fid, maillage, mnumdt, mnumit , nmodels, geotype_elst,geotypename_elst,
2692  nomcha, dtunit, typcha, ncomp, comp, unit, MED_STRUCT_ELEMENT,mode_coo, ncstp);
2693  if (lret != 0) {MESSAGE("Erreur a la lecture des champs aux éléments de sructure "); ret = -1;};
2694 
2695  free(comp);
2696  free(unit);
2697 
2698  }
2699 
2700  return;
2701 }
2702 
2703 /******************************************************************************
2704  *
2705  * - Nom de la fonction : lecture_parametres_scalaires
2706  * - Description : lecture des parametres scalaires definis
2707  * hors champs et maillages.
2708  * - Parametres :
2709  * - fid (IN) : ID du fichier MED.
2710  * - lecture_en_tete_seule (IN) : mode de lecture.
2711  *
2712  ******************************************************************************/
2713 
2715  int lecture_en_tete_seulement)
2716 {
2717  med_err ret = 0;
2718  char nom_scalaire[MED_NAME_SIZE+1];
2719  char description[MED_COMMENT_SIZE+1];
2720  med_int vali;
2721  med_float valr;
2722  med_int i,n,npdt,j;
2723  med_parameter_type type;
2724  med_int numdt,numo;
2725  med_float dt;
2726  char dt_unit[MED_SNAME_SIZE+1];
2727 
2728 
2729  /* Combien de variables scalaire ? */
2730  n = MEDnParameter(fid);
2731  EXIT_IF(n < 0,"lors de la lecture du nombre de scalaires",NULL);
2732 
2733  if (n) {
2734  fprintf(stdout,"\n(*******************************)\n");
2735  fprintf(stdout,"(* VARIABLES SCALAIRES : *)\n");
2736  fprintf(stdout,"(*******************************)\n\n");
2737  fprintf(stdout,"- Nombre de variables scalaires : "IFORMAT"\n",n);
2738  }
2739  if (lecture_en_tete_seulement)
2740  return ;
2741 
2742  for (i=1;i<=n;i++) {
2743 
2744  /* Lecture des infos (type,description) */
2745  ret = MEDparameterInfo( fid,i,nom_scalaire,&type,description,
2746  dt_unit, &npdt );
2747  EXIT_IF(ret < 0,"lors de la lecture des parametres d'un scalaire",NULL);
2748  fprintf(stdout,"- Scalaire n°"IFORMAT" de nom %s \n",i,nom_scalaire);
2749  if (type == MED_FLOAT64)
2750  fprintf(stdout," Type flottant. \n");
2751  else
2752  fprintf(stdout," Type entier. \n");
2753  printf(" Description associee : [%s] \n",description);
2754 
2755  /* Pour chaque scalaire on regarde les valeurs associees
2756  eventuellement a des pas de temps et des numeros d'ordre */
2757  EXIT_IF(npdt < 0,
2758  "lors de la lecture du nombre de pas de temps d'un scalaire"
2759  ,NULL);
2760  fprintf(stdout," Nombre de valeurs stockees : "IFORMAT" \n",npdt);
2761 
2762  for (j=1;j<=npdt;j++) {
2763 
2764  ret = MEDparameterComputationStepInfo(fid,nom_scalaire,j, &numdt,&numo,&dt);
2765  EXIT_IF(ret < 0,
2766  "lors de la lecture des parametres d'un pas de temps d'un scalaire",
2767  NULL);
2768 
2769  if (numdt == MED_NO_DT)
2770  fprintf(stdout," - Aucun de pas de temps \n");
2771  else
2772  fprintf(stdout,
2773  " - Pas de de temps de numero "IFORMAT" de valeur %f [%s] \n",numdt,
2774  dt,dt_unit);
2775  if (numo == MED_NO_IT)
2776  fprintf(stdout," - Aucun numero d'ordre \n");
2777  else
2778  fprintf(stdout," - Numero d'ordre : "IFORMAT" \n",numo);
2779 
2780  if (type == MED_FLOAT64) {
2781  ret = MEDparameterValueRd(fid,nom_scalaire,numdt,numo,(unsigned char * ) &valr);
2782  fprintf(stdout," - Valeur : %f \n",valr);
2783  }
2784  else {
2785  ret = MEDparameterValueRd(fid,nom_scalaire,numdt,numo,(unsigned char * ) &vali);
2786  fprintf(stdout," - Valeur : "IFORMAT" \n",vali);
2787  }
2788  EXIT_IF(ret < 0,"lors de la lecture de la valeur d'un scalaire",NULL);
2789 
2790  }
2791  }
2792 
2793  return ;
2794 }
2795 
2796 /******************************************************************************
2797  *
2798  * - Nom de la fonction : lecture_profils
2799  * - Description : lecture des différents profils
2800  * hors champs et maillages.
2801  * - Parametres :
2802  * - fid (IN) : ID du fichier MED.
2803  * - lecture_en_tete_seule (IN) : mode de lecture.
2804  *
2805  ******************************************************************************/
2806 
2808  int lecture_en_tete_seulement)
2809 {
2810  med_err ret;
2811  char pflname[MED_NAME_SIZE+1]="";
2812  med_int npro,*pflval,nval;
2813  int i,j;
2814 
2815 
2816  /* Interrogation des profils */
2817  npro = MEDnProfile(fid);
2818  EXIT_IF(npro < 0,"lors de la lecture du nombre de profils",NULL);
2819 
2820  if (npro) {
2821  fprintf(stdout,"\n(*************)\n");
2822  fprintf(stdout, "(* PROFILS : *)\n");
2823  fprintf(stdout, "(*************)\n");
2824  printf("\nNombre de profils stockes : "IFORMAT"\n\n",npro);
2825  }
2826 
2827  for (i=1 ; i <= npro ; i++ ) {
2828  if ( MEDprofileInfo(fid, i, pflname, &nval) < 0) {
2829  MESSAGE("Erreur a la demande d'information sur le profil n° : "); ISCRUTE_int(i);
2830  ret = -1;continue;
2831  }
2832  printf("\t- Profil n°%i de nom |%s| et de taille "IFORMAT"\n",i,pflname,nval);
2833  pflval = (med_int*) malloc(sizeof(med_int)*nval);
2834  if ( MEDprofileRd(fid, pflname, pflval) < 0) {
2835  MESSAGE("Erreur a la lecture des valeurs du profil : ");
2836  SSCRUTE(pflname);
2837  ret = -1;
2838  } else {
2839  if (!structure) {
2840  printf("\t");
2841  for (j=0;j<nval;j++) printf(" "IFORMAT" ",*(pflval+j));
2842  }
2843  printf("\n\n");
2844  }
2845  free(pflval);
2846  }
2847  return;
2848 }
2849 
2850 /******************************************************************************
2851  *
2852  * - Nom de la fonction : lecture_modeles_elstruct
2853  * - Description : lecture des différents modèles d'éléments de structure
2854  * hors champs et maillages.
2855  * - Parametres :
2856  * - fid (IN) : ID du fichier MED.
2857  * - lecture_en_tete_seule (IN) : mode de lecture.
2858  *
2859  ******************************************************************************/
2860 
2862  int lecture_en_tete_seulement)
2863 {
2864  med_err _ret=0;
2865  int _i =0,_j=0,_k=0, _n=0,_nvalue=0;
2866  med_int _nstructelement=0;
2867 
2868  med_geometry_type _geotype=MED_NONE;
2869 
2870  char _elementname[MED_NAME_SIZE+1]="";
2871  med_int _elementdim=0;
2872  char _supportmeshname[MED_NAME_SIZE+1]="";
2874  med_int _nnode=0;
2875  med_int _ncell=0;
2876  med_geometry_type _geocelltype=MED_NONE;
2877  char _geocelltypename[MED_SNAME_SIZE+1]="";
2878  med_int _nconstantattribute=0;
2879  med_bool _anyprofile=0;
2880  med_int _nvariableattribute=0;
2881 
2882  char _constattname[MED_NAME_SIZE+1]="";
2883  med_attribute_type _constatttype=MED_ATT_UNDEF;
2884  char _varattname[MED_NAME_SIZE+1]="";
2885  med_attribute_type _varatttype=MED_ATT_UNDEF;
2886  med_int _ncomponent=0;
2887  med_entity_type _attentitytype=MED_UNDEF_ENTITY_TYPE;
2888  char _profilename[MED_NAME_SIZE+1]="";
2889  med_int _profilesize=0;
2890 
2891  unsigned char * _value=NULL;
2892  void (*_printf)(const void*);
2893  med_int _atttypesize=0;
2894 
2895  _nstructelement = MEDnStructElement(fid);
2896  EXIT_IF(_nstructelement < 0,"lors de la lecture du nombre d'éléments de structure",NULL);
2897 
2898  if(_nstructelement) {
2899  fprintf(stdout,"\n(*************************************)\n");
2900  fprintf(stdout, "(* MODELES D'ELEMENTS DE STRUCTURE : *)\n");
2901  fprintf(stdout, "(*************************************)\n");
2902  printf("\nNombre d'éléments de structure : "IFORMAT"\n\n",_nstructelement);
2903  }
2904 
2905  for ( _i=1; _i<= _nstructelement; ++_i) {
2906 
2907  _ret= MEDstructElementInfo(fid,_i,_elementname,&_geotype,&_elementdim,_supportmeshname,
2908  &_entitytype,&_nnode,&_ncell,&_geocelltype,&_nconstantattribute,&_anyprofile,
2909  &_nvariableattribute );
2910  EXIT_IF(_ret < 0,"lors de la demande d'information sur les éléments de structure",NULL);
2911 
2912  fprintf(stdout,"\nElément de structure n°%d |%s| de type géométrique n°%d et de dimension "IFORMAT"\n",
2913  _i,_elementname,_geotype,_elementdim);
2914  if ( strlen(_supportmeshname) ) {
2915  fprintf(stdout,"\t Maillage support de nom |%s|",_supportmeshname);
2916  if (_ncell) {
2917  MEDmeshGeotypeName(fid,_geocelltype,_geocelltypename);
2918  fprintf(stdout," avec "IFORMAT" maille(s) de type |%s| et",_ncell,_geocelltypename);
2919  }
2920  if (_nnode)
2921  fprintf(stdout," avec "IFORMAT" noeud(s)\n",_nnode);
2922  else {
2923  fprintf(stderr,"\n Erreur : les noeuds doivent être définis s'il existe un maillage support\n");
2924  }
2925  } else
2926  fprintf(stdout,"\t Maillage support implicite sur noeud\n");
2927 
2928  fprintf(stdout,"\t Nombre d'attribut(s) constant(s) : "IFORMAT"",_nconstantattribute);
2929  if (_anyprofile) fprintf(stdout,", avec profil.\n"); else fprintf(stdout,", sans profil.\n");
2930 
2931  if ( _nconstantattribute ) {
2932  for (_j=1;_j<=_nconstantattribute;++_j) {
2933  _ret= MEDstructElementConstAttInfo(fid, _elementname,_j,
2934  _constattname, &_constatttype, &_ncomponent,
2935  &_attentitytype, _profilename, &_profilesize );
2936  EXIT_IF(_ret < 0,"lors de la demande d'information sur les attributs constants des éléments de structure",NULL);
2937 
2938  fprintf(stdout,"\t\t Attribut constant de nom |%s| de type %d à "IFORMAT" composantes\n",
2939  _constattname,_constatttype,_ncomponent);
2940 
2941  if (!_profilesize) {
2942  if (_attentitytype == MED_NODE) _nvalue = _nnode; else _nvalue=_ncell;
2943  } else {
2944  _nvalue = _profilesize;
2945  }
2946  _n = _ncomponent*_nvalue;
2947  if ( _attentitytype == MED_ATT_NAME) ++_n;
2948  _atttypesize = MEDstructElementAttSizeof(_constatttype);
2949  _value = (unsigned char *) malloc(_n*_atttypesize);
2950  if ( _attentitytype == MED_ATT_NAME) --_n;
2951 
2952  _ret= MEDstructElementConstAttRd(fid, _elementname,_constattname, _value );
2953  if (_ret < 0 ) free(_value);
2954  EXIT_IF(_ret < 0,"lors de la lecture des valeurs des attributs constants",NULL);
2955  _printf=MEDstructPrintFunction(_constatttype);
2956 
2957  if (!structure) {
2958  fprintf(stdout,"\t\t - Valeurs de l'attribut sur les d'entité |%s|",
2959  MED23MESH_GET_ENTITY_TYPENAME[_attentitytype+1]);
2960  if ( _profilesize)
2961  fprintf(stdout," avec un profil |%s| de taille "IFORMAT": ",_profilename,_profilesize);
2962  else
2963  fprintf(stdout," sans profil : ");
2964 
2965  for (_k=0;_k<_nvalue*_ncomponent;_k++) {
2966 /* if ( ( _ncomponent > 1 ) && !(_k % _ncomponent) ) */
2967  if ( !(_k % _ncomponent) )
2968  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (_k/_ncomponent +1) );
2969  _printf( (void *)( (char *)(_value) + _k*_atttypesize) );
2970  }
2971  printf("\n");
2972  }
2973  /* free memory */
2974  free(_value);
2975  printf("\n");
2976  } /*fin boucle sur constatt*/
2977  } /*fin if _nconstantattribute */
2978 
2979  fprintf(stdout,"\t Nombre d'attribut(s) variable(s) : "IFORMAT"\n",_nvariableattribute);
2980  if ( _nvariableattribute ) {
2981  for (_j=1;_j<=_nvariableattribute;++_j) {
2982  _ret = MEDstructElementVarAttInfo(fid, _elementname,_j,_varattname,&_varatttype,&_ncomponent );
2983  EXIT_IF(_ret < 0,"lors de la lecture des valeurs des attributs variables",NULL);
2984  fprintf(stdout,"\t\t Attribut variable de nom |%s| de type %d à "IFORMAT" composantes\n",
2985  _varattname,_varatttype,_ncomponent);
2986  }
2987  }
2988 
2989  }
2990 
2991  return;
2992 }
2993 
2994 /******************************************************************************
2995  *
2996  * - Nom de la fonction : lecture_fonctions_interpolation
2997  * - Description : lecture des différentes fonctions d'interpolation
2998  * hors champs et maillages.
2999  * - Parametres :
3000  * - fid (IN) : ID du fichier MED.
3001  * - lecture_en_tete_seule (IN) : mode de lecture.
3002  *
3003  ******************************************************************************/
3004 
3006  int lecture_en_tete_seulement)
3007 {
3008 
3009  med_err _ret=-1;
3010  med_int _ninterp=0;
3011  int _interpit =0;
3012  char _interpname[MED_NAME_SIZE+1]="";
3013  med_geometry_type _geotype =MED_NONE;
3014  char _geotypename[MED_SNAME_SIZE+1]="";
3015  med_int _geodim=0,_geonnodes=0;
3016  med_bool _cellnodes =MED_FALSE;
3017  med_int _nbasisfunc =0;
3018  med_int _nvariable =0;
3019  med_int _maxdegree =0;
3020  med_int _nmaxcoefficient =0;
3021  int _basisfuncit =0;
3022  int _powerit =0;
3023  med_int _ncoefficient =0;
3024  med_int* _power =NULL;
3025  med_float* _coefficient =NULL;
3026  int _coefficientit =0;
3027 
3028 
3029  _ninterp = MEDnInterp(fid);
3030  if (_ninterp) {
3031  fprintf(stdout,"\n(********************************)\n");
3032  fprintf(stdout, "(* FONCTIONS D'INTERPOLATION : *)\n");
3033  fprintf(stdout, "(********************************)\n");
3034  printf("\nNombre de fonctions d'interpolation : "IFORMAT"\n\n",_ninterp);
3035  }
3036 
3037  for ( _interpit=1; _interpit<= _ninterp; ++_interpit) {
3038 
3039  if (MEDinterpInfo(fid,_interpit,_interpname,&_geotype,&_cellnodes,&_nbasisfunc,
3040  &_nvariable,&_maxdegree,&_nmaxcoefficient) < 0 ) {
3041  MESSAGE("Erreur à la demande d'information de la fonction d'interpolation n°");
3042  ISCRUTE_int(_interpit);
3043  _ret = -1;continue;
3044  }
3045 
3046  MEDmeshGeotypeName(fid,_geotype,_geotypename);
3047  fprintf(stdout,"Fonction d'interpolation n° %d |%s| sur le type géométrique |%s|\n",
3048  _interpit,_interpname, _geotypename);
3049 
3050  if ( MEDmeshGeotypeParameter(fid,_geotype,&_geodim,&_geonnodes) <0 ) {
3051  MESSAGE("Erreur à la lecture du nom associé au typegeo : "); ISCRUTE_int(_geotype);
3052  _ret = -1;continue;
3053  }
3054 
3055  if ( _cellnodes ) {
3056  if ( _nbasisfunc == _geonnodes )
3057  fprintf(stdout,"\t Les noeuds de construction sont les noeuds de la maille de référence.\n");
3058  else {
3059  MESSAGE("Erreur : le nombre de noeuds de construction "\
3060  "est différent du nombre de noeuds de la maille de référence.\n");
3061  ISCRUTE(_nbasisfunc); ISCRUTE(_geonnodes);
3062  _ret = -1;continue;
3063  }
3064  }
3065 
3066 /* if ( _nvariable != _geodim ) { */
3067 /* MESSAGE("Erreur : le nombre de variables "\ */
3068 /* "est différent de la dimension de l'espace de la maille de référence.\n"); */
3069 /* ISCRUTE(_nvariable); ISCRUTE (_geodim); */
3070 /* _ret = -1;continue; */
3071 /* } else */
3072  fprintf(stdout,"\t Il y a "IFORMAT" fonctions de base avec "IFORMAT" variables\n ",_nbasisfunc,_nvariable);
3073  fprintf(stdout,"\t Le degré maximum des fonctions de base est "IFORMAT" et possèdent au maximum "IFORMAT" coefficients\n"
3074  ,_maxdegree,_nmaxcoefficient);
3075 
3076 
3077  _coefficient = (med_float*) calloc(sizeof(med_float),_nmaxcoefficient);
3078  _power = (med_int*) calloc(sizeof(med_int),_nvariable*_nmaxcoefficient);
3079 
3080  for ( _basisfuncit=1; _basisfuncit<= _nbasisfunc; ++_basisfuncit) {
3081 
3082 
3083  if ( (_ret = MEDinterpBaseFunctionRd( fid,_interpname,_basisfuncit,&_ncoefficient,_power,_coefficient) <0) ) {
3084  MESSAGE("Erreur à la lecture de la fonction de base n°");ISCRUTE_int(_basisfuncit);
3085  _ret=-1;continue;
3086  } else {
3087  if (!structure) {
3088 
3089  fprintf(stdout,"\n\t Tableau de coefficients de la fonctions de base n° %d :\n\t",_basisfuncit);
3090  for ( _coefficientit=1; _coefficientit<= _ncoefficient; ++_coefficientit)
3091  fprintf(stdout," %4f ",_coefficient[_coefficientit]);
3092 
3093  fprintf(stdout,"\n\t Tableau de puissances de la fonctions de base n° %d :\n\t",_basisfuncit);
3094  for ( _powerit=1; _powerit<= _nvariable*_ncoefficient; ++_powerit)
3095  fprintf(stdout," %4"MED_IFORMAT" ",_power[_powerit]);
3096  }
3097  }
3098  }
3099  fprintf(stdout,"\n");
3100  free(_coefficient);
3101  free(_power);
3102 
3103  }
3104 
3105  return;
3106 }
3107 
3108 /******************************************************************************
3109  *
3110  * - Nom de la fonction : lecture_liens
3111  * - Description : lecture des différents liens
3112  * hors champs et maillages.
3113  * - Parametres :
3114  * - fid (IN) : ID du fichier MED.
3115  * - lecture_en_tete_seule (IN) : mode de lecture.
3116  *
3117  ******************************************************************************/
3118 
3120  int lecture_en_tete_seulement)
3121 {
3122  med_err ret;
3123  char nomlien[MED_NAME_SIZE+1]="";
3124  char *lien = NULL;
3125  med_int nln=0,nval=0;
3126  int i;
3127 
3128 
3129  /* Interrogation des liens */
3130  nln = MEDnLink(fid);
3131 
3132  if (nln) {
3133  fprintf(stdout,"\n(***********)\n");
3134  fprintf(stdout, "(* LIENS : *)\n");
3135  fprintf(stdout, "(***********)\n");
3136  printf("\nNombre de liens : "IFORMAT"\n\n",nln);
3137  }
3138 
3139  for (i=1 ; i <= nln ; i++ ) {
3140  if ( MEDlinkInfo(fid, i, nomlien, &nval) < 0) {
3141  MESSAGE("Erreur a la demande d'information sur le lien n° : "); ISCRUTE_int(i);
3142  ret = -1;continue;
3143  }
3144  printf("\t- Lien n°%i de nom |%s| et de taille "IFORMAT"\n",i,nomlien,nval);
3145 
3146  lien = (char * ) malloc((nval+1)*sizeof(char));
3147  EXIT_IF(lien == NULL,NULL,NULL);
3148 
3149  if ( MEDlinkRd(fid, nomlien, lien ) < 0 ) {
3150  MESSAGE("Erreur a la lecture du lien : ");
3151  SSCRUTE(nomlien);SSCRUTE(lien);
3152  ret = -1;
3153  } else {
3154  lien[nval] = '\0';
3155  printf("\t\t|%s|\n\n",lien);
3156  }
3157  free(lien);
3158  }
3159  return;
3160 }
3161 
3162 /******************************************************************************
3163  *
3164  * - Nom de la fonction : lecture_localisation
3165  * - Description : lecture des différentes localisations
3166  * hors champs et maillages.
3167  * - Parametres :
3168  * - fid (IN) : ID du fichier MED.
3169  * - mode_coo (IN) : mode de stockage en memoire :
3170  * MED_FULL_INTERLACE |
3171  * MED_NO_INTERLACE.
3172  * - lecture_en_tete_seule (IN) : mode de lecture.
3173  *
3174  ******************************************************************************/
3175 
3177  const med_switch_mode mode_coo,
3178  int lecture_en_tete_seulement)
3179 {
3180  med_err ret = 0;
3181  med_int nloc=0,locsdim=0,ngauss=0;
3182  med_geometry_type type_geo;
3183  med_float *refcoo=NULL, *gscoo=NULL, *wg=NULL;
3184  char locname [MED_NAME_SIZE+1]="";
3185  char geointerpname [MED_NAME_SIZE+1]="";
3186  char ipointstructmeshname[MED_NAME_SIZE+1]="";
3187  med_int nsectionmeshcell = 0;
3188  med_geometry_type sectiongeotype;
3189  char sectiongeotypename[MED_NAME_SIZE+1]="";
3190  med_int locentdim=0;
3191  med_int locnnodes=0;
3192  char _locgeotypename[MED_NAME_SIZE+1]="";
3193  int t1=0,t2=0,t3=0;
3194  int i=0,j=0;
3195 
3196 
3197  /* Interrogation des localisations des points de GAUSS */
3198  nloc = MEDnLocalization(fid);
3199  if (nloc) {
3200  fprintf(stdout,"\n(********************************************)\n");
3201  fprintf(stdout, "(* LOCALISATIONS DES POINTS D'INTEGRATION : *)\n");
3202  fprintf(stdout, "(********************************************)\n");
3203  printf("\nNombre de localisations stockees : "IFORMAT"\n\n",nloc);
3204  }
3205 
3206  for (i=1 ; i <= nloc ; i++ ) {
3207  if ( MEDlocalizationInfo(fid, i, locname, &type_geo, &locsdim, &ngauss,
3208  geointerpname, ipointstructmeshname, &nsectionmeshcell,
3209  &sectiongeotype) < 0) {
3210  MESSAGE("Erreur a la demande d'information sur la localisation n° : "); ISCRUTE_int(i);
3211  ret = -1;continue;
3212  }
3213  printf("\t- Loc. n°%i de nom |%s| de dimension "IFORMAT" avec "IFORMAT" pts de GAUSS \n",i,locname,locsdim,ngauss);
3214 
3215  if ( MEDmeshGeotypeName(fid, type_geo,_locgeotypename) <0 ) {
3216  MESSAGE("Erreur à la lecture du nom associé au typegeo : "); ISCRUTE_int(type_geo);
3217  ret = -1;continue;
3218  }
3219 
3220  if ( MEDmeshGeotypeParameter(fid, type_geo,&locentdim,&locnnodes) <0 ) {
3221  MESSAGE("Erreur à la lecture du nom associé au typegeo : "); ISCRUTE_int(type_geo);
3222  ret = -1;continue;
3223  }
3224 
3225  if (strlen(ipointstructmeshname)) {
3226  if ( MEDmeshGeotypeName(fid, sectiongeotype,sectiongeotypename) <0 ) {
3227  MESSAGE("Erreur à la lecture du nom associé au sectiongeotype : "); ISCRUTE_int(sectiongeotype);
3228  SSCRUTE(ipointstructmeshname);
3229  ret = -1;continue;
3230  }
3231  }
3232 
3233  t1 = locnnodes*locsdim;
3234  t2 = ngauss*locsdim;
3235  t3 = ngauss;
3236  refcoo = (med_float *) malloc(sizeof(med_float)*t1 );
3237  gscoo = (med_float *) malloc(sizeof(med_float)*t2 );
3238  wg = (med_float *) malloc(sizeof(med_float)*t3 );
3239 
3240  if ( MEDlocalizationRd(fid, locname, mode_coo, refcoo, gscoo, wg ) < 0) {
3241  MESSAGE("Erreur a la lecture des valeurs de la localisation : ");
3242  SSCRUTE(locname);
3243  ret = -1;
3244  } else {
3245  if (!structure) {
3246  printf("\t Coordonnees de l'element de reference de type |%s| :\n\t\t",_locgeotypename);
3247 /* for (j=0;j<t1;j++) printf(" %f ",*(refcoo+j)); */
3248  for (j=0;j<locnnodes*locsdim;j++) {
3249  if (mode_coo == MED_FULL_INTERLACE && !(j % locsdim))
3250  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/locsdim + 1) );
3251  if (mode_coo == MED_NO_INTERLACE && ! (j % locnnodes))
3252  fprintf(stdout,"\n\n ");
3253  fprintf(stdout," %-+9.6f ",*(refcoo+j));
3254  }
3255  printf("\n");
3256  printf("\t Localisation des points de GAUSS : \n\t\t");
3257 /* for (j=0;j<t2;j++) printf(" %f ",*(gscoo+j)); */
3258  for (j=0;j<ngauss*locsdim;j++) {
3259  if (mode_coo == MED_FULL_INTERLACE && !(j % locsdim))
3260  fprintf(stdout,"\n [ %5"MED_IFORMAT" ] : ", (j/locsdim + 1) );
3261  if (mode_coo == MED_NO_INTERLACE && ! (j % ngauss))
3262  fprintf(stdout,"\n\n ");
3263  fprintf(stdout," %-+9.6f ",*(gscoo+j));
3264  }
3265  printf("\n");
3266  printf("\t Poids associes aux points de GAUSS :\n\t\t");
3267  for (j=0;j<t3;j++) printf(" %f ",*(wg+j));
3268  printf("\n");
3269  }
3270  if (strlen(ipointstructmeshname)) {
3271  printf("\t Maillage support de section d'élément de structure |%s|.\n",ipointstructmeshname);
3272  printf("\t Mailles des sections d'élément de structure de type |%s|.\n",sectiongeotypename);
3273  printf("\t Nombre de mailles par section d'élément de structure : "IFORMAT".\n",nsectionmeshcell);
3274  }
3275  if (strlen(geointerpname)) {
3276  printf("\t Tranformation géométrique associée à la localisation |%s|.\n",geointerpname);
3277  }
3278  printf("\n\n");
3279  }
3280  free(refcoo);
3281  free(gscoo);
3282  free(wg);
3283  }
3284 
3285  return;
3286 }
3287 
3288 
3290 {
3291  med_idt fid;
3292  med_err ret = 0;
3293  med_int majeur,mineur,release;
3294  med_bool hdfok;
3295  med_bool medok;
3296 
3297  /* on regarde si le fichier existe */
3298  ret = (int) access(fichier,F_OK);
3299  if (ret <0) { SSCRUTE(fichier);}
3300  EXIT_IF(ret < 0,"Le fichier n'est pas accessible ou n'existe pas ",
3301  fichier);
3302 
3303  /* on regarde s'il s'agit d'un fichier au format HDF 5 */
3304  ret = MEDfileCompatibility (fichier,&hdfok, &medok );
3305  EXIT_IF(ret < 0,"Impossible de déterminer la compatibilité de format. ",
3306  fichier);
3307 
3308  EXIT_IF(!hdfok,"Le fichier n'est pas dans un format HDF compatible ", fichier);
3309  EXIT_IF(!medok,"Le fichier n'est pas dans un format MED compatible ", fichier);
3310 
3311  /* Quelle version de MED est utilise par mdump ? */
3312  MEDlibraryNumVersion(&majeur,&mineur,&release);
3313  fprintf(stdout,
3314  "- Lecture du fichier à l'aide de la bibliotheque MED V"IFORMAT"."IFORMAT"."IFORMAT" \n",
3315  majeur,mineur,release);
3316 
3317  /* Ouverture du fichier MED en lecture seule */
3318  fid = MEDfileOpen(fichier,MED_ACC_RDONLY);
3319  EXIT_IF( fid < 0,"Ouverture du du fichier ",fichier);
3320 
3321  MEDfileNumVersionRd(fid, &majeur, &mineur, &release);
3322  EXIT_IF(( (majeur < 2) || ( (majeur == 2) && (mineur < 2)) ), "Le fichier est antérieur à la version 2.2", NULL);
3323 
3324  return fid;
3325 }
3326 
3327 void lecture_en_tete(med_idt fid,char* fichier)
3328 {
3329  char fichier_en_tete[MED_COMMENT_SIZE+1];
3330  med_err ret = 0;
3331 
3332  /* lecture de l'en-tete du fichier (optionnel) */
3333  /* on va lire dans le fichier */
3334  ret = MEDfileCommentRd(fid,fichier_en_tete);
3335 
3336  /* on affiche */
3337  if (ret >= 0)
3338  fprintf(stdout,"- En-tete du fichier : %s \n",fichier_en_tete);
3339 
3340  return;
3341 }
3342 
3344  med_connectivity_mode *typ_con)
3345 {
3346  int reponse;
3347  char _temp[256]="";
3348 
3349  fprintf(stdout,"(*****************)\n");
3350  fprintf(stdout,"(* PARAMETRAGE : *)\n");
3351  fprintf(stdout,"(*****************)\n");
3352  fprintf(stdout,"- Mode d'affichage des coordonnées des noeuds ? \n");
3353  fprintf(stdout," 1. Mode entrelacé : taper 1 \n");
3354  fprintf(stdout," 2. Mode non entrelacé : taper 2 \n");
3355  reponse = 0;
3356  do {
3357  fprintf(stdout," Reponse : ");
3358  if (!scanf("%d",&reponse)) fgets(_temp, 256, stdin) ;
3359  } while (reponse != 1 && reponse != 2);
3360  if (reponse == 1)
3361  *mode_coo = MED_FULL_INTERLACE;
3362  else
3363  *mode_coo = MED_NO_INTERLACE;
3364 
3365  fprintf(stdout,"- Connectivité des éléments ? \n");
3366  fprintf(stdout," 1. Nodale : taper 1 \n");
3367  fprintf(stdout," 2. Descendante : taper 2 \n");
3368  reponse = 0;
3369  do {
3370  fprintf(stdout," Reponse : ");
3371  if (!scanf("%d",&reponse)) fgets(_temp, 256, stdin) ;
3372  } while (reponse != 1 && reponse != 2);
3373  if (reponse == 1)
3374  *typ_con = MED_NODAL;
3375  else
3376  *typ_con = MED_DESCENDING;
3377 
3378  return;
3379 }
3380 
3381 
3383  const int numero,
3384  char * nommaa,
3385  med_int * const mdim,
3386  med_int * const edim,
3387  med_mesh_type * const type_maillage,
3388  char * const maillage_description,
3389  med_int * const nstep,
3390  char * const dtunit,
3391  char * const nomcoo,
3392  char * const unicoo,
3393  med_axis_type *const rep)
3394 {
3395  char nom_universel[MED_LNAME_SIZE+1];
3396  med_err ret = 0;
3397  med_sorting_type sortingtype;
3398 
3399  fprintf(stdout,"\n(**********************************************************)\n");
3400  fprintf(stdout,"(* INFORMATIONS GENERALES SUR LE MAILLAGE DE CALCUL N°%2.2d: *)\n",numero);
3401  fprintf(stdout,"(**********************************************************)\n\n");
3402 
3403  /* lecture du nom et de la dimension du maillage */
3404  ret = MEDmeshInfo(fid, numero,nommaa,edim,mdim,type_maillage,maillage_description,
3405  dtunit,&sortingtype,nstep,rep,nomcoo,unicoo);
3406  EXIT_IF(ret < 0,"Lecture des informations sur le maillage",NULL);
3407 
3408  /* affichage des donnees lues */
3409  fprintf(stdout,"- Nom du maillage : <<%s>>\n",nommaa);
3410  fprintf(stdout,"- Dimension du maillage : "IFORMAT"\n",*mdim);
3411  if (*edim > *mdim)
3412  fprintf(stdout,"- La dimension de l'espace est "IFORMAT" \n",*edim);
3413  if (*type_maillage == MED_UNSTRUCTURED_MESH)
3414  fprintf(stdout,"- Type du maillage : MED_NON_STRUCTURE \n");
3415  else
3416  fprintf(stdout,"- Type du maillage : MED_STRUCTURE \n");
3417  fprintf(stdout,"- Description associee au maillage : %s\n",
3418  maillage_description);
3419 
3420  if ( *nstep > 1 )
3421  fprintf(stdout,"- Nombre d'étapes de calcul associées au maillage : "IFORMAT"\n",
3422  *nstep);
3423  if (strlen(dtunit))
3424  fprintf(stdout,"- Unité des dates d'étapes de calcul associées au maillage : %s\n",
3425  dtunit);
3426 
3427  /* lecture du nom universel (presence optionnelle) */
3428  ret = MEDmeshUniversalNameRd(fid,nommaa,nom_universel);
3429  if (ret == 0)
3430  fprintf(stdout,"- Nom universel du maillage : %s \n",nom_universel);
3431 
3432  return;
3433 }
3434 
3435 /******************************************************************************
3436  *
3437  * - Nom de la fonction : main
3438  * - Description : fonction "main" de l'outil de DUMP d'un fichier MED.
3439  * - Parametres :
3440  * - argc (IN) : nombre d'arguments sur la ligne de commande.
3441  * - argv (IN) : liste des arguments.
3442  *
3443  ******************************************************************************/
3444 
3445 int main (int argc, char **argv)
3446 {
3447  med_err ret = 0;
3448  med_idt fid;
3449  int i=0,numero=0,firstmesh=0,lastmesh=0,meshit=0;
3452  int lecture_en_tete_seulement = 0;
3453  med_int mdim=0,nmaa=0,nmaasup=0;
3454  char nommaa[MED_NAME_SIZE+1];
3455  char maillage_description[MED_COMMENT_SIZE+1];
3456  med_mesh_type type_maillage;
3457  med_int edim;
3458  int decalage;
3459  char nomcoo[3*MED_SNAME_SIZE+1]="";
3460  char unicoo[3*MED_SNAME_SIZE+1]="";
3461  char dtunit[MED_SNAME_SIZE+1]="";
3462  med_int nstep=0,numdt=MED_NO_DT,numit=MED_NO_IT;
3463  int csit=0;
3464  med_float dt=0.0;
3465  med_axis_type rep;
3466 
3467  /*Gestion des paramètres de la ligne de commande*/
3468  char *filename=NULL,*typ_con_param=NULL,*mode_coo_param=NULL;
3469  size_t _bannerlen=0;
3470  char _temp[MAXBANNERLEN+1]="";
3471  char * _bannerstr=NULL;
3472 
3473  /*Modèles d'élements de structure utilisés par le maillage spécifié*/
3474  /*Celà permet de demander les champs uniquement sur ces modèles*/
3475  med_int _nmodels=0;
3476  med_geometry_type *_geotype_elst = NULL;
3477  char *_geotypename_elst = NULL;
3478 
3479 
3480  /****************************************************************************
3481  * TEST DU NOMBRE D'ARGUMENTS *
3482  * argument 1 = nom du fichier MED *
3483  ****************************************************************************/
3484 
3485  structure = 0;
3486  decalage = 0;
3487  if (argc > 2 && strcmp(argv[1], "--structure") == 0) {
3488  --argc;++decalage;
3489  structure = 1;
3490  }
3491 
3492  if ( (argc != 2) && (argc != 5) )
3493 /* fprintf(stderr,"Utilisation mdump [--structure] monfichier.med\n"); */
3494  fprintf(stderr,"Utilisation mdump [--structure] monfichier.med [ NODALE|DESCENDANTE "
3495  "NO_INTERLACE|FULL_INTERLACE|LECTURE_EN_TETE_SEULEMENT N°MAILLAGE|0 pour tous ] \n");
3496  EXIT_IF( (argc != 2) && (argc != 5),"nombre de parametres incorrect\n",NULL);
3497 
3498 
3499  /****************************************************************************
3500  * OUVERTURE DU FICHIER EN LECTURE *
3501  ****************************************************************************/
3502  filename = argv[1+decalage];
3503  fid = ouverture_fichier_MED(filename);
3504 /* ICI;_MEDobjetsOuverts(fid); */
3505 
3506  /****************************************************************************
3507  * QUESTIONS PRELIMINAIRES *
3508  * 1. Mode d'affichage des coordonnees (entrelace ou non) ? *
3509  * 2. Connectivite des elements (nodale ou descendante) ? *
3510  ***************************************************************************/
3511  fprintf(stdout,"\n >>>>>> DUMP DU FICHIER %s >>>>>>\n",filename);
3512 
3513  /* lecture et affichage de l'en-tete du fichier */
3514  lecture_en_tete(fid,filename);
3515 /* ICI;_MEDobjetsOuverts(fid); */
3516 
3517  if (argc == 2)
3518  parametrage(&mode_coo,&typ_con);
3519  else {
3520  typ_con_param=argv[2 + decalage];
3521 /* SSCRUTE(typ_con_param); */
3522  if (! strcmp(typ_con_param,"NODALE")) typ_con = MED_NODAL;
3523  if (! strcmp(typ_con_param,"DESCENDANTE")) typ_con = MED_DESCENDING;
3524  EXIT_IF( typ_con==MED_UNDEF_CONNECTIVITY_MODE,"Le paramètre de connectivité doit être soit NODALE|DESCENDANTE",NULL);
3525  mode_coo_param=argv[3 + decalage];
3526 /* SSCRUTE(mode_coo_param); */
3527  if (!strcmp(mode_coo_param,"NO_INTERLACE")) mode_coo = MED_NO_INTERLACE;
3528  if (!strcmp(mode_coo_param,"FULL_INTERLACE")) mode_coo = MED_FULL_INTERLACE;
3529  if (!strcmp(mode_coo_param,"LECTURE_EN_TETE_SEULEMENT")) { lecture_en_tete_seulement = MED_LECTURE_ENTETE_SEULEMENT;
3530  mode_coo = MED_FULL_INTERLACE;}
3531  EXIT_IF( (mode_coo==MED_UNDEF_INTERLACE) ,
3532  "Le paramètre d'entrelacement doit être soit "
3533  "NO_INTERLACE|FULL_INTERLACE|LECTURE_EN_TETE_SEULEMENT",NULL);
3534  }
3535 
3536 
3537  /****************************************************************************
3538  * QUEL MAILLAGE LIRE ? *
3539  ***************************************************************************/
3540  nmaa = MEDnMesh(fid);
3541 /* ICI;_MEDobjetsOuverts(fid); */
3542 
3543  /* Quel maillage lire ? */
3544  if (argc == 2) {
3545  if (nmaa >0) {
3546  fprintf(stdout,"- Il y a "IFORMAT" maillages dans ce fichier \n",nmaa);
3547  fprintf(stdout," Lequel voulez-vous lire (0 pour tous|1|2|3|...|n) ?\n");
3548  do {
3549  fprintf(stdout," Reponse : ");
3550  if (!scanf("%d",&numero)) fgets(_temp, 256, stdin) ;
3551  } while ( (numero > nmaa) || (numero < 0) );
3552  } else {
3553  fprintf(stdout,"- Il n'y a pas de maillage dans ce fichier \n");
3554  }
3555  } else {
3556  if ( argc == 5 ) {
3557  numero = atoi(argv[4 + decalage]);
3558  EXIT_IF(numero > nmaa || numero < 0,"ce numero de maillage n'existe pas", NULL);
3559  }
3560  }
3561 
3562  /****************************************************************************
3563  * MAILLAGES SUPPORTS *
3564  ****************************************************************************/
3565 
3566  nmaasup= MEDnSupportMesh(fid);
3567  if (nmaasup ) {
3568  fprintf(stdout, "\n(*****************************************************)\n");
3569  fprintf(stdout, "(* INFORMATIONS GENERALES SUR LES MAILLAGES SUPPORT: *)\n");
3570  fprintf(stdout, "(*****************************************************)\n");
3571  }
3572  for (meshit=1;meshit <= nmaasup;++meshit) {
3573 
3574 
3575  MEDsupportMeshInfo(fid, meshit, nommaa, &edim, &mdim,
3576  maillage_description, &rep, nomcoo, unicoo);
3577  fprintf(stdout,"\n(*******************************************)\n");
3578  fprintf(stdout,"(******** Maillage support n°%2.2d/%2.2"MED_IFORMAT" : *******)\n",meshit,nmaasup);
3579  fprintf(stdout,"(*******************************************)\n");
3580 
3581  fprintf(stdout,"- Nom du maillage support : <<%s>>\n",nommaa);
3582  fprintf(stdout,"- Dimension du maillage : "IFORMAT"\n",mdim);
3583  if (edim > mdim)
3584  fprintf(stdout,"- La dimension de l'espace est "IFORMAT" \n",edim);
3585 
3586  lecture_maillage_non_structure(fid,nommaa,MED_NO_DT,MED_NO_IT,mdim,edim,mode_coo,typ_con,
3587  nomcoo,unicoo,&rep, &_nmodels, &_geotype_elst,&_geotypename_elst,
3589 
3590  }
3591 
3592 
3593  /****************************************************************************
3594  * PARAMETRES SCALAIRES *
3595  ****************************************************************************/
3596 
3597  /* on va lire l'ensemble des parametres scalaire */
3598  lecture_parametres_scalaires(fid,lecture_en_tete_seulement);
3599 /* _MEDobjetsOuverts(fid); */
3600 
3601  /****************************************************************************
3602  * LOCALISATIONS *
3603  ****************************************************************************/
3604  lecture_localisation(fid,mode_coo,lecture_en_tete_seulement);
3605 /* _MEDobjetsOuverts(fid); */
3606 
3607  /****************************************************************************
3608  * PROFILS *
3609  ****************************************************************************/
3610  lecture_profils(fid,lecture_en_tete_seulement);
3611 /* _MEDobjetsOuverts(fid); */
3612 
3613 
3614  /****************************************************************************
3615  * MODELES D'ELEMENT DE STRUCTURE *
3616  ****************************************************************************/
3617  lecture_modeles_elstruct( fid, lecture_en_tete_seulement);
3618 /* _MEDobjetsOuverts(fid); */
3619 
3620  /****************************************************************************
3621  * FONCTIONS D'INTERPOLATION *
3622  ****************************************************************************/
3623  lecture_fonctions_interpolation( fid, lecture_en_tete_seulement);
3624 /* _MEDobjetsOuverts(fid); */
3625 
3626  /****************************************************************************
3627  * LIENS *
3628  ****************************************************************************/
3629  lecture_liens(fid,lecture_en_tete_seulement);
3630 /* _MEDobjetsOuverts(fid); */
3631 
3632  /****************************************************************************
3633  * INFOS GENERALES SUR LE MAILLAGE *
3634  ****************************************************************************/
3635  if (numero) {
3636  firstmesh=numero;lastmesh=numero;
3637  } else {
3638  firstmesh=1;lastmesh=nmaa;
3639  }
3640 
3641  for (meshit=firstmesh;meshit<=lastmesh;++meshit) {
3642 
3643  lecture_information_maillage(fid,meshit,nommaa,&mdim,&edim,&type_maillage,
3644  maillage_description,&nstep,dtunit,nomcoo,unicoo,&rep);
3645 /* _MEDobjetsOuverts(fid); */
3646 
3647  for (csit=1; csit <= nstep; ++csit) {
3648 
3649  ret = MEDmeshComputationStepInfo(fid, nommaa, csit, &numdt, &numit, &dt);
3650  EXIT_IF(ret < 0,"lors de l'appel à MEDmeshComputationStepInfo",NULL);
3651 
3652 /* fprintf(stdout,"\n(*********************************************************************************)\n"); */
3653 /* fprintf(stdout, "(* MAILLAGE DE CALCUL |%s| N°%2.2d À L'ÉTAPE DE CALCUL (n°dt,n°it)=" */
3654 /* "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT"): *)\n",nommaa,meshit,numdt,numit); */
3655 /* fprintf(stdout, "(*********************************************************************************)\n\n"); */
3656 
3657  /*les caractères ° sont comptabilisés comme deux caractères en locale "C" ? */
3658  _bannerstr ="(* MAILLAGE DE CALCUL |%s| n°%2.2d A L'ETAPE DE CALCUL (n°dt,n°it)="
3659  "(% 2.2"MED_IFORMAT",% 2.2"MED_IFORMAT"): %.*s*)\n";
3660  snprintf(_temp,MAXBANNERLEN+1,_bannerstr,nommaa,meshit,numdt,numit,0,"");
3661  _bannerlen =strlen(_temp);
3662  fprintf(stdout,"\n(");
3663  for (i=0;i< _bannerlen-6; i++) fprintf(stdout,"*");
3664  fprintf(stdout,")\n%s(",_temp);
3665  for (i=0;i< _bannerlen-6; i++) fprintf(stdout,"*");
3666  fprintf(stdout,")\n");
3667 
3668  /****************************************************************************
3669  * LECTURE DU MAILLAGE ET DES RESULTATS ASSOCIES *
3670  ****************************************************************************/
3671 /* _MEDobjetsOuverts(fid); */
3672 
3673  if (type_maillage == MED_UNSTRUCTURED_MESH)
3674  lecture_maillage_non_structure(fid,nommaa,numdt,numit,mdim,edim,mode_coo,typ_con,
3675  nomcoo,unicoo,&rep,
3676  &_nmodels,&_geotype_elst,&_geotypename_elst,
3677  lecture_en_tete_seulement);
3678  else {
3679  lecture_maillage_structure(fid,nommaa,numdt,numit,mdim,edim,mode_coo,
3680  nomcoo,unicoo,lecture_en_tete_seulement);
3681  }
3682 /* _MEDobjetsOuverts(fid); */
3683  /* on lit ensuite les resultats associes au maillage selectionne */
3684  lecture_resultats(fid,nommaa,numdt,numit,mode_coo,
3685  _nmodels,_geotype_elst,_geotypename_elst,
3686  lecture_en_tete_seulement);
3687 /* _MEDobjetsOuverts(fid); */
3688  free(_geotype_elst);
3689  free(_geotypename_elst);
3690  }
3691  }
3692 
3693  /****************************************************************************
3694  * FERMETURE DU FICHIER *
3695  ****************************************************************************/
3696  ret = MEDfileClose(fid);
3697  EXIT_IF(ret < 0,"lors de la fermeture du fichier",argv[1 + decalage]);
3698 
3699  fprintf(stdout,"\n >>>>>> FIN DU DUMP DU FICHIER %s >>>>>>\n",argv[1 + decalage]);
3700 
3701  return EXIT_SUCCESS;
3702 }
void lecture_equivalence_maillage(med_idt fid, const char *const nommaa, med_int nequ)
Definition: mdump3.c:289
MEDC_EXPORT med_int MEDnParameter(const med_idt fid)
Cette routine permet la lecture du nombre de paramètre numérique scalaire dans un fichier...
Definition: MEDnParameter.c:34
Definition: med.h:136
med_int lecture_nombre_mailles_standards(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_geometry_type typ_geo, const med_connectivity_mode typ_con, const int indice)
Definition: mdump3.c:698
void lecture_noeuds_maillage_non_structure(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int edim, const med_int nnoe, const med_switch_mode mode_coo, const char *const nomcoo, const char *const unicoo, const med_axis_type *const rep)
Definition: mdump3.c:585
med_geometry_type MED23MESH_GET_FACE_GEOMETRY_TYPE[MED_N_FACE_FIXED_GEO+2]
const med_geometry_type *const typmai
Definition: mdump3.c:118
MEDC_EXPORT med_err MEDsubdomainJointInfo(const med_idt fid, const char *const meshname, const int jointit, char *const jointname, char *const description, med_int *const domainnumber, char *const remotemeshname, med_int *const nstep, med_int *const nocstpncorrespondence)
Cette routine permet de lire les informations sur un joint dans un maillage.
MEDC_EXPORT med_err MEDmeshEntityInfo(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const int geotypeit, char *const geotypename, med_geometry_type *const geotype)
Cette routine indique de façon itérative les types géométriques disponibles dans un maillage...
med_int lecture_nombre_aretes_standards(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_geometry_type typ_geo, const med_int indice)
Definition: mdump3.c:1542
#define MED_N_ENTITY_TYPES
Definition: med.h:139
med_connectivity_mode
Definition: med.h:235
MEDC_EXPORT med_err MEDfield23ComputingStepMeshInfo(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 nmesh, char *const meshname, med_bool *const localmesh, med_int *const meshnumdt, med_int *const meshnumit)
Cette fonction permet de lire les informations caractérisant une séquence de calcul : numéro de pas d...
med_int lecture_nombre_faces_polygones(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit)
Definition: mdump3.c:1429
MEDC_EXPORT med_int MEDlinkInfoByName(const med_idt fid, const char *const meshname)
Cette routine permet de lire les informations sur un lien dans un fichier MED.
#define MED_QUAD4
Definition: med.h:187
herr_t med_err
Definition: med.h:310
med_int lecture_nombre_famille(med_idt fid, const char *const nommaa)
Definition: mdump3.c:181
MEDC_EXPORT med_err MEDlinkRd(const med_idt fid, const char *const meshname, char *const link)
Cette routine permet de lire un lien dans un fichier MED.
Definition: MEDlinkRd.c:37
med_geometry_type MED23FIELD_GET_EDGE_GEOMETRY_TYPE[MED_N_EDGE_FIXED_GEO+2]
#define MED_NO_IT
Definition: med.h:299
const char *const MED23MESH_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2]
med_int lecture_nombre_equivalence(med_idt fid, const char *const nommaa)
Definition: mdump3.c:279
MEDC_EXPORT med_int MEDnStructElement(const med_idt fid)
Cette routine renvoie le nombre de modèles d'éléments de structure.
med_geometry_type MED23FIELD_GET_CELL_GEOMETRY_TYPE[MED_N_CELL_FIXED_GEO+2]
#define MED_N_FACE_FIXED_GEO
Definition: med.h:223
MEDC_EXPORT med_err MEDinterpBaseFunctionRd(const med_idt fid, const char *const interpname, const int basisfuncit, med_int *const ncoef, med_int *const power, med_float *const coefficient)
Cette routine permet la lecture d'une fonction de base/forme de l'interpolation interpname.
void lecture_maillage_structure(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int edim, const med_switch_mode mode_coo, const char *const comp, const char *const unit, const int lecture_en_tete_seulement)
Definition: mdump3.c:2201
#define MED_POLYGON
Definition: med.h:204
#define MAX(a, b)
Definition: mdump3.c:135
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.
MEDC_EXPORT med_err MEDmeshEntityNumberRd(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, med_int *const number)
Cette routine permet de lire les numéros d'un type d'entité d'un maillage.
const char *const MED23FIELD_GET_FACE_GEOMETRY_TYPENAME[MED_N_FACE_FIXED_GEO+2]
MEDC_EXPORT med_int MEDnProfile(const med_idt fid)
Cette routine permet de lire le nombre de profil dans un fichier MED.
Definition: MEDnProfile.c:37
#define MED_POLYGON2
Definition: med.h:205
MEDC_EXPORT med_err MEDsupportMeshInfo(const med_idt fid, const int meshit, char *const supportmeshname, med_int *const spacedim, med_int *const meshdim, char *const description, med_axis_type *const axistype, char *const axisname, char *const axisunit)
Cette routine permet de lire les informations relatives à un maillage support dans un fichier...
MEDC_EXPORT med_int MEDnLocalization(const med_idt fid)
Cette routine permet de lire le nombre de localisations de points d'intégration contenues dans un fic...
med_geometry_type MED23MESH_GET_EDGE_GEOMETRY_TYPE[MED_N_EDGE_FIXED_GEO+2]
#define MESSAGE(chaine)
Definition: med_utils.h:316
MEDC_EXPORT med_int MEDnFamilyGroup(const med_idt fid, const char *const meshname, const int famit)
Cette routine permet de lire le nombre de groupe dans une famille.
MEDC_EXPORT med_int MEDfield23nProfile(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 meshit, char *const meshname, char *const defaultprofilename, char *const defaultlocalizationname)
Cette fonction permet de lire le nombre de profils référencés dans un champ pour une séquence de calc...
#define MED_N_CELL_FIXED_GEO
Definition: med.h:219
void lecture_localisation(med_idt fid, const med_switch_mode mode_coo, int lecture_en_tete_seulement)
Definition: mdump3.c:3176
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
Definition: MEDfileOpen.c:41
med_switch_mode
Definition: med.h:89
med_data_type
Definition: med.h:142
MEDC_EXPORT med_err MEDfileCommentRd(const med_idt fid, char *const comment)
Lecture d'un descripteur dans un fichier MED.
MEDC_EXPORT med_err MEDstructElementConstAttInfo(const med_idt fid, const char *const modelname, const int attit, char *const constattname, med_attribute_type *const constatttype, med_int *const ncomponent, med_entity_type *const sentitytype, char *const profilename, med_int *const profilesize)
Cette routine décrit les caractéristiques d'un attribut constant de modèle d'élément de structure par...
const med_geometry_type *const typfac
Definition: mdump3.c:119
MEDC_EXPORT med_err MEDinterpInfo(const med_idt fid, const int interpit, char *const interpname, med_geometry_type *const geotype, med_bool *const cellnode, med_int *const nbasisfunc, med_int *const nvariable, med_int *const maxdegree, med_int *const nmaxcoef)
Cette fonction informe des caractéristiques de la fonction d'interpolation n° interpit.
Definition: MEDinterpInfo.c:43
MEDC_EXPORT med_err MEDequivalenceInfo(const med_idt fid, const char *const meshname, const int equivit, char *const equivname, char *const equivdescription, med_int *const nstep, med_int *const nocstpncorrespondence)
Cette routine permet lire les informations d'une équivalence portant sur les entités d'un maillage...
double med_float
Definition: med.h:314
#define MED_ERR_GEOMETRIC_MSG
Definition: med_err.h:153
med_entity_type MED23FIELD_GET_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]
#define ISCRUTE_int(entier)
Definition: med_utils.h:307
med_mesh_type
Definition: med.h:124
#define MED_SEG2
Definition: med.h:183
#define IFORMAT
Definition: med_utils.h:144
MEDC_EXPORT med_err MEDstructElementVarAttInfo(const med_idt fid, const char *const modelname, const int attit, char *const varattname, med_attribute_type *const varatttype, med_int *const ncomponent)
Cette routine décrit les caractéristiques d'un attribut variable de modèle d'élément de structure par...
void lecture_profils(med_idt fid, int lecture_en_tete_seulement)
Definition: mdump3.c:2807
#define MED_NAME_BLANK
Definition: med.h:79
#define MED_ALL_CONSTITUENT
Definition: med.h:279
MEDC_EXPORT med_err MEDprofileInfo(const med_idt fid, const int profileit, char *const profilename, med_int *const profilesize)
Cette routine permet de lire les informations sur un profil dans un fichier MED.
const med_geometry_type *const typare
Definition: mdump3.c:120
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
MEDC_EXPORT med_int MEDfield23nValueWithProfile(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 char *const meshname, 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 séquence de calcul...
Definition: med.h:235
#define MED_N_EDGE_GEO_FIXED_CON
Definition: med.h:228
void lecture_mailles_polyedres(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int npolyedres, const med_switch_mode mode_coo, const med_connectivity_mode typ_con)
Definition: mdump3.c:1194
MEDC_EXPORT med_err MEDstructElementInfoByName(const med_idt fid, const 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 nconstantatribute, med_bool *const anyprofile, med_int *const nvariableattribute)
Cette routine décrit les caractéristiques d'un modèle d'élément de structure à partir de son nom...
void lecture_famille_maillage(med_idt fid, const char *const nommaa, med_int nfam)
Definition: mdump3.c:190
const char *const MED23MESH_GET_FACE_GEOMETRY_TYPENAME[MED_N_FACE_FIXED_GEO+2]
MEDC_EXPORT med_err MEDmeshUniversalNameRd(const med_idt fid, const char *const meshname, char *const univname)
Cette routine permet la lecture du nom universel d'un maillage.
MEDC_EXPORT med_int MEDnLink(const med_idt fid)
Cette routine permet la lecture du nombre de lien dans un fichier MED.
Definition: MEDnLink.c:34
MEDC_EXPORT med_err MEDequivalenceCorrespondenceRd(const med_idt fid, const char *const meshname, const char *const equivname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, med_int *const correspondence)
Cette routine permet de lire un tableau de correspondances entre les entités d'un maillage dans une é...
MEDC_EXPORT med_err MEDfileNumVersionRd(const med_idt fid, med_int *const major, med_int *const minor, med_int *const release)
Lecture du numéro de version de la bibliothèque MED utilisée pour créer le fichier.
MEDC_EXPORT med_err MEDprofileRd(const med_idt fid, const char *const profilename, med_int *const profilearray)
Cette routine permet de lire un profil dans un fichier MED.
Definition: MEDprofileRd.c:39
MEDC_EXPORT med_err MEDmeshElementRd(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_connectivity_mode cmode, const med_switch_mode switchmode, med_int *const connectivity, med_bool *const withelementname, char *const elementname, med_bool *const withelementnumber, med_int *const elementnumber, med_bool *const withfamnumber, med_int *const famnumber)
Cette routine permet la lecture d'un type d'élément d'un maillage non structuré pour une séquence de ...
MEDC_EXPORT med_err MEDparameterComputationStepInfo(const med_idt fid, const char *const paramname, const int csit, med_int *const numdt, med_int *const numit, med_float *const dt)
Cette routine permet la lecture des informations relatives à une séquence de calcul du paramètre numé...
void lecture_maillage_non_structure(med_idt fid, const char *nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int edim, const med_switch_mode mode_coo, const med_connectivity_mode typ_con, const char *const nomcoo, const char *const unicoo, const med_axis_type *const rep, med_int *nmodels, med_geometry_type **geotype_elst, char **geotypename_elst, const int lecture_en_tete_seulement)
Definition: mdump3.c:1668
int main(int argc, char **argv)
Definition: mdump3.c:3445
void lecture_modeles_elstruct(med_idt fid, int lecture_en_tete_seulement)
Definition: mdump3.c:2861
MEDC_EXPORT med_err _MEDgetGeometricParameter(const med_entity_type entitytype, const med_geometry_type geotype, med_int *const entdim, med_int *const nnodes, med_int *const nndes)
#define MED_POLYHEDRON
Definition: med.h:206
MEDC_EXPORT med_err MEDlinkInfo(const med_idt fid, const int linkit, char *const meshname, med_int *const linksize)
Cette routine permet de lire les informations sur un lien dans un fichier MED.
Definition: MEDlinkInfo.c:38
void lecture_noeuds_maillage_structure(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int edim, const med_int *const nind, const med_int nnoe, const char *const comp, const char *const unit, const med_grid_type type, const med_switch_mode mode_coo)
Definition: mdump3.c:1959
void lecture_liens(med_idt fid, int lecture_en_tete_seulement)
Definition: mdump3.c:3119
med_sorting_type
Definition: med.h:289
#define MED_ERR_RANGE_MSG
Definition: med_err.h:60
MEDC_EXPORT med_err MEDmeshEntityNameRd(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, char *const name)
Cette routine permet de lire les noms d'un type d'entité d'un maillage.
void lecture_caracteristiques_grille(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, med_int *nind, med_int *nnoe, med_int *nmai, med_grid_type *type)
Definition: mdump3.c:1863
MEDC_EXPORT med_err MEDparameterInfo(const med_idt fid, const int paramit, char *const paramname, med_parameter_type *const paramtype, char *const description, char *const dtunit, med_int *const nstep)
Cette routine permet la lecture des informations relatives à un paramètre scalaire via un itérateur...
void lecture_information_maillage(const med_idt fid, const int numero, char *nommaa, med_int *const mdim, med_int *const edim, med_mesh_type *const type_maillage, char *const maillage_description, med_int *const nstep, char *const dtunit, char *const nomcoo, char *const unicoo, med_axis_type *const rep)
Definition: mdump3.c:3382
#define MED_LNAME_SIZE
Definition: med.h:76
MEDC_EXPORT med_err MEDmeshGeotypeName(const med_idt fid, const med_geometry_type geotype, char *const geotypename)
Cette routine renvoie le nom associé à un type géométrique.
void lecture_faces_standard(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int *const nfaces, const med_switch_mode mode_coo)
Definition: mdump3.c:1343
med_entity_type
Definition: med.h:136
#define MED_N_EDGE_FIXED_GEO
Definition: med.h:227
int structure
Definition: mdump3.c:115
#define MED_NONE
Definition: med.h:211
Definition: med.h:240
void lecture_joint_maillage(med_idt fid, const char *const nommaa, med_int njnt)
Definition: mdump3.c:469
MEDC_EXPORT med_int MEDnInterp(const med_idt fid)
Cette routine renvoie le nombre d'interpolations disponibles dans le fichier.
Definition: MEDnInterp.c:34
void lecture_parametres_scalaires(med_idt fid, int lecture_en_tete_seulement)
Definition: mdump3.c:2714
MEDC_EXPORT med_err MEDmeshInfo(const med_idt fid, const int meshit, char *const meshname, med_int *const spacedim, med_int *const meshdim, med_mesh_type *const meshtype, char *const description, char *const dtunit, med_sorting_type *const sortingtype, med_int *const nstep, med_axis_type *const axistype, char *const axisname, char *const axisunit)
Cette routine permet de lire les informations relatives à un maillage dans un fichier.
Definition: MEDmeshInfo.c:43
MEDC_EXPORT med_err _MEDgetInternalGeometryTypeName(char *const geotypename, med_geometry_type geotype)
MEDC_EXPORT med_err MEDmeshComputationStepInfo(const med_idt fid, const char *const meshname, const int csit, med_int *const numdt, med_int *const numit, med_float *const dt)
Cette routine permet de lire les informations relatives à une séquence de calcul d'un maillage...
MEDC_EXPORT med_int MEDnFamily23Attribute(const med_idt fid, const char *const meshname, const int famit)
Cette routine permet de lire le nombre d'attribut dans une famille dans un maillage créé avec MED 2...
MEDC_EXPORT med_int MEDfieldnComponent(const med_idt fid, const int ind)
Cette fonction lit le nombre de composantes d'un champ.
int med_int
Definition: med.h:316
MEDC_EXPORT med_int MEDnMesh(const med_idt fid)
Cette routine permet de lire le nombre de maillages dans un fichier.
Definition: MEDnMesh.c:34
med_axis_type
Definition: med.h:238
Definition: med.h:136
MEDC_EXPORT med_int MEDnEquivalence(const med_idt fid, const char *const meshname)
Cette routine permet de lire le nombre d'équivalence dans un fichier.
void lecture_mailles_polygones(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_geometry_type polytype, const med_int nmpolygones, const med_switch_mode mode_coo, const med_connectivity_mode typ_con)
Definition: mdump3.c:1066
#define USER_MODE
Definition: mdump3.c:129
void lecture_resultats(const med_idt fid, const char *const maillage, const med_int mnumdt, const med_int mnumit, const med_switch_mode mode_coo, const med_int nmodels, const med_geometry_type *geotype_elst, const char *geotypename_elst, const int lecture_en_tete_seulement)
Definition: mdump3.c:2585
const char *const MED23MESH_GET_CELL_GEOMETRY_TYPENAME[MED_N_CELL_FIXED_GEO+2]
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
MEDC_EXPORT med_err MEDfield23ValueWithProfileRd(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 char *const meshname, 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 ...
MEDC_EXPORT med_err MEDmeshStructElementVarAttRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_geometry_type mgeotype, const char *const varattname, void *const value)
Cette routine lit les valeurs d'un attribut caractéristique variable sur les éléments de structure d'...
MEDC_EXPORT int MEDstructElementAttSizeof(med_attribute_type atttype)
Cette routine renvoie la taille en octets du type élémentaire atttype.
#define MED_N_CELL_GEO_FIXED_CON
Definition: med.h:220
MEDC_EXPORT med_int MEDnSupportMesh(const med_idt fid)
Cette routine permet de lire le nombre de maillages support dans un fichier.
const char *const MED23FIELD_GET_ENTITY_TYPENAME[MED_N_ENTITY_TYPES+2]
MEDC_EXPORT med_err MEDmeshGeotypeParameter(const med_idt fid, const med_geometry_type geotype, med_int *const geodim, med_int *const nnodes)
Cette routine renvoie les caractéristiques d'un type géométrique de maille.
med_field_type
Definition: med.h:155
MEDC_EXPORT med_int MEDprofileSizeByName(const med_idt fid, const char *const profilename)
Cette routine permet de lire la taille d'un profil dont on connait le nom.
MEDC_EXPORT med_err MEDmeshGridTypeRd(const med_idt fid, const char *const meshname, med_grid_type *const gridtype)
Cette routine permet de lire le type d'un maillage structuré (MED_STRUCTURED_MESH).
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
Definition: MEDfileClose.c:30
const char * MED23MESH_GET_NODE_GEOMETRY_TYPENAME[MED_N_NODE_FIXED_GEO+2]
void affi(const void *pva)
Definition: mdump3.c:145
_myfuncptr MEDstructPrintFunction(med_attribute_type atttype)
Definition: mdump3.c:161
#define MED_NO_GEOTYPE
Definition: med.h:212
#define EXIT_IF(expression, message, arg)
Definition: med_utils.h:335
#define MED_NO_PROFILE
Definition: med.h:261
MEDC_EXPORT med_err MEDstructElementConstAttRd(const med_idt fid, const char *const modelname, const char *const constattname, void *const value)
Cette routine lit la valeur d'un attribut caractéristique constant d'un modèle d'éléments de structur...
const char * MED23FIELD_GET_NODE_GEOMETRY_TYPENAME[MED_N_NODE_FIXED_GEO+2]
void lecture_mailles_standards(const med_idt fid, const char *nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int *const nmailles, const med_switch_mode mode_coo, const med_connectivity_mode typ_con)
Definition: mdump3.c:922
med_idt ouverture_fichier_MED(char *fichier)
Definition: mdump3.c:3289
MEDC_EXPORT med_int MEDnFamily(const med_idt fid, const char *const meshname)
Cette routine permet de lire le nombre de famille dans un maillage.
Definition: MEDnFamily.c:35
med_int lecture_nombre_faces_standards(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_geometry_type typ_geo, const med_int indice)
Definition: mdump3.c:1318
void parametrage(med_switch_mode *mode_coo, med_connectivity_mode *typ_con)
Definition: mdump3.c:3343
#define MED_POINT1
Definition: med.h:181
Definition: med.h:240
med_geometry_type MED23FIELD_GET_FACE_GEOMETRY_TYPE[MED_N_FACE_FIXED_GEO+2]
void lecture_aretes_standards(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int *const naretes, const med_switch_mode mode_coo)
Definition: mdump3.c:1565
#define MED_N_FACE_GEO_FIXED_CON
Definition: med.h:224
void lecture_mailles_elstruct(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int nmodels, const med_geometry_type *const geotype, const char *const geotypename, const med_int *const nmailles, const med_switch_mode mode_coo)
Definition: mdump3.c:753
med_err getFieldsOn(const med_idt fid, const char *const maillage, const med_int mnumdt, const med_int mnumit, const med_int nmodels, const med_geometry_type *const geotype_elst, const char *const 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: mdump3.c:2272
#define MED_COMMENT_SIZE
Definition: med.h:72
const char *const MED23FIELD_GET_CELL_GEOMETRY_TYPENAME[MED_N_CELL_FIXED_GEO+2]
#define ISCRUTE(entier)
Definition: med_utils.h:306
med_int lecture_nombre_mailles_polygones(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_geometry_type polytype, const med_connectivity_mode typ_con)
Definition: mdump3.c:1033
#define xstr(s)
Definition: mdump3.c:131
MEDC_EXPORT med_err MEDfamily23Info(const med_idt fid, const char *const meshname, const int famit, char *const familyname, med_int *const attributenumber, med_int *const attributevalue, char *const attributedes, med_int *const familynumber, char *const groupname)
Cette routine permet de lire les informations relatives à une famille d'un maillage créé avec MED 2...
MEDC_EXPORT med_err MEDlocalizationRd(const med_idt fid, const char *const localizationname, const med_switch_mode switchmode, med_float *const elementcoordinate, med_float *const ipointcoordinate, med_float *const weight)
Cette routine permet la lecture d'une localisation localizationname de points d'intégration dans/auto...
#define MED_N_NODE_FIXED_GEO
Definition: med.h:231
void lecture_mailles_maillage_structure(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int mdim, const med_int nmai)
Definition: mdump3.c:2108
MEDC_EXPORT med_err MEDequivalenceCorrespondenceSize(const med_idt fid, const char *const meshname, const char *const equivname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, med_int *const nentity)
Cette routine permet de lire le nombre de correspondances dans une équivalence pour une séquence de c...
#define MED_GEO_ALL
Definition: med.h:216
#define MED_LECTURE_ENTETE_SEULEMENT
Definition: mdump3.c:127
const char *const * nomare
Definition: mdump3.c:124
const char * MED23MESH_GET_EDGE_GEOMETRY_TYPENAME[MED_N_EDGE_FIXED_GEO+2]
const char *const * nomfac
Definition: mdump3.c:123
#define MED_NO_DT
Definition: med.h:298
hid_t med_idt
Definition: med.h:309
MEDC_EXPORT med_err MEDmeshPolygonRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_connectivity_mode cmode, med_int *const polyindex, med_int *const connectivity)
Cette routine permet la lecture des connectivités de polygones.
med_grid_type
Definition: med.h:130
MEDC_EXPORT med_err MEDsubdomainComputingStepInfo(const med_idt fid, const char *const meshname, const char *const jointname, const int csit, med_int *const numdt, med_int *const numit, med_int *const ncorrespondence)
Cette routine permet de lire les informations sur les correspondances entre types d'entités dans un m...
#define MED_SNAME_SIZE
Definition: med.h:75
MEDC_EXPORT med_err MEDmeshPolygon2Rd(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 polytype, const med_connectivity_mode cmode, med_int *const polyindex, med_int *const connectivity)
Cette routine permet la lecture des connectivités de polygones.
#define MED_NAME_SIZE
Definition: med.h:74
MEDC_EXPORT med_err MEDlocalizationInfo(const med_idt fid, const int localizationit, char *const localizationname, med_geometry_type *const geotype, med_int *const spacedimension, med_int *const nipoint, char *const geointerpname, char *const sectionmeshname, med_int *const nsectionmeshcell, med_geometry_type *const sectiongeotype)
Cette routine permet d'obtenir la description de la localisation de points d'intégration n° localizat...
MEDC_EXPORT med_err MEDsubdomainCorrespondenceSizeInfo(const med_idt fid, const char *const meshname, const char *const jointname, const med_int numdt, const med_int numit, const int corit, med_entity_type *const localentitytype, med_geometry_type *const localgeotype, med_entity_type *const remoteentitytype, med_geometry_type *const remotegeotype, med_int *const nentity)
Cette routine permet de lire les informations sur les couples d'entités en correspondance dans un joi...
void lecture_fonctions_interpolation(med_idt fid, int lecture_en_tete_seulement)
Definition: mdump3.c:3005
med_geometry_type MED23MESH_GET_CELL_GEOMETRY_TYPE[MED_N_CELL_FIXED_GEO+2]
#define str(s)
Definition: mdump3.c:132
med_entity_type MED23MESH_GET_ENTITY_TYPE[MED_N_ENTITY_TYPES+2]
void lecture_faces_polygones(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_int nfpolygones, const med_switch_mode mode_coo)
Definition: mdump3.c:1451
MEDC_EXPORT med_err MEDmeshPolyhedronRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_connectivity_mode cmode, med_int *const faceindex, med_int *const nodeindex, med_int *const connectivity)
Cette routine permet la lecture dans un maillage des connectivités de polyèdres.
MEDC_EXPORT med_err MEDmeshNodeRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_switch_mode switchmode, med_float *const coordinate, med_bool *const withnodename, char *const nodename, med_bool *const withnodenumber, med_int *const nodenumber, med_bool *const withfamnumber, med_int *const famnumber)
Cette routine permet la lecture des noeuds d'un maillage non structuré pour une séquence de calcul do...
Definition: MEDmeshNodeRd.c:43
MEDC_EXPORT med_err MEDmeshGridStructRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, med_int *const gridstruct)
Cette routine permet la lecture de la structure (nombre de points sur chaque axe du repère) d'un mail...
med_int lecture_nombre_mailles_polyedres(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const med_connectivity_mode typ_con)
Definition: mdump3.c:1171
MEDC_EXPORT med_err MEDlibraryNumVersion(med_int *const major, med_int *const minor, med_int *const release)
Renvoie les 3 numéros de version de la librairie MED.
med_geometry_type MED23FIELD_GET_NODE_GEOMETRY_TYPE[MED_N_NODE_FIXED_GEO+2]
const char * MED23FIELD_GET_EDGE_GEOMETRY_TYPENAME[MED_N_EDGE_FIXED_GEO+2]
med_bool
Definition: med.h:240
MEDC_EXPORT med_err MEDmeshGridIndexCoordinateRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_int axis, med_float *const gridindex)
Cette routine permet la lecture des coordonnées des noeuds d'un maillage structuré selon un axe du re...
void affs(const void *pva)
Definition: mdump3.c:153
#define MED_HEXA8
Definition: med.h:196
void lecture_en_tete(med_idt fid, char *fichier)
Definition: mdump3.c:3327
med_geometry_type MED23MESH_GET_NODE_GEOMETRY_TYPE[MED_N_NODE_FIXED_GEO+2]
#define MAXBANNERLEN
Definition: mdump3.c:137
med_int lecture_nombre_joint(med_idt fid, const char *const nommaa)
Definition: mdump3.c:459
med_int lecture_nombre_et_type_mailles_elstruct(const med_idt fid, const char *const nommaa, const med_int numdt, const med_int numit, const int indice, med_geometry_type *geotype, char *geotypename)
Definition: mdump3.c:723
#define MED_IFORMAT
Definition: med_utils.h:151
int med_geometry_type
Definition: med.h:179
MEDC_EXPORT med_err MEDfileCompatibility(const char *const filename, med_bool *const hdfok, med_bool *const medok)
Vérification de la compatibilité d'un fichier avec HDF et MED.
void affd(const void *pva)
Definition: mdump3.c:139
MEDC_EXPORT med_err MEDsubdomainCorrespondenceRd(const med_idt fid, const char *const meshname, const char *const jointname, const med_int numdt, const med_int numit, const med_entity_type localentitytype, const med_geometry_type localgeotype, const med_entity_type remoteentitytype, const med_geometry_type remotegeotype, med_int *const correspondence)
Cette routine permet la lecture d'une correspondance dans un joint pour un type de couple d'entité en...
MEDC_EXPORT med_err MEDmeshEntityFamilyNumberRd(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, med_int *const number)
Cette routine permet la lecture des numéros de famille d'un type d'entité d'un maillage.
void(* _myfuncptr)(const void *)
Definition: mdump3.c:159
MEDC_EXPORT med_err MEDequivalenceComputingStepInfo(const med_idt fid, const char *const meshname, const char *const equivname, const int csit, med_int *const numdt, med_int *const numit, med_int *const ncorrespondence)
Cette routine permet de lire les informations relatives à une équivalence pour une séquence de calcul...
const char *const * nommai
Definition: mdump3.c:122
med_int lecture_nombre_noeuds_maillage_non_structure(const med_idt fid, const char *nommaa, const med_int numdt, const med_int numit)
Definition: mdump3.c:566
MEDC_EXPORT med_err MEDparameterValueRd(const med_idt fid, const char *const paramname, const med_int numdt, const med_int numit, unsigned char *const value)
Cette routine permet la lecture de la valeur d'un paramètre numérique scalaire.
#define MED_LECTURE_MAILLAGE_SUPPORT_UNIQUEMENT
Definition: mdump3.c:126
#define SSCRUTE(chaine)
Definition: med_utils.h:315
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 séquence de calcul donnée...
med_attribute_type
Definition: med.h:158
MEDC_EXPORT med_err MEDmeshNodeCoordinateRd(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_switch_mode switchmode, med_float *const coordinates)
Cette routine permet de lire dans un maillage le tableau des coordonnées des noeuds, selon une séquence de calcul donnée.
MEDC_EXPORT med_int MEDnSubdomainJoint(const med_idt fid, const char *const meshname)
Cette routine permet la lecture du nombre de joint dans un maillage.