GAMG solver: Set the following defaults:

cacheAgglomeration true;
    agglomerator    faceAreaPair;
    nCellsInCoarsestLevel 10;
    mergeLevels     1;
This commit is contained in:
Henry
2015-05-03 18:11:25 +01:00
parent b06c078607
commit 767e1a4e69
3 changed files with 19 additions and 10 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,6 +29,7 @@ License
#include "Time.H"
#include "GAMGInterface.H"
#include "GAMGProcAgglomeration.H"
#include "pairGAMGAgglomeration.H"
#include "IOmanip.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -229,7 +230,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration
nCellsInCoarsestLevel_
(
readLabel(controlDict.lookup("nCellsInCoarsestLevel"))
controlDict.lookupOrDefault<label>("nCellsInCoarsestLevel", 10)
),
meshInterfaces_(mesh.interfaces()),
procAgglomeratorPtr_
@ -284,7 +285,10 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
)
)
{
const word agglomeratorType(controlDict.lookup("agglomerator"));
const word agglomeratorType
(
controlDict.lookupOrDefault<word>("agglomerator", "faceAreaPair")
);
const_cast<Time&>(mesh.thisDb().time()).libs().open
(
@ -339,7 +343,10 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
)
)
{
const word agglomeratorType(controlDict.lookup("agglomerator"));
const word agglomeratorType
(
controlDict.lookupOrDefault<word>("agglomerator", "faceAreaPair")
);
const_cast<Time&>(mesh.thisDb().time()).libs().open
(
@ -382,7 +389,10 @@ Foam::autoPtr<Foam::GAMGAgglomeration> Foam::GAMGAgglomeration::New
const dictionary& controlDict
)
{
const word agglomeratorType(controlDict.lookup("agglomerator"));
const word agglomeratorType
(
controlDict.lookupOrDefault<word>("agglomerator", "faceAreaPair")
);
const_cast<Time&>(mesh.thisDb().time()).libs().open
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,7 @@ Foam::pairGAMGAgglomeration::pairGAMGAgglomeration
)
:
GAMGAgglomeration(mesh, controlDict),
mergeLevels_(readLabel(controlDict.lookup("mergeLevels")))
mergeLevels_(controlDict.lookupOrDefault<label>("mergeLevels", 1))
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,7 @@ Foam::GAMGSolver::GAMGSolver
// Default values for all controls
// which may be overridden by those in controlDict
cacheAgglomeration_(false),
cacheAgglomeration_(true),
nPreSweeps_(0),
preSweepsLevelMultiplier_(1),
maxPreSweeps_(4),
@ -313,7 +313,6 @@ void Foam::GAMGSolver::readControls()
{
lduMatrix::solver::readControls();
// we could also consider supplying defaults here too
controlDict_.readIfPresent("cacheAgglomeration", cacheAgglomeration_);
controlDict_.readIfPresent("nPreSweeps", nPreSweeps_);
controlDict_.readIfPresent