GRINS-0.6.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-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 // This class
26 #include "grins/solver_factory.h"
27 
28 // GRINS
33 
34 // libMesh
35 #include "libmesh/getpot.h"
36 
37 namespace GRINS
38 {
40  {
41  return;
42  }
43 
45  {
46  return;
47  }
48 
49  std::tr1::shared_ptr<Solver> SolverFactory::build(const GetPot& input)
50  {
51  bool mesh_adaptive = input("MeshAdaptivity/mesh_adaptive", false );
52 
53  bool transient = input("unsteady-solver/transient", false );
54 
55  std::tr1::shared_ptr<Solver> solver; // Effectively NULL
56 
57  std::string solver_type = input("SolverOptions/solver_type", "DIE!");
58 
59  if( solver_type == std::string("displacement_continuation") )
60  {
61  solver.reset( new DisplacementContinuationSolver(input) );
62  }
63  else if(transient && !mesh_adaptive)
64  {
65  solver.reset( new UnsteadySolver(input) );
66  }
67  else if( !transient && !mesh_adaptive )
68  {
69  solver.reset( new SteadySolver(input) );
70  }
71  else if( !transient && mesh_adaptive )
72  {
73  solver.reset( new SteadyMeshAdaptiveSolver(input) );
74  }
75  else if( transient && mesh_adaptive )
76  {
77  libmesh_not_implemented();
78  }
79  else
80  {
81  std::cerr << "Invalid solver options!" << std::endl;
82  }
83 
84  return solver;
85  }
86 
87 } // namespace GRINS
GRINS namespace.
virtual std::tr1::shared_ptr< GRINS::Solver > build(const GetPot &input)
Builds GRINS::Solver object.

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