mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: Removed the redundant "viable" member function
Construction failure and recovery is not handled with exceptions in functionObjectList
This commit is contained in:
@ -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
|
||||
(
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user