1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

WilsonMG: Add conformability checks in MG preconditioner

This commit is contained in:
Daniel Richtmann 2018-03-28 13:17:36 +02:00
parent 917a92118a
commit 58c30c0cb1
No known key found for this signature in database
GPG Key ID: B33C490AF0772057

View File

@ -226,6 +226,9 @@ public:
virtual void operator()(Lattice<Fobj> const &in, Lattice<Fobj> &out) {
conformable(_LevelInfo.Grids[_CurrentLevel], in._grid);
conformable(in, out);
// TODO: implement a W-cycle
if(_MultiGridParams.kCycle)
kCycle(in, out);
@ -484,6 +487,7 @@ public:
// Member Data
/////////////////////////////////////////////
int _CurrentLevel;
MultiGridParams &_MultiGridParams;
LevelInfo & _LevelInfo;
FineMatrix & _FineMatrix;
@ -494,12 +498,19 @@ public:
/////////////////////////////////////////////
MultiGridPreconditioner(MultiGridParams &mgParams, LevelInfo &LvlInfo, FineMatrix &FineMat, FineMatrix &SmootherMat)
: _MultiGridParams(mgParams), _LevelInfo(LvlInfo), _FineMatrix(FineMat), _SmootherMatrix(SmootherMat) {}
: _CurrentLevel(mgParams.nLevels - (0 + 1))
, _MultiGridParams(mgParams)
, _LevelInfo(LvlInfo)
, _FineMatrix(FineMat)
, _SmootherMatrix(SmootherMat) {}
void setup() {}
virtual void operator()(Lattice<Fobj> const &in, Lattice<Fobj> &out) {
conformable(_LevelInfo.Grids[_CurrentLevel], in._grid);
conformable(in, out);
auto coarseSolverMaxIter = _MultiGridParams.coarseSolverMaxOuterIter * _MultiGridParams.coarseSolverMaxInnerIter;
// On the coarsest level we only have a fine what I above call the fine level, no coarse one