NoPreconditioner.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::NoPreconditioner
26 
27 Description
28  Null preconditioner for both symmetric and asymmetric matrices.
29 
30 SourceFiles
31  NoPreconditioner.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef NoPreconditioner_H
36 #define NoPreconditioner_H
37 
38 #include "LduMatrix.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class NoPreconditioner Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type, class DType, class LUType>
50 class NoPreconditioner
51 :
52  public LduMatrix<Type, DType, LUType>::preconditioner
53 {
54  // Private Member Functions
55 
56  //- Disallow default bitwise copy construct
58 
59  //- Disallow default bitwise assignment
60  void operator=(const NoPreconditioner&);
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("none");
67 
68 
69  // Constructors
70 
71  //- Construct from matrix components and preconditioner data dictionary
73  (
74  const typename LduMatrix<Type, DType, LUType>::solver& sol,
75  const dictionary& preconditionerDict
76  );
77 
78 
79  // Destructor
80 
81  virtual ~NoPreconditioner()
82  {}
83 
84 
85  // Member Functions
86 
87  //- Read and reset the preconditioner parameters from the given
88  // dictionary
89  virtual void read(const dictionary& preconditionerDict);
90 
91  //- Return wA the preconditioned form of residual rA
92  virtual void precondition
93  (
94  Field<Type>& wA,
95  const Field<Type>& rA
96  ) const;
97 
98  //- Return wT the transpose-matrix preconditioned form of
99  // residual rT.
100  virtual void preconditionT
101  (
102  Field<Type>& wT,
103  const Field<Type>& rT
104  ) const
105  {
106  return(precondition(wT, rT));
107  }
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #ifdef NoRepository
118  #include "NoPreconditioner.C"
119 #endif
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("none")
Runtime type information.
virtual void read(const dictionary &preconditionerDict)
Read and reset the preconditioner parameters from the given.
Pre-declare SubField and related Field type.
Definition: Field.H:57
Abstract base-class for LduMatrix solvers.
Definition: LduMatrix.H:112
Null preconditioner for both symmetric and asymmetric matrices.
virtual void precondition(Field< Type > &wA, const Field< Type > &rA) const
Return wA the preconditioned form of residual rA.
LduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: LduMatrix.H:69
virtual void preconditionT(Field< Type > &wT, const Field< Type > &rT) const
Return wT the transpose-matrix preconditioned form of.
Namespace for OpenFOAM.