Skip to content
Snippets Groups Projects
Commit 20eab963 authored by Henry's avatar Henry
Browse files

GAMG solver: Set the following defaults:

    cacheAgglomeration true;
    agglomerator    faceAreaPair;
    nCellsInCoarsestLevel 10;
    mergeLevels     1;
parent 6e87320a
No related merge requests found
......@@ -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
(
......
......@@ -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))
{}
......
......@@ -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
......
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