numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class to solve equations in Rosenbrock methods using GMRES. More...
#include <num_collect/ode/rosenbrock/gmres_rosenbrock_equation_solver.h>
Public Types | |
using | problem_type = Problem |
Type of problem. | |
using | scalar_type = typename problem_type::scalar_type |
Type of scalars. | |
using | variable_type = typename problem_type::variable_type |
Type of variables. | |
Public Member Functions | |
gmres_rosenbrock_equation_solver (const scalar_type &inverted_jacobian_coeff) | |
Constructor. | |
void | add_time_derivative_term (const scalar_type &step_size, const scalar_type &coeff, variable_type &target) |
Add a term of partial derivative with respect to time. | |
template<base::concepts::real_scalar_dense_vector Target, base::concepts::real_scalar_dense_vector Result> | |
void | apply_jacobian (const Target &target, Result &result) |
Multiply Jacobian matrix to a vector. | |
void | evaluate_and_update_jacobian (problem_type &problem, const scalar_type &time, const scalar_type &step_size, const variable_type &variable) |
Update Jacobian matrix and internal parameters. | |
auto | max_subspace_dim (index_type val) -> gmres_rosenbrock_equation_solver & |
Set the maximum number of dimensions of subspace used in GMRES. | |
void | solve (const variable_type &rhs, variable_type &result) |
Solve a linear equation. | |
auto | tolerances (const error_tolerances< variable_type > &val) -> gmres_rosenbrock_equation_solver & |
Set the error tolerances. | |
Static Public Attributes | |
static constexpr bool | use_time_derivative |
Whether to use partial derivative with respect to time. | |
Private Attributes | |
impl::gmres< variable_type > | gmres_ {} |
GMRES solver. | |
scalar_type | inverted_jacobian_coeff_ {static_cast<scalar_type>(1)} |
Coefficient multiplied to Jacobian matrices in inverted matrices. | |
problem_type * | problem_ {nullptr} |
Problem. | |
variable_type | residual_ {} |
Residual. | |
scalar_type | step_size_ {} |
Step size. | |
scalar_type | time_ {} |
Time. | |
std::optional< variable_type > | time_derivative_ {} |
Partial derivative with respect to time. | |
scalar_type | tolerance_rate_ {default_tolerance_rate} |
Rate of tolerance in this solver. | |
error_tolerances< variable_type > | tolerances_ {} |
Error tolerances. | |
variable_type | variable_ {} |
Variable. | |
Static Private Attributes | |
static constexpr auto | default_tolerance_rate |
Default rate of tolerance in this solver. | |
Class to solve equations in Rosenbrock methods using GMRES.
Problem | Type of the problem. |
Definition at line 45 of file gmres_rosenbrock_equation_solver.h.
using num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::problem_type = Problem |
Type of problem.
Definition at line 48 of file gmres_rosenbrock_equation_solver.h.
using num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::scalar_type = typename problem_type::scalar_type |
Type of scalars.
Definition at line 54 of file gmres_rosenbrock_equation_solver.h.
using num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::variable_type = typename problem_type::variable_type |
Type of variables.
Definition at line 51 of file gmres_rosenbrock_equation_solver.h.
|
inlineexplicit |
Constructor.
[in] | inverted_jacobian_coeff | Coefficient multiplied to Jacobian matrices in inverted matrices. |
Definition at line 70 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Add a term of partial derivative with respect to time.
[in] | step_size | Step size. |
[in] | coeff | Coefficient in formula. |
[in,out] | target | Target variable. |
Definition at line 136 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Multiply Jacobian matrix to a vector.
[in] | target | Target. |
[out] | result | Result. |
Definition at line 106 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Update Jacobian matrix and internal parameters.
[in] | problem | Problem. |
[in] | time | Time. |
[in] | step_size | Step size. |
[in] | variable | Variable. |
Definition at line 82 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Set the maximum number of dimensions of subspace used in GMRES.
[in] | val | Value. |
Definition at line 176 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Solve a linear equation.
[in] | rhs | Right-hand-side value. |
[out] | result | Result. |
Definition at line 151 of file gmres_rosenbrock_equation_solver.h.
|
inline |
Set the error tolerances.
[in] | val | Value. |
Definition at line 187 of file gmres_rosenbrock_equation_solver.h.
|
staticconstexprprivate |
Default rate of tolerance in this solver.
Definition at line 216 of file gmres_rosenbrock_equation_solver.h.
|
private |
GMRES solver.
Definition at line 210 of file gmres_rosenbrock_equation_solver.h.
|
private |
Coefficient multiplied to Jacobian matrices in inverted matrices.
Definition at line 226 of file gmres_rosenbrock_equation_solver.h.
|
private |
Problem.
Definition at line 195 of file gmres_rosenbrock_equation_solver.h.
|
private |
Residual.
Definition at line 213 of file gmres_rosenbrock_equation_solver.h.
|
private |
Step size.
Definition at line 201 of file gmres_rosenbrock_equation_solver.h.
|
private |
Time.
Definition at line 198 of file gmres_rosenbrock_equation_solver.h.
|
private |
Partial derivative with respect to time.
Definition at line 207 of file gmres_rosenbrock_equation_solver.h.
|
private |
Rate of tolerance in this solver.
Definition at line 220 of file gmres_rosenbrock_equation_solver.h.
|
private |
Error tolerances.
Definition at line 223 of file gmres_rosenbrock_equation_solver.h.
|
staticconstexpr |
Whether to use partial derivative with respect to time.
Definition at line 57 of file gmres_rosenbrock_equation_solver.h.
|
private |
Variable.
Definition at line 204 of file gmres_rosenbrock_equation_solver.h.