mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added run-time selection for fieldValue function object
This commit is contained in:
@ -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<fieldValues::cellSource::sourceType, 2>::names[] =
|
||||
{
|
||||
"cellZone",
|
||||
"all"
|
||||
@ -47,11 +41,7 @@ namespace Foam
|
||||
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::fieldValues::cellSource::operationType,
|
||||
9
|
||||
>::names[] =
|
||||
const char* NamedEnum<fieldValues::cellSource::operationType, 9>::names[] =
|
||||
{
|
||||
"none",
|
||||
"sum",
|
||||
@ -63,6 +53,12 @@ namespace Foam
|
||||
"max",
|
||||
"CoV"
|
||||
};
|
||||
|
||||
namespace fieldValues
|
||||
{
|
||||
defineTypeNameAndDebug(cellSource, 0);
|
||||
addToRunTimeSelectionTable(fieldValue, cellSource, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<fieldValues::faceSource::sourceType, 3>::names[] =
|
||||
{
|
||||
"faceZone",
|
||||
"patch",
|
||||
@ -53,11 +48,7 @@ namespace Foam
|
||||
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::fieldValues::faceSource::operationType,
|
||||
11
|
||||
>::names[] =
|
||||
const char* NamedEnum<fieldValues::faceSource::operationType, 11>::names[] =
|
||||
{
|
||||
"none",
|
||||
"sum",
|
||||
@ -72,6 +63,12 @@ namespace Foam
|
||||
"areaNormalIntegrate"
|
||||
};
|
||||
|
||||
namespace fieldValues
|
||||
{
|
||||
defineTypeNameAndDebug(faceSource, 0);
|
||||
addToRunTimeSelectionTable(fieldValue, faceSource, dictionary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<fieldValue> New
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles = false,
|
||||
const bool output = true
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
virtual ~fieldValue();
|
||||
|
||||
Reference in New Issue
Block a user