| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2023 - 2024 by the deal.II authors |
| 5 |
// |
| 6 |
// This file is part of the deal.II library. |
| 7 |
// |
| 8 |
// Part of the source code is dual licensed under Apache-2.0 WITH |
| 9 |
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information |
| 10 |
// governing the source code and code contributions can be found in |
| 11 |
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. |
| 12 |
// |
| 13 |
// ------------------------------------------------------------------------ |
| 14 |
|
| 15 |
#ifndef dealii_lac_orthogonalization_h |
| 16 |
#define dealii_lac_orthogonalization_h |
| 17 |
|
| 18 |
|
| 19 |
#include <deal.II/base/config.h> |
| 20 |
|
| 21 |
DEAL_II_NAMESPACE_OPEN |
| 22 |
|
| 23 |
namespace LinearAlgebra |
| 24 |
{ |
| 25 |
/** |
| 26 |
* Supported orthogonalization strategies within SolverGMRES and |
| 27 |
* SolverFGMRES. |
| 28 |
*/ |
| 29 |
enum class OrthogonalizationStrategy |
| 30 |
{ |
| 31 |
/** |
| 32 |
* Use modified Gram-Schmidt algorithm. |
| 33 |
*/ |
| 34 |
modified_gram_schmidt, |
| 35 |
/** |
| 36 |
* Use classical Gram-Schmidt algorithm. Since this approach works on |
| 37 |
* multi-vectors with a single global reduction (of multiple elements), it |
| 38 |
* is more efficient than the modified Gram-Schmidt algorithm. However, it |
| 39 |
* is less stable in terms of roundoff error propagation, requiring |
| 40 |
* additional re-orthogonalization steps more frequently. |
| 41 |
*/ |
| 42 |
classical_gram_schmidt, |
| 43 |
/** |
| 44 |
* Use classical Gram-Schmidt algorithm with two orthogonalization |
| 45 |
* iterations and delayed orthogonalization using the algorithm described |
| 46 |
* in @cite Bielich2022. This approach works on multi-vectors with a |
| 47 |
* single global reduction (of multiple elements) and is more efficient |
| 48 |
* than the modified Gram-Schmidt algorithm. At the same time, it |
| 49 |
* unconditionally performs the second orthogonalization step, making it |
| 50 |
* more stable than the classical Gram-Schmidt variant. For deal.II's own |
| 51 |
* vectors, there is no additional cost compared to the classical |
| 52 |
* Gram-Schmidt algorithm, because the second orthogonalization step is |
| 53 |
* done on cached data. For these beneficial reasons, this is the default |
| 54 |
* algorithm in the SolverGMRES class. |
| 55 |
*/ |
| 56 |
delayed_classical_gram_schmidt |
| 57 |
}; |
| 58 |
} // namespace LinearAlgebra |
| 59 |
|
| 60 |
|
| 61 |
DEAL_II_NAMESPACE_CLOSE |
| 62 |
|
| 63 |
#endif |