functionObjects: Removed the redundant "viable" member function

Construction failure and recovery is not handled with exceptions in functionObjectList
This commit is contained in:
Henry Weller
2016-05-11 12:57:17 +01:00
parent 82151962c5
commit 437030a57d
99 changed files with 220 additions and 1154 deletions

View File

@ -54,23 +54,16 @@ Foam::functionObjects::writeVTK::writeVTK
obr_(obr), obr_(obr),
objectNames_() objectNames_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::writeVTK::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::writeVTK::~writeVTK() Foam::functionObjects::writeVTK::~writeVTK()

View File

@ -131,16 +131,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~writeVTK(); virtual ~writeVTK();

View File

@ -76,18 +76,6 @@ ${typeName}FunctionObject::${typeName}FunctionObject
} }
bool ${typeName}FunctionObject::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
${typeName}FunctionObject::~${typeName}FunctionObject() ${typeName}FunctionObject::~${typeName}FunctionObject()

View File

@ -102,16 +102,6 @@ public:
const bool loadFromFilesUnused = false const bool loadFromFilesUnused = false
); );
//- Construct for given objectRegistry and dictionary.
// Allow the possibility to load fields from files
static bool viable
(
const word& name,
const objectRegistry& unused,
const dictionary&,
const bool loadFromFilesUnused = false
);
//- Destructor //- Destructor
virtual ~${typeName}FunctionObject(); virtual ~${typeName}FunctionObject();

View File

