GRINS-0.6.0
ufo_unit.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include "grins_config.h"
26 
27 #include <iostream>
28 
29 // GRINS
31 #include "grins/simulation.h"
32 
33 // libMesh
34 #include "libmesh/parallel.h"
35 
36 int main(int argc, char* argv[])
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 }
int main(int argc, char *argv[])
Definition: ufo_unit.C:36

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