00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <med.h>
00020 #include <med_config.h>
00021 #include <med_outils.h>
00022 #include <string.h>
00023 #include <stdlib.h>
00024
00048 med_err MEDmeshElementWr(const med_idt fid,
00049 const char * const meshname,
00050 const med_int numdt,
00051 const med_int numit,
00052 const med_float dt,
00053 const med_entity_type entitype,
00054 const med_geometry_type geotype,
00055 const med_connectivity_mode cmode,
00056 const med_switch_mode switchmode,
00057 const med_int nentity,
00058 const med_int * const connectivity,
00059 const med_bool withelementname,
00060 const char * const elementname,
00061 const med_bool withelementnumber,
00062 const med_int * const elementnumber,
00063 const med_bool withfamnumber,
00064 const med_int * const famnumber) {
00065
00066 med_err _ret = -1;
00067
00068 if ( (_ret = MEDmeshElementConnectivityWr(fid,
00069 meshname,
00070 numdt,
00071 numit,
00072 dt,
00073 entitype,
00074 geotype,
00075 cmode,
00076 switchmode,
00077 nentity,
00078 connectivity) ) < 0 ) {
00079 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshElementConnectivityWr");
00080 goto ERROR;
00081 }
00082
00083 if ( withelementname )
00084 if ( (_ret = MEDmeshEntityNameWr(fid,
00085 meshname,
00086 numdt,
00087 numit,
00088 entitype,
00089 geotype,
00090 nentity,
00091 elementname) ) < 0 ) {
00092 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNameWr");
00093 goto ERROR;
00094 }
00095
00096 if ( withelementnumber )
00097 if ( (_ret = MEDmeshEntityNumberWr(fid,
00098 meshname,
00099 numdt,
00100 numit,
00101 entitype,
00102 geotype,
00103 nentity,
00104 elementnumber) ) < 0 ) {
00105 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNumberWr");
00106 goto ERROR;
00107 }
00108
00109 if (withfamnumber)
00110 if ( (_ret = MEDmeshEntityFamilyNumberWr(fid,
00111 meshname,
00112 numdt,
00113 numit,
00114 entitype,
00115 geotype,
00116 nentity,
00117 famnumber) ) < 0 ) {
00118 MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityFamilyNumberWr");
00119 goto ERROR;
00120 }
00121
00122 _ret = 0;
00123 ERROR:
00124 return _ret;
00125 }