NoPreconditioner.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 -------------------------------------------------------------------------------
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::NoPreconditioner
29 
30 Description
31  Null preconditioner for both symmetric and asymmetric matrices.
32 
33 SourceFiles
34  NoPreconditioner.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef NoPreconditioner_H
39 #define NoPreconditioner_H
40 
41 #include "LduMatrix.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class NoPreconditioner Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type, class DType, class LUType>
53 class NoPreconditioner
54 :
55  public LduMatrix<Type, DType, LUType>::preconditioner
56 {
57  // Private Member Functions
58 
59  //- No copy construct
60  NoPreconditioner(const NoPreconditioner&) = delete;
61 
62  //- No copy assignment
63  void operator=(const NoPreconditioner&) = delete;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("none");
70 
71 
72  // Constructors
73 
74  //- Construct from matrix components and preconditioner data dictionary
76  (
77  const typename LduMatrix<Type, DType, LUType>::solver& sol,
78  const dictionary& preconditionerDict
79  );
80 
81 
82  // Destructor
83 
84  virtual ~NoPreconditioner() = default;
85 
86 
87  // Member Functions
88 
89  //- Read and reset the preconditioner parameters from the given
90  // dictionary
91  virtual void read(const dictionary& preconditionerDict);
92 
93  //- Return wA the preconditioned form of residual rA
94  virtual void precondition
95  (
96  Field<Type>& wA,
97  const Field<Type>& rA
98  ) const;
99 
100  //- Return wT the transpose-matrix preconditioned form of
101  // residual rT.
102  virtual void preconditionT
103  (
104  Field<Type>& wT,
105  const Field<Type>& rT
106  ) const
107  {
108  return(precondition(wT, rT));
109  }
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
120  #include "NoPreconditioner.C"
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::LduMatrix
LduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Definition: LduMatrix.H:72
Foam::NoPreconditioner::preconditionT
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
Definition: NoPreconditioner.H:102
LduMatrix.H
Foam::NoPreconditioner::read
virtual void read(const dictionary &preconditionerDict)
Read and reset the preconditioner parameters from the given.
Definition: NoPreconditioner.C:46
NoPreconditioner.C
Foam::NoPreconditioner
Null preconditioner for both symmetric and asymmetric matrices.
Definition: NoPreconditioner.H:52
Foam::LduMatrix::solver
Abstract base-class for LduMatrix solvers.
Definition: LduMatrix.H:115
Foam::NoPreconditioner::~NoPreconditioner
virtual ~NoPreconditioner()=default
Foam::Field
Generic templated field type.
Definition: Field.H:63
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::NoPreconditioner::precondition
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const
Return wA the preconditioned form of residual rA.
Definition: NoPreconditioner.C:52
Foam::NoPreconditioner::TypeName
TypeName("none")
Runtime type information.