From 54efb46f26bb3b34b790e9cedc1504239165640e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 28 Jan 2017 18:05:11 +0000 Subject: [PATCH] codedFunctionObject: Updated documentation Patch contributed by Bruno Santos Resolves bug-report https://bugs.openfoam.org/view.php?id=2441 --- .../codedFunctionObject/codedFunctionObject.C | 14 ++++++-- .../codedFunctionObject/codedFunctionObject.H | 34 +++++++++---------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C index 33d2227e6..16a11b154 100644 --- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C +++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ namespace Foam ); } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::codedFunctionObject::prepare ( @@ -284,6 +284,16 @@ bool Foam::codedFunctionObject::read(const dictionary& dict) ); } + if(!dataPtr && !readPtr && !execPtr && !writePtr && !endPtr) + { + IOWarningInFunction + ( + dict + ) << "No critical \"code\" prefixed keywords were found." + << " Please check the code documentation for more details." + << nl << endl; + } + updateLibrary(name_); return redirectFunctionObject().read(dict); } diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H index b79144c75..bc949c92a 100644 --- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H +++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,25 +28,26 @@ Group grpUtilitiesFunctionObjects Description - This function object provides a general interface to enable dynamic code - compilation. + Provides a general interface to enable dynamic code compilation. - The entries are - codeInclude : include files - codeOptions : include paths; inserted into EXE_INC in Make/options - codeLibs : link line; inserted into LIB_LIBS in Make/options - codeData : c++; local member data (null constructed); - localCode : c++; local static functions - codeRead : c++; upon functionObject::read(); - codeExecute : c++;upon functionObject::execute(); - codeWrite : c++; upon functionObject::write() - codeEnd : c++; upon functionObject::end(); + The entries are: + \plaintable + codeInclude | include files + codeOptions | include paths; inserted into EXE_INC in Make/options + codeLibs | link line; inserted into LIB_LIBS in Make/options + codeData | c++; local member data (null constructed); + localCode | c++; local static functions; + codeRead | c++; upon functionObject::read(); + codeExecute | c++; upon functionObject::execute(); + codeWrite | c++; upon functionObject::write() + codeEnd | c++; upon functionObject::end(); + \endplaintable Example of function object specification: \verbatim difference { - libs ("libutilityFunctionObjects.so"); + libs ("libutilityFunctionObjects.so"); type coded; // Name of on-the-fly generated functionObject @@ -56,12 +57,11 @@ Description // Lookup U const volVectorField& U = mesh().lookupObject("U"); // Write - mag(U).write(); - } + mag(U)().write(); + #};" } \endverbatim - See also Foam::functionObject Foam::codedBase