AMR-UCD Reader

Most visualization systems have no provisions for handling AMR data. One solution is to resample all of the grids into a single uniform sized grid. However for even a 7 level hierarchy, the unigrid becomes far too large to be manageable and still retain the fidelity of the original data. A second solution is use unigrid visualization algorithms on each grid in the hierarchy and then superimpose them on one-another. In this case geometries from the coarser resolution datasets occlude the finer-resolution geometry. An alternative solution is to convert the data into hexahedral cells with the overlaps between parent levels and the children are eliminated. This provides multi-resolution fidelity which matches the nature of the original data but allows it to be visualized using standard off-the-shelf visualizaton tools.

The AmrUcdFileReader inherits directly from the AmrFileReader and all methods from its base class are public. They will be listed again here for convenience. The only method (aside from the constructor/destructor) that is contributed by this class is the getUcd() method.


The API


C++ Interface

Constructors/Destructors
AmrUcdFileReader::AmrUcdFileReader(IObase &filehandle) constructor
The filehandle is an already open IEEEIO or HDFIO file. This initializes the reader and attaches it to that datafile.
AmrUcdFileReader::~AmrUcdFileReader() destructor
This flushes all of the necessary file buffers. The filehandle that the reader was bound to must be closed separately though.
Queries about File Contents
int AmrUcdFileReader::nLevels()
Returns the number of levels in the AMR hierarchy. This is the deepest the hierarchy gets in this particular datafile as opposed to the number of levels present at this time in the evolution (this distinction is important for adaptive depth schemes where the number of levels will change depending on the demands of the solver).
AmrUcdFileReader::getTimeRange(int &mintime,int &maxtime)
Gets the range of integer timesteps stored in the file. The nonzero mintime exists to support schemes where the evolution is broken up among several files.
Filters
The filter methods listed below select grids based on the criteria of time and level number. Grids selected by the filter are referred to as active grids.

AmrUcdFileReader::setTime(int time)
Sets the current timestep to select the data hierarchy for. The timestep is defined with respect to the rate at which grids change at the deepest level of the AMR hierarchy stored in the file. Selecting a particular timestep selects a snapshot of the hieararchy at a particular time in the evolution.
AmrUcdFileReader::hideLevel(int level)
By default all levels are visible and are read in when the getGrids() method is called. You can hide individual levels using this method. This is useful when loading the entire hierarchy is either too confusing, too slow, or too large for the workstation to handle.
AmrUcdFileReader::showLevel(int level)
Shows a level that has otherwise been hidden.
AmrUcdFileReader::showAllLevels()
A convenience method for making all of the levels visible.
Getting the UCD Data
int AmrUcdFileReader::getUcd(FlexArray<AmrNode*> &nodes, FlexArray<int> &cells)
Gets all currently active grids and converts them into a finite element form composed of hexahedral cells. The node list contains the coordinates of the vertices of the cells and the cell list contains the connectivity of the hexahedral cells (indexed into the nodes list where the first element is an index of 0 and the last is NumNodes-1).
Utility and Debugging Methods
AmrUcdFileReader::setDataLoadingOff()
This causes the getGrids() methods to read in the informational part of the AmrGrid datastructures, but not load any data. This is useful for just aquiring bounding box information or estimating the memory/computational requirements for loading the entire hierarchy.
AmrUcdFileReader::setDataLoadingOn()
This causes the getGrids() methods to read both the informational and data part of the AmrGrid datastructures. This is the default state for this API.
printGridInfo()
Prints information about all grids in file to STDERR. Used only for debugging.
printActiveGrids()
Prints information about all active grids to STDERR. Used only for debugging.
int debug This is a public variable that can be set to a nonzero value in order to print additional debugging information for each method call. This printing is turned off when it is set to zero.

C Interface

Not ready yet.

F77/F90 Interface

Not ready yet.
Last modified: Thu Feb 4 21:31:06 CST 1999