mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
WilsonMG: Add conformability checks in MG preconditioner
This commit is contained in:
parent
917a92118a
commit
58c30c0cb1
@ -226,6 +226,9 @@ public:
|
|||||||
|
|
||||||
virtual void operator()(Lattice<Fobj> const &in, Lattice<Fobj> &out) {
|
virtual void operator()(Lattice<Fobj> const &in, Lattice<Fobj> &out) {
|
||||||
|
|
||||||
|
conformable(_LevelInfo.Grids[_CurrentLevel], in._grid);
|
||||||
|
conformable(in, out);
|
||||||
|
|
||||||
// TODO: implement a W-cycle
|
// TODO: implement a W-cycle
|
||||||
if(_MultiGridParams.kCycle)
|
if(_MultiGridParams.kCycle)
|
||||||
kCycle(in, out);
|
kCycle(in, out);
|
||||||
@ -484,6 +487,7 @@ public:
|
|||||||
// Member Data
|
// Member Data
|
||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
|
|
||||||
|
int _CurrentLevel;
|
||||||
MultiGridParams &_MultiGridParams;
|
MultiGridParams &_MultiGridParams;
|
||||||
LevelInfo & _LevelInfo;
|
LevelInfo & _LevelInfo;
|
||||||
FineMatrix & _FineMatrix;
|
FineMatrix & _FineMatrix;
|
||||||
@ -494,12 +498,19 @@ public:
|
|||||||
/////////////////////////////////////////////
|
/////////////////////////////////////////////
|
||||||
|
|
||||||
MultiGridPreconditioner(MultiGridParams &mgParams, LevelInfo &LvlInfo, FineMatrix &FineMat, FineMatrix &SmootherMat)
|
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() {}
|
void setup() {}
|
||||||
|
|
||||||
virtual void operator()(Lattice<Fobj> const &in, Lattice<Fobj> &out) {
|
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;
|
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
|
// On the coarsest level we only have a fine what I above call the fine level, no coarse one
|
||||||
|
Loading…
x
Reference in New Issue
Block a user