Skip to content
Snippets Groups Projects
Commit b60866d9 authored by mattijs's avatar mattijs
Browse files

ENH: coded functionObject: added mesh()

parent 889b0a04
Branches
Tags
No related merge requests found
......@@ -289,7 +289,7 @@
redirectType average;
code
#{
const volScalarField& p = obr().lookupObject<volScalarField>("p");
const volScalarField& p = mesh().lookupObject<volScalarField>("p");
Info<<"p avg:" << average(p) << endl;
#};
}
......
......@@ -113,7 +113,7 @@
outputControl outputTime;
code
#{
const volScalarField& p = obr().lookupObject<volScalarField>("p");
const volScalarField& p = mesh().lookupObject<volScalarField>("p");
Info<<"p avg:" << average(p) << endl;
#};
}
......@@ -229,3 +229,11 @@
- parallel running not tested a lot. What about distributed data
(i.e. non-=NFS=) parallel?
- codedFixedValue could be extended to provide local data however
in terms of complexity this is not really worthwhile.
- all templates come from
=etc/codeTemplates/dynamicCode=
=~/.OpenFOAM/dev/codeTemplates/dynamicCode=
=FOAM_TEMPLATE_DIR=
......@@ -48,6 +48,20 @@ ${localCode}
//}}} end localCode
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const objectRegistry& ${typeName}FunctionObject::obr() const
{
return obr_;
}
const fvMesh& ${typeName}FunctionObject::mesh() const
{
return refCast<const fvMesh>(obr_);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
${typeName}FunctionObject::${typeName}FunctionObject
......
......@@ -45,6 +45,7 @@ namespace Foam
class objectRegistry;
class dictionary;
class mapPolyMesh;
class fvMesh;
/*---------------------------------------------------------------------------*\
A templated functionObject
......@@ -67,10 +68,9 @@ class ${typeName}FunctionObject
// Private Member Functions
const objectRegistry& obr() const
{
return obr_;
}
const objectRegistry& obr() const;
const fvMesh& mesh() const;
//- Disallow default bitwise copy construct
${typeName}FunctionObject(const ${typeName}FunctionObject&);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment