From 402e6053912eb7a5769ed5d7dc92ac43c3e666b0 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 28 Nov 2017 11:46:48 +0100 Subject: [PATCH] ENH: expose solutionControl::maxResiduals as a static with simpler parameters - use a Pair with first() / last() residuals --- src/OpenFOAM/meshes/data/data.H | 39 ++++---- .../pimpleControl/pimpleControl.C | 88 +++++++++--------- .../pimpleControl/pimpleControl.H | 10 +-- .../pimpleControl/pimpleControlI.H | 10 +-- .../simpleControl/simpleControl.C | 75 +++++++--------- .../simpleControl/simpleControl.H | 14 +-- .../solutionControl/solutionControl.C | 90 +++++++++++-------- .../solutionControl/solutionControl.H | 52 +++++++---- .../solutionControl/solutionControlI.H | 10 +-- 9 files changed, 202 insertions(+), 186 deletions(-) diff --git a/src/OpenFOAM/meshes/data/data.H b/src/OpenFOAM/meshes/data/data.H index 6158348364..9671fe3020 100644 --- a/src/OpenFOAM/meshes/data/data.H +++ b/src/OpenFOAM/meshes/data/data.H @@ -63,10 +63,10 @@ class data // Private Member Functions //- Disallow default bitwise copy construct - data(const data&); + data(const data&) = delete; //- Disallow default bitwise assignment - void operator=(const data&); + void operator=(const data&) = delete; public: @@ -83,27 +83,24 @@ public: // Member Functions - // Access + //- Return the dictionary of solver performance data which + //- includes initial and final residuals for convergence checking + const dictionary& solverPerformanceDict() const; - //- Return the dictionary of solver performance data - // which includes initial and final residuals for convergence - // checking - const dictionary& solverPerformanceDict() const; + //- Add/set the solverPerformance entry for the named field + template + void setSolverPerformance + ( + const word& name, + const SolverPerformance& sp + ) const; - //- Add/set the solverPerformance entry for the named field - template - void setSolverPerformance - ( - const word& name, - const SolverPerformance& - ) const; - - //- Add/set the solverPerformance entry, using its fieldName - template - void setSolverPerformance - ( - const SolverPerformance& - ) const; + //- Add/set the solverPerformance entry, using its fieldName + template + void setSolverPerformance + ( + const SolverPerformance& sp + ) const; }; diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C index 6d031f05b6..754b711230 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "pimpleControl.H" -#include "Switch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -42,12 +41,12 @@ void Foam::pimpleControl::read() const dictionary& pimpleDict = dict(); - solveFlow_ = pimpleDict.lookupOrDefault("solveFlow", true); + solveFlow_ = pimpleDict.lookupOrDefault("solveFlow", true); nCorrPIMPLE_ = pimpleDict.lookupOrDefault