diff options
Diffstat (limited to 'src/AMRHierLib/PrintAMRHier.cc')
-rw-r--r-- | src/AMRHierLib/PrintAMRHier.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/AMRHierLib/PrintAMRHier.cc b/src/AMRHierLib/PrintAMRHier.cc new file mode 100644 index 0000000..7201d05 --- /dev/null +++ b/src/AMRHierLib/PrintAMRHier.cc @@ -0,0 +1,24 @@ +#include <iostream> +#include "AMRHierarchy.hh" +#include "AMRLevel.hh" +#include "AMRGrid.hh" + +int main(int argc, char *argv[]) +{ + AMRHierarchy theAMRHier; + + if (argc!=2) { + std::cerr << "Usage: " << argv[0] << " <amrHierFile>" << std::endl; + return 27; + } + + if (!theAMRHier.readIEEEFile(argv[1])) { + std::cerr << "Could not read AMR file " << argv[1] << std::endl; + } + + for (int levelNo=0; levelNo<theAMRHier.numLevels(); ++levelNo) { + std::cout << "********** Level " << levelNo << " of " << theAMRHier.numLevels() << "**********" << std::endl; + for (AMRGrid *currGridPtr = theAMRHier.getLevel(levelNo)->getFirstGrid(); currGridPtr != 0; currGridPtr = currGridPtr->getNextGridInLevel()) + currGridPtr->printInfo(std::cout); + } +} |