4141#include " CSysVector.hpp"
4242#include " ../option_structure.hpp"
4343
44+ SU2_IGNORE_WARNING (" -Wmaybe-uninitialized" )
45+ #include " Eigen/Core"
46+ #include " Eigen/Dense"
47+ SU2_RESTORE_WARNING
48+
4449class CConfig ;
4550class CGeometry ;
4651template <class T >
@@ -110,6 +115,7 @@ class CSysSolve {
110115 mutable unsigned long k = 0 ;
111116 mutable std::vector<VectorType> Z, V; /* !< \brief Large matrices used by FGMRES, v^i+1 = A * z^i. */
112117 mutable std::vector<VectorType> W, T; /* !< \brief Large matrices used by FGCRODR for deflation vectors. */
118+ mutable Eigen::Matrix<ScalarType, Eigen::Dynamic, Eigen::Dynamic> VkWk;
113119
114120 /* !< \brief Temporary used when it is necessary to interface between active and passive types. */
115121 VectorType LinSysSol_tmp;
@@ -292,8 +298,8 @@ class CSysSolve {
292298 template <class Dummy = int >
293299 unsigned long FGCRODR_LinSolverImpl (const VectorType& b, VectorType& x, const ProductType& mat_vec,
294300 const PrecondType& precond, ScalarType tol, unsigned long max_iter,
295- ScalarType& residual, bool monitoring, const CConfig* config,
296- FgcrodrMode mode ) const ;
301+ ScalarType& residual, bool monitoring, const CConfig* config, FgcrodrMode mode,
302+ unsigned long custom_m ) const ;
297303
298304 /* !
299305 * \brief Creates the inner solver for nested preconditioning if the settings allow it.
@@ -316,7 +322,7 @@ class CSysSolve {
316322 * \param[in] tol - tolerance with which to solve the system
317323 * \param[in] m - maximum size of the search subspace
318324 * \param[out] residual - final normalized residual
319- * \param[in] monitoring - turn on priting residuals from solver to screen.
325+ * \param[in] monitoring - turn on priting residuals from solver to screen
320326 * \param[in] config - Definition of the particular problem.
321327 */
322328 unsigned long CG_LinSolver (const VectorType& b, VectorType& x, const ProductType& mat_vec, const PrecondType& precond,
@@ -332,7 +338,7 @@ class CSysSolve {
332338 * \param[in] tol - tolerance with which to solve the system
333339 * \param[in] m - maximum size of the search subspace
334340 * \param[out] residual - final normalized residual
335- * \param[in] monitoring - turn on priting residuals from solver to screen.
341+ * \param[in] monitoring - turn on priting residuals from solver to screen
336342 * \param[in] config - Definition of the particular problem.
337343 */
338344 unsigned long FGMRES_LinSolver (const VectorType& b, VectorType& x, const ProductType& mat_vec,
@@ -355,14 +361,15 @@ class CSysSolve {
355361 * \param[in] tol - tolerance with which to solve the system
356362 * \param[in] max_iter - maximum number of iterations
357363 * \param[out] residual - final normalized residual
358- * \param[in] monitoring - turn on priting residuals from solver to screen.
364+ * \param[in] monitoring - turn on priting residuals from solver to screen
359365 * \param[in] config - Definition of the particular problem.
360366 * \param[in] mode - See FgcrodrMode.
367+ * \param[in] custom_m - alternative maximum size of the search subspace, overrides the config value if != 0.
361368 */
362369 unsigned long FGCRODR_LinSolver (const VectorType& b, VectorType& x, const ProductType& mat_vec,
363370 const PrecondType& precond, ScalarType tol, unsigned long max_iter,
364371 ScalarType& residual, bool monitoring, const CConfig* config,
365- FgcrodrMode mode = FgcrodrMode::NORMAL) const ;
372+ FgcrodrMode mode = FgcrodrMode::NORMAL, unsigned long custom_m = 0 ) const ;
366373
367374 /* !
368375 * \brief Biconjugate Gradient Stabilized Method (BCGSTAB)
@@ -373,7 +380,7 @@ class CSysSolve {
373380 * \param[in] tol - tolerance with which to solve the system
374381 * \param[in] m - maximum size of the search subspace
375382 * \param[out] residual - final normalized residual
376- * \param[in] monitoring - turn on priting residuals from solver to screen.
383+ * \param[in] monitoring - turn on priting residuals from solver to screen
377384 * \param[in] config - Definition of the particular problem.
378385 */
379386 unsigned long BCGSTAB_LinSolver (const VectorType& b, VectorType& x, const ProductType& mat_vec,
@@ -389,7 +396,7 @@ class CSysSolve {
389396 * \param[in] tol - tolerance with which to solve the system
390397 * \param[in] m - maximum number of iterations
391398 * \param[out] residual - final normalized residual
392- * \param[in] monitoring - turn on priting residuals from solver to screen.
399+ * \param[in] monitoring - turn on priting residuals from solver to screen
393400 * \param[in] config - Definition of the particular problem.
394401 */
395402 unsigned long Smoother_LinSolver (const VectorType& b, VectorType& x, const ProductType& mat_vec,
0 commit comments