mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
dynamicCode/functionObjectTemplate: Updated and simplified by deriving from the regionFunctionObject base-class
This commit is contained in:
@ -77,12 +77,6 @@ ${localCode}
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
const objectRegistry& ${typeName}FunctionObject::obr() const
|
|
||||||
{
|
|
||||||
return obr_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const fvMesh& ${typeName}FunctionObject::mesh() const
|
const fvMesh& ${typeName}FunctionObject::mesh() const
|
||||||
{
|
{
|
||||||
return refCast<const fvMesh>(obr_);
|
return refCast<const fvMesh>(obr_);
|
||||||
@ -98,14 +92,7 @@ ${typeName}FunctionObject::${typeName}FunctionObject
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
functionObject(name),
|
functionObjects::regionFunctionObject(name, runTime, dict)
|
||||||
obr_
|
|
||||||
(
|
|
||||||
runTime.lookupObject<objectRegistry>
|
|
||||||
(
|
|
||||||
dict.lookupOrDefault("region", polyMesh::defaultRegion)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ SourceFiles
|
|||||||
#ifndef functionObjectTemplate_H
|
#ifndef functionObjectTemplate_H
|
||||||
#define functionObjectTemplate_H
|
#define functionObjectTemplate_H
|
||||||
|
|
||||||
#include "functionObject.H"
|
#include "regionFunctionObject.H"
|
||||||
|
|
||||||
//{{{ begin codeInclude
|
//{{{ begin codeInclude
|
||||||
${codeInclude}
|
${codeInclude}
|
||||||
@ -45,7 +45,6 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class objectRegistry;
|
|
||||||
class fvMesh;
|
class fvMesh;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -54,13 +53,10 @@ class fvMesh;
|
|||||||
|
|
||||||
class ${typeName}FunctionObject
|
class ${typeName}FunctionObject
|
||||||
:
|
:
|
||||||
public functionObject
|
public functionObjects::regionFunctionObject
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference to the objectRegistry
|
|
||||||
const objectRegistry& obr_;
|
|
||||||
|
|
||||||
//{{{ begin codeData
|
//{{{ begin codeData
|
||||||
${codeData}
|
${codeData}
|
||||||
//}}} end codeData
|
//}}} end codeData
|
||||||
@ -68,8 +64,6 @@ class ${typeName}FunctionObject
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
const objectRegistry& obr() const;
|
|
||||||
|
|
||||||
const fvMesh& mesh() const;
|
const fvMesh& mesh() const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|||||||
Reference in New Issue
Block a user