#define MESGERR 1
#include <string.h>
int main (
int argc,
char **argv) {
const med_float coordinates[2*10] = { 0.5, 0.,
1.5, 0.,
0., 0.5,
1., 0.5,
2., 0.5,
0., 1.,
1., 1.,
2., 1.,
0.5, 2.,
1.5, 2. };
const med_int connectivity[12] = {1,4,7,9,6,3,
2,5,8,10,7,4};
int ret=-1;
if (fid < 0) {
MESSAGE(
"ERROR : file creation ...");
goto ERROR;
}
{
MESSAGE(
"ERROR : write file description ...");
goto ERROR;
}
if (
MEDmeshCr(fid, meshname, spacedim, meshdim,
{
MESSAGE(
"ERROR : mesh creation ...");
goto ERROR;
}
{
MESSAGE(
"ERROR : nodes coordinates ...");
goto ERROR;
}
{
MESSAGE(
"ERROR : polygon connectivity ...");
goto ERROR;
}
{
MESSAGE(
"ERROR : family 0 creation ...");
goto ERROR;
}
ret=0;
ERROR:
ret=-1;
}
return ret;
}
MEDC_EXPORT med_err MEDmeshCr(const med_idt fid, const char *const meshname, const med_int spacedim, const med_int meshdim, const med_mesh_type meshtype, const char *const description, const char *const dtunit, const med_sorting_type sortingtype, const med_axis_type axistype, const char *const axisname, const char *const axisunit)
Cette routine permet de créer un maillage dans un fichier.
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
MEDC_EXPORT med_err MEDfileCommentWr(const med_idt fid, const char *const comment)
Ecriture d'un descripteur dans un fichier MED.
MEDC_EXPORT med_err MEDmeshPolygonWr(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_float dt, const med_entity_type entitype, const med_connectivity_mode cmode, const med_int indexsize, const med_int *const polyindex, const med_int *const connectivity)
Cette routine permet l'écriture des connectivités de polygones.
MEDC_EXPORT med_err MEDfamilyCr(const med_idt fid, const char *const meshname, const char *const familyname, const med_int familynumber, const med_int ngroup, const char *const groupname)
Cette routine permet la création d'une famille portant sur les entités d'un maillage.
MEDC_EXPORT med_err MEDmeshNodeCoordinateWr(const med_idt fid, const char *const meshname, const med_int numdt, const med_int numit, const med_float dt, const med_switch_mode switchmode, const med_int nentity, const med_float *const coordinates)
Cette routine permet d'écrire dans un maillage le tableau des coordonnées des noeuds,...
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
int main(int argc, char **argv)