parProfilingSolver.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) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::parProfilingSolver
28 
29 Description
30  Wrapper to switch on parProfiling around a linear solver.
31 
32  Used in combination with parProfiling functionObject.
33 
34 Usage
35  Example of linear solver specification in fvSolution:
36  \verbatim
37  solvers
38  {
39  p
40  {
41  solver parProfiling;
42  // Actual solver to use
43  baseSolver PCG;
44  preconditioner DIC;
45  ..
46  }
47  }
48  \endverbatim
49 
50 SourceFiles
51  parProfiling.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef Foam_parProfilingSolver_H
56 #define Foam_parProfilingSolver_H
57 
58 #include "lduMatrix.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class parProfilingSolver Declaration
67 \*---------------------------------------------------------------------------*/
68 
70 :
71  public lduMatrix::solver
72 {
73  // Private Data
74 
75  //- Underlying solver
77 
78 
79  // Private Member Functions
80 
81  //- No copy construct
82  parProfilingSolver(const parProfilingSolver&) = delete;
83 
84  //- No copy assignment
85  void operator=(const parProfilingSolver&) = delete;
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("parProfilingSolver");
92 
93 
94  // Constructors
95 
96  //- Construct from matrix components and solver controls
98  (
99  const word& fieldName,
100  const lduMatrix& matrix,
104  const dictionary& solverControls
105  );
106 
107 
108  //- Destructor
109  virtual ~parProfilingSolver() = default;
110 
111 
112  // Member Functions
113 
114  //- Solve the matrix with forwarding to the base solver
115  virtual solverPerformance solve
116  (
117  scalarField& psi,
118  const scalarField& source,
119  const direction cmpt=0
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
const FieldField< Field, scalar > & interfaceBouCoeffs() const noexcept
Definition: lduMatrix.H:311
uint8_t direction
Definition: direction.H:46
virtual ~parProfilingSolver()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual solverPerformance solve(scalarField &psi, const scalarField &source, const direction cmpt=0) const
Solve the matrix with forwarding to the base solver.
const lduMatrix & matrix() const noexcept
Definition: lduMatrix.H:306
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
A class for handling words, derived from Foam::string.
Definition: word.H:63
SolverPerformance is the class returned by the LduMatrix solver containing performance statistics...
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:129
const lduInterfaceFieldPtrsList & interfaces() const noexcept
Definition: lduMatrix.H:321
Wrapper to switch on parProfiling around a linear solver.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: lduMatrix.H:79
const FieldField< Field, scalar > & interfaceIntCoeffs() const noexcept
Definition: lduMatrix.H:316
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
const volScalarField & psi
const word & fieldName() const noexcept
Definition: lduMatrix.H:301
Namespace for OpenFOAM.
TypeName("parProfilingSolver")
Runtime type information.