|
[Sponsors] |
runTimeSelectionTable for child class of probesFunctionObject |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 13, 2012, 07:20 |
runTimeSelectionTable for child class of probesFunctionObject
|
#1 | |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
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 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 Quote:
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! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
thobois class engineTopoChangerMesh error | Peter_600 | OpenFOAM | 4 | August 2, 2014 10: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 |