GRINS-0.8.0
Functions
vorticity_qoi.C File Reference
#include "grins_config.h"
#include <iostream>
#include "grins/runner.h"
#include "libmesh/exact_solution.h"
Include dependency graph for vorticity_qoi.C:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 36 of file vorticity_qoi.C.

References GRINS::Simulation::get_qoi_value(), GRINS::Runner::get_simulation(), GRINS::Runner::init(), and GRINS::Runner::run().

37 {
38  GRINS::Runner grins(argc,argv);
39  grins.init();
40 
41  // Solve
42  grins.run();
43 
44  GRINS::Simulation & sim = grins.get_simulation();
45 
46  libMesh::Number qoi = sim.get_qoi_value( 0 );
47 
48  int return_flag = 0;
49  const libMesh::Number exact_value = -0.5;
50  const libMesh::Number rel_error = std::fabs( (qoi - exact_value )/exact_value );
51  const libMesh::Number tol = 1.0e-11;
52  if( rel_error > tol )
53  {
54  std::cerr << "Computed voriticity QoI mismatch greater than tolerance." << std::endl
55  << "Computed value = " << qoi << std::endl
56  << "Exact value = " << exact_value << std::endl
57  << "Relative error = " << rel_error << std::endl
58  << "Tolerance = " << tol << std::endl;
59  return_flag = 1;
60  }
61 
62  return return_flag;
63 }
libMesh::Number get_qoi_value(unsigned int qoi_index) const
Definition: simulation.C:398
Class to encapsulate initializing and running GRINS Simulation.
Definition: runner.h:47

Generated on Tue Dec 19 2017 12:47:29 for GRINS-0.8.0 by  doxygen 1.8.9.1