\doxysection{multigrid.\+hpp}
\hypertarget{multigrid_8hpp_source}{}\label{multigrid_8hpp_source}\index{ginkgo/core/solver/multigrid.hpp@{ginkgo/core/solver/multigrid.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2024\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_SOLVER\_MULTIGRID\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_SOLVER\_MULTIGRID\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <complex>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <functional>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <utility>}}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/abstract\_factory.hpp>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/array.hpp>}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception\_helpers.hpp>}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/lin\_op.hpp>}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/math.hpp>}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/precision\_dispatch.hpp>}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/config.hpp>}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/registry.hpp>}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ <ginkgo/core/config/type\_descriptor.hpp>}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ <ginkgo/core/log/logger.hpp>}}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/dense.hpp>}}
\DoxyCodeLine{00026\ \textcolor{preprocessor}{\#include\ <ginkgo/core/matrix/identity.hpp>}}
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ <ginkgo/core/multigrid/multigrid\_level.hpp>}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ <ginkgo/core/solver/solver\_base.hpp>}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/combined.hpp>}}
\DoxyCodeLine{00030\ \textcolor{preprocessor}{\#include\ <ginkgo/core/stop/criterion.hpp>}}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ }
\DoxyCodeLine{00033\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00034\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1solver}{solver}}\ \{}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00042\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid}{multigrid}}\ \{}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00054\ \textcolor{keyword}{enum\ class}\ \doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a4f89fc8a003f879d4ff2f482c2fbab68}{cycle}}\ \{\ v,\ f,\ w\ \};}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00070\ \textcolor{keyword}{enum\ class}\ \doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a24ab73573aae583623848c9bfaf0fddf}{mid\_smooth\_type}}\ \{\ both,\ post\_smoother,\ pre\_smoother,\ standalone\ \};}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \textcolor{comment}{//\ It\ should\ only\ be\ used\ internally}}
\DoxyCodeLine{00077\ \textcolor{keyword}{class\ }MultigridState;}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00081\ \}\ \ \textcolor{comment}{//\ namespace\ multigrid}}
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00107\ \textcolor{keyword}{class\ }Multigrid\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<Multigrid>,}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnableSolverBase<Multigrid>,}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnableIterativeBase<Multigrid>,}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{public}\ EnableApplyWithInitialGuess<Multigrid>\ \{}
\DoxyCodeLine{00111\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnableLinOp}{EnableLinOp}}<Multigrid>;}
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}<Multigrid,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}>;}
\DoxyCodeLine{00113\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }EnableApplyWithInitialGuess<Multigrid>;}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00115\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a708c25e7a2bcffb7ef0d98092d9d49e2}{apply\_uses\_initial\_guess}}()\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00123\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>get\_default\_initial\_guess()\ ==}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aa1f5f6080965ed6d0a90e6b9ec599e441}{initial\_guess\_mode::provided}};}
\DoxyCodeLine{00126\ \ \ \ \ \}}
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00133\ \ \ \ \ std::vector<std::shared\_ptr<const\ gko::multigrid::MultigridLevel>>}
\DoxyCodeLine{00134\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a329f84de3bf22628d198d18b0c0eeb82}{get\_mg\_level\_list}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00135\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mg\_level\_list\_;}
\DoxyCodeLine{00137\ \ \ \ \ \}}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00144\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a86822c874e019217a3bb1c7d356b42ab}{get\_pre\_smoother\_list}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00145\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ pre\_smoother\_list\_;}
\DoxyCodeLine{00147\ \ \ \ \ \}}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00154\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a4c7ff92d47f52b9a8b053db8b83a43df}{get\_mid\_smoother\_list}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00155\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00156\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mid\_smoother\_list\_;}
\DoxyCodeLine{00157\ \ \ \ \ \}}
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00164\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_ad0c56b5c7ad6c1093f3d13ba3a6cbe40}{get\_post\_smoother\_list}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00165\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ post\_smoother\_list\_;}
\DoxyCodeLine{00167\ \ \ \ \ \}}
\DoxyCodeLine{00168\ }
\DoxyCodeLine{00174\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a087f1555d94936b092fa6e8c9fc3f4c4}{get\_coarsest\_solver}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00175\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ coarsest\_solver\_;}
\DoxyCodeLine{00177\ \ \ \ \ \}}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00184\ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a4f89fc8a003f879d4ff2f482c2fbab68}{multigrid::cycle}}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a69ed1a6c1ac6c01f0700cdab8a5a1e1c}{get\_cycle}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ parameters\_.cycle;\ \}}
\DoxyCodeLine{00185\ }
\DoxyCodeLine{00191\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_a4a7d27445ab1f3228c827e9ee2c94c19}{set\_cycle}}(\doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a4f89fc8a003f879d4ff2f482c2fbab68}{multigrid::cycle}}\ cycle)\ \{\ parameters\_.cycle\ =\ cycle;\ \}}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ }
\DoxyCodeLine{00194\ \ \ \ \ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1solver_1_1Factory}{Factory}};}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00196\ \ \ \ \ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type}{parameters\_type}}}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{structgko_1_1solver_1_1enable__iterative__solver__factory__parameters}{enable\_iterative\_solver\_factory\_parameters}}<parameters\_type,}
\DoxyCodeLine{00198\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Factory>\ \{}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOpFactory>>}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_af8671d3890209b0063dae79c31ce489d}{mg\_level}});}
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ std::function<\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}},\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*)>}
\DoxyCodeLine{00232\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a99106889c07fe8076e65a73739d39a98}{level\_selector}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00233\ }
\DoxyCodeLine{00248\ \ \ \ \ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOpFactory>>}
\DoxyCodeLine{00249\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a80863b6dcda27058ce478cac54e18873}{pre\_smoother}});}
\DoxyCodeLine{00250\ }
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOpFactory>>}
\DoxyCodeLine{00257\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a11e65993abbf3a397709cabd1958edbc}{post\_smoother}});}
\DoxyCodeLine{00258\ }
\DoxyCodeLine{00266\ \ \ \ \ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOpFactory>>}
\DoxyCodeLine{00267\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_ac9cfc41847d5f9fe9b01b260a07e1d39}{mid\_smoother}});}
\DoxyCodeLine{00268\ }
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_abf546fafeff1ff864440bf05f6524dd0}{post\_uses\_pre}},\ \textcolor{keyword}{true});}
\DoxyCodeLine{00274\ }
\DoxyCodeLine{00282\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a24ab73573aae583623848c9bfaf0fddf}{multigrid::mid\_smooth\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00283\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_abc24bca2fd9c007318d9d135f9b04ab6}{mid\_case}},\ multigrid::mid\_smooth\_type::standalone);}
\DoxyCodeLine{00284\ }
\DoxyCodeLine{00292\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a2e4dd4ccd56c5becbbc60d3538b8dfe6}{max\_levels}},\ 10);}
\DoxyCodeLine{00293\ }
\DoxyCodeLine{00299\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a6ad3e4e874e1fcc987b269e3473449c6}{min\_coarse\_rows}},\ 64);}
\DoxyCodeLine{00300\ }
\DoxyCodeLine{00307\ \ \ \ \ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOpFactory>>}
\DoxyCodeLine{00308\ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_DEFERRED\_FACTORY\_VECTOR\_PARAMETER(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a0ba9248107e2b06f82f38c772f3ff121}{coarsest\_solver}});}
\DoxyCodeLine{00309\ }
\DoxyCodeLine{00332\ \ \ \ \ \ \ \ \ std::function<\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}},\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*)>}
\DoxyCodeLine{00333\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_ac722bf3fa49f15200604b9e30f492621}{solver\_selector}},\ \textcolor{keyword}{nullptr});}
\DoxyCodeLine{00334\ }
\DoxyCodeLine{00340\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_1_1multigrid_a4f89fc8a003f879d4ff2f482c2fbab68}{multigrid::cycle}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_aa9d6ce71458ca0427a1e53d679f8ee7b}{cycle}},}
\DoxyCodeLine{00341\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ multigrid::cycle::v);}
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00351\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a870fb93b6b4af67fea91ae1c76671126}{kcycle\_base}},\ 1);}
\DoxyCodeLine{00352\ }
\DoxyCodeLine{00360\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_adf03e53e31294aeebdbcb1bd128f3221}{kcycle\_rel\_tol}},\ 0.25);}
\DoxyCodeLine{00361\ }
\DoxyCodeLine{00366\ \ \ \ \ \ \ \ \ std::complex<double>\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a53ee23a630f6bce8940c98cc9000c561}{smoother\_relax}},\ 0.9);}
\DoxyCodeLine{00367\ }
\DoxyCodeLine{00372\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(\doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a88fd9e554c67014556e1da4d96e8c6d3}{smoother\_iters}},\ 1);}
\DoxyCodeLine{00373\ }
\DoxyCodeLine{00378\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ \doxymbox{\hyperlink{group__LinOp_ga49d4c09c39f06b22bebbbfd1d8bfe450}{GKO\_FACTORY\_PARAMETER\_SCALAR}}(}
\DoxyCodeLine{00379\ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type_a6f9a8a0ea54a9865cb0d2f62e0d8fc8e}{default\_initial\_guess}},\ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8aad02c4c4cde7ae76252540d116a40f23a}{initial\_guess\_mode::zero}});}
\DoxyCodeLine{00380\ \ \ \ \ \};}
\DoxyCodeLine{00381\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga8e0af90ec2414b768266f77cedffc309}{GKO\_ENABLE\_LIN\_OP\_FACTORY}}(Multigrid,\ parameters,\ Factory);}
\DoxyCodeLine{00382\ \ \ \ \ \doxymbox{\hyperlink{group__LinOp_ga521f65604cc4cf427dcb2ecfa49b757c}{GKO\_ENABLE\_BUILD\_METHOD}}(Factory);}
\DoxyCodeLine{00383\ }
\DoxyCodeLine{00398\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1solver_1_1Multigrid_1_1parameters__type}{parameters\_type}}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_af95b9cf44b04f023808f2f6243588560}{parse}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode}{config::pnode}}\&\ config,}
\DoxyCodeLine{00399\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1registry}{config::registry}}\&\ context,}
\DoxyCodeLine{00400\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1config_1_1type__descriptor}{config::type\_descriptor}}\&\ td\_for\_child\ =}
\DoxyCodeLine{00401\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ config::make\_type\_descriptor<>());}
\DoxyCodeLine{00402\ }
\DoxyCodeLine{00403\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00404\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00405\ }
\DoxyCodeLine{00406\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,}
\DoxyCodeLine{00407\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00408\ }
\DoxyCodeLine{00409\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00410\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00411\ }
\DoxyCodeLine{00412\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_with\_initial\_guess\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ alpha,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ b,}
\DoxyCodeLine{00413\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ beta,\ \doxymbox{\hyperlink{classgko_1_1LinOp}{LinOp}}*\ x,}
\DoxyCodeLine{00414\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00415\ }
\DoxyCodeLine{00416\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ VectorType>}
\DoxyCodeLine{00417\ \ \ \ \ \textcolor{keywordtype}{void}\ apply\_dense\_impl(\textcolor{keyword}{const}\ VectorType*\ b,\ VectorType*\ x,}
\DoxyCodeLine{00418\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_1_1solver_a82d21321745fbd3dc65c276d5838bb8a}{initial\_guess\_mode}}\ guess)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00419\ }
\DoxyCodeLine{00424\ \ \ \ \ \textcolor{keywordtype}{void}\ generate();}
\DoxyCodeLine{00425\ }
\DoxyCodeLine{00426\ \ \ \ \ \textcolor{keyword}{explicit}\ Multigrid(std::shared\_ptr<const\ Executor>\ exec);}
\DoxyCodeLine{00427\ }
\DoxyCodeLine{00428\ \ \ \ \ \textcolor{keyword}{explicit}\ Multigrid(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid_1_1Factory}{Factory}}*\ factory,}
\DoxyCodeLine{00429\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ LinOp>\ system\_matrix);}
\DoxyCodeLine{00430\ }
\DoxyCodeLine{00434\ \ \ \ \ \textcolor{keywordtype}{void}\ validate();}
\DoxyCodeLine{00435\ }
\DoxyCodeLine{00445\ \ \ \ \ \textcolor{keywordtype}{void}\ verify\_legal\_length(\textcolor{keywordtype}{bool}\ checked,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ len,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ ref\_len);}
\DoxyCodeLine{00446\ }
\DoxyCodeLine{00447\ \ \ \ \ \textcolor{keywordtype}{void}\ create\_state()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00448\ }
\DoxyCodeLine{00449\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00450\ \ \ \ \ std::vector<std::shared\_ptr<const\ gko::multigrid::MultigridLevel>>}
\DoxyCodeLine{00451\ \ \ \ \ \ \ \ \ mg\_level\_list\_\{\};}
\DoxyCodeLine{00452\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ pre\_smoother\_list\_\{\};}
\DoxyCodeLine{00453\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ mid\_smoother\_list\_\{\};}
\DoxyCodeLine{00454\ \ \ \ \ std::vector<std::shared\_ptr<const\ LinOp>>\ post\_smoother\_list\_\{\};}
\DoxyCodeLine{00455\ \ \ \ \ std::shared\_ptr<const\ LinOp>\ coarsest\_solver\_\{\};}
\DoxyCodeLine{00456\ \ \ \ \ std::function<\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}},\ \textcolor{keyword}{const}\ LinOp*)>\ level\_selector\_;}
\DoxyCodeLine{00457\ \ \ \ \ std::function<\doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}},\ \textcolor{keyword}{const}\ LinOp*)>\ solver\_selector\_;}
\DoxyCodeLine{00458\ }
\DoxyCodeLine{00469\ \ \ \ \ \textcolor{keyword}{mutable}\ \textcolor{keyword}{struct\ }cache\_struct\ \{}
\DoxyCodeLine{00470\ \ \ \ \ \ \ \ \ cache\_struct()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00471\ }
\DoxyCodeLine{00472\ \ \ \ \ \ \ \ \ \string~cache\_struct()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00473\ }
\DoxyCodeLine{00474\ \ \ \ \ \ \ \ \ cache\_struct(\textcolor{keyword}{const}\ cache\_struct\&)\ \{\}}
\DoxyCodeLine{00475\ }
\DoxyCodeLine{00476\ \ \ \ \ \ \ \ \ cache\_struct(cache\_struct\&\&)\ \{\}}
\DoxyCodeLine{00477\ }
\DoxyCodeLine{00478\ \ \ \ \ \ \ \ \ cache\_struct\&\ operator=(\textcolor{keyword}{const}\ cache\_struct\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00479\ }
\DoxyCodeLine{00480\ \ \ \ \ \ \ \ \ cache\_struct\&\ operator=(cache\_struct\&\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00481\ }
\DoxyCodeLine{00482\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ unique\_ptr\ with\ default\ destructor\ does\ not\ work\ with\ the\ incomplete}}
\DoxyCodeLine{00483\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ type.}}
\DoxyCodeLine{00484\ \ \ \ \ \ \ \ \ std::shared\_ptr<multigrid::detail::MultigridState>\ state\{\};}
\DoxyCodeLine{00485\ \ \ \ \ \}\ cache\_;}
\DoxyCodeLine{00486\ \};}
\DoxyCodeLine{00487\ }
\DoxyCodeLine{00488\ \textcolor{keyword}{template}\ <>}
\DoxyCodeLine{00489\ \textcolor{keyword}{struct\ }\doxymbox{\hyperlink{structgko_1_1solver_1_1workspace__traits}{workspace\_traits}}<\doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid}{Multigrid}}>\ \{}
\DoxyCodeLine{00490\ \ \ \ \ \textcolor{keyword}{using\ }Solver\ =\ \doxymbox{\hyperlink{classgko_1_1solver_1_1Multigrid}{Multigrid}};}
\DoxyCodeLine{00491\ \ \ \ \ \textcolor{comment}{//\ number\ of\ vectors\ used\ by\ this\ workspace}}
\DoxyCodeLine{00492\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00493\ \ \ \ \ \textcolor{comment}{//\ number\ of\ arrays\ used\ by\ this\ workspace}}
\DoxyCodeLine{00494\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ num\_arrays(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00495\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_vectors\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00496\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ op\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00497\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ the\ num\_arrays\ names\ for\ the\ workspace\ vectors}}
\DoxyCodeLine{00498\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<std::string>\ array\_names(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00499\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ scalar\ vectors\ (independent\ of\ problem\ size)}}
\DoxyCodeLine{00500\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ scalars(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00501\ \ \ \ \ \textcolor{comment}{//\ array\ containing\ all\ varying\ vectors\ (dependent\ on\ problem\ size)}}
\DoxyCodeLine{00502\ \ \ \ \ \textcolor{keyword}{static}\ std::vector<int>\ vectors(\textcolor{keyword}{const}\ Solver\&);}
\DoxyCodeLine{00503\ }
\DoxyCodeLine{00504\ \ \ \ \ \textcolor{comment}{//\ stopping\ status\ array}}
\DoxyCodeLine{00505\ \ \ \ \ \textcolor{keyword}{constexpr}\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ stop\ =\ 0;}
\DoxyCodeLine{00506\ \};}
\DoxyCodeLine{00507\ }
\DoxyCodeLine{00508\ }
\DoxyCodeLine{00509\ \}\ \ \textcolor{comment}{//\ namespace\ solver}}
\DoxyCodeLine{00510\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00511\ }
\DoxyCodeLine{00512\ }
\DoxyCodeLine{00513\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_SOLVER\_MULTIGRID\_HPP\_}}

\end{DoxyCode}
