TDILUPreconditioner.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::TDILUPreconditioner
29
30Description
31 Simplified diagonal-based incomplete LU preconditioner for asymmetric
32 matrices.
33
34 The inverse (reciprocal for scalar) of the preconditioned diagonal is
35 calculated and stored.
36
37SourceFiles
38 TDILUPreconditioner.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef TDILUPreconditioner_H
43#define TDILUPreconditioner_H
44
45#include "LduMatrix.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class TDILUPreconditioner Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class Type, class DType, class LUType>
58:
59 public LduMatrix<Type, DType, LUType>::preconditioner
60{
61 // Private data
62
63 //- The inverse (reciprocal for scalar) preconditioned diagonal
64 Field<DType> rD_;
65
66
67public:
68
69 //- Runtime type information
70 TypeName("DILU");
71
72
73 // Constructors
74
75 //- Construct from matrix components and preconditioner data dictionary
77 (
79 const dictionary& preconditionerDict
80 );
81
82
83 // Destructor
85 virtual ~TDILUPreconditioner() = default;
86
87
88 // Member Functions
89
90 //- Calculate the reciprocal of the preconditioned diagonal
91 static void calcInvD
92 (
93 Field<DType>& rD,
95 );
96
97 //- Return wA the preconditioned form of residual rA
98 virtual void precondition
99 (
100 Field<Type>& wA,
101 const Field<Type>& rA
102 ) const;
103
104 //- Return wT the transpose-matrix preconditioned form of
105 // residual rT.
106 virtual void preconditionT
107 (
108 Field<Type>& wT,
109 const Field<Type>& rT
110 ) const;
111};
112
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116} // End namespace Foam
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120#ifdef NoRepository
121 #include "TDILUPreconditioner.C"
122#endif
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
Abstract base-class for LduMatrix solvers.
Definition: LduMatrix.H:116
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: LduMatrix.H:88
Simplified diagonal-based incomplete LU preconditioner for asymmetric matrices.
TypeName("DILU")
Runtime type information.
virtual ~TDILUPreconditioner()=default
static void calcInvD(Field< DType > &rD, const LduMatrix< Type, DType, LUType > &matrix)
Calculate the reciprocal of the preconditioned diagonal.
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const
Return wA the preconditioned form of residual rA.
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73