|
28 | 28 | #pragma once |
29 | 29 | #include "CMultizoneDriver.hpp" |
30 | 30 | #include "../../../Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp" |
31 | | -#include "../../../Common/include/linear_algebra/CPreconditioner.hpp" |
32 | | -#include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp" |
33 | 31 | #include "../../../Common/include/linear_algebra/CSysSolve.hpp" |
34 | 32 |
|
35 | 33 | /*! |
36 | 34 | * \brief Block Gauss-Seidel driver for multizone / multiphysics discrete adjoint problems. |
37 | 35 | * \ingroup DiscAdj |
38 | 36 | */ |
| 37 | + |
39 | 38 | class CDiscAdjMultizoneDriver : public CMultizoneDriver { |
40 | 39 |
|
41 | 40 | protected: |
42 | | -#ifdef CODI_FORWARD_TYPE |
43 | | - using Scalar = su2double; |
44 | | -#else |
45 | | - using Scalar = passivedouble; |
46 | | -#endif |
47 | | - |
48 | | - class AdjointProduct : public CMatrixVectorProduct<Scalar> { |
49 | | - public: |
50 | | - CDiscAdjMultizoneDriver* const driver; |
51 | | - const unsigned short iZone = 0; |
52 | | - mutable unsigned long iInnerIter = 0; |
53 | | - |
54 | | - AdjointProduct(CDiscAdjMultizoneDriver* d, unsigned short i) : driver(d), iZone(i) {} |
55 | | - |
56 | | - inline void operator()(const CSysVector<Scalar> & u, CSysVector<Scalar> & v) const override { |
57 | | - driver->SetAllSolutions(iZone, true, u); |
58 | | - driver->Iterate(iZone, iInnerIter, true); |
59 | | - driver->GetAllSolutions(iZone, true, v); |
60 | | - v -= u; |
61 | | - ++iInnerIter; |
62 | | - } |
63 | | - }; |
64 | | - |
65 | | - class Identity : public CPreconditioner<Scalar> { |
66 | | - public: |
67 | | - inline bool IsIdentity() const override { return true; } |
68 | | - inline void operator()(const CSysVector<Scalar> & u, CSysVector<Scalar> & v) const override { v = u; } |
69 | | - }; |
| 41 | + #ifdef CODI_FORWARD_TYPE |
| 42 | + using Scalar = su2double; |
| 43 | + #else |
| 44 | + using Scalar = passivedouble; |
| 45 | + #endif |
70 | 46 |
|
71 | 47 | /*! |
72 | 48 | * \brief Kinds of recordings. |
@@ -161,14 +137,14 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { |
161 | 137 | */ |
162 | 138 | void Run() override; |
163 | 139 |
|
164 | | -protected: |
165 | | - |
166 | 140 | /*! |
167 | 141 | * \brief Run one inner iteration for a given zone. |
168 | 142 | * \return The result of "monitor". |
169 | 143 | */ |
170 | 144 | bool Iterate(unsigned short iZone, unsigned long iInnerIter, bool KrylovMode = false); |
171 | 145 |
|
| 146 | +protected: |
| 147 | + |
172 | 148 | /*! |
173 | 149 | * \brief Run inner iterations using a Krylov method (GMRES atm). |
174 | 150 | */ |
|
0 commit comments