1 #ifndef AMREX_GMRES_MV_H_
2 #define AMREX_GMRES_MV_H_
19 using PC = std::function<void(
VEC&,
VEC const&)>;
33 void solve (
VEC& a_sol,
VEC const& a_rhs, T a_tol_rel, T a_tol_abs);
49 static void scale (
VEC& vec, T scale_factor);
63 static void linComb (
VEC& lhs, T a,
VEC const& rhs_a, T b,
VEC const& rhs_b);
86 m_gmres.solve(a_sol, a_rhs, a_tol_rel, a_tol_abs);
92 return VEC(m_mat->partition());
98 return VEC(m_mat->partition());
101 template <
typename T>
107 template <
typename T>
113 template <
typename T>
119 template <
typename T>
125 template <
typename T>
131 template <
typename T>
137 template <
typename T>
143 template <
typename T>
149 template <
typename T>
Definition: AMReX_AlgVector.H:19
void setValAsync(T val)
Definition: AMReX_AlgVector.H:153
T norm2(bool local=false) const
Definition: AMReX_AlgVector.H:244
void scaleAsync(T scale_factor)
Definition: AMReX_AlgVector.H:206
void copyAsync(AlgVector< T > const &rhs)
Definition: AMReX_AlgVector.H:168
Definition: AMReX_GMRES_MV.H:13
static void assign(VEC &lhs, VEC const &rhs)
lhs = rhs
Definition: AMReX_GMRES_MV.H:126
PC m_pc
Definition: AMReX_GMRES_MV.H:73
std::function< void(VEC &, VEC const &)> PC
Definition: AMReX_GMRES_MV.H:19
static T norm2(VEC const &vec)
Definition: AMReX_GMRES_MV.H:102
void setVerbose(int v)
Sets verbosity.
Definition: AMReX_GMRES_MV.H:36
VEC makeVecLHS() const
Make MultiFab with ghost cells and set ghost cells to zero.
Definition: AMReX_GMRES_MV.H:96
AlgVector< T > VEC
Definition: AMReX_GMRES_MV.H:16
void apply(VEC &lhs, VEC &rhs) const
lhs = L(rhs)
Definition: AMReX_GMRES_MV.H:144
GM & getGMRES()
Get the GMRES object.
Definition: AMReX_GMRES_MV.H:39
static void scale(VEC &vec, T scale_factor)
Definition: AMReX_GMRES_MV.H:108
void solve(VEC &a_sol, VEC const &a_rhs, T a_tol_rel, T a_tol_abs)
Solve the linear system.
Definition: AMReX_GMRES_MV.H:84
static void linComb(VEC &lhs, T a, VEC const &rhs_a, T b, VEC const &rhs_b)
lhs = a*rhs_a + b*rhs_b
Definition: AMReX_GMRES_MV.H:138
Real RT
Definition: AMReX_GMRES_MV.H:15
static void setToZero(VEC &lhs)
lhs = 0
Definition: AMReX_GMRES_MV.H:120
static void increment(VEC &lhs, VEC const &rhs, T a)
lhs += a*rhs
Definition: AMReX_GMRES_MV.H:132
void precond(VEC &lhs, VEC const &rhs) const
Definition: AMReX_GMRES_MV.H:150
GM m_gmres
Definition: AMReX_GMRES_MV.H:71
GMRES_MV(MAT const *a_mat)
Definition: AMReX_GMRES_MV.H:77
static T dotProduct(VEC const &vec1, VEC const &vec2)
Definition: AMReX_GMRES_MV.H:114
MAT const * m_mat
Definition: AMReX_GMRES_MV.H:72
VEC makeVecRHS() const
Make MultiFab without ghost cells.
Definition: AMReX_GMRES_MV.H:90
void setPrecond(PC a_pc)
Definition: AMReX_GMRES_MV.H:23
void define(M &linop)
Definition: AMReX_GMRES.H:187
void setVerbose(int v)
Sets verbosity.
Definition: AMReX_GMRES.H:104
Definition: AMReX_SpMatrix.H:19
Definition: AMReX_Amr.cpp:49
void SpMV(AlgVector< T > &y, SpMatrix< T > const &A, AlgVector< T > const &x)
Definition: AMReX_SpMV.H:20
void Axpy(AlgVector< T > &y, T a, AlgVector< T > const &x, bool async=false)
Definition: AMReX_AlgVector.H:436
void LinComb(MF &dst, typename MF::value_type a, MF const &src_a, int acomp, typename MF::value_type b, MF const &src_b, int bcomp, int dcomp, int ncomp, IntVect const &nghost)
dst = a*src_a + b*src_b
Definition: AMReX_FabArrayUtility.H:1662
FAB::value_type Dot(FabArray< FAB > const &x, int xcomp, FabArray< FAB > const &y, int ycomp, int ncomp, IntVect const &nghost, bool local=false)
Compute dot products of two FabArrays.
Definition: AMReX_FabArrayUtility.H:1554