#define MESGERR 1
#include <string.h>
int main (
int argc,
char **argv) {
int i,j,k;
unsigned char *value;
med_bool coordinatechangement, geotransformation;
int ret=-1;
if (fid < 0) {
MESSAGE(
"ERROR : file creation ...");
goto ERROR;
}
MESSAGE(
"ERROR : read number of support mesh ...");
goto ERROR;
}
for (i=0; i<nsmesh; i++) {
&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);
}
}
MESSAGE(
"ERROR : read number of struct element models ...");
goto ERROR;
}
for (i=0; i<nmodels; i++) {
supportmeshname, &entitype, &nnode, &ncell,
&geocelltype, &nconstatt, &anyprofile, nvaratt+i) < 0) {
MESSAGE(
"ERROR : struct element models information ...");
goto ERROR;
}
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
value = (unsigned char *) malloc(size);
MESSAGE(
"ERROR : const attribute value ...");
free(value);
goto ERROR;
}
free(value);
}
}
if (
MEDmeshInfoByName(fid, computmeshname, &spacedim, &meshdim, &meshtype, description,
dtunit, &sortingtype, &nstep, &axistype, axisname, unitname) < 0) {
goto ERROR;
}
for (i=0;i<nmodels;i++) {
&geotransformation)) < 0) {
MESSAGE(
"ERROR : number of MED_STRUCT_ELEMENT ...");
goto ERROR;
}
MESSAGE(
"ERROR : get element name ...");
goto ERROR;
}
for (j=0; j<*(nvaratt+i); j++) {
attname, &atttype, &nattcomp) < 0) {
MESSAGE(
"ERROR : var attribute information ...");
goto ERROR;
}
else
value = (unsigned char *) malloc(size);
*(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;
}
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 MEDmeshnEntity(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_entity_type entitype, const med_geometry_type geotype, const med_data_type datatype, const med_connectivity_mode cmode, med_bool *const changement, med_bool *const transformation)
Cette routine permet de lire le nombre d'entités dans un maillage pour une étape de calcul donnée.
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
MEDC_EXPORT med_err MEDstructElementName(const med_idt fid, const med_geometry_type mgeotype, char *const modelname)
Cette routine renvoie le nom du modèle d'éléments de structure associé au type mgeotype.
MEDC_EXPORT med_err MEDmeshElementConnectivityRd(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)
Cette routine permet de lire dans un maillage le tableau des connectivités pour un type géométrique d...
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...
MEDC_EXPORT med_int MEDnStructElement(const med_idt fid)
Cette routine renvoie le nombre de modèles d'éléments de structure.
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,...
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
MEDC_EXPORT med_int MEDnSupportMesh(const med_idt fid)
Cette routine permet de lire le nombre de maillages support dans un fichier.
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...
MEDC_EXPORT med_err MEDmeshInfoByName(const med_idt fid, const 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 en précisant son nom.
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 int MEDstructElementAttSizeof(const med_attribute_type atttype)
Cette routine renvoie la taille en octets du type élémentaire atttype.
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...
int main(int argc, char **argv)
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'...