version 0.4
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
29 template <typename NonLinearSolver>
30 class LoadControl : public IObservable<ControlMessages> {
31 public:
33 constexpr auto name() const { return std::string("Load Control Method"); }
34
42 LoadControl(const std::shared_ptr<NonLinearSolver>& nonLinearSolver_, int loadSteps,
43 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 },
54 "The last parameter (load factor) must be assignable and incrementable with a double!");
55 }
56
63
64 private:
65 std::shared_ptr<NonLinearSolver> nonLinearSolver;
66 int loadSteps_;
67 double parameterBegin_;
68 double parameterEnd_;
69 double stepSize_;
70 };
71
72} // namespace Ikarus
73
Enums for observer messages.
Implementation of the observer design pattern.
Implementation of the run function.
Defines the ControlInformation structure for storing control results.
Definition: simpleassemblers.hh:21
Structure containing information about the control results.
Definition: controlinfos.hh:20
The LoadControl control routine increases the last parameter of a nonlinear operator and calls a nonl...
Definition: loadcontrol.hh:30
LoadControl(const std::shared_ptr< NonLinearSolver > &nonLinearSolver_, int loadSteps, const std::array< double, 2 > &tbeginEnd)
Constructor for LoadControl.
Definition: loadcontrol.hh:42
constexpr auto name() const
The name of the LoadControl method.
Definition: loadcontrol.hh:33
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:125