| 28 | } |
| 29 | |
| 30 | int |
| 31 | main (int argc, |
| 32 | char* argv[]) |
| 33 | { |
| 34 | amrex::Initialize(argc,argv); |
| 35 | |
| 36 | if (argc == 1) { |
| 37 | PrintUsage(argv[0]); |
| 38 | } |
| 39 | |
| 40 | // plotfile name |
| 41 | std::string iFile; |
| 42 | |
| 43 | // read in parameters from inputs file |
| 44 | ParmParse pp; |
| 45 | |
| 46 | // read in plotfile name |
| 47 | pp.query("infile", iFile); |
| 48 | if (iFile.empty()) |
| 49 | amrex::Abort("You must specify `infile'"); |
| 50 | |
| 51 | int comp_in_line = 0; |
| 52 | pp.query("comp_in_line", comp_in_line); |
| 53 | |
| 54 | // for the Header |
| 55 | std::string Header = iFile; |
| 56 | Header += "/Header"; |
| 57 | |
| 58 | // open header |
| 59 | ifstream x; |
| 60 | x.open(Header.c_str(), ios::in); |
| 61 | |
| 62 | // read in first line of header |
| 63 | string str; |
| 64 | x >> str; |
| 65 | |
| 66 | // read in number of components from header |
| 67 | int ncomp; |
| 68 | x >> ncomp; |
| 69 | |
| 70 | // read in variable names from header |
| 71 | for (int n=0; n<ncomp; ++n) { |
| 72 | x >> str; |
| 73 | } |
| 74 | |
| 75 | // read in dimensionality from header |
| 76 | int dim; |
| 77 | x >> dim; |
| 78 | |
| 79 | if (dim != AMREX_SPACEDIM) { |
| 80 | Print() << "\nError: you are using a " << AMREX_SPACEDIM << "D build to open a " |
| 81 | << dim << "D plotfile\n\n"; |
| 82 | Abort(); |
| 83 | } |
| 84 | |
| 85 | int lev = 0; |
| 86 | |
| 87 | do { |
nothing calls this directly
no test coverage detected