#include "AMRData.h"
Include dependency graph for AMR-HDF5.h:
Go to the source code of this file.
Client-side functions | |
void | AMR_OpenHDF5 (char *filename, int MPI_Communicator, int m, int *hdf5) |
void | AMR_CloseHDF5 (int hdf5) |
void | AMR_WriteData (int hdf5, int numLevels, int *levelData, int ncomp, char **compNames, int *refineFactor, double *spacing, double time, double dt, CONST int *domain_lo, CONST int *domain_hi) |
void | AMR_WriteStringAttribute (int hdf5, char *name, char *value) |
void | AMR_ReadMetaData (int hdf5, int *numLevels, int *ncomp, int *ndim, double *spacingCoarse, int *domain_lo_valid, int *domain_hi_valid, double *time, double *dtCoarse) |
void | AMR_ReadCompName (int hdf5, char **names) |
void | AMR_ReadNumBoxes (int hdf5, int level, int *ntotalBoxes) |
void | AMR_ReadBoxes (int hdf5, int level, int *loValid, int *hiValid, int *loRange, int *hiRange) |
void | AMR_ReadRefFactors (int hdf5, int *refs) |
void | AMR_ReadLevel (int hdf5, int level, int levelDatahandle, int compBegin, int ncomp) |
void | AMR_ReadPatch (int hdf5, int level, int patch, int comp, void *d_ptr) |
void | AMR_ReadStringAttribute (int hdf5, char *name, char **value) |
Fortran binding for AMR-HDF5 | |
void | amropenhdf5_ (char *filename, long int length, int *MPI_Communicator, int *m, int *hdf5) |
void | amrclosehdf5_ (int *hdf5) |
void | amrwritedata_ (int *hdf5, int *numLevels, int *levelData, int *ncomp, int *refineFactor, double *spacing, double *time, double *dt, int *domain_lo, int *domain_hi) |
void | amrwritecompname_ (int *hdf5, int *compIndex, char *compname, long int length) |
void | amrreadmetadata_ (int *hdf5, int *numLevels, int *ncomp, int *ndim, double *spacingCoarse, int *domain_lo_valid, int *domain_hi_valid, double *time, double *dtCoarse) |
void | amrreadcompname_ (int *hdf5, int *compIndex, char *names, long int length) |
void | amrreadnumboxes_ (int *hdf5, int *level, int *ntotalBoxes) |
void | amrreadboxes_ (int *hdf5, int *level, int *loValid, int *hiValid, int *loRange, int *hiRange) |
void | amrreadreffactors_ (int *hdf5, int *refs) |
void | amrreadlevel_ (int *hdf5, int *level, int *levelDatahandle, int *compBegin, int *ncomp) |
void | amrreadpatch_ (int *hdf5, int *level, int *patch, int *comp, void *d_ptr) |
|
Close an HDF5 file. this integer opaque handle is will now cause the code to abort if used in other AMR_ functions. |
|
Opens an AMR-HDF5 file
|
|
Caller allocates space to store arrays of data for the region definitions of all the patches and then makes a call to read them. Every processor that makes this call will receive a full list of box definitions. the int arrays are assumed to be allocated to hold ntotalBoxes of integers. |
|
Now that the caller know how many vars per cell exist, he can allocate an array of pointers to char (array length = ncomp, as obtained above). The caller then sends them in, where the callee mallocs memory to each element of the array and writes in the variable names. The caller frees the memory.
|
|
At this point the caller has enough info to create Levels as per the methods in AMRData.h. Once these empty levels have been created, they can be filled up from the file. This method is called in a loop, looping over all the levels
|
|
The following methods are to be used when reading in a file for the first time. The caller has no idea how many levels exist and neither does he have the LevelDatas created. This it time t = 0. In these calls, all the meomy is allocated by the caller and the callee only fills them up. The caller deletes the memory.
|
|
The caller now knows the number of levels but needs to know the number of patches on each level. This method is called in a loop over numLevels, obtained above.
|
|
This method provides the ability to read data in a controled manner. This is useful for navigating a large data file on a computer that cannot read the entire data set.
|
|
Now that the caller knows the total number of level, he allocates an int array, numLevels long into which the refinement factor for each level will be written.
|
|
|
|
Write out a set of levels to file. This assumes that you have gone through the functions in AMRData.h, creates a number of Levels, have their handles and have filled them with data. Now it's time to write them to file
|
|
|
|
|
|
amropenhdf5_ takes is invoked in Fortran as : INTEGER communicator, m, filehandle CHARACTER(LEN=12):: filename = 'output.hdf5' filename(12) = CHAR(0) CALL amropenhdf5(filename, communicator, m, filehandle)This works for some fortran compilers. Fortran compilers automatically add the 'length' argument for you. I'm not an expert in passing strings between fortran and C. the c implmentation is expecting a null terminated string. If somone wants to help debug the fortran binding, that would be nice. This applies for the component name writing routines as well |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fortran wrapper for AMR_WriteData, except it does not pass in an array of strings for component names. passing strings from Fortan and C is tricky. Other functions handle the work of IO for fortran component names
|