-
Notifications
You must be signed in to change notification settings - Fork 332
/
fvarnames.cpp
38 lines (33 loc) · 919 Bytes
/
fvarnames.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <AMReX.H>
#include <AMReX_Print.H>
#include <AMReX_PlotFileUtil.H>
using namespace amrex;
void main_main()
{
const int narg = amrex::command_argument_count();
if (narg == 0) {
amrex::Print()
<< "\n"
<< " Usage:\n"
<< " fvarnames plotfile\n"
<< "\n"
<< " Description:\n"
<< " This program takes a single plotfile and dumps out the list of variables\n"
<< '\n';
return;
}
const auto& fname = amrex::get_command_argument(1);
PlotFileData plotfile(fname);
const auto& names = plotfile.varNames();
int n = 0;
for (auto const& name : names) {
amrex::Print() << std::setw(4) << n++ << " " << name << "\n";
}
}
int main (int argc, char* argv[])
{
amrex::SetVerbose(0);
amrex::Initialize(argc, argv, false);
main_main();
amrex::Finalize();
}