45   GetPot command_line(argc,argv);
 
   47   if( !command_line.have_variable(
"input") )
 
   49       std::cerr << 
"ERROR: Must specify input file on command line with input=<file>." << std::endl;
 
   53   if( !command_line.have_variable(
"soln-data") )
 
   55       std::cerr << 
"ERROR: Must specify solution data on command line with soln-data=<file>." << std::endl;
 
   59   if( !command_line.have_variable(
"vars") )
 
   61       std::cerr << 
"ERROR: Must specify variables on command line with vars='var1 var2'" << std::endl;
 
   65   if( !command_line.have_variable(
"norms") )
 
   67       std::cerr << 
"ERROR: Must specify error norms on command line with norms='L2 H1'" << std::endl;
 
   71   if( !command_line.have_variable(
"tol") )
 
   73       std::cerr << 
"ERROR: Must specify test tolerance on command line with tol=<tol>" << std::endl;
 
   78   std::string libMesh_input_filename = command_line(
"input", 
"DIE!");
 
   81     std::ifstream i(libMesh_input_filename.c_str());
 
   84         std::cerr << 
"Error: Could not read from libMesh input file " 
   85                 << libMesh_input_filename << std::endl;
 
   91   GetPot libMesh_inputfile( libMesh_input_filename );
 
   94   libMesh::LibMeshInit libmesh_init(argc, argv);
 
  101                            libmesh_init.comm() );
 
  107   GRINS::SharedPtr<libMesh::EquationSystems> es = grins.get_equation_system();
 
  110   libMesh::ExactSolution exact_sol(*es);
 
  112   libMesh::EquationSystems es_ref( es->get_mesh() );
 
  115   std::string solution_file = command_line(
"soln-data", 
"DIE!");
 
  116   es_ref.read( solution_file );
 
  118   exact_sol.attach_reference_solution( &es_ref );
 
  121   unsigned int n_vars = command_line.vector_variable_size(
"vars");
 
  122   std::vector<std::string> vars(n_vars);
 
  123   for( 
unsigned int v = 0; v < n_vars; v++ )
 
  125       vars[v] = command_line(
"vars", 
"DIE!", v);
 
  129   unsigned int n_norms = command_line.vector_variable_size(
"norms");
 
  130   std::vector<std::string> norms(n_norms);
 
  131   for( 
unsigned int n = 0; n < n_norms; n++ )
 
  133       norms[n] = command_line(
"norms", 
"DIE!", n);
 
  134       if( norms[n] != std::string(
"L2") &&
 
  135           norms[n] != std::string(
"H1") )
 
  137           std::cerr << 
"ERROR: Invalid norm input " << norms[n] << std::endl
 
  138                     << 
"       Valid values are: L2" << std::endl
 
  139                     << 
"                         H1" << std::endl;
 
  143   const std::string& system_name = grins.get_multiphysics_system_name();
 
  146   for( 
unsigned int v = 0; v < n_vars; v++ )
 
  148       exact_sol.compute_error(system_name, vars[v]);
 
  153   double tol = command_line(
"tol", 1.0e-10);
 
  156   for( 
unsigned int v = 0; v < n_vars; v++ )
 
  158       for( 
unsigned int n = 0; n < n_norms; n++ )
 
  160           test_error_norm( exact_sol, system_name, vars[v], norms[n], tol, return_flag );
 
  165   unsigned int n_qoi_vals = command_line.vector_variable_size(
"qois");
 
  166   for( 
unsigned int n = 0; n < n_qoi_vals; n++ )
 
  169       std::cout << 
"==========================================================" << std::endl
 
  170                 << 
"Checking qoi " << n << 
" with tol " << tol << 
"...";
 
  172       libMesh::Number gold_qoi = command_line(
"qois", libMesh::Number(0), n);
 
  174       libMesh::Number computed_qoi =
 
  175         grins.get_multiphysics_system()->qoi[n];
 
  177       double error = computed_qoi - gold_qoi;
 
  179       if (std::abs(error) > tol)
 
  181           std::cerr << 
"Tolerance exceeded for generic regression test!" << std::endl
 
  182                     << 
"tolerance     = " << tol << std::endl
 
  183                     << 
"error         = " << error << std::endl
 
  184                     << 
"qoi index     = " << n << std::endl;
 
  188         std::cout << 
"PASSED!" << std::endl
 
  189                   << 
"==========================================================" << std::endl;
 
void test_error_norm(libMesh::ExactSolution &exact_sol, const std::string &system_name, const std::string &var, const std::string &norm, const double tol, int &return_flag)