Commit e22205d3 authored by Henry's avatar Henry
Browse files

GAMG solver: Add additional controls for pre- and post-sweeps:

    preSweepsLevelMultiplier
    maxPreSweeps

    postSweepsLevelMultiplier
    maxPostSweeps

which control the way in which the number of sweeps increases with level
parent c130b38e
......@@ -65,7 +65,11 @@ Foam::GAMGSolver::GAMGSolver
// which may be overridden by those in controlDict
cacheAgglomeration_(false),
nPreSweeps_(0),
preSweepsLevelMultiplier_(1),
maxPreSweeps_(10),
nPostSweeps_(2),
postSweepsLevelMultiplier_(1),
maxPostSweeps_(10),
nFinestSweeps_(2),
scaleCorrection_(matrix.symmetric()),
directSolveCoarsest_(false),
......@@ -156,7 +160,19 @@ void Foam::GAMGSolver::readControls()
// we could also consider supplying defaults here too
controlDict_.readIfPresent("cacheAgglomeration", cacheAgglomeration_);
controlDict_.readIfPresent("nPreSweeps", nPreSweeps_);
controlDict_.readIfPresent
(
"preSweepsLevelMultiplier",
preSweepsLevelMultiplier_
);
controlDict_.readIfPresent("maxPreSweeps", maxPreSweeps_);
controlDict_.readIfPresent("nPostSweeps", nPostSweeps_);
controlDict_.readIfPresent
(
"postSweepsLevelMultiplier",
postSweepsLevelMultiplier_
);
controlDict_.readIfPresent("maxPostSweeps", maxPostSweeps_);
controlDict_.readIfPresent("nFinestSweeps", nFinestSweeps_);
controlDict_.readIfPresent("scaleCorrection", scaleCorrection_);
controlDict_.readIfPresent("directSolveCoarsest", directSolveCoarsest_);
......
......@@ -79,9 +79,21 @@ class GAMGSolver
//- Number of pre-smoothing sweeps
label nPreSweeps_;
//- Lever multiplier for the number of pre-smoothing sweeps
label preSweepsLevelMultiplier_;
//- Maximum number of pre-smoothing sweeps
label maxPreSweeps_;
//- Number of post-smoothing sweeps
label nPostSweeps_;
//- Lever multiplier for the number of post-smoothing sweeps
label postSweepsLevelMultiplier_;
//- Maximum number of post-smoothing sweeps
label maxPostSweeps_;
//- Number of smoothing sweeps on finest mesh
label nFinestSweeps_;
......
......@@ -156,7 +156,11 @@ void Foam::GAMGSolver::Vcycle
coarseCorrFields[leveli],
coarseSources[leveli],
cmpt,
nPreSweeps_ + leveli
min
(
nPreSweeps_ + preSweepsLevelMultiplier_*leveli,
maxPreSweeps_
)
);
scalarField::subField ACf
......@@ -297,7 +301,11 @@ void Foam::GAMGSolver::Vcycle
coarseCorrFields[leveli],
coarseSources[leveli],
cmpt,
nPostSweeps_ + leveli
min
(
nPostSweeps_ + postSweepsLevelMultiplier_*leveli,
maxPostSweeps_
)
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment