GRINS-0.6.0
Functions
ufo_unit.C File Reference
#include "grins_config.h"
#include <iostream>
#include "grins/simulation_builder.h"
#include "grins/simulation.h"
#include "libmesh/parallel.h"
Include dependency graph for ufo_unit.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 ufo_unit.C.

37 {
38  // Check command line count.
39  if( argc < 2 )
40  {
41  // TODO: Need more consistent error handling.
42  std::cerr << "Error: Must specify libMesh input file." << std::endl;
43  exit(1); // TODO: something more sophisticated for parallel runs?
44  }
45 
46  // libMesh input file should be first argument
47  std::string libMesh_input_filename = argv[1];
48 
49  // Initialize libMesh library.
50  libMesh::LibMeshInit libmesh_init(argc, argv);
51 
52  // Create our GetPot object.
53  GetPot libMesh_inputfile( libMesh_input_filename );
54 
55  GetPot command_line(argc,argv);
56 
57  // GetPot doesn't throw an error for a nonexistent file?
58  {
59  std::ifstream i(libMesh_input_filename.c_str());
60  if (!i)
61  {
62  std::cerr << "Error: Could not read from libMesh input file "
63  << libMesh_input_filename << std::endl;
64  exit(1);
65  }
66  }
67 
68  GRINS::SimulationBuilder sim_builder;
69 
70  GRINS::Simulation grins( libMesh_inputfile,
71  command_line,
72  sim_builder,
73  libmesh_init.comm() );
74 
75  return 0;
76 }

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