ENH: build dummy runTimePostProcessing if VTK/ParaView are not available

- this allows more use of the runTimePostProcessing functionObject
  that will fail more gracefully if the proper version could not be
  built.

  The dummy functionObject simply emits a message that it is not available.
This commit is contained in:
Mark Olesen
2018-12-15 18:08:51 +01:00
parent dd2c7c4894
commit d1caaa0529
11 changed files with 284 additions and 64 deletions

View File

@ -40,6 +40,7 @@ bool Foam::functionObject::postProcess(false);
Foam::word Foam::functionObject::outputPrefix("postProcessing");
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::word Foam::functionObject::scopedName(const word& name) const
@ -68,10 +69,9 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
{
const word functionType(dict.get<word>("type"));
if (debug)
{
Info<< "Selecting function " << functionType << endl;
}
DebugInfo
<< "Selecting function " << functionType << endl;
// Load any additional libraries
{
@ -122,12 +122,6 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObject::~functionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::functionObject::name() const
@ -179,4 +173,45 @@ void Foam::functionObject::movePoints(const polyMesh&)
{}
// * * * * * * * * * * * * unavailableFunctionObject * * * * * * * * * * * * //
Foam::functionObject::unavailableFunctionObject::unavailableFunctionObject
(
const word& name
)
:
functionObject(name)
{}
void Foam::functionObject::unavailableFunctionObject::carp(std::string message)
{
FatalError
<< "####" << nl
<< " " << type() << " not available" << nl
<< "####" << nl;
if (message.size())
{
FatalError
<< message.c_str() << nl;
}
FatalError
<< exit(FatalError);
}
bool Foam::functionObject::unavailableFunctionObject::execute()
{
return true;
}
bool Foam::functionObject::unavailableFunctionObject::write()
{
return true;
}
// ************************************************************************* //