#include <med.h>
#define MESGERR 1
#include <med_utils.h>
#include <string.h>
int main (
int argc,
char **argv) {
const med_float tria3values_step1_profile1[3] = {1000., 4000., 8000.};
const med_float tria3values_step2_profile1[8] = {1500., 0., 0., 4500., 0., 0., 0., 8500.};
const med_float tria3values_step2_profile2[8] = { 0., 2500., 3500., 0., 5500., 6500., 7500., 0.};
const med_float quad4values_step1[4] = {10000., 20000., 30000., 40000.};
const med_float quad4values_step2[4] = {15000., 25000., 35000., 45000.};
const med_int profile1[3] = {1, 4, 8};
const med_int profile2[5] = {2, 3, 5, 6, 7};
int ret=-1;
if (fid < 0) {
MESSAGE(
"ERROR : file creation ...");
goto ERROR;
}
if (
MEDlinkWr(fid,meshname,
"./UsesCase_MEDmesh_1.med") < 0) {
MESSAGE(
"ERROR : create mesh link ...");
goto ERROR;
}
if (
MEDprofileWr(fid, profile1name, profile1size, profile1 ) < 0) {
MESSAGE(
"ERROR : create profile ...");
goto ERROR;
}
if (
MEDprofileWr(fid, profile2name, profile2size, profile2 ) < 0) {
MESSAGE(
"ERROR : create profile ...");
goto ERROR;
}
componentname, componentunit,"ms", meshname) < 0) {
goto ERROR;
}
(unsigned char*) tria3values_step1_profile1) < 0) {
MESSAGE(
"ERROR : write field values on MED_TRIA3");
goto ERROR;
}
(unsigned char*) quad4values_step1) < 0) {
MESSAGE(
"ERROR : write field values on MED_QUAD4 ");
goto ERROR;
}
(unsigned char*) tria3values_step2_profile1) < 0) {
MESSAGE(
"ERROR : write field values on MED_TRIA3 ...");
goto ERROR;
}
(unsigned char*) tria3values_step2_profile2) < 0) {
MESSAGE(
"ERROR : write field values on MED_TRIA3 ...");
goto ERROR;
}
(unsigned char*) quad4values_step2) < 0) {
MESSAGE(
"ERROR : write field values on MED_QUAD4 ... ");
goto ERROR;
}
ret=0;
ERROR:
ret=-1;
}
return ret;
}
int main(int argc, char **argv)
#define MED_NO_LOCALIZATION
#define MED_ALL_CONSTITUENT
MEDC_EXPORT med_err MEDfieldCr(const med_idt fid, const char *const fieldname, const med_field_type fieldtype, const med_int ncomponent, const char *const componentname, const char *const componentunit, const char *const dtunit, const char *const meshname)
Cette fonction crée un champ dans un fichier.
MEDC_EXPORT med_err MEDfieldValueWithProfileWr(const med_idt fid, const char *const fieldname, const med_int numdt, const med_int numit, const med_float dt, const med_entity_type entitype, const med_geometry_type geotype, const med_storage_mode storagemode, const char *const profilename, const char *const localizationname, const med_switch_mode switchmode, const med_int componentselect, const med_int nentity, const unsigned char *const value)
Cette fonction permet d'écrire les valeurs d'un champ définies sur des entités d'un maillage pour une...
MEDC_EXPORT med_err MEDfileClose(med_idt fid)
Fermeture d'un fichier MED.
MEDC_EXPORT med_idt MEDfileOpen(const char *const filename, const med_access_mode accessmode)
Ouverture d'un fichier MED.
MEDC_EXPORT med_err MEDlinkWr(const med_idt fid, const char *const meshname, const char *const link)
Cette routine permet d'écrire un lien dans un fichier MED.
MEDC_EXPORT med_err MEDprofileWr(const med_idt fid, const char *const profilename, const med_int profilesize, const med_int *const profilearray)
Cette routine permet d'écrire un profil dans un fichier MED.