version 0.4
pathfollowing.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
9#pragma once
10
11#include <memory>
12
19
20namespace Ikarus {
21
22 namespace Impl {
23
36 template <typename NonLinearSolver, typename PathFollowingType = ArcLength, typename AdaptiveStepSizing>
37 consteval bool checkPathFollowingTemplates() {
38 return ((Concepts::PathFollowingStrategy<
39 PathFollowingType, typename NonLinearSolver::NonLinearOperator,
40 SubsidiaryArgs>)and(Concepts::
41 AdaptiveStepSizingStrategy<
42 AdaptiveStepSizing, NonLinearSolverInformation, SubsidiaryArgs,
43 std::remove_cvref_t<typename NonLinearSolver::NonLinearOperator>>)
44 and (Concepts::NonLinearSolverCheckForPathFollowing<NonLinearSolver>));
45 }
46
47 } // namespace Impl
48
78 template <typename NonLinearSolver, typename PathFollowingType = ArcLength,
79 typename AdaptiveStepSizing = AdaptiveStepSizing::NoOp>
80 requires(
81 Impl::checkPathFollowingTemplates<NonLinearSolver, PathFollowingType, AdaptiveStepSizing>()) class PathFollowing
83 public:
85 constexpr auto name() const { return std::string("Path following with " + pathFollowingType_.name()); }
86
96 PathFollowing(const std::shared_ptr<NonLinearSolver>& p_nonLinearSolver, int steps, double stepSize,
97 PathFollowingType p_pathFollowingType = ArcLength{}, AdaptiveStepSizing p_adaptiveStepSizing = {})
98 : nonLinearSolver{p_nonLinearSolver},
99 steps_{steps},
100 stepSize_{stepSize},
101 pathFollowingType_{p_pathFollowingType},
102 adaptiveStepSizing{p_adaptiveStepSizing} {}
103
109 ControlInformation run();
110
111 private:
112 std::shared_ptr<NonLinearSolver> nonLinearSolver;
113 int steps_;
114 double stepSize_;
115 PathFollowingType pathFollowingType_;
116 AdaptiveStepSizing adaptiveStepSizing;
117 };
118
119} // namespace Ikarus
120
Enums for observer messages.
Implementation of the observer design pattern.
Contains the AdaptiveStepSizing namespace with strategies for adaptive step sizing.
Implementation of the run function.
Defines structures and methods related to subsidiary functions for control routines.
Defines the ControlInformation structure for storing control results.
Definition: simpleassemblers.hh:21
The PathFollowing control routine for path-following analysis.
Definition: pathfollowing.hh:82
constexpr auto name() const
The name of the PathFollowing method.
Definition: pathfollowing.hh:85
PathFollowing(const std::shared_ptr< NonLinearSolver > &p_nonLinearSolver, int steps, double stepSize, PathFollowingType p_pathFollowingType=ArcLength{}, AdaptiveStepSizing p_adaptiveStepSizing={})
Constructor for PathFollowing.
Definition: pathfollowing.hh:96
Structure representing the subsidiary function for the standard arc-length method.
Definition: pathfollowingfunctions.hh:65