45template <concepts::multi_variate_problem Problem>
90 problem.evaluate_on(time, variable,
109 problem_ !=
nullptr,
"evaluate_and_update_jacobian is not called.");
112 if (target_norm < std::numeric_limits<scalar_type>::min()) {
113 result = variable_type::Zero(target.size());
117 std::sqrt(std::numeric_limits<scalar_type>::epsilon()) /
127 result /=
static_cast<scalar_type>(2) * diff_width;
141 target += step_size * coeff * (*time_derivative_);
153 const auto coeff_function = [
this](
const auto& target,
auto& result) {
157 result +=
problem_->mass() * target;
162 result = variable_type::Zero(rhs.size());
Definition of bicgstab class.
Class of error tolerances hairer1993.
Class to solve linear equations using BiCGstab golub2013.
auto tolerances(const error_tolerances< vector_type > &val) -> bicgstab &
Set the error tolerances.
void solve(CoeffFunction &&coeff_function, const vector_type &rhs, vector_type &solution)
Solve.
Class to solve equations in Rosenbrock methods using BiCGstab.
std::optional< variable_type > time_derivative_
Partial derivative with respect to time.
typename problem_type::variable_type variable_type
Type of variables.
scalar_type inverted_jacobian_coeff_
Coefficient multiplied to Jacobian matrices in inverted matrices.
void solve(const variable_type &rhs, variable_type &result)
Solve a linear equation.
static constexpr bool use_mass
Whether to use mass.
auto tolerances(const error_tolerances< variable_type > &val) -> bicgstab_rosenbrock_equation_solver &
Set the error tolerances.
static constexpr bool use_time_derivative
Whether to use partial derivative with respect to time.
Problem problem_type
Type of problem.
impl::bicgstab< variable_type > bicgstab_
BiCGstab solver.
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.
problem_type * problem_
Problem.
scalar_type step_size_
Step size.
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.
variable_type variable_
Variable.
typename problem_type::scalar_type scalar_type
Type of scalars.
bicgstab_rosenbrock_equation_solver(const scalar_type &inverted_jacobian_coeff)
Constructor.
void apply_jacobian(const Target &target, Result &result)
Multiply Jacobian matrix to a vector.
Concept of Eigen's dense vectors with real scalars.
Concept of problems of ordinary differential equations with mass.
Concept of problems of ordinary differential equations differentiable by time variable.
Definition of error_tolerances class.
Definition of evaluation_type enumeration.
Definition of mass_problem concept.
Definition of multi_variate_problem concept.
Namespace of Rosenbrock method.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.
Definition of real_scalar_dense_vector concept.
Struct to specify types of evaluations.
Definition of time_differentiable_problem concept.