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

#include <solver_parsing.h>

Public Member Functions

 SolverParsing ()
 
 ~SolverParsing ()
 

Static Public Member Functions

static std::string solver_type (const GetPot &input)
 
static bool is_transient (const GetPot &input)
 
static void dup_solver_option_check (const GetPot &input, const std::string &option1, const std::string &option2)
 

Detailed Description

Definition at line 36 of file solver_parsing.h.

Constructor & Destructor Documentation

GRINS::SolverParsing::SolverParsing ( )
inline

Definition at line 40 of file solver_parsing.h.

40 {};
GRINS::SolverParsing::~SolverParsing ( )
inline

Definition at line 42 of file solver_parsing.h.

42 {};

Member Function Documentation

void GRINS::SolverParsing::dup_solver_option_check ( const GetPot &  input,
const std::string &  option1,
const std::string &  option2 
)
static

Definition at line 99 of file solver_parsing.C.

Referenced by is_transient(), GRINS::TimeSteppingParsing::parse_backtrack_deltat(), and GRINS::TimeSteppingParsing::parse_n_timesteps().

102  {
103  // Can't specify both old and new version
104  if( input.have_variable(option1) && input.have_variable(option2) )
105  {
106  libmesh_error_msg("ERROR: Cannot specify both "+option1+" and "+option2);
107  }
108  }
bool GRINS::SolverParsing::is_transient ( const GetPot &  input)
static

Definition at line 72 of file solver_parsing.C.

References dup_solver_option_check(), and grins_warning.

Referenced by solver_type().

73  {
74  // Can't specify both old and new version
76  "unsteady-solver/transient",
77  "SolverOptions/TimeStepping/solver_type");
78 
79  bool transient = false;
80 
81  if( input.have_variable("unsteady-solver/transient") )
82  {
83  transient = input("unsteady-solver/transient",false);
84 
85  std::string warning = "WARNING: unsteady-solver/transient is DEPRECATED!\n";
86  warning += " Please use SolverOptions/TimeStepping/solver_type to specify time stepping solver.\n";
87  grins_warning(warning);
88  }
89 
90  // In the new version, we set the solver type so we just need to
91  // check if the variable is present. Solver class will figure
92  // out the type.
93  if( input.have_variable("SolverOptions/TimeStepping/solver_type") )
94  transient = true;
95 
96  return transient;
97  }
#define grins_warning(message)
Definition: common.h:34
static void dup_solver_option_check(const GetPot &input, const std::string &option1, const std::string &option2)
std::string GRINS::SolverParsing::solver_type ( const GetPot &  input)
static
Todo:
We should just pass this object in from the calling function

Definition at line 38 of file solver_parsing.C.

References GRINS::MeshAdaptivityOptions::is_mesh_adaptive(), is_transient(), GRINS::SolverNames::steady_mesh_adaptive_solver(), GRINS::SolverNames::steady_solver(), GRINS::SolverNames::unsteady_mesh_adaptive_solver(), and GRINS::SolverNames::unsteady_solver().

Referenced by GRINS::SolverFactory::build().

39  {
41  MeshAdaptivityOptions mesh_adaptivity_options(input);
42  bool mesh_adaptive = mesh_adaptivity_options.is_mesh_adaptive();
43 
44  bool transient = SolverParsing::is_transient(input);
45 
46  std::string solver_type = input("SolverOptions/solver_type", "DIE!");
47 
48  if(transient && !mesh_adaptive)
49  {
50  solver_type = SolverNames::unsteady_solver();
51  }
52  else if( !transient && !mesh_adaptive )
53  {
54  solver_type = SolverNames::steady_solver();
55  }
56  else if( !transient && mesh_adaptive )
57  {
59  }
60  else if( transient && mesh_adaptive )
61  {
63  }
64  else
65  {
66  libmesh_error_msg("Unsupported combination of solver options!");
67  }
68 
69  return solver_type;
70  }
static std::string solver_type(const GetPot &input)
static bool is_transient(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