ENH: coded functionObject: added mesh()
This commit is contained in:
parent
889b0a0488
commit
b60866d98c
@ -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&);
|
||||
|
Loading…
Reference in New Issue
Block a user