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 "cellSource.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0);
|
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum
|
const char* NamedEnum<fieldValues::cellSource::sourceType, 2>::names[] =
|
||||||
<
|
|
||||||
Foam::fieldValues::cellSource::sourceType,
|
|
||||||
2
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"cellZone",
|
"cellZone",
|
||||||
"all"
|
"all"
|
||||||
@ -47,11 +41,7 @@ namespace Foam
|
|||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum
|
const char* NamedEnum<fieldValues::cellSource::operationType, 9>::names[] =
|
||||||
<
|
|
||||||
Foam::fieldValues::cellSource::operationType,
|
|
||||||
9
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"none",
|
"none",
|
||||||
"sum",
|
"sum",
|
||||||
@ -63,6 +53,12 @@ namespace Foam
|
|||||||
"max",
|
"max",
|
||||||
"CoV"
|
"CoV"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace fieldValues
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(cellSource, 0);
|
||||||
|
addToRunTimeSelectionTable(fieldValue, cellSource, dictionary);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,19 +32,14 @@ License
|
|||||||
#include "mergePoints.H"
|
#include "mergePoints.H"
|
||||||
#include "indirectPrimitivePatch.H"
|
#include "indirectPrimitivePatch.H"
|
||||||
#include "PatchTools.H"
|
#include "PatchTools.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0);
|
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum
|
const char* NamedEnum<fieldValues::faceSource::sourceType, 3>::names[] =
|
||||||
<
|
|
||||||
Foam::fieldValues::faceSource::sourceType,
|
|
||||||
3
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"faceZone",
|
"faceZone",
|
||||||
"patch",
|
"patch",
|
||||||
@ -53,11 +48,7 @@ namespace Foam
|
|||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
const char* Foam::NamedEnum
|
const char* NamedEnum<fieldValues::faceSource::operationType, 11>::names[] =
|
||||||
<
|
|
||||||
Foam::fieldValues::faceSource::operationType,
|
|
||||||
11
|
|
||||||
>::names[] =
|
|
||||||
{
|
{
|
||||||
"none",
|
"none",
|
||||||
"sum",
|
"sum",
|
||||||
@ -72,6 +63,12 @@ namespace Foam
|
|||||||
"areaNormalIntegrate"
|
"areaNormalIntegrate"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace fieldValues
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(faceSource, 0);
|
||||||
|
addToRunTimeSelectionTable(fieldValue, faceSource, dictionary);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,12 +26,14 @@ License
|
|||||||
#include "fieldValue.H"
|
#include "fieldValue.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(fieldValue, 0);
|
defineTypeNameAndDebug(fieldValue, 0);
|
||||||
|
defineRunTimeSelectionTable(fieldValue, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ SourceFiles
|
|||||||
#include "pointFieldFwd.H"
|
#include "pointFieldFwd.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -106,6 +107,21 @@ public:
|
|||||||
//- Run-time type information
|
//- Run-time type information
|
||||||
TypeName("fieldValue");
|
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
|
//- Construct from components
|
||||||
fieldValue
|
fieldValue
|
||||||
@ -117,6 +133,15 @@ public:
|
|||||||
const bool loadFromFiles = false
|
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
|
//- Destructor
|
||||||
virtual ~fieldValue();
|
virtual ~fieldValue();
|
||||||
|
|||||||
Reference in New Issue
Block a user