Loading...
Searching...
No Matches
PBiCG.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::PBiCG
29
30Description
31 Preconditioned bi-conjugate gradient solver for asymmetric lduMatrices
32 using a run-time selectable preconditioner.
33
34SourceFiles
35 PBiCG.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef PBiCG_H
40#define PBiCG_H
41
42#include "lduMatrix.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class PBiCG Declaration
51\*---------------------------------------------------------------------------*/
52
53class PBiCG
54:
56{
57 // Private Member Data
58
59 //- Cached preconditioner
60 mutable autoPtr<lduMatrix::preconditioner> preconPtr_;
61
62
63 // Private Member Functions
64
65 //- No copy construct
66 PBiCG(const PBiCG&) = delete;
67
68 //- No copy assignment
69 void operator=(const PBiCG&) = delete;
70
71
72public:
73
74 //- Runtime type information
75 TypeName("PBiCG");
76
77
78 // Constructors
79
80 //- Construct from matrix components and solver data stream
81 PBiCG
82 (
83 const word& fieldName,
84 const lduMatrix& matrix,
88 const dictionary& solverControls
89 );
90
91
92 //- Destructor
93 virtual ~PBiCG() = default;
94
95
96 // Member Functions
97
98 //- Solve the matrix with this solver
102 const scalarField& source,
103 const direction cmpt=0
104 ) const;
105};
106
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110} // End namespace Foam
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114#endif
115
116// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition FieldField.H:77
virtual ~PBiCG()=default
Destructor.
TypeName("PBiCG")
Runtime type information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base-class for lduMatrix solvers.
Definition lduMatrix.H:152
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition lduMatrix.H:338
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition lduMatrix.H:343
const lduMatrix & matrix() const noexcept
Definition lduMatrix.H:328
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition lduMatrix.H:333
const word & fieldName() const noexcept
Definition lduMatrix.H:323
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition lduMatrix.H:81
A class for handling words, derived from Foam::string.
Definition word.H:66
const volScalarField & psi
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
uint8_t direction
Definition direction.H:49
UPtrList< const lduInterfaceField > lduInterfaceFieldPtrsList
List of coupled interface fields to be used in coupling.
SolverPerformance< scalar > solverPerformance
SolverPerformance instantiated for a scalar.
CEqn solve()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68