34 initial_values(
const libMesh::Point& p,
const libMesh::Parameters ¶ms,
35 const std::string& system_name,
const std::string& unknown_name );
37 int main(
int argc,
char* argv[])
42 libmesh_example_requires
43 (libMesh::default_solver_package() != libMesh::LASPACK_SOLVERS,
53 std::string restart_file = inputfile(
"restart-options/restart_file",
"none" );
55 if( restart_file ==
"none" )
58 std::string system_name = inputfile(
"screen-options/system_name",
"GRINS" );
60 const libMesh::System& system = es->get_system(system_name);
62 libMesh::Parameters ¶ms = es->parameters;
63 libMesh::Real T_init = inputfile(
"Materials/TestMaterial/ReferenceTemperature/value", 0.0);
64 libMesh::Real p0_init = inputfile(
"Materials/TestMaterial/ThermodynamicPressure/value", 0.0);
66 libMesh::Real& dummy_T = params.set<libMesh::Real>(
"T_init");
69 libMesh::Real& dummy_p0 = params.set<libMesh::Real>(
"p0_init");
86 const libMesh::Real exact_qoi = 4.8654229502012685;
88 const libMesh::Real tol = 1.0e-9;
92 libMesh::Real rel_error = std::fabs( (qoi-exact_qoi)/exact_qoi );
100 std::cerr << std::setprecision(16)
102 <<
"Error: QoI value mismatch." << std::endl
103 <<
"Computed qoi = " << qoi << std::endl
104 <<
"Exact qoi = " << exact_qoi << std::endl
105 <<
"Relative error = " << rel_error << std::endl;
113 const std::string& ,
const std::string& unknown_name )
115 libMesh::Real value = 0.0;
117 if( unknown_name ==
"T" )
118 value = params.get<libMesh::Real>(
"T_init");
120 else if( unknown_name ==
"p0" )
121 value = params.get<libMesh::Real>(
"p0_init");
void init()
Initialize the Simulation objects.
SharedPtr< libMesh::EquationSystems > get_equation_system()
int main(int argc, char *argv[])
const GetPot & get_input_file() const
libMesh::Number get_qoi_value(unsigned int qoi_index) const
libMesh::Real initial_values(const libMesh::Point &p, const libMesh::Parameters ¶ms, const std::string &system_name, const std::string &unknown_name)
Class to encapsulate initializing and running GRINS Simulation.
void run()
Runs the simulation that was setup at construction time.
Simulation & get_simulation()