/
inflating_sheet.C
87 lines (70 loc) · 2.68 KB
/
inflating_sheet.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//-----------------------------------------------------------------------bl-
//--------------------------------------------------------------------------
//
// GRINS - General Reacting Incompressible Navier-Stokes
//
// Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
// Copyright (C) 2010-2013 The PECOS Development Team
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the Version 2.1 GNU Lesser General
// Public License as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc. 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301 USA
//
//-----------------------------------------------------------------------el-
#include "grins_config.h"
#include <iostream>
// GRINS
#include "grins/simulation_builder.h"
#include "grins/simulation.h"
// libMesh
#include "libmesh/parallel.h"
// InflatingSheet
#include "inflating_sheet_solver_factory.h"
int main(int argc, char* argv[])
{
// Check command line count.
if( argc < 2 )
{
// TODO: Need more consistent error handling.
std::cerr << "Error: Must specify libMesh input file." << std::endl;
exit(1); // TODO: something more sophisticated for parallel runs?
}
// libMesh input file should be first argument
std::string libMesh_input_filename = argv[1];
// Create our GetPot object.
GetPot libMesh_inputfile( libMesh_input_filename );
// GetPot doesn't throw an error for a nonexistent file?
{
std::ifstream i(libMesh_input_filename.c_str());
if (!i)
{
std::cerr << "Error: Could not read from libMesh input file "
<< libMesh_input_filename << std::endl;
exit(1);
}
}
// Initialize libMesh library.
libMesh::LibMeshInit libmesh_init(argc, argv);
libMesh::out << "Starting GRINS with command:\n";
for (int i=0; i != argc; ++i)
libMesh::out << argv[i] << ' ';
libMesh::out << std::endl;
GRINS::SimulationBuilder sim_builder;
std::tr1::shared_ptr<GRINS::InflatingSheetSolverFactory> sheet_factory( new GRINS::InflatingSheetSolverFactory );
sim_builder.attach_solver_factory( sheet_factory );
GRINS::Simulation grins( libMesh_inputfile,
sim_builder,
libmesh_init.comm() );
grins.run();
return 0;
}