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

Class to solve equations in Rosenbrock methods for single-variate case. More...

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

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

Public Types

using jacobian_type = typename problem_type::jacobian_type
 Type of Jacobians.
 
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

 scalar_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.
 
void apply_jacobian (const variable_type &target, variable_type &result)
 Multiply Jacobian to a value.
 
void evaluate_and_update_jacobian (problem_type &problem, const scalar_type &time, const scalar_type &step_size, const variable_type &variable)
 Update Jacobian and internal parameters.
 
void solve (const variable_type &rhs, variable_type &result)
 Solve a linear equation.
 

Static Public Attributes

static constexpr bool use_mass = concepts::mass_problem<problem_type>
 Whether to use mass.
 
static constexpr bool use_time_derivative
 Whether to use partial derivative with respect to time.
 

Private Attributes

jacobian_type inverted_coeff_ {}
 Inverted coefficient.
 
scalar_type inverted_jacobian_coeff_ {static_cast<scalar_type>(1)}
 Coefficient multiplied to Jacobian in inverted values.
 
jacobian_type jacobian_ {}
 Jacobian.
 
std::optional< variable_typetime_derivative_ {}
 Partial derivative with respect to time.
 

Detailed Description

template<concepts::single_variate_differentiable_problem Problem>
class num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >

Class to solve equations in Rosenbrock methods for single-variate case.

Template Parameters
ProblemType of the problem.

Definition at line 44 of file scalar_rosenbrock_equation_solver.h.

Member Typedef Documentation

◆ jacobian_type

template<concepts::single_variate_differentiable_problem Problem>
using num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::jacobian_type = typename problem_type::jacobian_type

Type of Jacobians.

Definition at line 56 of file scalar_rosenbrock_equation_solver.h.

◆ problem_type

template<concepts::single_variate_differentiable_problem Problem>
using num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::problem_type = Problem

Type of problem.

Definition at line 47 of file scalar_rosenbrock_equation_solver.h.

◆ scalar_type

template<concepts::single_variate_differentiable_problem Problem>
using num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::scalar_type = typename problem_type::scalar_type

Type of scalars.

Definition at line 53 of file scalar_rosenbrock_equation_solver.h.

◆ variable_type

template<concepts::single_variate_differentiable_problem Problem>
using num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::variable_type = typename problem_type::variable_type

Type of variables.

Definition at line 50 of file scalar_rosenbrock_equation_solver.h.

Constructor & Destructor Documentation

◆ scalar_rosenbrock_equation_solver()

template<concepts::single_variate_differentiable_problem Problem>
num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::scalar_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 71 of file scalar_rosenbrock_equation_solver.h.

Member Function Documentation

◆ add_time_derivative_term()

template<concepts::single_variate_differentiable_problem Problem>
void num_collect::ode::rosenbrock::scalar_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 126 of file scalar_rosenbrock_equation_solver.h.

◆ apply_jacobian()

template<concepts::single_variate_differentiable_problem Problem>
void num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::apply_jacobian ( const variable_type & target,
variable_type & result )
inline

Multiply Jacobian to a value.

Parameters
[in]targetTarget.
[out]resultResult.

Definition at line 115 of file scalar_rosenbrock_equation_solver.h.

◆ evaluate_and_update_jacobian()

template<concepts::single_variate_differentiable_problem Problem>
void num_collect::ode::rosenbrock::scalar_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 and internal parameters.

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

Definition at line 83 of file scalar_rosenbrock_equation_solver.h.

◆ solve()

template<concepts::single_variate_differentiable_problem Problem>
void num_collect::ode::rosenbrock::scalar_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 141 of file scalar_rosenbrock_equation_solver.h.

Member Data Documentation

◆ inverted_coeff_

template<concepts::single_variate_differentiable_problem Problem>
jacobian_type num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::inverted_coeff_ {}
private

Inverted coefficient.

Definition at line 153 of file scalar_rosenbrock_equation_solver.h.

◆ inverted_jacobian_coeff_

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

Coefficient multiplied to Jacobian in inverted values.

Definition at line 156 of file scalar_rosenbrock_equation_solver.h.

◆ jacobian_

template<concepts::single_variate_differentiable_problem Problem>
jacobian_type num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::jacobian_ {}
private

Jacobian.

Definition at line 147 of file scalar_rosenbrock_equation_solver.h.

◆ time_derivative_

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

Partial derivative with respect to time.

Definition at line 150 of file scalar_rosenbrock_equation_solver.h.

◆ use_mass

template<concepts::single_variate_differentiable_problem Problem>
bool num_collect::ode::rosenbrock::scalar_rosenbrock_equation_solver< Problem >::use_mass = concepts::mass_problem<problem_type>
staticconstexpr

Whether to use mass.

Definition at line 63 of file scalar_rosenbrock_equation_solver.h.

◆ use_time_derivative

template<concepts::single_variate_differentiable_problem Problem>
bool num_collect::ode::rosenbrock::scalar_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 59 of file scalar_rosenbrock_equation_solver.h.


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