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

Go to the source code of this file.

Functions

libMesh::Real initial_values (const libMesh::Point &p, const libMesh::Parameters &params, const std::string &system_name, const std::string &unknown_name)
 
int main (int argc, char *argv[])
 

Function Documentation

libMesh::Real initial_values ( const libMesh::Point &  p,
const libMesh::Parameters &  params,
const std::string &  system_name,
const std::string &  unknown_name 
)

Definition at line 77 of file 3d_low_mach_jacobians.C.

Referenced by main().

79 {
80  libMesh::Real value = 0.0;
81 
82  if( unknown_name == "T" )
83  value = params.get<libMesh::Real>("T_init");
84 
85  else if( unknown_name == "p0" )
86  value = params.get<libMesh::Real>("p0_init");
87 
88  else
89  value = 0.0;
90 
91  return value;
92 }
int main ( int  argc,
char *  argv[] 
)

Definition at line 40 of file 3d_low_mach_jacobians.C.

References GRINS::Simulation::get_equation_system(), GRINS::Runner::get_input_file(), GRINS::Runner::get_simulation(), GRINS::Runner::init(), initial_values(), and GRINS::Runner::run().

41 {
42  GRINS::Runner grins(argc,argv);
43  grins.init();
44 
45  const GetPot & inputfile = grins.get_input_file();
46 
47  //FIXME: We need to move this to within the Simulation object somehow...
48  std::string restart_file = inputfile( "restart-options/restart_file", "none" );
49 
50  if( restart_file == "none" )
51  {
52  GRINS::Simulation & sim = grins.get_simulation();
53  // Asssign initial temperature value
54  std::string system_name = inputfile( "screen-options/system_name", "GRINS" );
55  GRINS::SharedPtr<libMesh::EquationSystems> es = sim.get_equation_system();
56  const libMesh::System& system = es->get_system(system_name);
57 
58  libMesh::Parameters &params = es->parameters;
59  libMesh::Real T_init = inputfile("Materials/TestMaterial/ReferenceTemperature/value", 0.0);
60  libMesh::Real p0_init = inputfile("Materials/TestMaterial/ThermodynamicPressure/value", 0.0);
61 
62  libMesh::Real& dummy_T = params.set<libMesh::Real>("T_init");
63  dummy_T = T_init;
64 
65  libMesh::Real& dummy_p0 = params.set<libMesh::Real>("p0_init");
66  dummy_p0 = p0_init;
67 
68  system.project_solution( initial_values, NULL, params );
69  }
70 
71  grins.run();
72 
73  return 0;
74 }
SharedPtr< libMesh::EquationSystems > get_equation_system()
Definition: simulation.C:393
libMesh::Real initial_values(const libMesh::Point &p, const libMesh::Parameters &params, const std::string &system_name, const std::string &unknown_name)
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