@ -30,7 +30,7 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(FUNCTIONOBJECT, 0); defineTypeNameAndDebug(FUNCTIONOBJECT, 0);
} }
@ -83,8 +83,7 @@ void Foam::FUNCTIONOBJECT::timeSet()
void Foam::FUNCTIONOBJECT::write() void Foam::FUNCTIONOBJECT::write()
{ {}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -134,7 +134,7 @@ public:
// Member Functions // Member Functions
//- Return name of the FUNCTIONOBJECT //- Return name of the FUNCTIONOBJECT
virtual const word& name() const const word& name() const
{ {
return name_; return name_;
} }

View File

@ -66,32 +66,6 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
{} {}
template<class OutputFilter>
bool Foam::IOOutputFilter<OutputFilter>::viable
(
const word& outputFilterName,
const objectRegistry& obr,
const word& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles
)
{
IOdictionary dict
(
IOobject
(
dictName,
obr.time().system(),
obr,
rOpt,
IOobject::NO_WRITE
)
);
return OutputFilter::viable(outputFilterName, obr, dict, readFromFiles);
}
template<class OutputFilter> template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::IOOutputFilter Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
( (

View File

@ -94,16 +94,6 @@ public:
const bool loadFromFile = false const bool loadFromFile = false
); );
//- Return true if the construction of this functionObject is viable
static bool viable
(
const word& outputFilterName,
const objectRegistry&,
const word& dictName = OutputFilter::typeName() + "Dict",
const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
const bool loadFromFiles = false
);
//- Construct for given objectRegistry and dictionary //- Construct for given objectRegistry and dictionary
// Dictionary read from full path. // Dictionary read from full path.
// Allow the possibility to load fields from files // Allow the possibility to load fields from files

View File

@ -56,49 +56,27 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::allocateFilter()
{ {
if (dictName_.size()) if (dictName_.size())
{ {
if ptr_.reset
( (
IOOutputFilter<OutputFilter>::viable new IOOutputFilter<OutputFilter>
( (
name(), name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dictName_ dictName_
) )
) );
{
ptr_.reset
(
new IOOutputFilter<OutputFilter>
(
name(),
time_.lookupObject<objectRegistry>(regionName_),
dictName_
)
);
}
} }
else else
{ {
if ptr_.reset
( (
OutputFilter::viable new OutputFilter
( (
name(), name(),
time_.lookupObject<objectRegistry>(regionName_), time_.lookupObject<objectRegistry>(regionName_),
dict_ dict_
) )
) );
{
ptr_.reset
(
new OutputFilter
(
name(),
time_.lookupObject<objectRegistry>(regionName_),
dict_
)
);
}
} }
return ptr_.valid(); return ptr_.valid();

View File

@ -92,23 +92,16 @@ Foam::functionObjects::div::div
fieldName_("undefined-fieldName"), fieldName_("undefined-fieldName"),
resultName_("undefined-resultName") resultName_("undefined-resultName")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::div::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::div::~div() Foam::functionObjects::div::~div()

View File

@ -125,16 +125,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~div(); virtual ~div();

View File

@ -277,23 +277,16 @@ Foam::functionObjects::fieldAverage::fieldAverage
totalTime_(), totalTime_(),
periodIndex_(1) periodIndex_(1)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::fieldAverage::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldAverage::~fieldAverage() Foam::functionObjects::fieldAverage::~fieldAverage()

View File

@ -301,16 +301,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~fieldAverage(); virtual ~fieldAverage();

View File

@ -53,6 +53,12 @@ fieldCoordinateSystemTransform
fieldSet_(), fieldSet_(),
coordSys_(obr, dict) coordSys_(obr, dict)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
Info<< type() << " " << name_ << ":" << nl Info<< type() << " " << name_ << ":" << nl
@ -61,19 +67,6 @@ fieldCoordinateSystemTransform
} }
bool Foam::functionObjects::fieldCoordinateSystemTransform::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldCoordinateSystemTransform:: Foam::functionObjects::fieldCoordinateSystemTransform::

View File

@ -155,16 +155,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~fieldCoordinateSystemTransform(); virtual ~fieldCoordinateSystemTransform();

View File

@ -68,23 +68,16 @@ Foam::functionObjects::fieldMinMax::fieldMinMax
mode_(mdMag), mode_(mdMag),
fieldSet_() fieldSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::fieldMinMax::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldMinMax::~fieldMinMax() Foam::functionObjects::fieldMinMax::~fieldMinMax()

View File

@ -181,16 +181,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~fieldMinMax(); virtual ~fieldMinMax();

View File

@ -218,23 +218,16 @@ Foam::functionObjects::fieldValues::cellSource::cellSource
weightFieldName_("none"), weightFieldName_("none"),
writeVolume_(dict.lookupOrDefault("writeVolume", false)) writeVolume_(dict.lookupOrDefault("writeVolume", false))
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::fieldValues::cellSource::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::cellSource::~cellSource() Foam::functionObjects::fieldValues::cellSource::~cellSource()

View File

@ -250,16 +250,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~cellSource(); virtual ~cellSource();

View File

@ -660,23 +660,16 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
facePatchId_(), facePatchId_(),
faceSign_() faceSign_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::fieldValues::faceSource::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::faceSource::~faceSource() Foam::functionObjects::fieldValues::faceSource::~faceSource()

View File

@ -350,16 +350,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~faceSource(); virtual ~faceSource();

View File

@ -118,23 +118,16 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
source1Ptr_(NULL), source1Ptr_(NULL),
source2Ptr_(NULL) source2Ptr_(NULL)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::fieldValues::fieldValueDelta::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::fieldValueDelta::~fieldValueDelta() Foam::functionObjects::fieldValues::fieldValueDelta::~fieldValueDelta()

View File

@ -174,16 +174,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~fieldValueDelta(); virtual ~fieldValueDelta();

View File

@ -54,23 +54,16 @@ Foam::functionObjects::grad::grad
fieldName_("undefined-fieldName"), fieldName_("undefined-fieldName"),
resultName_("undefined-resultName") resultName_("undefined-resultName")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::grad::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::grad::~grad() Foam::functionObjects::grad::~grad()

View File

@ -128,16 +128,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~grad(); virtual ~grad();

View File

@ -77,23 +77,16 @@ Foam::functionObjects::histogram::histogram
functionObjectFile(obr, typeName), functionObjectFile(obr, typeName),
name_(name) name_(name)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::histogram::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::histogram::~histogram() Foam::functionObjects::histogram::~histogram()

View File

@ -149,16 +149,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
// Destructor // Destructor

View File

@ -54,23 +54,16 @@ Foam::functionObjects::mag::mag
fieldName_("undefined-fieldName"), fieldName_("undefined-fieldName"),
resultName_("undefined-resultName") resultName_("undefined-resultName")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::mag::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::mag::~mag() Foam::functionObjects::mag::~mag()

View File

@ -122,16 +122,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~mag(); virtual ~mag();

View File

@ -233,23 +233,16 @@ Foam::functionObjects::nearWallFields::nearWallFields
obr_(obr), obr_(obr),
fieldSet_() fieldSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::nearWallFields::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::nearWallFields::~nearWallFields() Foam::functionObjects::nearWallFields::~nearWallFields()

View File

@ -196,16 +196,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~nearWallFields(); virtual ~nearWallFields();

View File

@ -51,6 +51,12 @@ Foam::functionObjects::processorField::processorField
name_(name), name_(name),
obr_(obr) obr_(obr)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -76,20 +82,6 @@ Foam::functionObjects::processorField::processorField
} }
bool Foam::functionObjects::processorField::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::processorField::~processorField() Foam::functionObjects::processorField::~processorField()

