diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 488f690ca4..799273b4ff 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -26,20 +26,14 @@ License #include "cellSource.H" #include "fvMesh.H" #include "volFields.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0); - namespace Foam { - template<> - const char* Foam::NamedEnum - < - Foam::fieldValues::cellSource::sourceType, - 2 - >::names[] = + const char* NamedEnum::names[] = { "cellZone", "all" @@ -47,11 +41,7 @@ namespace Foam template<> - const char* Foam::NamedEnum - < - Foam::fieldValues::cellSource::operationType, - 9 - >::names[] = + const char* NamedEnum::names[] = { "none", "sum", @@ -63,6 +53,12 @@ namespace Foam "max", "CoV" }; + + namespace fieldValues + { + defineTypeNameAndDebug(cellSource, 0); + addToRunTimeSelectionTable(fieldValue, cellSource, dictionary); + } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index d9f822dde5..b5918da056 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -32,19 +32,14 @@ License #include "mergePoints.H" #include "indirectPrimitivePatch.H" #include "PatchTools.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0); - namespace Foam { template<> - const char* Foam::NamedEnum - < - Foam::fieldValues::faceSource::sourceType, - 3 - >::names[] = + const char* NamedEnum::names[] = { "faceZone", "patch", @@ -53,11 +48,7 @@ namespace Foam template<> - const char* Foam::NamedEnum - < - Foam::fieldValues::faceSource::operationType, - 11 - >::names[] = + const char* NamedEnum::names[] = { "none", "sum", @@ -72,6 +63,12 @@ namespace Foam "areaNormalIntegrate" }; + namespace fieldValues + { + defineTypeNameAndDebug(faceSource, 0); + addToRunTimeSelectionTable(fieldValue, faceSource, dictionary); + + } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 731eadc0c1..dc37c6909d 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -26,12 +26,14 @@ License #include "fieldValue.H" #include "fvMesh.H" #include "Time.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(fieldValue, 0); + defineRunTimeSelectionTable(fieldValue, dictionary); } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H index 0a91671f72..1d6befa9ce 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -43,6 +43,7 @@ SourceFiles #include "pointFieldFwd.H" #include "OFstream.H" #include "dictionary.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -106,6 +107,21 @@ public: //- Run-time type information TypeName("fieldValue"); + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + fieldValue, + dictionary, + ( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles + ), + (name, obr, dict, loadFromFiles) + ); //- Construct from components fieldValue @@ -117,6 +133,15 @@ public: const bool loadFromFiles = false ); + //- Return a reference to the selected fieldValue + static autoPtr New + ( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles = false, + const bool output = true + ); //- Destructor virtual ~fieldValue();