mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: subModelBase - added localPath() helper function for file writing
This commit is contained in:
committed by
Mark Olesen
parent
e753125669
commit
b576f9dcc7
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -169,6 +170,17 @@ bool Foam::subModelBase::writeTime() const
|
||||
}
|
||||
|
||||
|
||||
Foam::fileName Foam::subModelBase::localPath() const
|
||||
{
|
||||
if (modelName_ != word::null)
|
||||
{
|
||||
return modelName_;
|
||||
}
|
||||
|
||||
return baseName_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::subModelBase::getModelDict
|
||||
(
|
||||
const word& entryName,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -157,6 +158,9 @@ public:
|
||||
//- Flag to indicate when to write a property
|
||||
virtual bool writeTime() const;
|
||||
|
||||
//- Output directory
|
||||
virtual fileName localPath() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -66,9 +66,7 @@ Foam::CloudFunctionObject<CloudType>::CloudFunctionObject
|
||||
(
|
||||
owner.mesh().time().globalPath()
|
||||
/ functionObject::outputPrefix
|
||||
/ cloud::prefix
|
||||
/ owner.name()
|
||||
/ this->modelName()
|
||||
/ this->localPath();
|
||||
);
|
||||
|
||||
outputDir_.clean(); // Remove unneeded ".."
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CloudSubModelBase.H"
|
||||
#include "cloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -125,6 +126,18 @@ bool Foam::CloudSubModelBase<CloudType>::writeTime() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::fileName Foam::CloudSubModelBase<CloudType>::localPath() const
|
||||
{
|
||||
if (modelName_ != word::null)
|
||||
{
|
||||
return cloud::prefix/owner_.name()/modelName_;
|
||||
}
|
||||
|
||||
return cloud::prefix/owner_.name()/baseName_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::CloudSubModelBase<CloudType>::write(Ostream& os) const
|
||||
{
|
||||
|
||||
@ -109,6 +109,9 @@ public:
|
||||
//- Flag to indicate when to write a property
|
||||
virtual bool writeTime() const;
|
||||
|
||||
//- Output directory
|
||||
virtual fileName localPath() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user