GRINS-0.7.0
solver_factory.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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 // This class
26 #include "grins/solver_factory.h"
27 
28 // GRINS
29 #include "grins/solver_names.h"
30 #include "grins/solver_parsing.h"
35 
36 // libMesh
37 #include "libmesh/getpot.h"
38 
39 namespace GRINS
40 {
41  SharedPtr<Solver> SolverFactory::build(const GetPot& input)
42  {
43  std::string solver_type = SolverParsing::solver_type(input);
44 
45  SharedPtr<Solver> solver; // Effectively NULL
46 
47  if(solver_type == SolverNames::unsteady_solver() )
48  {
49  solver.reset( new UnsteadySolver(input) );
50  }
51  else if( solver_type == SolverNames::steady_solver() )
52  {
53  solver.reset( new SteadySolver(input) );
54  }
55  else if( solver_type == SolverNames::steady_mesh_adaptive_solver() )
56  {
57  solver.reset( new SteadyMeshAdaptiveSolver(input) );
58  }
59  else if( solver_type == SolverNames::unsteady_mesh_adaptive_solver() )
60  {
61  solver.reset( new UnsteadyMeshAdaptiveSolver(input) );
62  }
63  else
64  {
65  libmesh_error_msg("Invalid solver_type: "+solver_type);
66  }
67 
68  return solver;
69  }
70 
71 } // namespace GRINS
virtual SharedPtr< GRINS::Solver > build(const GetPot &input)
Builds GRINS::Solver object.
static std::string solver_type(const GetPot &input)
GRINS namespace.
static const std::string unsteady_solver()
Definition: solver_names.h:37
static const std::string steady_mesh_adaptive_solver()
Definition: solver_names.h:40
static const std::string unsteady_mesh_adaptive_solver()
Definition: solver_names.h:43
static const std::string steady_solver()
Definition: solver_names.h:34

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10