From 7dd0f2aa89851b82f49683597c809115cedfdc5e Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 5 Jan 2016 14:22:54 +0000 Subject: [PATCH] Bugfix: update for debug handling on library load --- .../cfdTools/general/adjustPhi/adjustPhi.C | 14 +++--- src/foam/global/debug/debug.C | 50 +++++++++---------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C index af398be58..a58c687fa 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C @@ -33,6 +33,14 @@ License // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // +// Note: all tolerances need to be global statics: closedDomainTol +// taken outside of the function. HJ, 25/Dec/2015 +static const Foam::debug::tolerancesSwitch closedDomainTol +( + "closedDomainTol", + 1e-10 +); + bool Foam::adjustPhi ( surfaceScalarField& phi, @@ -116,12 +124,6 @@ bool Foam::adjustPhi scalar massCorr = 1.0; - static const debug::tolerancesSwitch closedDomainTol - ( - "closedDomainTol", - 1e-10 - ); - if (mag(adjustableMassOut) > SMALL) { massCorr = (massIn - fixedMassOut)/adjustableMassOut; diff --git a/src/foam/global/debug/debug.C b/src/foam/global/debug/debug.C index 60fdc56fd..c2a165cda 100644 --- a/src/foam/global/debug/debug.C +++ b/src/foam/global/debug/debug.C @@ -416,7 +416,7 @@ void Foam::debug::updateCentralDictVars } sortedValidKeys.sort(); - FatalErrorIn + WarningIn ( "debug::updateCentralDictVars\n" "(\n" @@ -425,10 +425,10 @@ void Foam::debug::updateCentralDictVars " const bool verbose\n" ")" ) << "Usage of non-existent DebugSwitches name: " - << key << nl << nl + << key << ". Cannot be changed." << nl << nl << "Valid entries for this application are: " << sortedValidKeys - << exit(FatalError); + << endl; } } else @@ -514,19 +514,19 @@ void Foam::debug::updateCentralDictVars } sortedValidKeys.sort(); - FatalErrorIn - ( - "debug::updateCentralDictVars\n" - "(\n" - " const globalControlDictSwitchSet,\n" - " const string& keyValues,\n" - " const bool verbose\n" - ")" - ) << "Usage of non-existent InfoSwitches name: " - << key << nl << nl - << "Valid entries for this application are: " - << sortedValidKeys - << exit(FatalError); + WarningIn + ( + "debug::updateCentralDictVars\n" + "(\n" + " const globalControlDictSwitchSet,\n" + " const string& keyValues,\n" + " const bool verbose\n" + ")" + ) << "Usage of non-existent InfoSwitches name: " + << key << ". Cannot change." << nl << nl + << "Valid entries for this application are: " + << sortedValidKeys + << endl; } } else @@ -673,7 +673,7 @@ void Foam::debug::updateCentralDictVars } sortedValidKeys.sort(); - FatalErrorIn + WarningIn ( "debug::updateCentralDictVars\n" "(\n" @@ -683,10 +683,10 @@ void Foam::debug::updateCentralDictVars ")" ) << "Usage of non-existent " << " OptimisationSwitches name: " << key - << endl << endl + << ". Cannot change." << endl << endl << "Valid entries for this application are: " << sortedValidKeys - << exit(FatalError); + << endl; } } else @@ -784,7 +784,7 @@ void Foam::debug::updateCentralDictVars } sortedValidKeys.sort(); - FatalErrorIn + WarningIn ( "debug::updateCentralDictVars\n" "(\n" @@ -793,10 +793,10 @@ void Foam::debug::updateCentralDictVars " const bool verbose\n" ")" ) << "Usage of non-existent Tolerances name: " - << key << nl << nl + << key << ". Cannot change." << nl << nl << "Valid entries for this application are: " << sortedValidKeys - << exit(FatalError); + << endl; } } else @@ -896,7 +896,7 @@ void Foam::debug::updateCentralDictVars } sortedValidKeys.sort(); - FatalErrorIn + WarningIn ( "debug::updateCentralDictVars\n" "(\n" @@ -906,10 +906,10 @@ void Foam::debug::updateCentralDictVars ")" ) << "Usage of non-existent " << "DimensionedConstants name: " - << key << nl << nl + << key << "Cannot change." << nl << nl << "Valid entries for this application are: " << sortedValidKeys - << exit(FatalError); + << endl; } } else