View File

@ -124,16 +124,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~processorField(); virtual ~processorField();

View File

@ -51,23 +51,16 @@ Foam::functionObjects::readFields::readFields
obr_(obr), obr_(obr),
fieldSet_() fieldSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::readFields::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::readFields::~readFields() Foam::functionObjects::readFields::~readFields()

View File

@ -155,16 +155,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~readFields(); virtual ~readFields();

View File

@ -333,23 +333,16 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution
alphaName_(dict.lookup("field")), alphaName_(dict.lookup("field")),
patchNames_(dict.lookup("patches")) patchNames_(dict.lookup("patches"))
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::regionSizeDistribution::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution() Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution()

View File

@ -255,16 +255,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
// Destructor // Destructor

View File

@ -337,23 +337,16 @@ Foam::functionObjects::streamLine::streamLine
loadFromFiles_(loadFromFiles), loadFromFiles_(loadFromFiles),
nSubCycle_(0) nSubCycle_(0)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict_); read(dict_);
} }
bool Foam::functionObjects::streamLine::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::streamLine::~streamLine() Foam::functionObjects::streamLine::~streamLine()

View File

@ -243,16 +243,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~streamLine(); virtual ~streamLine();

View File

@ -50,23 +50,16 @@ Foam::functionObjects::surfaceInterpolateFields::surfaceInterpolateFields
obr_(obr), obr_(obr),
fieldSet_() fieldSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::surfaceInterpolateFields::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::surfaceInterpolateFields::~surfaceInterpolateFields() Foam::functionObjects::surfaceInterpolateFields::~surfaceInterpolateFields()

View File

@ -151,16 +151,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~surfaceInterpolateFields(); virtual ~surfaceInterpolateFields();

View File

@ -448,23 +448,16 @@ Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine
obr_(obr), obr_(obr),
loadFromFiles_(loadFromFiles) loadFromFiles_(loadFromFiles)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict_); read(dict_);
} }
bool Foam::functionObjects::wallBoundedStreamLine::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine() Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine()

View File

@ -249,16 +249,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~wallBoundedStreamLine(); virtual ~wallBoundedStreamLine();

View File

@ -139,21 +139,13 @@ Foam::functionObjects::forceCoeffs::forceCoeffs
lRef_(0.0), lRef_(0.0),
Aref_(0.0) Aref_(0.0)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
Info<< endl;
}
bool Foam::functionObjects::forceCoeffs::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
} }

View File

@ -171,16 +171,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~forceCoeffs(); virtual ~forceCoeffs();

View File

