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 
00045 med_err MEDmeshNodeWr(const med_idt                  fid,
00046                       const char            * const  meshname,
00047                       const med_int                  numdt,
00048                       const med_int                  numit,
00049                       const med_float                dt,
00050                       const med_switch_mode          switchmode,
00051                       const med_int                  nentity,
00052                       const med_float       * const  coordinate,
00053                       const med_bool                 withnodename,
00054                       const char            * const  nodename,
00055                       const med_bool                 withnodenumber,
00056                       const med_int         * const  nodenumber,
00057                       const med_bool                 withfamnumber,
00058                       const med_int         * const  famnumber) {
00059 
00060   med_err           _ret       = -1;
00061   med_entity_type   _entitype  = MED_NODE;
00062   med_geometry_type _geotype   = MED_NONE;
00063 
00064   if ( (_ret = MEDmeshNodeCoordinateWr(fid,
00065                                        meshname,
00066                                        numdt,
00067                                        numit,
00068                                        dt,
00069                                        switchmode,
00070                                        nentity,
00071                                        coordinate) ) < 0 ) {
00072     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshNodeCoordinateWr");
00073     goto ERROR;
00074   }
00075 
00076   if ( withnodename )
00077     if ( (_ret =  MEDmeshEntityNameWr(fid,
00078                                       meshname,
00079                                       numdt,
00080                                       numit,
00081                                       _entitype,
00082                                       _geotype,
00083                                       nentity,
00084                                       nodename) ) < 0 ) {
00085       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNameWr");
00086       goto ERROR;
00087     }
00088 
00089   if ( withnodenumber )
00090     if ( (_ret =  MEDmeshEntityNumberWr(fid,
00091                                         meshname,
00092                                         numdt,
00093                                         numit,
00094                                         _entitype,
00095                                         _geotype,
00096                                         nentity,
00097                                         nodenumber) ) < 0 ) {
00098       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityNumberWr");
00099       goto ERROR;
00100     }
00101 
00102   if (withfamnumber)
00103     if ( (_ret =  MEDmeshEntityFamilyNumberWr(fid,
00104                                               meshname,
00105                                               numdt,
00106                                               numit,
00107                                               _entitype,
00108                                               _geotype,
00109                                               nentity,
00110                                               famnumber) ) < 0 ) {
00111       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityFamilyNumberWr");
00112       goto ERROR;
00113     }
00114 
00115   _ret = 0;
00116  ERROR:
00117   return _ret;
00118 }