numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem > Class Template Reference

Class to solve equations in Rosenbrock methods using GMRES. More...

#include <num_collect/ode/rosenbrock/gmres_rosenbrock_equation_solver.h>

+ Collaboration diagram for num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >:

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_typegmres_ {}
 GMRES solver.
 
scalar_type inverted_jacobian_coeff_ {static_cast<scalar_type>(1)}
 Coefficient multiplied to Jacobian matrices in inverted matrices.
 
problem_typeproblem_ {nullptr}
 Problem.
 
variable_type residual_ {}
 Residual.
 
scalar_type step_size_ {}
 Step size.
 
scalar_type time_ {}
 Time.
 
std::optional< variable_typetime_derivative_ {}
 Partial derivative with respect to time.
 
scalar_type tolerance_rate_ {default_tolerance_rate}
 Rate of tolerance in this solver.
 
error_tolerances< variable_typetolerances_ {}
 Error tolerances.
 
variable_type variable_ {}
 Variable.
 

Static Private Attributes

static constexpr auto default_tolerance_rate
 Default rate of tolerance in this solver.
 

Detailed Description

template<concepts::multi_variate_problem Problem>
class num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >

Class to solve equations in Rosenbrock methods using GMRES.

Template Parameters
ProblemType of the problem.

Definition at line 45 of file gmres_rosenbrock_equation_solver.h.

Member Typedef Documentation

◆ problem_type

template<concepts::multi_variate_problem Problem>
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.

◆ scalar_type

template<concepts::multi_variate_problem Problem>
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.

◆ variable_type

template<concepts::multi_variate_problem Problem>
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.

Constructor & Destructor Documentation

◆ gmres_rosenbrock_equation_solver()

template<concepts::multi_variate_problem Problem>
num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::gmres_rosenbrock_equation_solver ( const scalar_type & inverted_jacobian_coeff)
inlineexplicit

Constructor.

Parameters
[in]inverted_jacobian_coeffCoefficient multiplied to Jacobian matrices in inverted matrices.

Definition at line 70 of file gmres_rosenbrock_equation_solver.h.

Member Function Documentation

◆ add_time_derivative_term()

template<concepts::multi_variate_problem Problem>
void num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::add_time_derivative_term ( const scalar_type & step_size,
const scalar_type & coeff,
variable_type & target )
inline

Add a term of partial derivative with respect to time.

Parameters
[in]step_sizeStep size.
[in]coeffCoefficient in formula.
[in,out]targetTarget variable.

Definition at line 136 of file gmres_rosenbrock_equation_solver.h.

◆ apply_jacobian()

template<concepts::multi_variate_problem Problem>
template<base::concepts::real_scalar_dense_vector Target, base::concepts::real_scalar_dense_vector Result>
void num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::apply_jacobian ( const Target & target,
Result & result )
inline

Multiply Jacobian matrix to a vector.

Parameters
[in]targetTarget.
[out]resultResult.

Definition at line 106 of file gmres_rosenbrock_equation_solver.h.

◆ evaluate_and_update_jacobian()

template<concepts::multi_variate_problem Problem>
void num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::evaluate_and_update_jacobian ( problem_type & problem,
const scalar_type & time,
const scalar_type & step_size,
const variable_type & variable )
inline

Update Jacobian matrix and internal parameters.

Parameters
[in]problemProblem.
[in]timeTime.
[in]step_sizeStep size.
[in]variableVariable.

Definition at line 82 of file gmres_rosenbrock_equation_solver.h.

◆ max_subspace_dim()

template<concepts::multi_variate_problem Problem>
auto num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::max_subspace_dim ( index_type val) -> gmres_rosenbrock_equation_solver&
inline

Set the maximum number of dimensions of subspace used in GMRES.

Parameters
[in]valValue.
Returns
This.

Definition at line 176 of file gmres_rosenbrock_equation_solver.h.

◆ solve()

template<concepts::multi_variate_problem Problem>
void num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::solve ( const variable_type & rhs,
variable_type & result )
inline

Solve a linear equation.

Parameters
[in]rhsRight-hand-side value.
[out]resultResult.

Definition at line 151 of file gmres_rosenbrock_equation_solver.h.

◆ tolerances()

template<concepts::multi_variate_problem Problem>
auto num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::tolerances ( const error_tolerances< variable_type > & val) -> gmres_rosenbrock_equation_solver&
inline

Set the error tolerances.

Parameters
[in]valValue.
Returns
This.

Definition at line 187 of file gmres_rosenbrock_equation_solver.h.

Member Data Documentation

◆ default_tolerance_rate

template<concepts::multi_variate_problem Problem>
auto num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::default_tolerance_rate
staticconstexprprivate
Initial value:
=
static_cast<scalar_type>(1e-2)

Default rate of tolerance in this solver.

Definition at line 216 of file gmres_rosenbrock_equation_solver.h.

◆ gmres_

template<concepts::multi_variate_problem Problem>
impl::gmres<variable_type> num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::gmres_ {}
private

GMRES solver.

Definition at line 210 of file gmres_rosenbrock_equation_solver.h.

◆ inverted_jacobian_coeff_

template<concepts::multi_variate_problem Problem>
scalar_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::inverted_jacobian_coeff_ {static_cast<scalar_type>(1)}
private

Coefficient multiplied to Jacobian matrices in inverted matrices.

Definition at line 226 of file gmres_rosenbrock_equation_solver.h.

◆ problem_

template<concepts::multi_variate_problem Problem>
problem_type* num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::problem_ {nullptr}
private

Problem.

Definition at line 195 of file gmres_rosenbrock_equation_solver.h.

◆ residual_

template<concepts::multi_variate_problem Problem>
variable_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::residual_ {}
private

Residual.

Definition at line 213 of file gmres_rosenbrock_equation_solver.h.

◆ step_size_

template<concepts::multi_variate_problem Problem>
scalar_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::step_size_ {}
private

Step size.

Definition at line 201 of file gmres_rosenbrock_equation_solver.h.

◆ time_

template<concepts::multi_variate_problem Problem>
scalar_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::time_ {}
private

Time.

Definition at line 198 of file gmres_rosenbrock_equation_solver.h.

◆ time_derivative_

template<concepts::multi_variate_problem Problem>
std::optional<variable_type> num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::time_derivative_ {}
private

Partial derivative with respect to time.

Definition at line 207 of file gmres_rosenbrock_equation_solver.h.

◆ tolerance_rate_

template<concepts::multi_variate_problem Problem>
scalar_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::tolerance_rate_ {default_tolerance_rate}
private

Rate of tolerance in this solver.

Definition at line 220 of file gmres_rosenbrock_equation_solver.h.

◆ tolerances_

template<concepts::multi_variate_problem Problem>
error_tolerances<variable_type> num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::tolerances_ {}
private

Error tolerances.

Definition at line 223 of file gmres_rosenbrock_equation_solver.h.

◆ use_time_derivative

template<concepts::multi_variate_problem Problem>
bool num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::use_time_derivative
staticconstexpr
Initial value:
=
Concept of problems of ordinary differential equations differentiable by time variable.

Whether to use partial derivative with respect to time.

Definition at line 57 of file gmres_rosenbrock_equation_solver.h.

◆ variable_

template<concepts::multi_variate_problem Problem>
variable_type num_collect::ode::rosenbrock::gmres_rosenbrock_equation_solver< Problem >::variable_ {}
private

Variable.

Definition at line 204 of file gmres_rosenbrock_equation_solver.h.


The documentation for this class was generated from the following file: