mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cleanup of Enum class
- more dictionary-like methods, enforce keyType::LITERAL for all
lookups to avoid any spurious keyword matching.
- new readEntry, readIfPresent methods
- The get() method replaces the now deprecate lookup() method.
- Deprecate lookupOrFailsafe()
Failsafe behaviour is now an optional parameter for lookupOrDefault,
which makes it easier to tailor behaviour at runtime.
- output of the names is now always flatted without line-breaks.
Thus,
os << flatOutput(someEnumNames.names()) << nl;
os << someEnumNames << nl;
both generate the same output.
- Constructor now uses C-string (const char*) directly instead of
Foam::word in its initializer_list.
- Remove special enum + initializer_list constructor form since
it can create unbounded lookup indices.
- Removd old hasEnum, hasName forms that were provided during initial
transition from NamedEnum.
- Added static_assert on Enum contents to restrict to enum or
integral values. Should not likely be using this class to enumerate
other things since it internally uses an 'int' for its values.
Changed volumeType accordingly to enumerate on its type (enum),
not the class itself.
This commit is contained in:
@ -44,10 +44,10 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldAverageItem::baseType
|
||||
>
|
||||
Foam::functionObjects::fieldAverageItem::baseTypeNames_
|
||||
{
|
||||
({
|
||||
{ baseType::ITER, "iteration" },
|
||||
{ baseType::TIME, "time" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
@ -55,11 +55,11 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldAverageItem::windowType
|
||||
>
|
||||
Foam::functionObjects::fieldAverageItem::windowTypeNames_
|
||||
{
|
||||
({
|
||||
{ windowType::NONE, "none" },
|
||||
{ windowType::APPROXIMATE, "approximate" },
|
||||
{ windowType::EXACT, "exact" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -69,13 +69,12 @@ Foam::Istream& Foam::functionObjects::operator>>
|
||||
faItem.fieldName_ = dictEntry.keyword();
|
||||
faItem.mean_ = dict.get<bool>("mean");
|
||||
faItem.prime2Mean_ = dict.get<bool>("prime2Mean");
|
||||
faItem.base_ = faItem.baseTypeNames_.lookup("base", dict);
|
||||
faItem.base_ = faItem.baseTypeNames_.get("base", dict);
|
||||
faItem.window_ = dict.lookupOrDefault<scalar>("window", -1.0);
|
||||
|
||||
if (faItem.window_ > 0)
|
||||
{
|
||||
faItem.windowType_ =
|
||||
faItem.windowTypeNames_.lookup("windowType", dict);
|
||||
faItem.windowType_ = faItem.windowTypeNames_.get("windowType", dict);
|
||||
|
||||
if (faItem.windowType_ != fieldAverageItem::windowType::NONE)
|
||||
{
|
||||
|
||||
@ -43,10 +43,10 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldMinMax::modeType
|
||||
>
|
||||
Foam::functionObjects::fieldMinMax::modeTypeNames_
|
||||
{
|
||||
({
|
||||
{ modeType::mdMag, "magnitude" },
|
||||
{ modeType::mdCmpt, "component" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -46,13 +46,13 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldValues::fieldValueDelta::operationType
|
||||
>
|
||||
Foam::functionObjects::fieldValues::fieldValueDelta::operationTypeNames_
|
||||
{
|
||||
({
|
||||
{ operationType::opAdd, "add" },
|
||||
{ operationType::opSubtract, "subtract" },
|
||||
{ operationType::opMin, "min" },
|
||||
{ operationType::opMax, "max" },
|
||||
{ operationType::opAverage, "average" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
@ -146,7 +146,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read
|
||||
).ptr()
|
||||
);
|
||||
|
||||
operation_ = operationTypeNames_.lookup("operation", dict);
|
||||
operation_ = operationTypeNames_.get("operation", dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -55,12 +55,12 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
|
||||
>
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
|
||||
{
|
||||
({
|
||||
{ regionTypes::stFaceZone, "faceZone" },
|
||||
{ regionTypes::stPatch, "patch" },
|
||||
{ regionTypes::stSurface, "surface" },
|
||||
{ regionTypes::stSampledSurface, "sampledSurface" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
@ -68,7 +68,7 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
|
||||
>
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
|
||||
{
|
||||
({
|
||||
// Normal operations
|
||||
{ operationType::opNone, "none" },
|
||||
{ operationType::opMin, "min" },
|
||||
@ -98,17 +98,17 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
|
||||
{ operationType::opAbsWeightedAreaAverage, "absWeightedAreaAverage" },
|
||||
{ operationType::opAbsWeightedAreaIntegrate, "absWeightedAreaIntegrate" },
|
||||
{ operationType::opAbsWeightedUniformity, "absWeightedUniformity" },
|
||||
};
|
||||
});
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
|
||||
>
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
|
||||
{
|
||||
({
|
||||
{ postOperationType::postOpNone, "none" },
|
||||
{ postOperationType::postOpSqrt, "sqrt" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -901,15 +901,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
)
|
||||
:
|
||||
fieldValue(name, runTime, dict, typeName),
|
||||
regionType_(regionTypeNames_.lookup("regionType", dict)),
|
||||
operation_(operationTypeNames_.lookup("operation", dict)),
|
||||
regionType_(regionTypeNames_.get("regionType", dict)),
|
||||
operation_(operationTypeNames_.get("operation", dict)),
|
||||
postOperation_
|
||||
(
|
||||
postOperationTypeNames_.lookupOrDefault
|
||||
(
|
||||
"postOperation",
|
||||
dict,
|
||||
postOperationType::postOpNone
|
||||
postOperationType::postOpNone,
|
||||
true // Failsafe behaviour
|
||||
)
|
||||
),
|
||||
weightFieldName_("none"),
|
||||
@ -932,15 +933,16 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
)
|
||||
:
|
||||
fieldValue(name, obr, dict, typeName),
|
||||
regionType_(regionTypeNames_.lookup("regionType", dict)),
|
||||
operation_(operationTypeNames_.lookup("operation", dict)),
|
||||
regionType_(regionTypeNames_.get("regionType", dict)),
|
||||
operation_(operationTypeNames_.get("operation", dict)),
|
||||
postOperation_
|
||||
(
|
||||
postOperationTypeNames_.lookupOrDefault
|
||||
(
|
||||
"postOperation",
|
||||
dict,
|
||||
postOperationType::postOpNone
|
||||
postOperationType::postOpNone,
|
||||
true // Failsafe behaviour
|
||||
)
|
||||
),
|
||||
weightFieldName_("none"),
|
||||
|
||||
@ -48,7 +48,7 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldValues::volFieldValue::operationType
|
||||
>
|
||||
Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_
|
||||
{
|
||||
({
|
||||
// Normal operations
|
||||
{ operationType::opNone, "none" },
|
||||
{ operationType::opMin, "min" },
|
||||
@ -65,7 +65,7 @@ Foam::functionObjects::fieldValues::volFieldValue::operationTypeNames_
|
||||
{ operationType::opWeightedAverage, "weightedAverage" },
|
||||
{ operationType::opWeightedVolAverage, "weightedVolAverage" },
|
||||
{ operationType::opWeightedVolIntegrate, "weightedVolIntegrate" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -205,7 +205,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
|
||||
:
|
||||
fieldValue(name, runTime, dict, typeName),
|
||||
volRegion(fieldValue::mesh_, dict),
|
||||
operation_(operationTypeNames_.lookup("operation", dict)),
|
||||
operation_(operationTypeNames_.get("operation", dict)),
|
||||
weightFieldName_("none")
|
||||
{
|
||||
read(dict);
|
||||
@ -222,7 +222,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
|
||||
:
|
||||
fieldValue(name, obr, dict, typeName),
|
||||
volRegion(fieldValue::mesh_, dict),
|
||||
operation_(operationTypeNames_.lookup("operation", dict)),
|
||||
operation_(operationTypeNames_.get("operation", dict)),
|
||||
weightFieldName_("none")
|
||||
{
|
||||
read(dict);
|
||||
|
||||
@ -59,13 +59,13 @@ const Foam::Enum
|
||||
Foam::functionObjects::fluxSummary::modeType
|
||||
>
|
||||
Foam::functionObjects::fluxSummary::modeTypeNames_
|
||||
{
|
||||
({
|
||||
{ modeType::mdFaceZone , "faceZone" },
|
||||
{ modeType::mdFaceZoneAndDirection, "faceZoneAndDirection" },
|
||||
{ modeType::mdCellZoneAndDirection, "cellZoneAndDirection" },
|
||||
{ modeType::mdSurface, "surface" },
|
||||
{ modeType::mdSurfaceAndDirection, "surfaceAndDirection" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -817,7 +817,7 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
|
||||
fvMeshFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
|
||||
mode_ = modeTypeNames_.lookup("mode", dict);
|
||||
mode_ = modeTypeNames_.get("mode", dict);
|
||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
|
||||
tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 0.8);
|
||||
|
||||
@ -53,12 +53,12 @@ const Foam::Enum
|
||||
Foam::functionObjects::setFlow::modeType
|
||||
>
|
||||
Foam::functionObjects::setFlow::modeTypeNames
|
||||
{
|
||||
({
|
||||
{ functionObjects::setFlow::modeType::FUNCTION, "function" },
|
||||
{ functionObjects::setFlow::modeType::ROTATION, "rotation" },
|
||||
{ functionObjects::setFlow::modeType::VORTEX2D, "vortex2D" },
|
||||
{ functionObjects::setFlow::modeType::VORTEX3D, "vortex3D" }
|
||||
};
|
||||
{ functionObjects::setFlow::modeType::VORTEX3D, "vortex3D" },
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -137,7 +137,8 @@ bool Foam::functionObjects::setFlow::read(const dictionary& dict)
|
||||
if (fvMeshFunctionObject::read(dict))
|
||||
{
|
||||
Info<< name() << ":" << endl;
|
||||
mode_ = modeTypeNames.lookup("mode", dict);
|
||||
|
||||
modeTypeNames.readEntry("mode", dict, mode_);
|
||||
|
||||
Info<< " operating mode: " << modeTypeNames[mode_] << endl;
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ const Foam::Enum
|
||||
Foam::functionObjects::turbulenceFields::compressibleField
|
||||
>
|
||||
Foam::functionObjects::turbulenceFields::compressibleFieldNames_
|
||||
{
|
||||
({
|
||||
{ compressibleField::cfK, "k" },
|
||||
{ compressibleField::cfEpsilon, "epsilon" },
|
||||
{ compressibleField::cfOmega, "omega" },
|
||||
@ -62,8 +62,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_
|
||||
{ compressibleField::cfR, "R" },
|
||||
{ compressibleField::cfDevRhoReff, "devRhoReff" },
|
||||
{ compressibleField::cfL, "L" },
|
||||
{ compressibleField::cfI, "I" }
|
||||
};
|
||||
{ compressibleField::cfI, "I" },
|
||||
});
|
||||
|
||||
|
||||
const Foam::Enum
|
||||
@ -71,7 +71,7 @@ const Foam::Enum
|
||||
Foam::functionObjects::turbulenceFields::incompressibleField
|
||||
>
|
||||
Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
|
||||
{
|
||||
({
|
||||
{ incompressibleField::ifK, "k" },
|
||||
{ incompressibleField::ifEpsilon, "epsilon" },
|
||||
{ incompressibleField::ifOmega, "omega" },
|
||||
@ -81,8 +81,8 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_
|
||||
{ incompressibleField::ifR, "R" },
|
||||
{ incompressibleField::ifDevReff, "devReff" },
|
||||
{ incompressibleField::ifL, "L" },
|
||||
{ incompressibleField::ifI, "I" }
|
||||
};
|
||||
{ incompressibleField::ifI, "I" },
|
||||
});
|
||||
|
||||
|
||||
const Foam::word Foam::functionObjects::turbulenceFields::modelName
|
||||
|
||||
@ -52,22 +52,22 @@ const Foam::Enum
|
||||
Foam::functionObjects::fieldVisualisationBase::colourByType
|
||||
>
|
||||
Foam::functionObjects::fieldVisualisationBase::colourByTypeNames
|
||||
{
|
||||
({
|
||||
{ colourByType::cbColour, "colour" },
|
||||
{ colourByType::cbField, "field" },
|
||||
};
|
||||
});
|
||||
|
||||
const Foam::Enum
|
||||
<
|
||||
Foam::functionObjects::fieldVisualisationBase::colourMapType
|
||||
>
|
||||
Foam::functionObjects::fieldVisualisationBase::colourMapTypeNames
|
||||
{
|
||||
({
|
||||
{ colourMapType::cmRainbow, "rainbow" },
|
||||
{ colourMapType::cmBlueWhiteRed, "blueWhiteRed" },
|
||||
{ colourMapType::cmFire, "fire" },
|
||||
{ colourMapType::cmGreyscale, "greyscale" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -489,7 +489,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
|
||||
colourMap_(cmRainbow),
|
||||
range_()
|
||||
{
|
||||
colourBy_ = colourByTypeNames.lookup("colourBy", dict);
|
||||
colourByTypeNames.readEntry("colourBy", dict, colourBy_);
|
||||
|
||||
switch (colourBy_)
|
||||
{
|
||||
@ -502,10 +502,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
|
||||
{
|
||||
dict.readEntry("range", range_);
|
||||
|
||||
if (dict.found("colourMap"))
|
||||
{
|
||||
colourMap_ = colourMapTypeNames.lookup("colourMap", dict);
|
||||
}
|
||||
colourMapTypeNames.readIfPresent("colourMap", dict, colourMap_);
|
||||
|
||||
const dictionary& sbarDict = dict.subDict("scalarBar");
|
||||
sbarDict.readEntry("visible", scalarBar_.visible_);
|
||||
|
||||
@ -37,11 +37,11 @@ const Foam::Enum
|
||||
Foam::functionObjects::runTimePostPro::geometryBase::renderModeType
|
||||
>
|
||||
Foam::functionObjects::runTimePostPro::geometryBase::renderModeTypeNames
|
||||
{
|
||||
({
|
||||
{ renderModeType::rmFlat, "flat" },
|
||||
{ renderModeType::rmGouraud, "gouraud" },
|
||||
{ renderModeType::rmPhong, "phong" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -87,15 +87,13 @@ Foam::functionObjects::runTimePostPro::geometryBase::geometryBase
|
||||
parent_(parent),
|
||||
name_(dict.dictName()),
|
||||
visible_(dict.get<bool>("visible")),
|
||||
renderMode_(rmGouraud),
|
||||
renderMode_
|
||||
(
|
||||
renderModeTypeNames.lookupOrDefault("renderMode", dict, rmGouraud)
|
||||
),
|
||||
opacity_(nullptr),
|
||||
colours_(colours)
|
||||
{
|
||||
if (dict.found("renderMode"))
|
||||
{
|
||||
renderMode_ = renderModeTypeNames.lookup("renderMode", dict);
|
||||
}
|
||||
|
||||
if (dict.found("opacity"))
|
||||
{
|
||||
opacity_.reset(Function1<scalar>::New("opacity", dict).ptr());
|
||||
|
||||
@ -55,12 +55,12 @@ const Foam::Enum
|
||||
Foam::functionObjects::runTimePostPro::pathline::representationType
|
||||
>
|
||||
Foam::functionObjects::runTimePostPro::pathline::representationTypeNames
|
||||
{
|
||||
({
|
||||
{ representationType::rtNone, "none" },
|
||||
{ representationType::rtLine, "line" },
|
||||
{ representationType::rtTube, "tube" },
|
||||
{ representationType::rtVector, "vector" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -129,7 +129,7 @@ Foam::functionObjects::runTimePostPro::pathline::pathline
|
||||
geometryBase(parent, dict, colours),
|
||||
representation_
|
||||
(
|
||||
representationTypeNames.lookup("representation", dict)
|
||||
representationTypeNames.get("representation", dict)
|
||||
),
|
||||
tubeRadius_(0.0),
|
||||
lineColour_(nullptr)
|
||||
|
||||
@ -55,10 +55,10 @@ const Foam::Enum
|
||||
Foam::functionObjects::runTimePostPro::pointData::representationType
|
||||
>
|
||||
Foam::functionObjects::runTimePostPro::pointData::representationTypeNames
|
||||
{
|
||||
({
|
||||
{ representationType::rtSphere, "sphere" },
|
||||
{ representationType::rtVector, "vector" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -99,7 +99,7 @@ Foam::functionObjects::runTimePostPro::pointData::pointData
|
||||
geometryBase(parent, dict, colours),
|
||||
representation_
|
||||
(
|
||||
representationTypeNames.lookup("representation", dict)
|
||||
representationTypeNames.get("representation", dict)
|
||||
),
|
||||
maxGlyphLength_(dict.get<scalar>("maxGlyphLength")),
|
||||
pointColour_(nullptr)
|
||||
|
||||
@ -56,13 +56,13 @@ const Foam::Enum
|
||||
Foam::functionObjects::runTimePostPro::surface::representationType
|
||||
>
|
||||
Foam::functionObjects::runTimePostPro::surface::representationTypeNames
|
||||
{
|
||||
({
|
||||
{ representationType::rtNone, "none" },
|
||||
{ representationType::rtWireframe, "wireframe" },
|
||||
{ representationType::rtSurface, "surface" },
|
||||
{ representationType::rtSurfaceWithEdges, "surfaceWithEdges" },
|
||||
{ representationType::rtGlyph, "glyph" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
@ -149,7 +149,7 @@ Foam::functionObjects::runTimePostPro::surface::surface
|
||||
geometryBase(parent, dict, colours),
|
||||
representation_
|
||||
(
|
||||
representationTypeNames.lookup("representation", dict)
|
||||
representationTypeNames.get("representation", dict)
|
||||
),
|
||||
featureEdges_(false),
|
||||
surfaceColour_(nullptr),
|
||||
|
||||
@ -106,11 +106,12 @@ Foam::functionObjects::ensightWrite::ensightWrite
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
writeOpts_
|
||||
(
|
||||
IOstreamOption::formatNames.lookupOrFailsafe
|
||||
IOstreamOption::formatNames.lookupOrDefault
|
||||
(
|
||||
"format",
|
||||
dict,
|
||||
runTime.writeFormat()
|
||||
runTime.writeFormat(),
|
||||
true // Failsafe behaviour
|
||||
)
|
||||
),
|
||||
caseOpts_(writeOpts_.format()),
|
||||
|
||||
@ -58,10 +58,10 @@ const Foam::Enum
|
||||
>
|
||||
Foam::functionObjects::runTimeControls::equationInitialResidualCondition::
|
||||
operatingModeNames
|
||||
{
|
||||
({
|
||||
{ operatingMode::omMin, "minimum" },
|
||||
{ operatingMode::omMax, "maximum" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -79,7 +79,7 @@ equationInitialResidualCondition
|
||||
fieldNames_(dict.get<wordList>("fields")),
|
||||
value_(dict.get<scalar>("value")),
|
||||
timeStart_(dict.lookupOrDefault("timeStart", -GREAT)),
|
||||
mode_(operatingModeNames.lookup("mode", dict))
|
||||
mode_(operatingModeNames.get("mode", dict))
|
||||
{
|
||||
if (fieldNames_.size())
|
||||
{
|
||||
|
||||
@ -66,10 +66,10 @@ const Foam::Enum
|
||||
::modeType
|
||||
>
|
||||
Foam::functionObjects::runTimeControls::minMaxCondition::modeTypeNames_
|
||||
{
|
||||
({
|
||||
{ modeType::mdMin, "minimum" },
|
||||
{ modeType::mdMax, "maximum" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -84,7 +84,7 @@ Foam::functionObjects::runTimeControls::minMaxCondition::minMaxCondition
|
||||
:
|
||||
runTimeCondition(name, obr, dict, state),
|
||||
functionObjectName_(dict.get<word>("functionObject")),
|
||||
mode_(modeTypeNames_.lookup("mode", dict)),
|
||||
mode_(modeTypeNames_.get("mode", dict)),
|
||||
fieldNames_(dict.get<wordList>("fields")),
|
||||
value_(dict.get<scalar>("value"))
|
||||
{}
|
||||
|
||||
@ -50,11 +50,11 @@ const Foam::Enum
|
||||
Foam::functionObjects::writeObjects::writeOption
|
||||
>
|
||||
Foam::functionObjects::writeObjects::writeOptionNames_
|
||||
{
|
||||
({
|
||||
{ writeOption::AUTO_WRITE, "autoWrite" },
|
||||
{ writeOption::NO_WRITE, "noWrite" },
|
||||
{ writeOption::ANY_WRITE, "anyWrite" },
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -89,8 +89,8 @@ bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
|
||||
|
||||
if (dict.found("field"))
|
||||
{
|
||||
objectNames_.setSize(1);
|
||||
dict.readEntry("field", objectNames_[0]);
|
||||
objectNames_.resize(1);
|
||||
dict.readEntry("field", objectNames_.first());
|
||||
}
|
||||
else if (dict.found("fields"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user