OGS
AndersonAcceleration.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <Eigen/Core>
7#include <vector>
8
10
11namespace NumLib
12{
31{
32public:
35 static constexpr int min_mixing_depth = 2;
36
40 explicit AndersonAcceleration(int depth);
41
43
46
59 void accelerate(GlobalVector const& x_old, GlobalVector& x_new);
60
64 void dropLastStep();
65
66private:
75
77 static void releaseHistoryEntry(HistoryEntry const& entry);
78
81 int const _depth;
82
84 std::vector<HistoryEntry> _history;
85
91 Eigen::MatrixXd _gram;
92};
93
94} // namespace NumLib
MathLib::EigenVector GlobalVector
void accelerate(GlobalVector const &x_old, GlobalVector &x_new)
static constexpr int min_mixing_depth
std::vector< HistoryEntry > _history
Circular buffer of history entries, oldest first (size <= _depth).
AndersonAcceleration & operator=(AndersonAcceleration const &)=delete
static void releaseHistoryEntry(HistoryEntry const &entry)
Returns entry's vectors to the global vector provider.
AndersonAcceleration(AndersonAcceleration const &)=delete