Aller à la documentation de ce fichier.
30 int main (
int argc,
char **argv) {
32 const char meshname[
MED_NAME_SIZE+1] =
"3D Unstructured Mesh With 2 polyhedrons";
61 MESSAGE(
"ERROR : open file in READ ONLY ACCESS mode ...");
71 if (
MEDmeshInfoByName(fid, meshname, &spacedim, &meshdim, &meshtype, meshdescription,
72 dtunit, &sortingtype, &nstep, &axistype, axisname, unitname) < 0) {
73 MESSAGE(
"ERROR : mesh info ...");
80 {
MESSAGE(
"ERROR : number of nodes ...");
96 &coordinatechangement, &geotransformation)) < 0)
97 {
MESSAGE(
"ERROR : read number of polyhedrons ...");
100 npoly = faceindexsize-1;
105 &coordinatechangement, &geotransformation)) < 0)
106 {
MESSAGE(
"ERROR : read number of polyhedrons ...");
114 &coordinatechangement, &geotransformation)) < 0)
115 {
MESSAGE(
"ERROR : read connectivity size ...");
122 MESSAGE(
"ERROR : memory allocation ...");
128 MESSAGE(
"ERROR : nodes coordinates ...");
131 for (i=0;i<nnodes*spacedim;i++)
132 printf(
"%f - ",*(coordinates+i));
139 connectivity = (
med_int *) malloc(
sizeof(
med_int)*connectivitysize);
142 faceindex,nodeindex,connectivity) < 0)
143 {
MESSAGE(
"ERROR : read polyhedron connectivity ...");
147 for (i=0;i<npoly;i++)
149 printf(
">> MED_POLYHEDRON %d : \n",i+1);
150 printf(
"---- Face Index ----- : [\n");
151 ind1 = *(faceindex+i)-1;
152 ind2 = *(faceindex+i+1)-1;
153 for (k=ind1;k<ind2;k++)
154 printf(
IFORMAT" ",*(nodeindex+k));
156 printf(
"---- Connectivity ----- : [\n");
157 for (k=ind1;k<ind2;k++)
159 jind1 = *(nodeindex+k)-1;
160 jind2 = *(nodeindex+k+1)-1;
161 for (j=jind1;j<jind2;j++)
162 printf(
IFORMAT" ",*(connectivity+j));
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_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_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
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_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
int main(int argc, char **argv)
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,...