GRINS-0.6.0
Public Member Functions | List of all members
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 std::tr1::shared_ptr< 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 ( )

Definition at line 39 of file solver_factory.C.

40  {
41  return;
42  }
GRINS::SolverFactory::~SolverFactory ( )
virtual

Definition at line 44 of file solver_factory.C.

45  {
46  return;
47  }

Member Function Documentation

std::tr1::shared_ptr< 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 49 of file solver_factory.C.

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  }

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

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