GRINS-0.8.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 107 of file solver_parsing.C.

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

110  {
111  // Can't specify both old and new version
112  if( input.have_variable(option1) && input.have_variable(option2) )
113  {
114  libmesh_error_msg("ERROR: Cannot specify both "+option1+" and "+option2);
115  }
116  }
bool GRINS::SolverParsing::is_transient ( const GetPot &  input)
static

Definition at line 80 of file solver_parsing.C.

References dup_solver_option_check(), and grins_warning.

Referenced by solver_type().

81  {
82  // Can't specify both old and new version
84  "unsteady-solver/transient",
85  "SolverOptions/TimeStepping/solver_type");
86 
87  bool transient = false;
88 
89  if( input.have_variable("unsteady-solver/transient") )
90  {
91  transient = input("unsteady-solver/transient",false);
92 
93  std::string warning = "WARNING: unsteady-solver/transient is DEPRECATED!\n";
94  warning += " Please use SolverOptions/TimeStepping/solver_type to specify time stepping solver.\n";
95  grins_warning(warning);
96  }
97 
98  // In the new version, we set the solver type so we just need to
99  // check if the variable is present. Solver class will figure
100  // out the type.
101  if( input.have_variable("SolverOptions/TimeStepping/solver_type") )
102  transient = true;
103 
104  return transient;
105  }
#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::Simulation::build_solver().

39  {
40  std::string solver_type;
41 
42  // If the user set the solver_type, use that
43  if( input.have_variable("SolverOptions/solver_type") )
44  solver_type = input("SolverOptions/solver_type", "DIE!");
45 
46  // Otherwise, they're using grins_steady/unsteady (possibly mesh_adaptive) solver
47  else
48  {
50  MeshAdaptivityOptions mesh_adaptivity_options(input);
51  bool mesh_adaptive = mesh_adaptivity_options.is_mesh_adaptive();
52 
53  bool transient = SolverParsing::is_transient(input);
54 
55  if(transient && !mesh_adaptive)
56  {
57  solver_type = SolverNames::unsteady_solver();
58  }
59  else if( !transient && !mesh_adaptive )
60  {
61  solver_type = SolverNames::steady_solver();
62  }
63  else if( !transient && mesh_adaptive )
64  {
66  }
67  else if( transient && mesh_adaptive )
68  {
70  }
71  else
72  {
73  libmesh_error_msg("Unsupported combination of solver options!");
74  }
75  }
76 
77  return solver_type;
78  }
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 Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1