25 #include "grins_config.h"
33 #include "libmesh/parallel.h"
34 #include "libmesh/exact_solution.h"
38 initial_values(
const libMesh::Point& p,
const libMesh::Parameters ¶ms,
39 const std::string& system_name,
const std::string& unknown_name );
43 int main(
int argc,
char* argv[])
49 std::cerr <<
"Error: Must specify libMesh input file and exact solution file." << std::endl;
57 return_flag =
run( argv, grins );
70 GRINS::SharedPtr<libMesh::EquationSystems>
76 libMesh::ExactSolution exact_sol(*es);
78 libMesh::EquationSystems es_ref( es->get_mesh() );
81 std::string solution_file = std::string(argv[2]);
82 es_ref.read( solution_file );
84 exact_sol.attach_reference_solution( &es_ref );
87 exact_sol.compute_error(
"StretchedElasticSheet",
"u");
88 exact_sol.compute_error(
"StretchedElasticSheet",
"v");
89 exact_sol.compute_error(
"StretchedElasticSheet",
"w");
91 double u_l2error = exact_sol.l2_error(
"StretchedElasticSheet",
"u");
92 double u_h1error = exact_sol.h1_error(
"StretchedElasticSheet",
"u");
94 double v_l2error = exact_sol.l2_error(
"StretchedElasticSheet",
"v");
95 double v_h1error = exact_sol.h1_error(
"StretchedElasticSheet",
"v");
97 double w_l2error = exact_sol.l2_error(
"StretchedElasticSheet",
"w");
98 double w_h1error = exact_sol.h1_error(
"StretchedElasticSheet",
"w");
104 if( u_l2error > tol || u_h1error > tol ||
105 v_l2error > tol || v_h1error > tol ||
106 w_l2error > tol || w_h1error > tol )
110 std::cout <<
"Tolerance exceeded for thermally driven flow test." << std::endl
111 <<
"tolerance = " << tol << std::endl
112 <<
"u l2 error = " << u_l2error << std::endl
113 <<
"u h1 error = " << u_h1error << std::endl
114 <<
"v l2 error = " << v_l2error << std::endl
115 <<
"v h1 error = " << v_h1error << std::endl
116 <<
"w l2 error = " << w_l2error << std::endl
117 <<
"w h1 error = " << w_h1error << std::endl;
int main(int argc, char *argv[])
void init()
Initialize the Simulation objects.
SharedPtr< libMesh::EquationSystems > get_equation_system()
libMesh::Real initial_values(const libMesh::Point &p, const libMesh::Parameters ¶ms, const std::string &system_name, const std::string &unknown_name)
int run(char *argv[], GRINS::Runner &grins)
Class to encapsulate initializing and running GRINS Simulation.
void run()
Runs the simulation that was setup at construction time.
Simulation & get_simulation()