34 #include "libmesh/exact_solution.h"
36 int main(
int argc,
char* argv[])
42 std::cerr <<
"Error: Must specify libMesh input file, regression file, and regression tolerance." << std::endl;
47 std::string libMesh_input_filename = argv[1];
50 GetPot libMesh_inputfile( libMesh_input_filename );
53 libMesh::LibMeshInit libmesh_init(argc, argv);
59 libmesh_init.comm() );
64 std::tr1::shared_ptr<libMesh::EquationSystems> es = grins.get_equation_system();
69 libMesh::ExactSolution exact_sol(*es);
71 libMesh::EquationSystems es_ref( es->get_mesh() );
74 std::string solution_file = std::string(argv[2]);
75 es_ref.read( solution_file );
77 exact_sol.attach_reference_solution( &es_ref );
79 std::string system_name = libMesh_inputfile(
"screen-options/system_name",
"GRINS" );
82 exact_sol.compute_error(system_name,
"u");
83 exact_sol.compute_error(system_name,
"v");
85 exact_sol.compute_error(system_name,
"p");
87 double u_l2error = exact_sol.l2_error(system_name,
"u");
88 double u_h1error = exact_sol.h1_error(system_name,
"u");
90 double v_l2error = exact_sol.l2_error(system_name,
"v");
91 double v_h1error = exact_sol.h1_error(system_name,
"v");
93 double p_l2error = exact_sol.l2_error(system_name,
"p");
94 double p_h1error = exact_sol.h1_error(system_name,
"p");
100 double tol = atof(argv[3]);
102 if( u_l2error > tol || u_h1error > tol ||
103 v_l2error > tol || v_h1error > tol ||
104 p_l2error > tol || p_h1error > tol )
108 std::cout <<
"Tolerance exceeded for thermally driven flow test." << std::endl
109 <<
"tolerance = " << tol << std::endl
110 <<
"u l2 error = " << u_l2error << std::endl
111 <<
"u h1 error = " << u_h1error << std::endl
112 <<
"v l2 error = " << v_l2error << std::endl
113 <<
"v h1 error = " << v_h1error << std::endl
114 <<
"p l2 error = " << p_l2error << std::endl
115 <<
"p h1 error = " << p_h1error << std::endl;
int main(int argc, char *argv[])