@ -553,27 +553,19 @@ Foam::functionObjects::forces::forces
binCumulative_(true), binCumulative_(true),
initialised_(false) initialised_(false)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
if (readFields) if (readFields)
{ {
read(dict); read(dict);
Info<< endl;
} }
} }
bool Foam::functionObjects::forces::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
Foam::functionObjects::forces::forces Foam::functionObjects::forces::forces
( (
const word& name, const word& name,

View File

@ -292,16 +292,6 @@ public:
const bool readFields = true const bool readFields = true
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Construct from components //- Construct from components
forces forces
( (

View File

@ -203,6 +203,12 @@ Foam::functionObjects::pressureTools::pressureTools
UInf_(Zero), UInf_(Zero),
rhoInf_(0.0) rhoInf_(0.0)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
dimensionSet pDims(dimPressure); dimensionSet pDims(dimPressure);
@ -235,19 +241,6 @@ Foam::functionObjects::pressureTools::pressureTools
} }
bool Foam::functionObjects::pressureTools::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::pressureTools::~pressureTools() Foam::functionObjects::pressureTools::~pressureTools()

View File

@ -218,16 +218,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~pressureTools(); virtual ~pressureTools();

View File

@ -108,6 +108,12 @@ Foam::functionObjects::wallShearStress::wallShearStress
log_(true), log_(true),
patchSet_() patchSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
volVectorField* wallShearStressPtr volVectorField* wallShearStressPtr
@ -138,19 +144,6 @@ Foam::functionObjects::wallShearStress::wallShearStress
} }
bool Foam::functionObjects::wallShearStress::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::wallShearStress::~wallShearStress() Foam::functionObjects::wallShearStress::~wallShearStress()

View File

@ -159,16 +159,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~wallShearStress(); virtual ~wallShearStress();

View File

@ -68,18 +68,6 @@ Foam::functionObjects::cloudInfo::cloudInfo
} }
bool Foam::functionObjects::cloudInfo::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::cloudInfo::~cloudInfo() Foam::functionObjects::cloudInfo::~cloudInfo()

View File

@ -144,16 +144,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~cloudInfo(); virtual ~cloudInfo();

View File

@ -73,6 +73,12 @@ Foam::functionObjects::CourantNo::CourantNo
phiName_("phi"), phiName_("phi"),
rhoName_("rho") rhoName_("rho")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -99,19 +105,6 @@ Foam::functionObjects::CourantNo::CourantNo
} }
bool Foam::functionObjects::CourantNo::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::CourantNo::~CourantNo() Foam::functionObjects::CourantNo::~CourantNo()

View File

@ -110,16 +110,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~CourantNo(); virtual ~CourantNo();

View File

@ -54,6 +54,12 @@ Foam::functionObjects::Lambda2::Lambda2
obr_(obr), obr_(obr),
UName_("U") UName_("U")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -79,19 +85,6 @@ Foam::functionObjects::Lambda2::Lambda2
} }
bool Foam::functionObjects::Lambda2::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::Lambda2::~Lambda2() Foam::functionObjects::Lambda2::~Lambda2()

View File

@ -104,16 +104,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~Lambda2(); virtual ~Lambda2();

View File

@ -57,6 +57,12 @@ Foam::functionObjects::Peclet::Peclet
phiName_("phi"), phiName_("phi"),
rhoName_("rho") rhoName_("rho")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -82,19 +88,6 @@ Foam::functionObjects::Peclet::Peclet
} }
bool Foam::functionObjects::Peclet::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::Peclet::~Peclet() Foam::functionObjects::Peclet::~Peclet()

View File

@ -106,16 +106,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~Peclet(); virtual ~Peclet();

View File

@ -53,6 +53,12 @@ Foam::functionObjects::Q::Q
obr_(obr), obr_(obr),
UName_("U") UName_("U")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -78,19 +84,6 @@ Foam::functionObjects::Q::Q
} }
bool Foam::functionObjects::Q::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::Q::~Q() Foam::functionObjects::Q::~Q()

View File

@ -107,16 +107,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~Q(); virtual ~Q();

View File

@ -97,19 +97,6 @@ Foam::functionObjects::abort::abort
} }
bool Foam::functionObjects::abort::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::abort::~abort() Foam::functionObjects::abort::~abort()

View File

@ -126,16 +126,6 @@ public:
const bool loadFromFilesUnused = false const bool loadFromFilesUnused = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~abort(); virtual ~abort();

View File

@ -52,23 +52,16 @@ Foam::functionObjects::blendingFactor::blendingFactor
phiName_("unknown-phiName"), phiName_("unknown-phiName"),
fieldName_("unknown-fieldName") fieldName_("unknown-fieldName")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::blendingFactor::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::blendingFactor::~blendingFactor() Foam::functionObjects::blendingFactor::~blendingFactor()

View File

