IOobject: Added modelName member function

which constructs the name for a field property associated with the model by
pre-pending the given field name with <modelType>: e.g. the generation term in
the kEpsilon model is named kEpsilon:G
This commit is contained in:
Henry Weller
2019-07-22 10:19:13 +01:00
parent 53e8458153
commit 01da12c1f6
2 changed files with 11 additions and 1 deletions

View File

@ -372,6 +372,10 @@ public:
//- Return member (name without the extension)
word member() const;
//- Return the name of the object within this model
// as <model>:<name>
inline word modelName(const char* name) const;
const fileName& rootPath() const;
const fileName& caseName() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,6 +41,12 @@ inline Foam::word Foam::IOobject::groupName(Name name, const word& group)
}
inline Foam::word Foam::IOobject::modelName(const char* name) const
{
return type() + ':' + name;
}
template<class Stream>
inline Stream& Foam::IOobject::writeBanner(Stream& os, bool noHint)
{