From 437030a57d3e62022c69ba0c88b224cc044b7761 Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Wed, 11 May 2016 12:57:17 +0100 Subject: [PATCH] functionObjects: Removed the redundant "viable" member function Construction failure and recovery is not handled with exceptions in functionObjectList --- .../foamToVTK/foamToVTK/writeVTK/writeVTK.C | 19 ++++------- .../foamToVTK/foamToVTK/writeVTK/writeVTK.H | 10 ------ .../dynamicCode/functionObjectTemplate.C | 12 ------- .../dynamicCode/functionObjectTemplate.H | 10 ------ .../functionObject/FUNCTIONOBJECT.C | 5 ++- .../functionObject/FUNCTIONOBJECT.H | 2 +- .../IOOutputFilter/IOOutputFilter.C | 26 -------------- .../IOOutputFilter/IOOutputFilter.H | 10 ------ .../OutputFilterFunctionObject.C | 34 ++++--------------- .../functionObjects/field/div/div.C | 19 ++++------- .../functionObjects/field/div/div.H | 10 ------ .../fieldAverage/fieldAverage/fieldAverage.C | 19 ++++------- .../fieldAverage/fieldAverage/fieldAverage.H | 10 ------ .../fieldCoordinateSystemTransform.C | 19 ++++------- .../fieldCoordinateSystemTransform.H | 10 ------ .../field/fieldMinMax/fieldMinMax.C | 19 ++++------- .../field/fieldMinMax/fieldMinMax.H | 10 ------ .../field/fieldValues/cellSource/cellSource.C | 19 ++++------- .../field/fieldValues/cellSource/cellSource.H | 10 ------ .../field/fieldValues/faceSource/faceSource.C | 19 ++++------- .../field/fieldValues/faceSource/faceSource.H | 10 ------ .../fieldValueDelta/fieldValueDelta.C | 19 ++++------- .../fieldValueDelta/fieldValueDelta.H | 10 ------ .../functionObjects/field/grad/grad.C | 19 ++++------- .../functionObjects/field/grad/grad.H | 10 ------ .../field/histogram/histogram.C | 19 ++++------- .../field/histogram/histogram.H | 10 ------ .../functionObjects/field/mag/mag.C | 19 ++++------- .../functionObjects/field/mag/mag.H | 10 ------ .../field/nearWallFields/nearWallFields.C | 19 ++++------- .../field/nearWallFields/nearWallFields.H | 10 ------ .../field/processorField/processorField.C | 20 ++++------- .../field/processorField/processorField.H | 10 ------ .../field/readFields/readFields.C | 19 ++++------- .../field/readFields/readFields.H | 10 ------ .../regionSizeDistribution.C | 19 ++++------- .../regionSizeDistribution.H | 10 ------ .../field/streamLine/streamLine.C | 19 ++++------- .../field/streamLine/streamLine.H | 10 ------ .../surfaceInterpolateFields.C | 19 ++++------- .../surfaceInterpolateFields.H | 10 ------ .../wallBoundedStreamLine.C | 19 ++++------- .../wallBoundedStreamLine.H | 10 ------ .../forces/forceCoeffs/forceCoeffs.C | 20 ++++------- .../forces/forceCoeffs/forceCoeffs.H | 10 ------ .../functionObjects/forces/forces/forces.C | 20 ++++------- .../functionObjects/forces/forces/forces.H | 10 ------ .../forces/pressureTools/pressureTools.C | 19 ++++------- .../forces/pressureTools/pressureTools.H | 10 ------ .../forces/wallShearStress/wallShearStress.C | 19 ++++------- .../forces/wallShearStress/wallShearStress.H | 10 ------ .../lagrangian/cloudInfo/cloudInfo.C | 12 ------- .../lagrangian/cloudInfo/cloudInfo.H | 10 ------ .../utilities/CourantNo/CourantNo.C | 19 ++++------- .../utilities/CourantNo/CourantNo.H | 10 ------ .../utilities/Lambda2/Lambda2.C | 19 ++++------- .../utilities/Lambda2/Lambda2.H | 10 ------ .../functionObjects/utilities/Peclet/Peclet.C | 19 ++++------- .../functionObjects/utilities/Peclet/Peclet.H | 10 ------ .../functionObjects/utilities/Q/Q.C | 19 ++++------- .../functionObjects/utilities/Q/Q.H | 10 ------ .../functionObjects/utilities/abort/abort.C | 13 ------- .../functionObjects/utilities/abort/abort.H | 10 ------ .../utilities/blendingFactor/blendingFactor.C | 19 ++++------- .../utilities/blendingFactor/blendingFactor.H | 11 ------ .../utilities/dsmcFields/dsmcFields.C | 19 ++++------- .../utilities/dsmcFields/dsmcFields.H | 10 ------ .../utilities/partialWrite/partialWrite.C | 13 ------- .../utilities/partialWrite/partialWrite.H | 10 ------ .../removeRegisteredObject.C | 12 ------- .../removeRegisteredObject.H | 10 ------ .../utilities/residuals/residuals.C | 19 ++++------- .../utilities/residuals/residuals.H | 10 ------ .../scalarTransport/scalarTransport.C | 19 ++++------- .../scalarTransport/scalarTransport.H | 10 ------ .../utilities/systemCall/systemCall.C | 12 ------- .../utilities/systemCall/systemCall.H | 10 ------ .../timeActivatedFileUpdate.C | 12 ------- .../timeActivatedFileUpdate.H | 10 ------ .../turbulenceFields/turbulenceFields.C | 30 +++++----------- .../turbulenceFields/turbulenceFields.H | 10 ------ .../utilities/vorticity/vorticity.C | 19 ++++------- .../utilities/vorticity/vorticity.H | 10 ------ .../writeDictionary/writeDictionary.C | 12 ------- .../writeDictionary/writeDictionary.H | 10 ------ .../writeRegisteredObject.C | 12 ------- .../writeRegisteredObject.H | 10 ------ .../functionObjects/utilities/yPlus/yPlus.C | 19 ++++------- .../functionObjects/utilities/yPlus/yPlus.H | 10 ------ src/sampling/probes/patchProbes.C | 12 ------- src/sampling/probes/patchProbes.H | 11 +----- src/sampling/probes/probes.C | 12 ------- src/sampling/probes/probes.H | 10 ------ .../sampledSet/sampledSets/sampledSets.C | 17 ++-------- .../sampledSet/sampledSets/sampledSets.H | 10 ------ .../sampledSurfaces/sampledSurfaces.C | 13 ------- .../sampledSurfaces/sampledSurfaces.H | 10 ------ .../moleFractions/moleFractions.C | 20 ++++------- .../moleFractions/moleFractions.H | 10 ------ 99 files changed, 220 insertions(+), 1154 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C index 8e9e3bcdf6e..9513a64a151 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C @@ -54,20 +54,13 @@ Foam::functionObjects::writeVTK::writeVTK obr_(obr), objectNames_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H index dad936a9e42..d230d7726d3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H @@ -131,16 +131,6 @@ public: 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 virtual ~writeVTK(); diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.C b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C index cb256b9b93e..fae5975f595 100644 --- a/etc/codeTemplates/dynamicCode/functionObjectTemplate.C +++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C @@ -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 * * * * * * * * * * * * * * * // ${typeName}FunctionObject::~${typeName}FunctionObject() diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.H b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H index b1f7e7af8e7..60f04091a6f 100644 --- a/etc/codeTemplates/dynamicCode/functionObjectTemplate.H +++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H @@ -102,16 +102,6 @@ public: 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 virtual ~${typeName}FunctionObject(); diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C index 5c480baee4b..4cdaf575bcd 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C @@ -30,7 +30,7 @@ License namespace Foam { -defineTypeNameAndDebug(FUNCTIONOBJECT, 0); + defineTypeNameAndDebug(FUNCTIONOBJECT, 0); } @@ -83,8 +83,7 @@ void Foam::FUNCTIONOBJECT::timeSet() void Foam::FUNCTIONOBJECT::write() -{ -} +{} // ************************************************************************* // diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H index b3bd373e4c8..ad45ba61b4b 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H @@ -134,7 +134,7 @@ public: // Member Functions //- Return name of the FUNCTIONOBJECT - virtual const word& name() const + const word& name() const { return name_; } diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C index e70e55a1bc8..3816c7e9f34 100644 --- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C +++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C @@ -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> Foam::IOOutputFilter<OutputFilter>::IOOutputFilter ( diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H index 6950b523f8f..a16d91a2cce 100644 --- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H +++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H @@ -94,16 +94,6 @@ public: 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 // Dictionary read from full path. // Allow the possibility to load fields from files diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index 316e128fc10..c4f5249af02 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -56,49 +56,27 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::allocateFilter() { if (dictName_.size()) { - if + ptr_.reset ( - IOOutputFilter<OutputFilter>::viable + new IOOutputFilter<OutputFilter> ( name(), time_.lookupObject<objectRegistry>(regionName_), dictName_ ) - ) - { - ptr_.reset - ( - new IOOutputFilter<OutputFilter> - ( - name(), - time_.lookupObject<objectRegistry>(regionName_), - dictName_ - ) - ); - } + ); } else { - if + ptr_.reset ( - OutputFilter::viable + new OutputFilter ( name(), time_.lookupObject<objectRegistry>(regionName_), dict_ ) - ) - { - ptr_.reset - ( - new OutputFilter - ( - name(), - time_.lookupObject<objectRegistry>(regionName_), - dict_ - ) - ); - } + ); } return ptr_.valid(); diff --git a/src/postProcessing/functionObjects/field/div/div.C b/src/postProcessing/functionObjects/field/div/div.C index cf5405659ac..599bb194625 100644 --- a/src/postProcessing/functionObjects/field/div/div.C +++ b/src/postProcessing/functionObjects/field/div/div.C @@ -92,20 +92,13 @@ Foam::functionObjects::div::div fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/div/div.H b/src/postProcessing/functionObjects/field/div/div.H index e371ee84a87..4f7bed7ae4e 100644 --- a/src/postProcessing/functionObjects/field/div/div.H +++ b/src/postProcessing/functionObjects/field/div/div.H @@ -125,16 +125,6 @@ public: 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 virtual ~div(); diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C index d6829f16c98..adfad58cba0 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -277,20 +277,13 @@ Foam::functionObjects::fieldAverage::fieldAverage totalTime_(), periodIndex_(1) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H index 2fbbe0e2ea2..cec06ebcfd9 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H @@ -301,16 +301,6 @@ public: 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 virtual ~fieldAverage(); diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index 97a366a517d..7359bea3830 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -53,6 +53,12 @@ fieldCoordinateSystemTransform fieldSet_(), coordSys_(obr, dict) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::fieldCoordinateSystemTransform:: diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index f850e834512..4995caea3be 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -155,16 +155,6 @@ public: 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 virtual ~fieldCoordinateSystemTransform(); diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index ad80d03c312..a0ab4def64f 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -68,20 +68,13 @@ Foam::functionObjects::fieldMinMax::fieldMinMax mode_(mdMag), fieldSet_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 437b4595ab6..2f47d58c9d0 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -181,16 +181,6 @@ public: 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 virtual ~fieldMinMax(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 8d9b291db29..62e689185ff 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -218,20 +218,13 @@ Foam::functionObjects::fieldValues::cellSource::cellSource weightFieldName_("none"), writeVolume_(dict.lookupOrDefault("writeVolume", false)) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H index 15bf465e627..20f984d2c0c 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H @@ -250,16 +250,6 @@ public: 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 virtual ~cellSource(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 6cf89971d00..48b8d37a476 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -660,20 +660,13 @@ Foam::functionObjects::fieldValues::faceSource::faceSource facePatchId_(), faceSign_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index ec7c6a96d79..774fa516ff0 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -350,16 +350,6 @@ public: 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 virtual ~faceSource(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index c8c81862791..1c4bda54245 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -118,20 +118,13 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta source1Ptr_(NULL), source2Ptr_(NULL) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H index abaf609c7fd..dcb09c00c7c 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H @@ -174,16 +174,6 @@ public: 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 virtual ~fieldValueDelta(); diff --git a/src/postProcessing/functionObjects/field/grad/grad.C b/src/postProcessing/functionObjects/field/grad/grad.C index d304ee53f4b..0fc2c755189 100644 --- a/src/postProcessing/functionObjects/field/grad/grad.C +++ b/src/postProcessing/functionObjects/field/grad/grad.C @@ -54,20 +54,13 @@ Foam::functionObjects::grad::grad fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/grad/grad.H b/src/postProcessing/functionObjects/field/grad/grad.H index 1c0119ffa16..b7f3b60223b 100644 --- a/src/postProcessing/functionObjects/field/grad/grad.H +++ b/src/postProcessing/functionObjects/field/grad/grad.H @@ -128,16 +128,6 @@ public: 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 virtual ~grad(); diff --git a/src/postProcessing/functionObjects/field/histogram/histogram.C b/src/postProcessing/functionObjects/field/histogram/histogram.C index 68fef256388..d797d06f40d 100644 --- a/src/postProcessing/functionObjects/field/histogram/histogram.C +++ b/src/postProcessing/functionObjects/field/histogram/histogram.C @@ -77,20 +77,13 @@ Foam::functionObjects::histogram::histogram functionObjectFile(obr, typeName), name_(name) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/histogram/histogram.H b/src/postProcessing/functionObjects/field/histogram/histogram.H index db23fc1bce9..f1201bd37d7 100644 --- a/src/postProcessing/functionObjects/field/histogram/histogram.H +++ b/src/postProcessing/functionObjects/field/histogram/histogram.H @@ -149,16 +149,6 @@ public: 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 diff --git a/src/postProcessing/functionObjects/field/mag/mag.C b/src/postProcessing/functionObjects/field/mag/mag.C index fa0fa725e1f..9816f50df20 100644 --- a/src/postProcessing/functionObjects/field/mag/mag.C +++ b/src/postProcessing/functionObjects/field/mag/mag.C @@ -54,20 +54,13 @@ Foam::functionObjects::mag::mag fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/mag/mag.H b/src/postProcessing/functionObjects/field/mag/mag.H index a6870953919..215b3c7ae3d 100644 --- a/src/postProcessing/functionObjects/field/mag/mag.H +++ b/src/postProcessing/functionObjects/field/mag/mag.H @@ -122,16 +122,6 @@ public: 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 virtual ~mag(); diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index e9d78673111..a0549bfe66c 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -233,20 +233,13 @@ Foam::functionObjects::nearWallFields::nearWallFields obr_(obr), fieldSet_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H index e2fde8f2886..f6638756e47 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H @@ -196,16 +196,6 @@ public: 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 virtual ~nearWallFields(); diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.C b/src/postProcessing/functionObjects/field/processorField/processorField.C index aef6d4ba8e6..1647afa2e8b 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.C +++ b/src/postProcessing/functionObjects/field/processorField/processorField.C @@ -51,6 +51,12 @@ Foam::functionObjects::processorField::processorField name_(name), obr_(obr) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::processorField::~processorField() diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.H b/src/postProcessing/functionObjects/field/processorField/processorField.H index 4df52b11eaa..478a47184e2 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.H +++ b/src/postProcessing/functionObjects/field/processorField/processorField.H @@ -124,16 +124,6 @@ public: 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 virtual ~processorField(); diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.C b/src/postProcessing/functionObjects/field/readFields/readFields.C index d9c49519633..4648c252bd3 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.C +++ b/src/postProcessing/functionObjects/field/readFields/readFields.C @@ -51,20 +51,13 @@ Foam::functionObjects::readFields::readFields obr_(obr), fieldSet_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.H b/src/postProcessing/functionObjects/field/readFields/readFields.H index 4b72bd958aa..ed6b0489fd6 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.H +++ b/src/postProcessing/functionObjects/field/readFields/readFields.H @@ -155,16 +155,6 @@ public: 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 virtual ~readFields(); diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C index 418afc3ecf7..7987c141b62 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -333,20 +333,13 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution alphaName_(dict.lookup("field")), patchNames_(dict.lookup("patches")) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 0a686dacaf7..18b4e36e21f 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H @@ -255,16 +255,6 @@ public: 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 diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index a5015e79500..308a27bb446 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -337,20 +337,13 @@ Foam::functionObjects::streamLine::streamLine loadFromFiles_(loadFromFiles), nSubCycle_(0) { - read(dict_); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict_); } diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.H b/src/postProcessing/functionObjects/field/streamLine/streamLine.H index ede9683fafb..c47bb9f8cde 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.H +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.H @@ -243,16 +243,6 @@ public: 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 virtual ~streamLine(); diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C index d5ba3878794..5093b9056f6 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C @@ -50,20 +50,13 @@ Foam::functionObjects::surfaceInterpolateFields::surfaceInterpolateFields obr_(obr), fieldSet_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H index 7121237a3bc..d86d5b5ae77 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H @@ -151,16 +151,6 @@ public: 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 virtual ~surfaceInterpolateFields(); diff --git a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C index f110a884551..1b02584b20c 100644 --- a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C +++ b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C @@ -448,20 +448,13 @@ Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine obr_(obr), loadFromFiles_(loadFromFiles) { - read(dict_); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict_); } diff --git a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H index b8e2697178d..1a2f7dc4e4a 100644 --- a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H +++ b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H @@ -249,16 +249,6 @@ public: 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 virtual ~wallBoundedStreamLine(); diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index ea0efdd4513..18fec8f25c6 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -139,21 +139,13 @@ Foam::functionObjects::forceCoeffs::forceCoeffs lRef_(0.0), Aref_(0.0) { - read(dict); - Info<< endl; -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H index a3eddb57e44..be1a3d385d8 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -171,16 +171,6 @@ public: 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 virtual ~forceCoeffs(); diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index c8e63db2d63..5ff699f3535 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -553,27 +553,19 @@ Foam::functionObjects::forces::forces binCumulative_(true), initialised_(false) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + if (readFields) { 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 ( const word& name, diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index 5899f62134f..449f2f62008 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -292,16 +292,6 @@ public: 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 forces ( diff --git a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C index c4315511235..b256dafe7bb 100644 --- a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C @@ -203,6 +203,12 @@ Foam::functionObjects::pressureTools::pressureTools UInf_(Zero), rhoInf_(0.0) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::pressureTools::~pressureTools() diff --git a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H index b42bf373aa2..404c140c640 100644 --- a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H +++ b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H @@ -218,16 +218,6 @@ public: 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 virtual ~pressureTools(); diff --git a/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.C index e2160e34311..85e605533a6 100644 --- a/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.C @@ -108,6 +108,12 @@ Foam::functionObjects::wallShearStress::wallShearStress log_(true), patchSet_() { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + const fvMesh& mesh = refCast<const fvMesh>(obr_); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::wallShearStress::~wallShearStress() diff --git a/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.H b/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.H index 07665ce6573..486351bffa6 100644 --- a/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.H +++ b/src/postProcessing/functionObjects/forces/wallShearStress/wallShearStress.H @@ -159,16 +159,6 @@ public: 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 virtual ~wallShearStress(); diff --git a/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.C b/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.C index 7641bf5c01a..369804dc948 100644 --- a/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.C +++ b/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::cloudInfo::~cloudInfo() diff --git a/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.H b/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.H index 36b064c362c..5906215598b 100644 --- a/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.H +++ b/src/postProcessing/functionObjects/lagrangian/cloudInfo/cloudInfo.H @@ -144,16 +144,6 @@ public: 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 virtual ~cloudInfo(); diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 13a4e61c936..a7fc210de38 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -73,6 +73,12 @@ Foam::functionObjects::CourantNo::CourantNo phiName_("phi"), rhoName_("rho") { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::CourantNo::~CourantNo() diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index dd249eb9c65..ca377f1c88e 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -110,16 +110,6 @@ public: 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 virtual ~CourantNo(); diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index 23345a25ae4..e6c13e8bdf0 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -54,6 +54,12 @@ Foam::functionObjects::Lambda2::Lambda2 obr_(obr), UName_("U") { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::Lambda2::~Lambda2() diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H index 265e2dd2b7f..804bb584fbb 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H @@ -104,16 +104,6 @@ public: 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 virtual ~Lambda2(); diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index ced9ace56d7..9bc2a62e153 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -57,6 +57,12 @@ Foam::functionObjects::Peclet::Peclet phiName_("phi"), rhoName_("rho") { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::Peclet::~Peclet() diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H index e300a6814bc..4b500ec0dc7 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H @@ -106,16 +106,6 @@ public: 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 virtual ~Peclet(); diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index 7e4fb2ff312..cea5d053346 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -53,6 +53,12 @@ Foam::functionObjects::Q::Q obr_(obr), UName_("U") { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::Q::~Q() diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.H b/src/postProcessing/functionObjects/utilities/Q/Q.H index 780cc1e4586..e8395211c49 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.H +++ b/src/postProcessing/functionObjects/utilities/Q/Q.H @@ -107,16 +107,6 @@ public: 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 virtual ~Q(); diff --git a/src/postProcessing/functionObjects/utilities/abort/abort.C b/src/postProcessing/functionObjects/utilities/abort/abort.C index d68fe939b3d..76e71d39a1f 100644 --- a/src/postProcessing/functionObjects/utilities/abort/abort.C +++ b/src/postProcessing/functionObjects/utilities/abort/abort.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::abort::~abort() diff --git a/src/postProcessing/functionObjects/utilities/abort/abort.H b/src/postProcessing/functionObjects/utilities/abort/abort.H index 3ab02cf1a90..b07ea5ee74b 100644 --- a/src/postProcessing/functionObjects/utilities/abort/abort.H +++ b/src/postProcessing/functionObjects/utilities/abort/abort.H @@ -126,16 +126,6 @@ public: 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 virtual ~abort(); diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C index 64863bcfc65..96c73367d54 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C @@ -52,20 +52,13 @@ Foam::functionObjects::blendingFactor::blendingFactor phiName_("unknown-phiName"), fieldName_("unknown-fieldName") { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H index 92db53a8e6e..938449e3244 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H @@ -119,17 +119,6 @@ public: 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 virtual ~blendingFactor(); diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C index 33722637d65..8b519877bf5 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C @@ -56,20 +56,13 @@ Foam::functionObjects::dsmcFields::dsmcFields name_(name), obr_(obr) { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H index 16e457f9246..08c5cb7f0b1 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H @@ -101,16 +101,6 @@ public: 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 virtual ~dsmcFields(); diff --git a/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.C b/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.C index 3d5faaf9647..4a4a801e4f6 100644 --- a/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.C +++ b/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::partialWrite::~partialWrite() diff --git a/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.H b/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.H index a4f4e9bf2dd..bfd55e89c01 100644 --- a/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.H +++ b/src/postProcessing/functionObjects/utilities/partialWrite/partialWrite.H @@ -170,16 +170,6 @@ public: 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 virtual ~partialWrite(); diff --git a/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.C b/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.C index 9bd09cd0b66..4ecd2a4fe07 100644 --- a/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.C +++ b/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject() diff --git a/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H b/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H index d7ad03adfbb..e3fbe35193a 100644 --- a/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H +++ b/src/postProcessing/functionObjects/utilities/removeRegisteredObject/removeRegisteredObject.H @@ -127,16 +127,6 @@ public: 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 virtual ~removeRegisteredObject(); diff --git a/src/postProcessing/functionObjects/utilities/residuals/residuals.C b/src/postProcessing/functionObjects/utilities/residuals/residuals.C index d82b5120eab..b7a8d52b948 100644 --- a/src/postProcessing/functionObjects/utilities/residuals/residuals.C +++ b/src/postProcessing/functionObjects/utilities/residuals/residuals.C @@ -54,20 +54,13 @@ Foam::functionObjects::residuals::residuals obr_(obr), fieldSet_() { - read(dict); -} - + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } -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); + read(dict); } diff --git a/src/postProcessing/functionObjects/utilities/residuals/residuals.H b/src/postProcessing/functionObjects/utilities/residuals/residuals.H index 67672139923..5b8b5226944 100644 --- a/src/postProcessing/functionObjects/utilities/residuals/residuals.H +++ b/src/postProcessing/functionObjects/utilities/residuals/residuals.H @@ -145,16 +145,6 @@ public: 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 virtual ~residuals(); diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index a4bfb5bbbc0..1c3d02df283 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -176,6 +176,12 @@ Foam::functionObjects::scalarTransport::scalarTransport boundaryTypes() ) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::scalarTransport::~scalarTransport() diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index 166bc37b7f3..29b5fb0e653 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -144,16 +144,6 @@ public: 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 virtual ~scalarTransport(); diff --git a/src/postProcessing/functionObjects/utilities/systemCall/systemCall.C b/src/postProcessing/functionObjects/utilities/systemCall/systemCall.C index 2462b526fed..1d1796af9af 100644 --- a/src/postProcessing/functionObjects/utilities/systemCall/systemCall.C +++ b/src/postProcessing/functionObjects/utilities/systemCall/systemCall.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::systemCall::~systemCall() diff --git a/src/postProcessing/functionObjects/utilities/systemCall/systemCall.H b/src/postProcessing/functionObjects/utilities/systemCall/systemCall.H index 5e44dae6d60..e12da249701 100644 --- a/src/postProcessing/functionObjects/utilities/systemCall/systemCall.H +++ b/src/postProcessing/functionObjects/utilities/systemCall/systemCall.H @@ -154,16 +154,6 @@ public: 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 virtual ~systemCall(); diff --git a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C index acee1ecfb5a..f571185f1e3 100644 --- a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C +++ b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::timeActivatedFileUpdate::~timeActivatedFileUpdate() diff --git a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H index 2cbc81d506a..89fd0e1ee58 100644 --- a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H +++ b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H @@ -129,16 +129,6 @@ public: 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 virtual ~timeActivatedFileUpdate(); diff --git a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C index 15862244495..41a1de210b3 100644 --- a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C +++ b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.C @@ -125,36 +125,24 @@ Foam::functionObjects::turbulenceFields::turbulenceFields obr_(obr), 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)) { - return false; + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); } if ( - obr.foundObject<compressible::turbulenceModel>(modelName) - || obr.foundObject<incompressible::turbulenceModel>(modelName) + !obr.foundObject<compressible::turbulenceModel>(modelName) + && !obr.foundObject<incompressible::turbulenceModel>(modelName) ) { - return true; - } - else - { - return false; + FatalErrorInFunction + << "Cannot find turbulenceModel in objectRegistry" + << exit(FatalError); } + + read(dict); } diff --git a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H index a8dc7ae3ffe..f578022b86f 100644 --- a/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H +++ b/src/postProcessing/functionObjects/utilities/turbulenceFields/turbulenceFields.H @@ -196,16 +196,6 @@ public: 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 virtual ~turbulenceFields(); diff --git a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C index fd45701ecf2..89cb38d2c30 100644 --- a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C +++ b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C @@ -54,6 +54,12 @@ Foam::functionObjects::vorticity::vorticity UName_("U"), outputName_(typeName) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::vorticity::~vorticity() diff --git a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H index 3c24347d443..e430924a1bf 100644 --- a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H +++ b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H @@ -102,16 +102,6 @@ public: 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 virtual ~vorticity(); diff --git a/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.C b/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.C index afe37cf4a34..7fdc21fba10 100644 --- a/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.C +++ b/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::writeDictionary::~writeDictionary() diff --git a/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.H b/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.H index 89107494d79..5a3f81f9d8d 100644 --- a/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.H +++ b/src/postProcessing/functionObjects/utilities/writeDictionary/writeDictionary.H @@ -119,16 +119,6 @@ public: 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 virtual ~writeDictionary(); diff --git a/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.C b/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.C index 6385ad89b1f..837ddd35fa6 100644 --- a/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.C +++ b/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.C @@ -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 * * * * * * * * * * * * * * * // Foam::functionObjects::writeRegisteredObject::~writeRegisteredObject() diff --git a/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.H b/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.H index 64c2dbe9ece..adfe67752b5 100644 --- a/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.H +++ b/src/postProcessing/functionObjects/utilities/writeRegisteredObject/writeRegisteredObject.H @@ -142,16 +142,6 @@ public: 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 virtual ~writeRegisteredObject(); diff --git a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.C b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.C index 9b6289a814f..4384c47acfe 100644 --- a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.C +++ b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.C @@ -70,6 +70,12 @@ Foam::functionObjects::yPlus::yPlus log_(true), phiName_("phi") { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + const fvMesh& mesh = refCast<const fvMesh>(obr_); 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 * * * * * * * * * * * * * * * // Foam::functionObjects::yPlus::~yPlus() diff --git a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H index 74402e7246e..a40e3b3dbc7 100644 --- a/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H +++ b/src/postProcessing/functionObjects/utilities/yPlus/yPlus.H @@ -120,16 +120,6 @@ public: 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 virtual ~yPlus(); diff --git a/src/sampling/probes/patchProbes.C b/src/sampling/probes/patchProbes.C index 0541cd5c7e3..0d4acb2de6d 100644 --- a/src/sampling/probes/patchProbes.C +++ b/src/sampling/probes/patchProbes.C @@ -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 * * * * * * * * * * * * * * * // Foam::patchProbes::~patchProbes() diff --git a/src/sampling/probes/patchProbes.H b/src/sampling/probes/patchProbes.H index 447463ebe97..a2758b469cc 100644 --- a/src/sampling/probes/patchProbes.H +++ b/src/sampling/probes/patchProbes.H @@ -138,20 +138,11 @@ public: 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 virtual ~patchProbes(); + //- Public members //- Sample and write diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index 661bba6a4dd..f8874237cb9 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -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 * * * * * * * * * * * * * * * // Foam::probes::~probes() diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 55ffc625664..c9c988cdf48 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -210,16 +210,6 @@ public: 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 virtual ~probes(); diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.C b/src/sampling/sampledSet/sampledSets/sampledSets.C index 1a0723762fd..6f57a96fb6c 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.C +++ b/src/sampling/sampledSet/sampledSets/sampledSets.C @@ -35,8 +35,9 @@ License namespace Foam { -defineTypeNameAndDebug(sampledSets, 0); -bool sampledSets::verbose_ = false; + defineTypeNameAndDebug(sampledSets, 0); + + 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 * * * * * * * * * * * * * * * // Foam::sampledSets::~sampledSets() diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.H b/src/sampling/sampledSet/sampledSets/sampledSets.H index 332efc2e533..26e494c28d3 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.H +++ b/src/sampling/sampledSet/sampledSets/sampledSets.H @@ -266,16 +266,6 @@ public: 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 virtual ~sampledSets(); diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 41ac7b56e14..701135b4025 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -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 * * * * * * * * * * * * * * * // Foam::sampledSurfaces::~sampledSurfaces() diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H index 50b6f2710a8..f2c2430e5a6 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H @@ -186,16 +186,6 @@ public: 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 virtual ~sampledSurfaces(); diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C index f7d8bb51ab7..fb7837cdd47 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C @@ -60,6 +60,12 @@ Foam::moleFractions<ThermoType>::moleFractions name_(name), mesh_(refCast<const fvMesh>(obr)) { + if (!isA<fvMesh>(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + if (mesh_.foundObject<ThermoType>(basicThermo::dictName)) { 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 * * * * * * * * * * * * * * * // template<class ThermoType> diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H index 7e6beb8c19f..05c7fa416a5 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H @@ -119,16 +119,6 @@ public: 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 virtual ~moleFractions(); -- GitLab