version 0.4.1
loadcontrol.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
16
17namespace Ikarus {
18
29template <typename NLS>
30class LoadControl : public IObservable<ControlMessages>
31{
32public:
34 constexpr auto name() const { return std::string("Load Control Method"); }
35
43 LoadControl(const std::shared_ptr<NLS>& nonLinearSolver, int loadSteps, const std::array<double, 2>& tbeginEnd)
44 : nonLinearSolver_{nonLinearSolver},
45 loadSteps_{loadSteps},
46 parameterBegin_{tbeginEnd[0]},
47 parameterEnd_{tbeginEnd[1]},
48 stepSize_{(parameterEnd_ - parameterBegin_) / loadSteps_} {
49 static_assert(
50 requires {
51 nonLinearSolver_->nonLinearOperator().lastParameter() = 0.0;
52 nonLinearSolver_->nonLinearOperator().lastParameter() += 0.0;
53 }, "The last parameter (load factor) must be assignable and incrementable with a double!");
54 }
55
62
63private:
64 std::shared_ptr<NLS> nonLinearSolver_;
65 int loadSteps_;
66 double parameterBegin_;
67 double parameterEnd_;
68 double stepSize_;
69};
70
71} // namespace Ikarus
72
Implementation of the run function.
Defines the ControlInformation structure for storing control results.
Enums for observer messages.
Implementation of the observer design pattern.
Definition: simpleassemblers.hh:22
Structure containing information about the control results.
Definition: controlinfos.hh:21
The LoadControl control routine increases the last parameter of a nonlinear operator and calls a nonl...
Definition: loadcontrol.hh:31
LoadControl(const std::shared_ptr< NLS > &nonLinearSolver, int loadSteps, const std::array< double, 2 > &tbeginEnd)
Constructor for LoadControl.
Definition: loadcontrol.hh:43
constexpr auto name() const
The name of the LoadControl method.
Definition: loadcontrol.hh:34
ControlInformation run()
Executes the LoadControl routine.
Definition: loadcontrol.inl:14
Generic observable interface for the Observer design pattern. See for a description of the design pa...
Definition: observer.hh:129