78 #ifdef GRINS_USE_GRVY_TIMERS
79 GRVY::GRVY_Timer_Class grvy_timer;
80 grvy_timer.Init(
"GRINS Timer");
87 std::cerr <<
"Error: Must specify libMesh input file and solution file." << std::endl;
92 std::string libMesh_input_filename = argv[1];
95 GetPot libMesh_inputfile( libMesh_input_filename );
97 #ifdef GRINS_USE_GRVY_TIMERS
98 grvy_timer.BeginTimer(
"Initialize Solver");
102 libMesh::LibMeshInit libmesh_init(argc, argv);
110 libmesh_init.comm() );
112 #ifdef GRINS_USE_GRVY_TIMERS
113 grvy_timer.EndTimer(
"Initialize Solver");
116 grins.attach_grvy_timer( &grvy_timer );
123 std::tr1::shared_ptr<libMesh::EquationSystems> es = grins.get_equation_system();
128 libMesh::ExactSolution exact_sol(*es);
130 libMesh::EquationSystems es_ref( es->get_mesh() );
133 std::string solution_file = std::string(argv[2]);
134 es_ref.read( solution_file );
136 exact_sol.attach_reference_solution( &es_ref );
139 exact_sol.compute_error(
"GRINS",
"u");
140 exact_sol.compute_error(
"GRINS",
"v");
142 if( (es->get_mesh()).mesh_dimension() == 3 )
143 exact_sol.compute_error(
"GRINS",
"w");
145 exact_sol.compute_error(
"GRINS",
"p");
146 exact_sol.compute_error(
"GRINS",
"T");
148 double u_l2error = exact_sol.l2_error(
"GRINS",
"u");
149 double u_h1error = exact_sol.h1_error(
"GRINS",
"u");
151 double v_l2error = exact_sol.l2_error(
"GRINS",
"v");
152 double v_h1error = exact_sol.h1_error(
"GRINS",
"v");
154 double p_l2error = exact_sol.l2_error(
"GRINS",
"p");
155 double p_h1error = exact_sol.h1_error(
"GRINS",
"p");
157 double T_l2error = exact_sol.l2_error(
"GRINS",
"T");
158 double T_h1error = exact_sol.h1_error(
"GRINS",
"T");
160 double w_l2error = 0.0,
163 if( (es->get_mesh()).mesh_dimension() == 3 )
165 w_l2error = exact_sol.l2_error(
"GRINS",
"w");
166 w_h1error = exact_sol.h1_error(
"GRINS",
"w");
175 if( u_l2error > tol || u_h1error > tol ||
176 v_l2error > tol || v_h1error > tol ||
177 w_l2error > tol || w_h1error > tol ||
178 p_l2error > tol || p_h1error > tol ||
179 T_l2error > tol || T_h1error > tol )
183 std::cout <<
"Tolerance exceeded for thermally driven flow test." << std::endl
184 <<
"tolerance = " << tol << std::endl
185 <<
"u l2 error = " << u_l2error << std::endl
186 <<
"u h1 error = " << u_h1error << std::endl
187 <<
"v l2 error = " << v_l2error << std::endl
188 <<
"v h1 error = " << v_h1error << std::endl
189 <<
"w l2 error = " << w_l2error << std::endl
190 <<
"w h1 error = " << w_h1error << std::endl
191 <<
"p l2 error = " << p_l2error << std::endl
192 <<
"p h1 error = " << p_h1error << std::endl
193 <<
"T l2 error = " << T_l2error << std::endl
194 <<
"T h1 error = " << T_h1error << std::endl;
void attach_bc_factory(std::tr1::shared_ptr< BoundaryConditionsFactory > bc_factory)