functionObjects: Removed the redundant "viable" member function

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

View File

@ -54,23 +54,16 @@ Foam::functionObjects::writeVTK::writeVTK
obr_(obr),
objectNames_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::writeVTK::~writeVTK()

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -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()
{
}
{}
// ************************************************************************* //

View File

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

View File

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

View File

@ -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

View File

@ -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();

View File

@ -92,23 +92,16 @@ Foam::functionObjects::div::div
fieldName_("undefined-fieldName"),
resultName_("undefined-resultName")
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::div::~div()

View File

@ -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();

View File

@ -277,23 +277,16 @@ Foam::functionObjects::fieldAverage::fieldAverage
totalTime_(),
periodIndex_(1)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldAverage::~fieldAverage()

View File

@ -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();

View File

@ -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::

View File

@ -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();

View File

@ -68,23 +68,16 @@ Foam::functionObjects::fieldMinMax::fieldMinMax
mode_(mdMag),
fieldSet_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldMinMax::~fieldMinMax()

View File

@ -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();

View File

@ -218,23 +218,16 @@ Foam::functionObjects::fieldValues::cellSource::cellSource
weightFieldName_("none"),
writeVolume_(dict.lookupOrDefault("writeVolume", false))
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::cellSource::~cellSource()

View File

@ -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();

View File

@ -660,23 +660,16 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
facePatchId_(),
faceSign_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::faceSource::~faceSource()

View File

@ -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();

View File

@ -118,23 +118,16 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta
source1Ptr_(NULL),
source2Ptr_(NULL)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::fieldValueDelta::~fieldValueDelta()

View File

@ -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();

View File

@ -54,23 +54,16 @@ Foam::functionObjects::grad::grad
fieldName_("undefined-fieldName"),
resultName_("undefined-resultName")
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::grad::~grad()

View File

@ -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();

View File

@ -77,23 +77,16 @@ Foam::functionObjects::histogram::histogram
functionObjectFile(obr, typeName),
name_(name)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::histogram::~histogram()

View File

@ -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

View File

@ -54,23 +54,16 @@ Foam::functionObjects::mag::mag
fieldName_("undefined-fieldName"),
resultName_("undefined-resultName")
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::mag::~mag()

View File

@ -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();

View File

@ -233,23 +233,16 @@ Foam::functionObjects::nearWallFields::nearWallFields
obr_(obr),
fieldSet_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::nearWallFields::~nearWallFields()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

@ -51,23 +51,16 @@ Foam::functionObjects::readFields::readFields
obr_(obr),
fieldSet_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::readFields::~readFields()

View File

@ -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();

View File

@ -333,23 +333,16 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution
alphaName_(dict.lookup("field")),
patchNames_(dict.lookup("patches"))
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution()

View File

@ -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

View File

@ -337,23 +337,16 @@ Foam::functionObjects::streamLine::streamLine
loadFromFiles_(loadFromFiles),
nSubCycle_(0)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::streamLine::~streamLine()

View File

@ -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();

View File

@ -50,23 +50,16 @@ Foam::functionObjects::surfaceInterpolateFields::surfaceInterpolateFields
obr_(obr),
fieldSet_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::surfaceInterpolateFields::~surfaceInterpolateFields()

View File

@ -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();

View File

@ -448,23 +448,16 @@ Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine
obr_(obr),
loadFromFiles_(loadFromFiles)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine()

View File

@ -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();

View File

@ -139,21 +139,13 @@ Foam::functionObjects::forceCoeffs::forceCoeffs
lRef_(0.0),
Aref_(0.0)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}

View File

@ -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();

View File

@ -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,

View File

@ -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
(

View File

@ -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()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -52,23 +52,16 @@ Foam::functionObjects::blendingFactor::blendingFactor
phiName_("unknown-phiName"),
fieldName_("unknown-fieldName")
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::blendingFactor::~blendingFactor()

View File

@ -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();

View File

@ -56,23 +56,16 @@ Foam::functionObjects::dsmcFields::dsmcFields
name_(name),
obr_(obr)
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::dsmcFields::~dsmcFields()

View File

@ -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();

View File

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

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -54,23 +54,16 @@ Foam::functionObjects::residuals::residuals
obr_(obr),
fieldSet_()
{
if (!isA<fvMesh>(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<fvMesh>(obr);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::residuals::~residuals()

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -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);
}

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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

View File

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

View File

@ -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();

View File

@ -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()

View File

@ -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();

View File

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

View File

@ -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();

View File

@ -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>

View File

@ -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();