#define MESGERR 1
#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;
}
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 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...
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.
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 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 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 int MEDstructElementAttSizeof(const med_attribute_type atttype)
Cette routine renvoie la taille en octets du type élémentaire atttype.
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'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...
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.
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
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,...
int main(int argc, char **argv)
MEDC_EXPORT med_err MEDsupportMeshInfoByName(const med_idt fid, const 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 en précisant son nom.
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...