numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
avf_integrand.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
22#include "num_collect/constants/one.h" // IWYU pragma: keep
25
27
34template <concepts::problem Problem>
36public:
38 using problem_type = Problem;
39
41 using variable_type = typename problem_type::variable_type;
42
44 using scalar_type = typename problem_type::scalar_type;
45
46 static_assert(!problem_type::allowed_evaluations.mass,
47 "Mass matrix is not supported.");
48
56
63 [[nodiscard]] auto operator()(scalar_type rate) const -> variable_type {
64 problem_.evaluate_on(time_,
66 evaluation_type{.diff_coeff = true});
67 return problem_.diff_coeff();
68 }
69
75 [[nodiscard]] auto problem() -> problem_type& { return problem_; }
76
82 [[nodiscard]] auto problem() const -> const problem_type& {
83 return problem_;
84 }
85
91 void time(scalar_type val) { time_ = val; }
92
98 void prev_var(const variable_type& var) { prev_var_ = var; }
99
105 void next_var(const variable_type& var) { next_var_ = var; }
106
107private:
110
113
116
119};
120
121} // namespace num_collect::ode::avf::impl
Class of integrand for average vector field (AVF) method quispel2008.
void time(scalar_type val)
Set time.
typename problem_type::variable_type variable_type
Type of variables.
auto operator()(scalar_type rate) const -> variable_type
Calculate integrand.
avf_integrand(const problem_type &problem=problem_type())
Constructor.
typename problem_type::scalar_type scalar_type
Type of scalars.
auto problem() const -> const problem_type &
Get the problem.
variable_type prev_var_
Previous variable.
void prev_var(const variable_type &var)
Set the previous variable.
variable_type next_var_
Next variable.
void next_var(const variable_type &var)
Set the next variable.
auto problem() -> problem_type &
Get the problem.
Definition of evaluation_type enumeration.
constexpr T one
Value 1.
Definition one.h:30
Namespace of internal implementations.
Definition of one.
Definition of problem concept.
Struct to specify types of evaluations.