#include <med.h>
#define MESGERR 1
#include <med_utils.h>
#include <string.h>
int main (
int argc,
char **argv) {
int i,j;
int ret=-1;
if (fid < 0) {
MESSAGE(
"ERROR : file creation ...");
goto ERROR;
}
if (
MEDmeshInfoByName(fid, computmeshname, &spacedim, &meshdim, &meshtype, description,
dtunit, &sortingtype, &nstep, &axistype, axisname, unitname) < 0) {
goto ERROR;
}
&geotransformation)) < 0) {
MESSAGE(
"ERROR : number of nodes ...");
goto ERROR;
}
for (i=0;i<nmodels;i++) {
MESSAGE(
"ERROR : name and type of MED_STRUCT_ELEMENT ...");
goto ERROR;
}
&geotransformation)) < 0) {
MESSAGE(
"ERROR : number of MED_STRUCT_ELEMENT ...");
goto ERROR;
}
supportmeshname, &entitype, &nnode, &ncell,
&geocelltype, &nconstatt, &anyprofile, nvaratt+i) < 0) {
MESSAGE(
"ERROR : struct element models information ...");
goto ERROR;
}
if (strcmp(supportmeshname,"")) {
&axistype, axisname, axisunit) < 0 ) {
MESSAGE(
"ERROR : read information about mesh support ...");
goto ERROR;
}
&geotransformation)) < 0) {
MESSAGE(
"ERROR : read number of nodes ...");
goto ERROR;
}
coordinates) < 0) {
MESSAGE(
"ERROR : read nodes coordinates ...");
free(coordinates);
goto ERROR;
}
free(coordinates);
&geotransformation)) < 0) {
MESSAGE(
"ERROR : number of MED_SEG2 ...");
goto ERROR;
}
if (nseg2 > 0) {
MESSAGE(
"ERROR : MED_SEG2 connectivity ...");
free(seg2connectivity);
goto ERROR;
}
free(seg2connectivity);
}
}
for (j=0; j<nconstatt; j++) {
attname, &atttype, &nattcomp, &attentitype,
profilename, &profilesize) < 0) {
MESSAGE(
"ERROR : const attribute information ...");
goto ERROR;
}
if (profilesize != 0)
else
else
MESSAGE(
"ERROR : const attribute value ...");
free(value);
goto ERROR;
}
free(value);
}
for (j=0; j<*(nvaratt+i); j++) {
attname, &atttype, &nattcomp) < 0) {
MESSAGE(
"ERROR : var attribute information ...");
goto ERROR;
}
value = (
med_float *) malloc((size)*
sizeof(char));
*(geotype+i), attname, value ) < 0) {
MESSAGE(
"ERROR : read variable attributes values ...");
free(value);
goto ERROR;
}
free(value);
}
}
ret=0;
ERROR:
free(geotype);
free(nvaratt);
MESSAGE(
"ERROR : file closing ...");
ret=-1;
}
return ret;
}