@ -119,17 +119,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~blendingFactor(); virtual ~blendingFactor();

View File

@ -56,23 +56,16 @@ Foam::functionObjects::dsmcFields::dsmcFields
name_(name), name_(name),
obr_(obr) obr_(obr)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::dsmcFields::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::dsmcFields::~dsmcFields() Foam::functionObjects::dsmcFields::~dsmcFields()

View File

@ -101,16 +101,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~dsmcFields(); virtual ~dsmcFields();

View File

@ -58,19 +58,6 @@ Foam::functionObjects::partialWrite::partialWrite
} }
bool Foam::functionObjects::partialWrite::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::partialWrite::~partialWrite() Foam::functionObjects::partialWrite::~partialWrite()

View File

@ -170,16 +170,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~partialWrite(); virtual ~partialWrite();

View File

@ -56,18 +56,6 @@ Foam::functionObjects::removeRegisteredObject::removeRegisteredObject
} }
bool Foam::functionObjects::removeRegisteredObject::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject() Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject()

View File

@ -127,16 +127,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~removeRegisteredObject(); virtual ~removeRegisteredObject();

View File

@ -54,23 +54,16 @@ Foam::functionObjects::residuals::residuals
obr_(obr), obr_(obr),
fieldSet_() fieldSet_()
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
} }
bool Foam::functionObjects::residuals::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::residuals::~residuals() Foam::functionObjects::residuals::~residuals()

View File

@ -145,16 +145,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~residuals(); virtual ~residuals();

View File

@ -176,6 +176,12 @@ Foam::functionObjects::scalarTransport::scalarTransport
boundaryTypes() boundaryTypes()
) )
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
if (resetOnStartUp_) if (resetOnStartUp_)
@ -185,19 +191,6 @@ Foam::functionObjects::scalarTransport::scalarTransport
} }
bool Foam::functionObjects::scalarTransport::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::scalarTransport::~scalarTransport() Foam::functionObjects::scalarTransport::~scalarTransport()

View File

@ -144,16 +144,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~scalarTransport(); virtual ~scalarTransport();

View File

@ -57,18 +57,6 @@ Foam::functionObjects::systemCall::systemCall
} }
bool Foam::functionObjects::systemCall::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::systemCall::~systemCall() Foam::functionObjects::systemCall::~systemCall()

View File

@ -154,16 +154,6 @@ public:
const bool loadFromFilesUnused = false const bool loadFromFilesUnused = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~systemCall(); virtual ~systemCall();

View File

@ -84,18 +84,6 @@ Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
} }
bool Foam::functionObjects::timeActivatedFileUpdate::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::timeActivatedFileUpdate::~timeActivatedFileUpdate() Foam::functionObjects::timeActivatedFileUpdate::~timeActivatedFileUpdate()

View File

@ -129,16 +129,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~timeActivatedFileUpdate(); virtual ~timeActivatedFileUpdate();

View File

@ -125,36 +125,24 @@ Foam::functionObjects::turbulenceFields::turbulenceFields
obr_(obr), obr_(obr),
fieldSet_() fieldSet_()
{ {
read(dict);
}
bool Foam::functionObjects::turbulenceFields::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
if (!isA<fvMesh>(obr)) if (!isA<fvMesh>(obr))
{ {
return false; FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
} }
if if
( (
obr.foundObject<compressible::turbulenceModel>(modelName) !obr.foundObject<compressible::turbulenceModel>(modelName)
|| obr.foundObject<incompressible::turbulenceModel>(modelName) && !obr.foundObject<incompressible::turbulenceModel>(modelName)
) )
{ {
return true; FatalErrorInFunction
} << "Cannot find turbulenceModel in objectRegistry"
else << exit(FatalError);
{
return false;
} }
read(dict);
} }

View File

@ -196,16 +196,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~turbulenceFields(); virtual ~turbulenceFields();

View File

@ -54,6 +54,12 @@ Foam::functionObjects::vorticity::vorticity
UName_("U"), UName_("U"),
outputName_(typeName) outputName_(typeName)
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict); read(dict);
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
@ -79,19 +85,6 @@ Foam::functionObjects::vorticity::vorticity
} }
bool Foam::functionObjects::vorticity::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::vorticity::~vorticity() Foam::functionObjects::vorticity::~vorticity()

