GRINS-0.7.0
grins_solver.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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 
26 #ifndef GRINS_SOLVER_H
27 #define GRINS_SOLVER_H
28 
29 // GRINS
30 #include "grins/shared_ptr.h"
31 
32 // libMesh
33 #include "libmesh/equation_systems.h"
34 
35 #ifdef GRINS_HAVE_GRVY
36 #include "grvy.h" // GRVY timers
37 #endif
38 
39 // libMesh forward declarations
40 class GetPot;
41 
42 namespace libMesh
43 {
44  class DiffSolver;
45  class ParameterVector;
46  class SensitivityData;
47 }
48 
49 namespace GRINS
50 {
51  // Forward declarations
52  class MultiphysicsSystem;
53  class SolverContext;
54 
55  class Solver
56  {
57  public:
58  Solver( const GetPot& input );
59  virtual ~Solver();
60 
61  virtual void initialize( const GetPot& input,
62  SharedPtr<libMesh::EquationSystems> equation_system,
63  GRINS::MultiphysicsSystem* system );
64 
65  virtual void solve( SolverContext& context )=0;
66 
68  (SolverContext& /*context*/,
69  const libMesh::QoISet& /*qoi_indices*/,
70  const libMesh::ParameterVector& /*parameters_in*/,
71  libMesh::SensitivityData& /*sensitivities*/)
72  const
73  { libmesh_not_implemented(); }
74 
76  (SolverContext& /*context*/,
77  const libMesh::QoISet& /*qoi_indices*/,
78  const libMesh::ParameterVector& /*parameters_in*/,
79  libMesh::SensitivityData& /*sensitivities*/)
80  const
81  { libmesh_not_implemented(); }
82 
84 
86  void steady_adjoint_solve( SolverContext& context );
87 
88  void print_scalar_vars( SolverContext& context );
89 
90  void print_qoi( SolverContext& context, std::ostream& output );
91 
92  protected:
93 
94  // Linear/Nonlinear solver options
98 
99  // _relative_residual_tolerance applies to both one of the
100  // stopping criteria for (nonlinear) forward solves and *the*
101  // stopping criterion for (linear) adjoint solves.
103 
111 
112  // Screen display options
115 
116  void set_solver_options( libMesh::DiffSolver& solver );
117 
118  virtual void init_time_solver(GRINS::MultiphysicsSystem* system)=0;
119 
120  };
121 
122 } //End namespace block
123 
124 #endif //GRINS_SOLVER_H
double _absolute_residual_tolerance
Definition: grins_solver.h:104
bool _solver_verbose
Definition: grins_solver.h:114
virtual void init_time_solver(GRINS::MultiphysicsSystem *system)=0
double _relative_residual_tolerance
Definition: grins_solver.h:102
virtual void solve(SolverContext &context)=0
Solver(const GetPot &input)
Definition: grins_solver.C:48
unsigned int _max_linear_iterations
Definition: grins_solver.h:107
void set_solver_options(libMesh::DiffSolver &solver)
Definition: grins_solver.C:92
double _relative_step_tolerance
Definition: grins_solver.h:96
void steady_adjoint_solve(SolverContext &context)
Do steady version of adjoint solve.
Definition: grins_solver.C:123
virtual void adjoint_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: grins_solver.h:68
bool _continue_after_backtrack_failure
Definition: grins_solver.h:108
GRINS namespace.
virtual void forward_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: grins_solver.h:76
double _minimum_linear_tolerance
Definition: grins_solver.h:106
virtual void initialize(const GetPot &input, SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system)
Definition: grins_solver.C:72
double _absolute_step_tolerance
Definition: grins_solver.h:97
void print_scalar_vars(SolverContext &context)
Definition: grins_solver.C:133
Interface with libMesh for solving Multiphysics problems.
bool _continue_after_max_iterations
Definition: grins_solver.h:109
void print_qoi(SolverContext &context, std::ostream &output)
Definition: grins_solver.C:155
virtual ~Solver()
Definition: grins_solver.C:67
Simple class to hold objects passed to Solver::solve.
unsigned int _max_nonlinear_iterations
Definition: grins_solver.h:95
bool _require_residual_reduction
Definition: grins_solver.h:110
double _initial_linear_tolerance
Definition: grins_solver.h:105

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