This very simplistic API reads information about each grid stored in the AMR file into a list of AmrGrid datastructures without actually loading the associated grid data. The user can then use this information to tell the AMRreader which grids to load data for. The higher-level AmrFileReader provides its own filtering system for selecting grids by level and timestep. At this time only a C++ interface is released. C and F77 interfaces are available on request.
There are two different types of "get" requests that can be filled. When you "getGridInfo", only the informational portions of the AmrGrid datastructure are filled out. When you "getGridData" then both the grid information and associated data will be loaded into the AmrGrid datastructure.
data
member of the structure is left NULL. Returns
a pointer to the AmrGrid if it is successful and a NULL if it fails.
data
member of
the AmrGrid datastructure. If the data
member is NULL,
it will allocate storage for it (which the user is responsible
for freeing), otherwise it will load the data directly into
existing storage pointed to by that member. Returns pointer
to the AmrGrid if it is successful and returns NULL if it fails.
AmrGridReader::getGridData()
. Just a more
convenient name.
AmrGridReader::getGridData()
except that it
allocates a new AmrGrid datastructure to store the information
and data in. The user is responsible for freeing this
structure when they are done with it though.