u17.c File Reference

#include <stdlib.h>
#include "nmd.h"

Include dependency graph for u17.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main ( int  argc,
char **  argv 
)

Test hdf5 dumping of scalar values

Definition at line 5 of file u17.c.

References NMDCreateObject(), NMDDestroyObject(), NMDGetValue(), NMDInt, NMDReal, and NMDSetValue().

00005                                {
00006   NMD_metadata nmd; NMDErrorCode ierr; 
00007   NMDTruth flg; int i; double r;
00008   PetscFunctionBegin;
00009   PetscInitialize(&argc,&argv,0,0);
00010 
00011   ierr = NMDCreateObject(&nmd); NMD_ERR_RETURN(ierr);
00012 
00013   i = 5;
00014   ierr = NMDSetValue(nmd,"cat1","cmp-i",NMDInt,&i); NMD_ERR_RETURN(ierr);
00015   i = 6;
00016   ierr = NMDSetValue(nmd,"cat1","cmp-ii",NMDInt,&i); NMD_ERR_RETURN(ierr);
00017 
00018   i = 27;
00019   ierr = NMDGetValue
00020     (nmd,"cat1","cmp-ii",NULL,(void*)&i,&flg); NMD_ERR_RETURN(ierr);
00021   if (!flg || i!=6) 
00022     NMD_ERR_REPORT("Trouble retrieving cmp-ii");
00023   ierr = NMDGetValue
00024     (nmd,"cat2","cmp-ii",NULL,(void*)&i,&flg); NMD_ERR_RETURN(ierr);
00025   if (flg)
00026     NMD_ERR_REPORT("This should not happen1");
00027 
00028   r = 4.17;
00029   ierr = NMDSetValue(nmd,"cat2","cmp-i",NMDReal,&r); NMD_ERR_RETURN(ierr);
00030 
00031   ierr = NMDObjectDumpToHDF5(nmd,"u17.h5"); NMD_ERR_RETURN(ierr);
00032   
00033   ierr = NMDDestroyObject(nmd); NMD_ERR_RETURN(ierr);
00034 
00035   PetscFinalize();
00036   PetscFunctionReturn(0);
00037 }

Here is the call graph for this function:


Generated on Sun Oct 4 03:59:31 2009 for NMD by  doxygen 1.5.9