Commit 1a806fa2 authored by Henry's avatar Henry
Browse files

Add support for reading and updating the debug switches of templated

classes in the DebugSwitches sub-dictionary of system/controlDict
parent 03316b00
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -40,6 +40,46 @@ Description
// definitions (debug information only)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
namespace Foam
{
//- Define the debug information, lookup as \a Name
template<class Type>
class AddToDebug
:
public ::Foam::simpleRegIOobject
{
public:
//- The unique AddToDebug object
static const AddToDebug addToDebug;
AddToDebug(const char* name)
:
::Foam::simpleRegIOobject(Foam::debug::addDebugObject, name)
{}
virtual ~AddToDebug()
{}
virtual void readData(Foam::Istream& is)
{
Type::debug = readLabel(is);
}
virtual void writeData(Foam::Ostream& os) const
{
os << Type::debug;
}
};
} // End namespace Foam
#define registerTemplateDebugSwitchWithName(Type,Name) \
template<> \
const Foam::AddToDebug<Type> Foam::AddToDebug<Type>::addToDebug(Name)
//- Define the debug information, lookup as \a Name
#define registerDebugSwitchWithName(Type,Tag,Name) \
class add##Tag##ToDebug \
......@@ -135,11 +175,13 @@ Description
//- Define the debug information for templates, lookup as \a Name
# define defineTemplateDebugSwitchWithName(Type, Name, DebugSwitch) \
template<> \
defineDebugSwitchWithName(Type, Name, DebugSwitch)
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
registerTemplateDebugSwitchWithName(Type, Name)
//- Define the debug information for templates sub-classes, lookup as \a Name
# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \
template<> \
defineDebugSwitchWithName(Type, Name, DebugSwitch)
defineDebugSwitchWithName(Type, Name, DebugSwitch); \
registerTemplateDebugSwitchWithName(Type, Name)
#endif
//- Define the debug information for templates
......
......@@ -27,43 +27,39 @@ License
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebugWithName
(
constSolid_thermalBaffle1DFvPatchScalarField,
Foam::compressible::constSolid_thermalBaffle1DFvPatchScalarField,
"compressible::thermalBaffle1D<hConstSolidThermoPhysics>",
0
);
addToPatchFieldRunTimeSelection
(
fvPatchScalarField,
constSolid_thermalBaffle1DFvPatchScalarField
);
defineTemplateTypeNameAndDebugWithName
(
expoSolid_thermalBaffle1DFvPatchScalarField,
Foam::compressible::expoSolid_thermalBaffle1DFvPatchScalarField,
"compressible::thermalBaffle1D<hExponentialSolidThermoPhysics>",
0
);
addToPatchFieldRunTimeSelection
(
fvPatchScalarField,
expoSolid_thermalBaffle1DFvPatchScalarField
);
namespace Foam
{
namespace compressible
{
addToPatchFieldRunTimeSelection
(
fvPatchScalarField,
constSolid_thermalBaffle1DFvPatchScalarField
);
addToPatchFieldRunTimeSelection
(
fvPatchScalarField,
expoSolid_thermalBaffle1DFvPatchScalarField
);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //
......@@ -90,14 +90,16 @@ License
#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
typedef Foam::SType##Models::Type<Foam::eddyDiffusivity<Foam::BaseModel> > \
Type##SType##BaseModel; \
defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
\
namespace Foam \
{ \
namespace SType##Models \
{ \
typedef Type<eddyDiffusivity<BaseModel> > Type##SType##BaseModel; \
\
defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
\
addToRunTimeSelectionTable \
( \
SType##BaseModel, \
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -88,14 +88,15 @@ License
#define makeTemplatedTurbulenceModel(BaseModel, SType, Type) \
defineNamedTemplateTypeNameAndDebug \
(Foam::SType##Models::Type<Foam::BaseModel>, 0); \
\
namespace Foam \
{ \
namespace SType##Models \
{ \
typedef Type<BaseModel> Type##SType##BaseModel; \
\
defineNamedTemplateTypeNameAndDebug(Type##SType##BaseModel, 0); \
\
addToRunTimeSelectionTable \
( \
SType##BaseModel, \
......
......@@ -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
......@@ -34,77 +34,71 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
// Combustion models based on sensibleEnthalpy
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
);
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
);
}
}
// Combustion models based on sensibleEnthalpy
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
);
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
FSD,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -31,14 +31,8 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel);
}
}
makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel);
makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel);
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -30,43 +30,61 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \
\
typedef CombModel<CombType, Thermo> CombModel##CombType##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType##Thermo, \
#CombModel"<"#CombType","#Thermo">", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType##Thermo, \
dictionary \
);
#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \
\
typedef Foam::combustionModels::CombModel \
<Foam::combustionModels::CombType, Foam::Thermo> \
CombModel##CombType##Thermo; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType##Thermo, \
#CombModel"<"#CombType","#Thermo">", \
0 \
); \
\
namespace Foam \
{ \
namespace combustionModels \
{ \
typedef CombModel<CombType, Thermo> CombModel##CombType##Thermo; \
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType##Thermo, \
dictionary \
); \
} \
}
#define makeCombustionTypes(CombModel, CombType, Table) \
\
typedef CombModel<CombType> CombModel##CombType; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType, \
#CombModel"<"#CombType">", \
0 \
); \
\
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType, \
dictionary \
);
#define makeCombustionTypes(CombModel, CombType, Table) \
\
typedef Foam::combustionModels::CombModel \
<Foam::combustionModels::CombType> \
CombModel##CombType; \
\
defineTemplateTypeNameAndDebugWithName \
( \
CombModel##CombType, \
#CombModel"<"#CombType">", \
0 \
); \
\
namespace Foam \
{ \
namespace combustionModels \
{ \
typedef CombModel<CombType> CombModel##CombType; \
\
addToRunTimeSelectionTable \
( \
Table, \
CombModel##CombType, \
dictionary \
); \
} \
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -32,78 +32,72 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace combustionModels
{
// Combustion models based on sensibleEnthalpy
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
);
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasEThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasEThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasEThermoPhysics,
rhoCombustionModel
);
}
}
// Combustion models based on sensibleEnthalpy
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
constGasHThermoPhysics,
psiCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
gasHThermoPhysics,
rhoCombustionModel
);
makeCombustionTypesThermo
(
diffusion,
rhoThermoCombustion,
constGasHThermoPhysics,
rhoCombustionModel
);
// Combustion models based on sensibleInternalEnergy
makeCombustionTypesThermo
(
diffusion,
psiThermoCombustion,
gasEThermoPhysics,