#define MESGERR 1
#include <string.h>
int main (
int argc,
char **argv) {
const char meshname[
MED_NAME_SIZE+1] =
"3D Unstructured Mesh With 2 polyhedrons";
-10.0, -10.0, +0.0,
-10.0, -10.0, +10.,
-10.0, +10.0, +10.,
-10.0, +10.0, +0.0,
+10.0, -10.0, +0.0,
+10.0, -10.0, +10.,
+10.0, +10.0, +10.,
+10.0, +10.0, +0.0,
-10.0, +0.0 , +10.0,
-10.0, +0.0 , +0.0 ,
+0.0 , -10.0 , +10.0,
+0.0 , -10.0 , +0.0 ,
+0.0 , +10.0 , +10.0,
+10.0, +0.0 , +10.0,
+0.0 , +10.0 , +0.0 ,
+10.0, +0.0 , +0.0
};
const med_int connectivity[26+32] = {
1, 2 , 9 , 3 , 10,
1, 12 , 5 , 6 , 11, 2,
2, 11 , 6 , 3 , 9 ,
3, 6 , 5 ,
3, 5 , 10 ,
1, 10 , 5 , 12,
3, 13 , 7 , 8 , 15, 4,
3, 4 , 10 ,
4, 15 , 8 , 16 , 5, 10,
3, 6 , 14 , 7 , 13,
5, 16 , 8 , 7 , 14, 6,
3, 10 , 5 ,
3, 5 , 6
};
const med_int nodeindex[6+7+1] = { 1, 6, 12, 17, 20, 23,
27, 33, 36, 42, 47, 53, 56, 59};
const med_int nodeindexSize = 6+7+1;
const med_int faceindex[3] = {1,7,14};
if (fid < 0) {
MESSAGE(
"ERROR : file creation ...");
return -1;
}
"A 3D unstructured mesh : 2 polyhedrons") < 0) {
MESSAGE(
"ERROR : write file description ...");
return -1;
}
if (
MEDmeshCr(fid, meshname, spacedim, meshdim,
MESSAGE(
"ERROR : mesh creation ...");
return -1;
}
MESSAGE(
"ERROR : nodes coordinates ...");
return -1;
}
faceindexSize, faceindex,
nodeindexSize, nodeindex,
connectivity) < 0) {
MESSAGE(
"ERROR : polyhedron connectivity ...");
return -1;
}
MESSAGE(
"ERROR : family 0 creation ...");
return -1;
}
return -1;
}
return 0;
}