CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

runTimeSelectionTable for child class of probesFunctionObject

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2012, 06:20
Default runTimeSelectionTable for child class of probesFunctionObject
  #1
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
The reason I am working on this is already explained in this topic: http://www.cfd-online.com/Forums/ope...sed-probe.html

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
probeFinishControl.tar.gz
probeFinishTestCase.tar.gz

probeFinishControlFunctionObject.C
Code:
#include "probeFinishControlFunctionObject.H"
#include "addToRunTimeSelectionTable.H"


namespace Foam
{
    defineTypeNameAndDebug(probeFinishControlFunctionObject, 1);

    addToRunTimeSelectionTable
    (
        functionObject,
        probeFinishControlFunctionObject,
        dictionary
    );

// Constructor
probeFinishControlFunctionObject::probeFinishControlFunctionObject
(
    const word &name,
    const Time& t,
    const dictionary& dict
)
:
probesFunctionObject(name,t,dict)
{
    // Do nothing
}

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

} // namespace Foam
probeFinishControlFunctionObject.H
Code:
#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&);

    public:

    TypeName("probeFinishControl");

    probeFinishControlFunctionObject
    (
        const word &name,
        const Time& t,
        const dictionary& dict
    );

    bool start();

    bool execute(bool execute);

    bool read(const dictionary& dict);

};

} // namespace Foam

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

Quote:
...
Starting time loop

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1175
dlopen error : .../platforms/linux64GccDPOpt/lib/libprobeFinishControl.so: 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 "libprobeFinishControl.so"
--> FOAM Warning :
From function dlLibraryTable:pen(const dictionary&, const word&, const TablePtr&)
in file lnInclude/dlLibraryTableTemplates.C at line 67
Could not open library "libprobeFinishControl.so"



--> FOAM FATAL ERROR:
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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 03:52
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 20:30
How to add a new class locally ville OpenFOAM 4 December 11, 2006 13:20
About UList and List class leosding OpenFOAM Running, Solving & CFD 1 December 1, 2005 23:52


All times are GMT -4. The time now is 10:12.