Put additional debug switches under command-line control

This commit is contained in:
Martin Beaudoin 2014-05-28 22:32:29 -04:00
parent 705a5bc7c9
commit e95300d296
32 changed files with 115 additions and 40 deletions

View file

@ -36,9 +36,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
template<> \ template<> \
int fvPatchTypeField::disallowGenericFvPatchField \ debug::debugSwitch \
fvPatchTypeField::disallowGenericFvPatchField \
( \ ( \
debug::debugSwitchFromDict("disallowGenericFvPatchField", 0) \ "disallowGenericFvPatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \

View file

@ -36,9 +36,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \
template<> \ template<> \
int fvsPatchTypeField::disallowDefaultFvsPatchField \ Foam::debug::debugSwitch \
fvsPatchTypeField::disallowDefaultFvsPatchField \
( \ ( \
debug::debugSwitchFromDict("disallowDefaultFvsPatchField", 0) \ "disallowDefaultFvsPatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \

View file

@ -34,9 +34,11 @@ const Foam::label Foam::polyTopoChange::pointFraction = 10;
const Foam::label Foam::polyTopoChange::faceFraction = 10; const Foam::label Foam::polyTopoChange::faceFraction = 10;
const Foam::label Foam::polyTopoChange::cellFraction = 10; const Foam::label Foam::polyTopoChange::cellFraction = 10;
int Foam::polyTopoChange::debug Foam::debug::debugSwitch
Foam::polyTopoChange::debug
( (
Foam::debug::debugSwitchFromDict("polyTopoChange", 0) "polyTopoChange",
0
); );

View file

@ -121,7 +121,7 @@ class polyTopoChange
public: public:
static int debug; static debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -43,6 +43,7 @@ SourceFiles
#include "faPatch.H" #include "faPatch.H"
#include "DimensionedField.H" #include "DimensionedField.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -96,7 +97,7 @@ public:
TypeName("faPatchField"); TypeName("faPatchField");
//- Debug switch to disallow the use of //- Debug switch to disallow the use of
static int disallowDefaultFaPatchField; static debug::debugSwitch disallowDefaultFaPatchField;
// Declare run-time constructor selection tables // Declare run-time constructor selection tables

View file

@ -36,9 +36,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(faPatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(faPatchTypeField, 0); \
template<> \ template<> \
int faPatchTypeField::disallowDefaultFaPatchField \ Foam::debug::debugSwitch \
faPatchTypeField::disallowDefaultFaPatchField \
( \ ( \
debug::debugSwitchFromDict("disallowDefaultFaPatchField", 0) \ "disallowDefaultFaPatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(faPatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(faPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(faPatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(faPatchTypeField, patchMapper); \

View file

@ -43,6 +43,7 @@ SourceFiles
#include "faPatch.H" #include "faPatch.H"
#include "DimensionedField.H" #include "DimensionedField.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -93,7 +94,7 @@ public:
TypeName("faePatchField"); TypeName("faePatchField");
//- Debug switch to disallow the use of //- Debug switch to disallow the use of
static int disallowDefaultFaePatchField; static debug::debugSwitch disallowDefaultFaePatchField;
// Declare run-time constructor selection tables // Declare run-time constructor selection tables

View file

@ -39,9 +39,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(faePatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(faePatchTypeField, 0); \
template<> \ template<> \
int faePatchTypeField::disallowDefaultFaePatchField \ Foam::debug::debugSwitch \
faePatchTypeField::disallowDefaultFaePatchField \
( \ ( \
debug::debugSwitchFromDict("disallowDefaultFaePatchField", 0) \ "disallowDefaultFaePatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(faePatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(faePatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(faePatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(faePatchTypeField, patchMapper); \

View file

@ -35,7 +35,12 @@ Description
namespace Foam namespace Foam
{ {
int faSchemes::debug(Foam::debug::debugSwitchFromDict("faSchemes", false)); Foam::debug::debugSwitch
faSchemes::debug
(
"faSchemes",
false
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -38,6 +38,7 @@ SourceFiles
#define faSchemes_H #define faSchemes_H
#include "IOdictionary.H" #include "IOdictionary.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -90,7 +91,7 @@ private:
public: public:
//- Debug switch //- Debug switch
static int debug; static debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -46,6 +46,7 @@ SourceFiles
#include "fvPatch.H" #include "fvPatch.H"
#include "DimensionedField.H" #include "DimensionedField.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,7 +115,7 @@ public:
TypeName("fvPatchField"); TypeName("fvPatchField");
//- Debug switch to disallow the use of genericFvPatchField //- Debug switch to disallow the use of genericFvPatchField
static int disallowGenericFvPatchField; static debug::debugSwitch disallowGenericFvPatchField;
// Declare run-time constructor selection tables // Declare run-time constructor selection tables

View file

@ -36,9 +36,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
template<> \ template<> \
int fvPatchTypeField::disallowGenericFvPatchField \ Foam::debug::debugSwitch \
fvPatchTypeField::disallowGenericFvPatchField \
( \ ( \
debug::debugSwitchFromDict("disallowGenericFvPatchField", 0) \ "disallowGenericFvPatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \

View file

@ -98,7 +98,7 @@ public:
TypeName("fvsPatchField"); TypeName("fvsPatchField");
//- Debug switch to disallow the use of //- Debug switch to disallow the use of
static int disallowDefaultFvsPatchField; static debug::debugSwitch disallowDefaultFvsPatchField;
// Declare run-time constructor selection tables // Declare run-time constructor selection tables

View file

@ -36,9 +36,11 @@ namespace Foam
\ \
defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \ defineNamedTemplateTypeNameAndDebug(fvsPatchTypeField, 0); \
template<> \ template<> \
int fvsPatchTypeField::disallowDefaultFvsPatchField \ Foam::debug::debugSwitch \
fvsPatchTypeField::disallowDefaultFvsPatchField \
( \ ( \
debug::debugSwitchFromDict("disallowDefaultFvsPatchField", 0) \ "disallowDefaultFvsPatchField", \
0 \
); \ ); \
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \ defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patch); \
defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \ defineTemplateRunTimeSelectionTable(fvsPatchTypeField, patchMapper); \

View file

@ -29,7 +29,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::fvSchemes::debug(Foam::debug::debugSwitchFromDict("fvSchemes", false)); Foam::debug::debugSwitch
Foam::fvSchemes::debug
(
"fvSchemes",
false
);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

View file

@ -38,6 +38,7 @@ SourceFiles
#define fvSchemes_H #define fvSchemes_H
#include "IOdictionary.H" #include "IOdictionary.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -96,7 +97,7 @@ class fvSchemes
public: public:
//- Debug switch //- Debug switch
static int debug; static debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -28,7 +28,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::cellPointWeight::debug(debug::debugSwitchFromDict("cellPointWeight", 0)); Foam::debug::debugSwitch
Foam::cellPointWeight::debug
(
"cellPointWeight",
0
);
Foam::scalar Foam::cellPointWeight::tol(SMALL); Foam::scalar Foam::cellPointWeight::tol(SMALL);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

View file

@ -84,7 +84,7 @@ protected:
public: public:
//- Debug switch //- Debug switch
static int debug; static debug::debugSwitch debug;
//- Tolerance used in calculating barycentric co-ordinates //- Tolerance used in calculating barycentric co-ordinates
// (applied to normailised values) // (applied to normailised values)

View file

@ -29,7 +29,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::messageStream::level(Foam::debug::debugSwitchFromDict("level", 2)); Foam::debug::debugSwitch
Foam::messageStream::level
(
"level",
2
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -48,6 +48,7 @@ SourceFiles
#include "label.H" #include "label.H"
#include "string.H" #include "string.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -93,7 +94,7 @@ public:
// Debug switches // Debug switches
static int level; static debug::debugSwitch level;
// Constructors // Constructors

View file

@ -30,7 +30,13 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineRunTimeSelectionTable(Foam::functionObject, dictionary); defineRunTimeSelectionTable(Foam::functionObject, dictionary);
int Foam::functionObject::debug(Foam::debug::debugSwitchFromDict("functionObject", 0));
Foam::debug::debugSwitch
Foam::functionObject::debug
(
"functionObject",
0
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -41,6 +41,7 @@ SourceFiles
#include "typeInfo.H" #include "typeInfo.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,7 +77,7 @@ public:
//- Runtime type information //- Runtime type information
virtual const word& type() const = 0; virtual const word& type() const = 0;
static int debug; static debug::debugSwitch debug;
// Declare run-time constructor selection tables // Declare run-time constructor selection tables

View file

@ -28,7 +28,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::scalarRange::debug(::Foam::debug::debugSwitchFromDict("scalarRange", 0)); Foam::debug::debugSwitch
Foam::scalarRange::debug
(
"scalarRange",
0
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -40,6 +40,7 @@ SourceFiles
#define scalarRange_H #define scalarRange_H
#include "scalar.H" #include "scalar.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,7 +83,7 @@ class scalarRange
public: public:
static int debug; static debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -33,7 +33,12 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::solution::debug(::Foam::debug::debugSwitchFromDict("solution", 0)); Foam::debug::debugSwitch
Foam::solution::debug
(
"solution",
0
);
// List of sub-dictionaries to rewrite // List of sub-dictionaries to rewrite
//! @cond localScope //! @cond localScope

View file

@ -36,6 +36,7 @@ SourceFiles
#define solution_H #define solution_H
#include "IOdictionary.H" #include "IOdictionary.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -77,7 +78,7 @@ public:
static label upgradeSolverDict(dictionary& dict, const bool verbose=true); static label upgradeSolverDict(dictionary& dict, const bool verbose=true);
//- Debug switch //- Debug switch
static int debug; static debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -30,7 +30,12 @@ License
const char* const Foam::cell::typeName = "cell"; const char* const Foam::cell::typeName = "cell";
int Foam::cell::debug(debug::debugSwitchFromDict("cell", 0)); Foam::debug::debugSwitch
Foam::cell::debug
(
"cell",
0
);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View file

@ -37,6 +37,7 @@ SourceFiles
#include "faceList.H" #include "faceList.H"
#include "oppositeFace.H" #include "oppositeFace.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,7 +67,7 @@ public:
static const char* const typeName; static const char* const typeName;
//- Debug switch //- Debug switch
static int debug; static Foam::debug::debugSwitch debug;
// Constructors // Constructors

View file

@ -39,9 +39,11 @@ namespace Foam
{ {
defineTypeNameAndDebug(polyPatch, 0); defineTypeNameAndDebug(polyPatch, 0);
int polyPatch::disallowGenericPolyPatch debug::debugSwitch
polyPatch::disallowGenericPolyPatch
( (
debug::debugSwitchFromDict("disallowGenericPolyPatch", 0) "disallowGenericPolyPatch",
0
); );
defineRunTimeSelectionTable(polyPatch, word); defineRunTimeSelectionTable(polyPatch, word);

View file

@ -226,7 +226,7 @@ public:
// Static data // Static data
//- Debug switch to disallow the use of genericPolyPatch //- Debug switch to disallow the use of genericPolyPatch
static int disallowGenericPolyPatch; static debug::debugSwitch disallowGenericPolyPatch;
//- Relative tolerance (for geometric matching) //- Relative tolerance (for geometric matching)
// Calculated as a factor of maximum edge length per face. // Calculated as a factor of maximum edge length per face.

View file

@ -32,7 +32,14 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const char* const Foam::fileName::typeName = "fileName"; const char* const Foam::fileName::typeName = "fileName";
int Foam::fileName::debug(debug::debugSwitchFromDict(fileName::typeName, 0));
Foam::debug::debugSwitch
Foam::fileName::debug
(
fileName::typeName,
0
);
const Foam::fileName Foam::fileName::null; const Foam::fileName Foam::fileName::null;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -45,6 +45,7 @@ SourceFiles
#define fileName_H #define fileName_H
#include "word.H" #include "word.H"
#include "controlSwitches.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,7 +92,7 @@ public:
// Static data members // Static data members
static const char* const typeName; static const char* const typeName;
static int debug; static debug::debugSwitch debug;
static const fileName null; static const fileName null;