GRINS-0.6.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-2015 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 // C++
30 #include "boost/tr1/memory.hpp"
31 
32 // GRINS
33 #include "grins/nbc_container.h"
34 
35 // libMesh
36 #include "libmesh/equation_systems.h"
37 
38 #ifdef GRINS_HAVE_GRVY
39 #include "grvy.h" // GRVY timers
40 #endif
41 
42 // libMesh forward declarations
43 class GetPot;
44 
45 namespace libMesh
46 {
47  class DiffSolver;
48  class ParameterVector;
49  class SensitivityData;
50 }
51 
52 namespace GRINS
53 {
54  // Forward declarations
55  class MultiphysicsSystem;
56  class SolverContext;
57 
58  class Solver
59  {
60  public:
61  Solver( const GetPot& input );
62  virtual ~Solver();
63 
64  virtual void initialize( const GetPot& input,
65  std::tr1::shared_ptr<libMesh::EquationSystems> equation_system,
66  GRINS::MultiphysicsSystem* system );
67 
68  virtual void solve( SolverContext& context )=0;
69 
71  (SolverContext& /*context*/,
72  const libMesh::QoISet& /*qoi_indices*/,
73  const libMesh::ParameterVector& /*parameters_in*/,
74  libMesh::SensitivityData& /*sensitivities*/)
75  const
76  { libmesh_not_implemented(); }
77 
79  (SolverContext& /*context*/,
80  const libMesh::QoISet& /*qoi_indices*/,
81  const libMesh::ParameterVector& /*parameters_in*/,
82  libMesh::SensitivityData& /*sensitivities*/)
83  const
84  { libmesh_not_implemented(); }
85 
87 
89  void steady_adjoint_solve( SolverContext& context );
90 
91  protected:
92 
93  // Linear/Nonlinear solver options
97 
98  // _relative_residual_tolerance applies to both one of the
99  // stopping criteria for (nonlinear) forward solves and *the*
100  // stopping criterion for (linear) adjoint solves.
102 
109 
110  // Screen display options
113 
114  /* Keep copies of the boundary conditions around
115  in case they need to be updated during a solve;
116  for example parameter continuation. */
117  std::map< std::string, GRINS::NBCContainer > _neumann_bc_funcs;
118 
119  void set_solver_options( libMesh::DiffSolver& solver );
120 
121  virtual void init_time_solver(GRINS::MultiphysicsSystem* system)=0;
122 
123  };
124 
125 } //End namespace block
126 
127 #endif //GRINS_SOLVER_H
double _absolute_residual_tolerance
Definition: grins_solver.h:103
bool _solver_verbose
Definition: grins_solver.h:112
virtual void init_time_solver(GRINS::MultiphysicsSystem *system)=0
double _relative_residual_tolerance
Definition: grins_solver.h:101
virtual void solve(SolverContext &context)=0
Solver(const GetPot &input)
Definition: grins_solver.C:44
unsigned int _max_linear_iterations
Definition: grins_solver.h:106
void set_solver_options(libMesh::DiffSolver &solver)
Definition: grins_solver.C:87
double _relative_step_tolerance
Definition: grins_solver.h:95
void steady_adjoint_solve(SolverContext &context)
Do steady version of adjoint solve.
Definition: grins_solver.C:105
virtual void adjoint_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: grins_solver.h:71
bool _continue_after_backtrack_failure
Definition: grins_solver.h:107
GRINS namespace.
virtual void forward_qoi_parameter_sensitivity(SolverContext &, const libMesh::QoISet &, const libMesh::ParameterVector &, libMesh::SensitivityData &) const
Definition: grins_solver.h:79
double _minimum_linear_tolerance
Definition: grins_solver.h:105
double _absolute_step_tolerance
Definition: grins_solver.h:96
Interface with libMesh for solving Multiphysics problems.
bool _continue_after_max_iterations
Definition: grins_solver.h:108
std::map< std::string, GRINS::NBCContainer > _neumann_bc_funcs
Definition: grins_solver.h:117
virtual ~Solver()
Definition: grins_solver.C:62
virtual void initialize(const GetPot &input, std::tr1::shared_ptr< libMesh::EquationSystems > equation_system, GRINS::MultiphysicsSystem *system)
Definition: grins_solver.C:67
Simple class to hold objects passed to Solver::solve.
unsigned int _max_nonlinear_iterations
Definition: grins_solver.h:94
double _initial_linear_tolerance
Definition: grins_solver.h:104

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