View File

@ -102,16 +102,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~vorticity(); virtual ~vorticity();

View File

@ -107,18 +107,6 @@ Foam::functionObjects::writeDictionary::writeDictionary
} }
bool Foam::functionObjects::writeDictionary::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::writeDictionary::~writeDictionary() Foam::functionObjects::writeDictionary::~writeDictionary()

View File

@ -119,16 +119,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~writeDictionary(); virtual ~writeDictionary();

View File

@ -57,18 +57,6 @@ Foam::functionObjects::writeRegisteredObject::writeRegisteredObject
} }
bool Foam::functionObjects::writeRegisteredObject::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::writeRegisteredObject::~writeRegisteredObject() Foam::functionObjects::writeRegisteredObject::~writeRegisteredObject()

View File

@ -142,16 +142,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~writeRegisteredObject(); virtual ~writeRegisteredObject();

View File

@ -70,6 +70,12 @@ Foam::functionObjects::yPlus::yPlus
log_(true), log_(true),
phiName_("phi") phiName_("phi")
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
volScalarField* yPlusPtr volScalarField* yPlusPtr
@ -93,19 +99,6 @@ Foam::functionObjects::yPlus::yPlus
} }
bool Foam::functionObjects::yPlus::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::yPlus::~yPlus() Foam::functionObjects::yPlus::~yPlus()

View File

@ -120,16 +120,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~yPlus(); virtual ~yPlus();

View File

@ -202,18 +202,6 @@ Foam::patchProbes::patchProbes
} }
bool Foam::patchProbes::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::patchProbes::~patchProbes() Foam::patchProbes::~patchProbes()

View File

@ -138,20 +138,11 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~patchProbes(); virtual ~patchProbes();
//- Public members //- Public members
//- Sample and write //- Sample and write

View File

@ -287,18 +287,6 @@ Foam::probes::probes
} }
bool Foam::probes::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::probes::~probes() Foam::probes::~probes()

View File

@ -210,16 +210,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~probes(); virtual ~probes();

View File

@ -35,8 +35,9 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(sampledSets, 0); defineTypeNameAndDebug(sampledSets, 0);
bool sampledSets::verbose_ = false;
bool sampledSets::verbose_ = false;
} }
@ -162,18 +163,6 @@ Foam::sampledSets::sampledSets
} }
bool Foam::sampledSets::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sampledSets::~sampledSets() Foam::sampledSets::~sampledSets()

View File

@ -266,16 +266,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~sampledSets(); virtual ~sampledSets();

View File

@ -115,19 +115,6 @@ Foam::sampledSurfaces::sampledSurfaces
} }
bool Foam::sampledSurfaces::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
return true;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sampledSurfaces::~sampledSurfaces() Foam::sampledSurfaces::~sampledSurfaces()

View File

@ -186,16 +186,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~sampledSurfaces(); virtual ~sampledSurfaces();

View File

@ -60,6 +60,12 @@ Foam::moleFractions<ThermoType>::moleFractions
name_(name), name_(name),
mesh_(refCast<const fvMesh>(obr)) mesh_(refCast<const fvMesh>(obr))
{ {
if (!isA<fvMesh>(obr))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
if (mesh_.foundObject<ThermoType>(basicThermo::dictName)) if (mesh_.foundObject<ThermoType>(basicThermo::dictName))
{ {
const ThermoType& thermo = const ThermoType& thermo =
@ -102,20 +108,6 @@ Foam::moleFractions<ThermoType>::moleFractions
} }
template<class ThermoType>
bool Foam::moleFractions<ThermoType>::viable
(
const word& name,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
)
{
// Construction is viable if the available mesh is an fvMesh
return isA<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ThermoType> template<class ThermoType>

View File

@ -119,16 +119,6 @@ public:
const bool loadFromFiles = false const bool loadFromFiles = false
); );
//- Return true if the construction of this functionObject is viable
// i.e. the prerequisites for construction are available
static bool viable
(
const word& name,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
);
//- Destructor //- Destructor
virtual ~moleFractions(); virtual ~moleFractions();