GRINS-0.8.0
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-2017 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 // libMesh forward declarations
36 class GetPot;
37 
38 namespace libMesh
39 {
40  class DiffSolver;
41  class ParameterVector;
42  class SensitivityData;
43 }
44 
45 namespace GRINS
46 {
47  // Forward declarations
48  class MultiphysicsSystem;
49  class SolverContext;
50 
51  class Solver
52  {
53  public:
54  Solver( const GetPot& input );
55  virtual ~Solver();
56 
57  virtual void initialize( const GetPot& input,
58  SharedPtr<libMesh::EquationSystems> equation_system,
59  GRINS::MultiphysicsSystem* system );
60 
61  virtual void solve( SolverContext& context )=0;
62 
64  (SolverContext& /*context*/,
65  const libMesh::QoISet& /*qoi_indices*/,
66  const libMesh::ParameterVector& /*parameters_in*/,
67  libMesh::SensitivityData& /*sensitivities*/)
68  const
69  { libmesh_not_implemented(); }
70 
72  (SolverContext& /*context*/,
73  const libMesh::QoISet& /*qoi_indices*/,
74  const libMesh::ParameterVector& /*parameters_in*/,
75  libMesh::SensitivityData& /*sensitivities*/)
76  const
77  { libmesh_not_implemented(); }
78 
80 
82  void steady_adjoint_solve( SolverContext& context );
83 
84  void print_scalar_vars( SolverContext& context );
85 
86  void print_qoi( SolverContext& context );
87 
88  protected:
89 
90  // Linear/Nonlinear solver options
94 
95  // _relative_residual_tolerance applies to both one of the
96  // stopping criteria for (nonlinear) forward solves and *the*
97  // stopping criterion for (linear) adjoint solves.
99 
107 
108  // Screen display options
111 
112  void set_solver_options( libMesh::DiffSolver& solver );
113 
114  virtual void init_time_solver(GRINS::MultiphysicsSystem* system)=0;
115 
116  };
117 
118 } //End namespace block
119 
120 #endif //GRINS_SOLVER_H
double _absolute_residual_tolerance
Definition: solver.h:100
bool _solver_verbose
Definition: solver.h:110
virtual void init_time_solver(GRINS::MultiphysicsSystem *system)=0
double _relative_residual_tolerance
Definition: solver.h:98
virtual void solve(SolverContext &context)=0
Solver(const GetPot &input)
Definition: solver.C:48
unsigned int _max_linear_iterations
Definition: solver.h:103
void set_solver_options(libMesh::DiffSolver &solver)
Definition: solver.C:92
double _relative_step_tolerance
Definition: solver.h:92
void steady_adjoint_solve(SolverContext &context)
Do steady version of adjoint solve.
Definition: solver.C:123
virtual void adjoint_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: solver.h:64
bool _continue_after_backtrack_failure
Definition: solver.h:104
GRINS namespace.
virtual void forward_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: solver.h:72
double _minimum_linear_tolerance
Definition: solver.h:102
virtual void initialize(const GetPot &input, SharedPtr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system)
Definition: solver.C:72
double _absolute_step_tolerance
Definition: solver.h:93
void print_scalar_vars(SolverContext &context)
Definition: solver.C:133
Interface with libMesh for solving Multiphysics problems.
bool _continue_after_max_iterations
Definition: solver.h:105
virtual ~Solver()
Definition: solver.C:67
Simple class to hold objects passed to Solver::solve.
void print_qoi(SolverContext &context)
Definition: solver.C:155
unsigned int _max_nonlinear_iterations
Definition: solver.h:91
bool _require_residual_reduction
Definition: solver.h:106
double _initial_linear_tolerance
Definition: solver.h:101
bool _solver_quiet
Definition: solver.h:109

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1