Reference documentation for deal.II version 9.5.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
nox.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2022 - 2023 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_trilinos_nox
17#define dealii_trilinos_nox
18
19#include <deal.II/base/config.h>
20
21#ifdef DEAL_II_TRILINOS_WITH_NOX
22
24
26
27# include <Teuchos_ParameterList.hpp>
28
29# include <exception>
30# include <functional>
31
33
34namespace TrilinosWrappers
35{
36 // Indicate that NOXSolver has not converged.
38
39
87 template <typename VectorType>
89 {
90 public:
97 {
98 public:
102 AdditionalData(const unsigned int max_iter = 10,
103 const double abs_tol = 1.e-20,
104 const double rel_tol = 1.e-5,
105 const unsigned int threshold_nonlinear_iterations = 1,
106 const unsigned int threshold_n_linear_iterations = 0,
107 const bool reuse_solver = false);
108
112 unsigned int max_iter;
113
120 double abs_tol;
121
128 double rel_tol;
129
135
151
159 };
160
172 const Teuchos::RCP<Teuchos::ParameterList> &parameters =
173 Teuchos::rcp(new Teuchos::ParameterList));
174
179
183 void
185
190 unsigned int
191 solve(VectorType &solution);
192
205 std::function<void(const VectorType &u, VectorType &F)> residual;
206
219 std::function<void(const VectorType &current_u)> setup_jacobian;
220
238 std::function<void(const VectorType &current_u)> setup_preconditioner;
239
260 std::function<void(const VectorType &x, VectorType &y)> apply_jacobian;
261
282 std::function<
283 void(const VectorType &y, VectorType &x, const double tolerance)>
285
315 std::function<
316 int(const VectorType &y, VectorType &x, const double tolerance)>
318
338 std::function<SolverControl::State(const unsigned int i,
339 const double norm_f,
340 const VectorType & current_u,
341 const VectorType & f)>
343
363
364 private:
369
375 const Teuchos::RCP<Teuchos::ParameterList> parameters;
376
381
386
391
396
402 mutable std::exception_ptr pending_exception;
403 };
404} // namespace TrilinosWrappers
405
407
408#endif
409
410#endif
std::function< void(const VectorType &x, VectorType &y)> apply_jacobian
Definition nox.h:260
unsigned int n_residual_evaluations
Definition nox.h:380
unsigned int n_nonlinear_iterations
Definition nox.h:390
std::function< void(const VectorType &current_u)> setup_preconditioner
Definition nox.h:238
unsigned int n_last_linear_iterations
Definition nox.h:395
std::function< void(const VectorType &y, VectorType &x, const double tolerance)> solve_with_jacobian
Definition nox.h:284
std::function< bool()> update_preconditioner_predicate
Definition nox.h:362
std::function< void(const VectorType &u, VectorType &F)> residual
Definition nox.h:205
AdditionalData additional_data
Definition nox.h:368
unsigned int solve(VectorType &solution)
NOXSolver(AdditionalData &additional_data, const Teuchos::RCP< Teuchos::ParameterList > &parameters=Teuchos::rcp(new Teuchos::ParameterList))
std::function< void(const VectorType &current_u)> setup_jacobian
Definition nox.h:219
const Teuchos::RCP< Teuchos::ParameterList > parameters
Definition nox.h:375
std::exception_ptr pending_exception
Definition nox.h:402
std::function< SolverControl::State(const unsigned int i, const double norm_f, const VectorType &current_u, const VectorType &f)> check_iteration_status
Definition nox.h:342
unsigned int n_jacobian_applications
Definition nox.h:385
std::function< int(const VectorType &y, VectorType &x, const double tolerance)> solve_with_jacobian_and_track_n_linear_iterations
Definition nox.h:317
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#define DeclException0(Exception0)
Definition exceptions.h:465
static ::ExceptionBase & ExcNOXNoConvergence()
AdditionalData(const unsigned int max_iter=10, const double abs_tol=1.e-20, const double rel_tol=1.e-5, const unsigned int threshold_nonlinear_iterations=1, const unsigned int threshold_n_linear_iterations=0, const bool reuse_solver=false)