CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

runTimeSelectionTable for child class of probesFunctionObject

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   December 13, 2012, 07:20
Default runTimeSelectionTable for child class of probesFunctionObject
Senior Member
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 13
Bernhard is on a distinguished road
The reason I am working on this is already explained in this topic: Terminate simulation based on probe

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

#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:pen(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
could not load ""
--> FOAM Warning :
From function dlLibraryTable:pen(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!
Bernhard is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 09:52
member function [value()] of dimensioned<Type> class sblee1977 OpenFOAM Programming & Development 2 November 9, 2010 04:52
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
How to add a new class locally ville OpenFOAM 4 December 11, 2006 14:20
About UList and List class leosding OpenFOAM Running, Solving & CFD 1 December 2, 2005 00:52

All times are GMT -4. The time now is 20:17.