MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / main

Function main

Tools/Postprocessing/C_Src/WritePlotfileToASCII.cpp:30–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int
31main (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 {

Callers

nothing calls this directly

Calls 15

AbortFunction · 0.85
PrintClass · 0.85
ReadFunction · 0.85
toIntVectMethod · 0.80
PrintUsageFunction · 0.70
InitializeFunction · 0.50
queryMethod · 0.45
emptyMethod · 0.45
nCompMethod · 0.45
ixTypeMethod · 0.45
boxArrayMethod · 0.45
numPtsMethod · 0.45

Tested by

no test coverage detected