diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C index 8e9e3bcdf6..9513a64a15 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C @@ -54,23 +54,16 @@ Foam::functionObjects::writeVTK::writeVTK obr_(obr), objectNames_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::writeVTK::~writeVTK() diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H index dad936a9e4..d230d7726d 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 cb256b9b93..fae5975f59 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 b1f7e7af8e..60f04091a6 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 5c480baee4..4cdaf575bc 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 b3bd373e4c..ad45ba61b4 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 e70e55a1bc..3816c7e9f3 100644 --- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C +++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C @@ -66,32 +66,6 @@ Foam::IOOutputFilter::IOOutputFilter {} -template -bool Foam::IOOutputFilter::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 Foam::IOOutputFilter::IOOutputFilter ( diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H index 6950b523f8..a16d91a2cc 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 316e128fc1..c4f5249af0 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -56,49 +56,27 @@ bool Foam::OutputFilterFunctionObject::allocateFilter() { if (dictName_.size()) { - if + ptr_.reset ( - IOOutputFilter::viable + new IOOutputFilter ( name(), time_.lookupObject(regionName_), dictName_ ) - ) - { - ptr_.reset - ( - new IOOutputFilter - ( - name(), - time_.lookupObject(regionName_), - dictName_ - ) - ); - } + ); } else { - if + ptr_.reset ( - OutputFilter::viable + new OutputFilter ( name(), time_.lookupObject(regionName_), dict_ ) - ) - { - ptr_.reset - ( - new OutputFilter - ( - name(), - time_.lookupObject(regionName_), - dict_ - ) - ); - } + ); } return ptr_.valid(); diff --git a/src/postProcessing/functionObjects/field/div/div.C b/src/postProcessing/functionObjects/field/div/div.C index cf5405659a..599bb19462 100644 --- a/src/postProcessing/functionObjects/field/div/div.C +++ b/src/postProcessing/functionObjects/field/div/div.C @@ -92,23 +92,16 @@ Foam::functionObjects::div::div fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::div::~div() diff --git a/src/postProcessing/functionObjects/field/div/div.H b/src/postProcessing/functionObjects/field/div/div.H index e371ee84a8..4f7bed7ae4 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 d6829f16c9..adfad58cba 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -277,23 +277,16 @@ Foam::functionObjects::fieldAverage::fieldAverage totalTime_(), periodIndex_(1) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldAverage::~fieldAverage() diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H index 2fbbe0e2ea..cec06ebcfd 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 97a366a517..7359bea383 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(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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldCoordinateSystemTransform:: diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index f850e83451..4995caea3b 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 ad80d03c31..a0ab4def64 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -68,23 +68,16 @@ Foam::functionObjects::fieldMinMax::fieldMinMax mode_(mdMag), fieldSet_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldMinMax::~fieldMinMax() diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 437b4595ab..2f47d58c9d 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 8d9b291db2..62e689185f 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -218,23 +218,16 @@ Foam::functionObjects::fieldValues::cellSource::cellSource weightFieldName_("none"), writeVolume_(dict.lookupOrDefault("writeVolume", false)) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldValues::cellSource::~cellSource() diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H index 15bf465e62..20f984d2c0 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 6cf89971d0..48b8d37a47 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -660,23 +660,16 @@ Foam::functionObjects::fieldValues::faceSource::faceSource facePatchId_(), faceSign_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldValues::faceSource::~faceSource() diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index ec7c6a96d7..774fa516ff 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 c8c8186279..1c4bda5424 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -118,23 +118,16 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta source1Ptr_(NULL), source2Ptr_(NULL) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::fieldValues::fieldValueDelta::~fieldValueDelta() diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H index abaf609c7f..dcb09c00c7 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 d304ee53f4..0fc2c75518 100644 --- a/src/postProcessing/functionObjects/field/grad/grad.C +++ b/src/postProcessing/functionObjects/field/grad/grad.C @@ -54,23 +54,16 @@ Foam::functionObjects::grad::grad fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::grad::~grad() diff --git a/src/postProcessing/functionObjects/field/grad/grad.H b/src/postProcessing/functionObjects/field/grad/grad.H index 1c0119ffa1..b7f3b60223 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 68fef25638..d797d06f40 100644 --- a/src/postProcessing/functionObjects/field/histogram/histogram.C +++ b/src/postProcessing/functionObjects/field/histogram/histogram.C @@ -77,23 +77,16 @@ Foam::functionObjects::histogram::histogram functionObjectFile(obr, typeName), name_(name) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::histogram::~histogram() diff --git a/src/postProcessing/functionObjects/field/histogram/histogram.H b/src/postProcessing/functionObjects/field/histogram/histogram.H index db23fc1bce..f1201bd37d 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 fa0fa725e1..9816f50df2 100644 --- a/src/postProcessing/functionObjects/field/mag/mag.C +++ b/src/postProcessing/functionObjects/field/mag/mag.C @@ -54,23 +54,16 @@ Foam::functionObjects::mag::mag fieldName_("undefined-fieldName"), resultName_("undefined-resultName") { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::mag::~mag() diff --git a/src/postProcessing/functionObjects/field/mag/mag.H b/src/postProcessing/functionObjects/field/mag/mag.H index a687095391..215b3c7ae3 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 e9d7867311..a0549bfe66 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -233,23 +233,16 @@ Foam::functionObjects::nearWallFields::nearWallFields obr_(obr), fieldSet_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::nearWallFields::~nearWallFields() diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H index e2fde8f288..f6638756e4 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 aef6d4ba8e..1647afa2e8 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 4df52b11ea..478a47184e 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 d9c4951963..4648c252bd 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.C +++ b/src/postProcessing/functionObjects/field/readFields/readFields.C @@ -51,23 +51,16 @@ Foam::functionObjects::readFields::readFields obr_(obr), fieldSet_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::readFields::~readFields() diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.H b/src/postProcessing/functionObjects/field/readFields/readFields.H index 4b72bd958a..ed6b0489fd 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 418afc3ecf..7987c141b6 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -333,23 +333,16 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution alphaName_(dict.lookup("field")), patchNames_(dict.lookup("patches")) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution() diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 0a686dacaf..18b4e36e21 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 a5015e7950..308a27bb44 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -337,23 +337,16 @@ Foam::functionObjects::streamLine::streamLine loadFromFiles_(loadFromFiles), nSubCycle_(0) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::streamLine::~streamLine() diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.H b/src/postProcessing/functionObjects/field/streamLine/streamLine.H index ede9683faf..c47bb9f8cd 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 d5ba387879..5093b9056f 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C @@ -50,23 +50,16 @@ Foam::functionObjects::surfaceInterpolateFields::surfaceInterpolateFields obr_(obr), fieldSet_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::surfaceInterpolateFields::~surfaceInterpolateFields() diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H index 7121237a3b..d86d5b5ae7 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 f110a88455..1b02584b20 100644 --- a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C +++ b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C @@ -448,23 +448,16 @@ Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine obr_(obr), loadFromFiles_(loadFromFiles) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine() diff --git a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H index b8e2697178..1a2f7dc4e4 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 ea0efdd451..18fec8f25c 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) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); } diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H index a3eddb57e4..be1a3d385d 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 c8e63db2d6..5ff699f353 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(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(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 5899f62134..449f2f6200 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 c431551123..b256dafe7b 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(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(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 b42bf373aa..404c140c64 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 e2160e3431..85e605533a 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + const fvMesh& mesh = refCast(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(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 07665ce657..486351bffa 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 7641bf5c01..369804dc94 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 36b064c362..5906215598 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 13a4e61c93..a7fc210de3 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 dd249eb9c6..ca377f1c88 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 23345a25ae..e6c13e8bdf 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 265e2dd2b7..804bb584fb 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 ced9ace56d..9bc2a62e15 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 e300a6814b..4b500ec0dc 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 7e4fb2ff31..cea5d05334 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 780cc1e458..e8395211c4 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 d68fe939b3..76e71d39a1 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 3ab02cf1a9..b07ea5ee74 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 64863bcfc6..96c73367d5 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C @@ -52,23 +52,16 @@ Foam::functionObjects::blendingFactor::blendingFactor phiName_("unknown-phiName"), fieldName_("unknown-fieldName") { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::blendingFactor::~blendingFactor() diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H index 92db53a8e6..938449e324 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 33722637d6..8b519877bf 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C @@ -56,23 +56,16 @@ Foam::functionObjects::dsmcFields::dsmcFields name_(name), obr_(obr) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::dsmcFields::~dsmcFields() diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H index 16e457f924..08c5cb7f0b 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 3d5faaf964..4a4a801e4f 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(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 a4f4e9bf2d..bfd55e89c0 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 9bd09cd0b6..4ecd2a4fe0 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 d7ad03adfb..e3fbe35193 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 d82b5120ea..b7a8d52b94 100644 --- a/src/postProcessing/functionObjects/utilities/residuals/residuals.C +++ b/src/postProcessing/functionObjects/utilities/residuals/residuals.C @@ -54,23 +54,16 @@ Foam::functionObjects::residuals::residuals obr_(obr), fieldSet_() { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + 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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::functionObjects::residuals::~residuals() diff --git a/src/postProcessing/functionObjects/utilities/residuals/residuals.H b/src/postProcessing/functionObjects/utilities/residuals/residuals.H index 6767213992..5b8b522694 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 a4bfb5bbbc..1c3d02df28 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(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(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 166bc37b7f..29b5fb0e65 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 2462b526fe..1d1796af9a 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 5e44dae6d6..e12da24970 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 acee1ecfb5..f571185f1e 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 2cbc81d506..89fd0e1ee5 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 1586224449..41a1de210b 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(obr)) { - return false; + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); } if ( - obr.foundObject(modelName) - || obr.foundObject(modelName) + !obr.foundObject(modelName) + && !obr.foundObject(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 a8dc7ae3ff..f578022b86 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 fd45701ecf..89cb38d2c3 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + read(dict); const fvMesh& mesh = refCast(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(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 3c24347d44..e430924a1b 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 afe37cf4a3..7fdc21fba1 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 89107494d7..5a3f81f9d8 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 6385ad89b1..837ddd35fa 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 64c2dbe9ec..adfe67752b 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 9b6289a814..4384c47acf 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(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + const fvMesh& mesh = refCast(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(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 74402e7246..a40e3b3dbc 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 0541cd5c7e..0d4acb2de6 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 447463ebe9..a2758b469c 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 661bba6a4d..f8874237cb 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 55ffc62566..c9c988cdf4 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 1a0723762f..6f57a96fb6 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 332efc2e53..26e494c28d 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 41ac7b56e1..701135b402 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 50b6f2710a..f2c2430e5a 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 f7d8bb51ab..fb7837cdd4 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C @@ -60,6 +60,12 @@ Foam::moleFractions::moleFractions name_(name), mesh_(refCast(obr)) { + if (!isA(obr)) + { + FatalErrorInFunction + << "objectRegistry is not an fvMesh" << exit(FatalError); + } + if (mesh_.foundObject(basicThermo::dictName)) { const ThermoType& thermo = @@ -102,20 +108,6 @@ Foam::moleFractions::moleFractions } -template -bool Foam::moleFractions::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(obr); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H index 7e6beb8c19..05c7fa416a 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();