CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   runTimeSelectionTable for child class of probesFunctionObject (

Bernhard December 13, 2012 07:20

runTimeSelectionTable for child class of probesFunctionObject
2 Attachment(s)
The reason I am working on this is already explained in this topic:

My starting point (amongst others ;)), is to start with a functionObject that is derived from the probesFunctionObject. I attached all files, but for convenience will copy the C and H file here. I also attached a minimal reproductive test case
Attachment 17605
Attachment 17606


#include "probeFinishControlFunctionObject.H"
#include "addToRunTimeSelectionTable.H"

namespace Foam
    defineTypeNameAndDebug(probeFinishControlFunctionObject, 1);


// Constructor
    const word &name,
    const Time& t,
    const dictionary& dict
    // Do nothing

bool probeFinishControlFunctionObject::start()
    Info << "Executed this fancy functionObject!!" << endl;
    return true;

} // namespace Foam


#ifndef probeFinishControlFunctionObject_H
#define probeFinishControlFunctionObject_H

//#include "functionObject.H"
#include "dictionary.H"
#include "OFstream.H"
#include "HashPtrTable.H"
#include "boolList.H"
#include "Field.H"
#include "probesFunctionObject.H"

namespace Foam

class probeFinishControlFunctionObject
 public probesFunctionObject

    // Private Member Functions
    //- Disallow default bitwise copy construct
    probeFinishControlFunctionObject(const probeFinishControlFunctionObject&);
    //- Disallow default bitwise assignment
    void operator=(const probeFinishControlFunctionObject&);



        const word &name,
        const Time& t,
        const dictionary& dict

    bool start();

    bool execute(bool execute);

    bool read(const dictionary& dict);


} // namespace Foam


This compiles well into a library, but creates the following error-messages on running.


Starting time loop

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : .../platforms/linux64GccDPOpt/lib/ undefined symbol: _ZN4Foam32probeFinishControlFunctionObject7execute Eb
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load ""
--> FOAM Warning :
From function dlLibraryTable::open(const dictionary&, const word&, const TablePtr&)
in file lnInclude/dlLibraryTableTemplates.C at line 67
Could not open library ""

Unknown function type probeFinishControl

Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.

FOAM exiting

Where does the error with the library loading come from? With some simpler functionObjects that I compile myself (just copies of other functionObjects), I do not get these messages.

Apparently my functionObject does not appear properly in the runTime-selection tables. Probably because I inherit the class not directly from functionObject, but from probesFunctionObject (defined by typedef src/sampling/probes/probesFunctionObject ) in . But what is the correct way to do this (if any)? Am I conceptually missing something here? probesFunctionObject is already added to the runTimeSelectionTable, I am unsure whether it's child classes could be added again (probably not).
Any other hints in how this issue should be approach are welcome as well!

All times are GMT -4. The time now is 07:29.