GRINS-0.6.0
Functions
3d_low_mach_jacobians.C File Reference
#include "grins_config.h"
#include <iostream>
#include "grins/simulation.h"
#include "grins/simulation_builder.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 122 of file 3d_low_mach_jacobians.C.

Referenced by main().

124 {
125  libMesh::Real value = 0.0;
126 
127  if( unknown_name == "T" )
128  value = params.get<libMesh::Real>("T_init");
129 
130  else if( unknown_name == "p0" )
131  value = params.get<libMesh::Real>("p0_init");
132 
133  else
134  value = 0.0;
135 
136  return value;
137 }
int main ( int  argc,
char *  argv[] 
)

Definition at line 46 of file 3d_low_mach_jacobians.C.

References initial_values().

47 {
48 #ifdef GRINS_USE_GRVY_TIMERS
49  GRVY::GRVY_Timer_Class grvy_timer;
50  grvy_timer.Init("GRINS Timer");
51 #endif
52 
53  // Check command line count.
54  if( argc < 2 )
55  {
56  // TODO: Need more consistent error handling.
57  std::cerr << "Error: Must specify libMesh input file." << std::endl;
58  exit(1); // TODO: something more sophisticated for parallel runs?
59  }
60 
61  // libMesh input file should be first argument
62  std::string libMesh_input_filename = argv[1];
63 
64  // Create our GetPot object.
65  GetPot libMesh_inputfile( libMesh_input_filename );
66 
67 #ifdef GRINS_USE_GRVY_TIMERS
68  grvy_timer.BeginTimer("Initialize Solver");
69 #endif
70 
71  // Initialize libMesh library.
72  libMesh::LibMeshInit libmesh_init(argc, argv);
73 
74  GRINS::SimulationBuilder sim_builder;
75 
76  GRINS::Simulation grins( libMesh_inputfile,
77  sim_builder,
78  libmesh_init.comm() );
79 
80  //FIXME: We need to move this to within the Simulation object somehow...
81  std::string restart_file = libMesh_inputfile( "restart-options/restart_file", "none" );
82 
83  if( restart_file == "none" )
84  {
85  // Asssign initial temperature value
86  std::string system_name = libMesh_inputfile( "screen-options/system_name", "GRINS" );
87  std::tr1::shared_ptr<libMesh::EquationSystems> es = grins.get_equation_system();
88  const libMesh::System& system = es->get_system(system_name);
89 
90  libMesh::Parameters &params = es->parameters;
91  libMesh::Real T_init = libMesh_inputfile("Physics/LowMachNavierStokes/T0", 0.0);
92  libMesh::Real p0_init = libMesh_inputfile("Physics/LowMachNavierStokes/p0", 0.0);
93 
94  libMesh::Real& dummy_T = params.set<libMesh::Real>("T_init");
95  dummy_T = T_init;
96 
97  libMesh::Real& dummy_p0 = params.set<libMesh::Real>("p0_init");
98  dummy_p0 = p0_init;
99 
100  system.project_solution( initial_values, NULL, params );
101  }
102 
103 #ifdef GRINS_USE_GRVY_TIMERS
104  grvy_timer.EndTimer("Initialize Solver");
105 
106  // Attach GRVY timer to solver
107  grins.attach_grvy_timer( &grvy_timer );
108 #endif
109 
110  grins.run();
111 
112 #ifdef GRINS_USE_GRVY_TIMERS
113  grvy_timer.Finalize();
114 
115  if( Parallel::Communicator_World.rank() == 0 ) grvy_timer.Summarize();
116 #endif
117 
118  return 0;
119 }
libMesh::Real initial_values(const libMesh::Point &p, const libMesh::Parameters &params, const std::string &system_name, const std::string &unknown_name)

Generated on Mon Jun 22 2015 21:32:21 for GRINS-0.6.0 by  doxygen 1.8.9.1