PlasCom2  1.0
XPACC Multi-physics simluation application
pc2compare.C
Go to the documentation of this file.
1 #include "PC2Util.H"
2 
3 int
4 main(int argc,char *argv[])
5 {
6  double errorTolerance = 1e-15;
7  if(argc == 1){
8  std::cout << "This utility compares the state data in two specified" << std::endl
9  << "PlasCom2 or PlasComCM HDF5 files. Cross-comparisons between" << std::endl
10  << "PlasCom2 and PlasComCM are supported. A plottable summary" << std::endl
11  << "of the comparison is generated on stdout. Return values are:" << std::endl
12  << " 0 : All tests passed." << std::endl
13  << " 1 : One or more tests failed." << std::endl
14  << " -1 : Tests not run due to some error or incompatibility." << std::endl
15  << std::endl << "Some limitations:" << std::endl
16  << "* Currently, only rho, rhoV, and rhoE fields are compared." << std::endl
17  << "* Comparisons on subsets of domains are not yet supported." << std::endl
18  << "* Only single grid datasets are supported (default to 1st grid)." << std::endl
19  << std::endl
20  << " Usage: " << std::endl
21  << argv[0] << " <red file> <blue file> [tolerance]" << std::endl
22  << std::endl
23  << "<red/blue file> := Required PlasCom2 or PlasComCM HDF5 files." << std::endl
24  << "tolerance := Optional error tolerance defaults to 1e-15." << std::endl;
25  return(-1);
26  }
27 
28  if(argc < 3){
29  std::cerr << argv[0]
30  << ":Error: Missing some required arguments. Invoke without arguments for usage summary."
31  << std::endl;
32  return(-1);
33  }
34 
35  if(argc > 3){
36  std::istringstream Istr(argv[3]);
37  Istr >> errorTolerance;
38  }
39 
40  return(plascom2::util::PC2Compare(argv[1],argv[2],errorTolerance,std::cout));
41 
42 }
int PC2Compare(const std::string &redFileName, const std::string &blueFileName, double errTolerance, std::ostream &outStream)
Read two HDF5 files and compare the state data therein.
Definition: PC2Util.C:30
int main(int argc, char *argv[])
Definition: pc2compare.C:4