PBiCGStab.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::PBiCGStab
29 
30 Description
31  Preconditioned bi-conjugate gradient stabilized solver for asymmetric
32  lduMatrices using a run-time selectable preconditioner.
33 
34  References:
35  \verbatim
36  Van der Vorst, H. A. (1992).
37  Bi-CGSTAB: A fast and smoothly converging variant of Bi-CG
38  for the solution of nonsymmetric linear systems.
39  SIAM Journal on scientific and Statistical Computing, 13(2), 631-644.
40 
41  Barrett, R., Berry, M. W., Chan, T. F., Demmel, J., Donato, J.,
42  Dongarra, J., Eijkhout, V., Pozo, R., Romine, C. & Van der Vorst, H.
43  (1994).
44  Templates for the solution of linear systems:
45  building blocks for iterative methods
46  (Vol. 43). Siam.
47  \endverbatim
48 
49 SourceFiles
50  PBiCGStab.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef PBiCGStab_H
55 #define PBiCGStab_H
56 
57 #include "lduMatrix.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class PBiCGStab Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class PBiCGStab
69 :
70  public lduMatrix::solver
71 {
72  // Private Member Functions
73 
74  //- No copy construct
75  PBiCGStab(const PBiCGStab&) = delete;
76 
77  //- No copy assignment
78  void operator=(const PBiCGStab&) = delete;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("PBiCGStab");
85 
86 
87  // Constructors
88 
89  //- Construct from matrix components and solver data stream
90  PBiCGStab
91  (
92  const word& fieldName,
93  const lduMatrix& matrix,
97  const dictionary& solverControls
98  );
99 
100 
101  //- Destructor
102  virtual ~PBiCGStab() = default;
103 
104 
105  // Member Functions
106 
107  //- Solve the matrix with this solver
109  (
111  const solveScalarField& source,
112  const direction cmpt = 0
113  ) const;
114 
115  //- Solve the matrix with this solver
116  virtual solverPerformance solve
117  (
118  scalarField& psi,
119  const scalarField& source,
120  const direction cmpt=0
121  ) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::lduMatrix::solver::interfaces
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition: lduMatrix.H:248
Foam::PBiCGStab::~PBiCGStab
virtual ~PBiCGStab()=default
Destructor.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::lduMatrix
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: lduMatrix.H:83
Foam::lduMatrix::solver
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:98
lduMatrix.H
Foam::lduMatrix::solver::fieldName
const word & fieldName() const noexcept
Definition: lduMatrix.H:228
Foam::Field< solveScalar >
Foam::lduMatrix::solver::interfaceBouCoeffs
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition: lduMatrix.H:238
Foam::UPtrList< const lduInterfaceField >
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PBiCGStab
Preconditioned bi-conjugate gradient stabilized solver for asymmetric lduMatrices using a run-time se...
Definition: PBiCGStab.H:67
Foam::lduMatrix::solver::interfaceIntCoeffs
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition: lduMatrix.H:243
Foam::PBiCGStab::scalarSolve
virtual solverPerformance scalarSolve(solveScalarField &psi, const solveScalarField &source, const direction cmpt=0) const
Solve the matrix with this solver.
Definition: PBiCGStab.C:73
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::PBiCGStab::solve
virtual solverPerformance solve(scalarField &psi, const scalarField &source, const direction cmpt=0) const
Solve the matrix with this solver.
Definition: PBiCGStab.C:279
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::SolverPerformance
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics.
Definition: SolverPerformance.H:52
Foam::PBiCGStab::TypeName
TypeName("PBiCGStab")
Runtime type information.
Foam::lduMatrix::solver::matrix
const lduMatrix & matrix() const noexcept
Definition: lduMatrix.H:233