| 58 | } |
| 59 | |
| 60 | int |
| 61 | main (int argc, |
| 62 | char* argv[]) |
| 63 | { |
| 64 | Initialize(argc,argv); |
| 65 | { |
| 66 | if (argc < 2) |
| 67 | print_usage(argc,argv); |
| 68 | |
| 69 | ParmParse pp; |
| 70 | |
| 71 | const std::string farg = amrex::get_command_argument(1); |
| 72 | if (farg == "-h" || farg == "--help") |
| 73 | print_usage(argc,argv); |
| 74 | |
| 75 | if (pp.contains("verbose")) |
| 76 | AmrData::SetVerbose(true); |
| 77 | |
| 78 | std::string ifile; |
| 79 | pp.get("ifile",ifile); |
| 80 | |
| 81 | std::string ofile; |
| 82 | pp.get("ofile",ofile); |
| 83 | |
| 84 | std::cout << "Reading " << ifile << " ... " << std::flush; |
| 85 | |
| 86 | DataServices::SetBatchMode(); |
| 87 | Amrvis::FileType fileType(Amrvis::NEWPLT); |
| 88 | DataServices dataServices(ifile, fileType); |
| 89 | std::cout << "done" << std::endl; |
| 90 | |
| 91 | if (!dataServices.AmrDataOk()) |
| 92 | DataServices::Dispatch(DataServices::ExitRequest, NULL); |
| 93 | AmrData& amrData = dataServices.AmrDataRef(); |
| 94 | |
| 95 | std::string TurbDir = ofile; |
| 96 | |
| 97 | if (ParallelDescriptor::IOProcessor()) |
| 98 | if (!UtilCreateDirectory(TurbDir, 0755)) |
| 99 | CreateDirectoryFailed(TurbDir); |
| 100 | |
| 101 | std::string Hdr = TurbDir; Hdr += "/HDR"; |
| 102 | std::string Dat = TurbDir; Dat += "/DAT"; |
| 103 | |
| 104 | std::ofstream ifsd, ifsh; |
| 105 | |
| 106 | ifsh.open(Hdr.c_str(), std::ios::out|std::ios::trunc); |
| 107 | if (!ifsh.good()) |
| 108 | FileOpenFailed(Hdr); |
| 109 | |
| 110 | ifsd.open(Dat.c_str(), std::ios::out|std::ios::trunc); |
| 111 | if (!ifsd.good()) |
| 112 | FileOpenFailed(Dat); |
| 113 | |
| 114 | const int dir = BL_SPACEDIM - 1; |
| 115 | const int finestLevel = amrData.FinestLevel(); |
| 116 | const Box domain = amrData.ProbDomain()[finestLevel]; |
| 117 | Box xdm = domain; |
nothing calls this directly
no test coverage detected