GRINS-0.7.0
List of all members | Public Member Functions
GRINS::SolverFactory Class Reference

This object handles constructing the solver to be used. More...

#include <solver_factory.h>

Public Member Functions

 SolverFactory ()
 
virtual ~SolverFactory ()
 
virtual SharedPtr< GRINS::Solverbuild (const GetPot &input)
 Builds GRINS::Solver object. More...
 

Detailed Description

This object handles constructing the solver to be used.

To allow the user to easily extend the (limited) available solvers, the solver construction is handled in this object.

Definition at line 40 of file solver_factory.h.

Constructor & Destructor Documentation

GRINS::SolverFactory::SolverFactory ( )
inline

Definition at line 44 of file solver_factory.h.

44 {};
virtual GRINS::SolverFactory::~SolverFactory ( )
inlinevirtual

Definition at line 45 of file solver_factory.h.

45 {};

Member Function Documentation

SharedPtr< Solver > GRINS::SolverFactory::build ( const GetPot &  input)
virtual

Builds GRINS::Solver object.

Users should override this method to construct their own solvers.

Definition at line 41 of file solver_factory.C.

References GRINS::SolverParsing::solver_type(), GRINS::SolverNames::steady_mesh_adaptive_solver(), GRINS::SolverNames::steady_solver(), GRINS::SolverNames::unsteady_mesh_adaptive_solver(), and GRINS::SolverNames::unsteady_solver().

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  }
static std::string solver_type(const GetPot &input)
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

The documentation for this class was generated from the following files:

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