25 #include "grins_config.h" 
   39 #include "libmesh/parallel.h" 
   40 #include "libmesh/exact_solution.h" 
   44 initial_values( 
const libMesh::Point& p, 
const libMesh::Parameters ¶ms, 
 
   45                 const std::string& system_name, 
const std::string& unknown_name );
 
   47 int run( 
int argc, 
char* argv[], 
const GetPot& input );
 
   49 int main(
int argc, 
char* argv[])
 
   51 #ifdef USE_GRVY_TIMERS 
   52   GRVY::GRVY_Timer_Class grvy_timer;
 
   53   grvy_timer.Init(
"GRINS Timer");
 
   60       std::cerr << 
"Error: Must specify libMesh input file and exact solution file." << std::endl;
 
   65   std::string libMesh_input_filename = argv[1];
 
   68   GetPot libMesh_inputfile( libMesh_input_filename );
 
   72   return_flag = 
run( argc, argv, libMesh_inputfile );
 
   77 int run( 
int argc, 
char* argv[], 
const GetPot& input )
 
   79 #ifdef USE_GRVY_TIMERS 
   80   grvy_timer.BeginTimer(
"Initialize Solver");
 
   84   libMesh::LibMeshInit libmesh_init(argc, argv);
 
   90                            libmesh_init.comm() );
 
   95   GRINS::SharedPtr<libMesh::EquationSystems>
 
   96     es = grins.get_equation_system();
 
  101   libMesh::ExactSolution exact_sol(*es);
 
  103   libMesh::EquationSystems es_ref( es->get_mesh() );
 
  106   std::string solution_file = std::string(argv[2]);
 
  107   es_ref.read( solution_file );
 
  109   exact_sol.attach_reference_solution( &es_ref );
 
  112   exact_sol.compute_error(
"StretchedElasticSheet", 
"u");
 
  113   exact_sol.compute_error(
"StretchedElasticSheet", 
"v");
 
  114   exact_sol.compute_error(
"StretchedElasticSheet", 
"w");
 
  116   double u_l2error = exact_sol.l2_error(
"StretchedElasticSheet", 
"u");
 
  117   double u_h1error = exact_sol.h1_error(
"StretchedElasticSheet", 
"u");
 
  119   double v_l2error = exact_sol.l2_error(
"StretchedElasticSheet", 
"v");
 
  120   double v_h1error = exact_sol.h1_error(
"StretchedElasticSheet", 
"v");
 
  122   double w_l2error = exact_sol.l2_error(
"StretchedElasticSheet", 
"w");
 
  123   double w_h1error = exact_sol.h1_error(
"StretchedElasticSheet", 
"w");
 
  129   if( u_l2error > tol   || u_h1error > tol   ||
 
  130       v_l2error > tol   || v_h1error > tol   ||
 
  131       w_l2error > tol   || w_h1error > tol     )
 
  135       std::cout << 
"Tolerance exceeded for thermally driven flow test." << std::endl
 
  136                 << 
"tolerance     = " << tol << std::endl
 
  137                 << 
"u l2 error    = " << u_l2error << std::endl
 
  138                 << 
"u h1 error    = " << u_h1error << std::endl
 
  139                 << 
"v l2 error    = " << v_l2error << std::endl
 
  140                 << 
"v h1 error    = " << v_h1error << std::endl
 
  141                 << 
"w l2 error    = " << w_l2error << std::endl
 
  142                 << 
"w h1 error    = " << w_h1error << std::endl;
 
int main(int argc, char *argv[])
 
int run(int argc, char *argv[], const GetPot &input)
 
libMesh::Real initial_values(const libMesh::Point &p, const libMesh::Parameters ¶ms, const std::string &system_name, const std::string &unknown_name)