ENH: simpler coordinateSystem writeEntry with single parameter

This commit is contained in:
Mark Olesen 2022-01-13 13:55:08 +01:00
parent 4b7f92935e
commit befbcfce24
6 changed files with 29 additions and 8 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -244,7 +244,10 @@ void Foam::engineValve::writeDict(Ostream& os) const
{
os << nl << name() << nl << token::BEGIN_BLOCK;
cs().writeEntry(coordinateSystem::typeName_(), os);
if (csysPtr_)
{
csysPtr_->writeEntry(os);
}
os << "bottomPatch " << bottomPatch_.name() << token::END_STATEMENT << nl
<< "poppetPatch " << poppetPatch_.name() << token::END_STATEMENT << nl

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -127,7 +127,7 @@ void Foam::coordinateScaling<Type>::writeEntry(Ostream& os) const
{
if (coordSys_)
{
coordSys_->writeEntry(coordinateSystem::typeName_(), os);
coordSys_->writeEntry(os);
}
forAll(scale_, dir)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -426,6 +426,12 @@ void Foam::coordinateSystem::write(Ostream& os) const
}
void Foam::coordinateSystem::writeEntry(Ostream& os) const
{
writeEntry(coordinateSystem::typeName_(), os);
}
void Foam::coordinateSystem::writeEntry(const word& keyword, Ostream& os) const
{
if (!valid())

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -530,6 +530,9 @@ public:
//- Write
virtual void write(Ostream& os) const;
//- Write 'coordinateSystem' dictionary entry
virtual void writeEntry(Ostream& os) const;
//- Write dictionary entry
virtual void writeEntry(const word& keyword, Ostream& os) const;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -87,6 +87,12 @@ void Foam::coordSystem::indirect::write(Ostream& os) const
}
void Foam::coordSystem::indirect::writeEntry(Ostream& os) const
{
writeEntry(coordinateSystem::typeName_(), os);
}
void Foam::coordSystem::indirect::writeEntry
(
const word& keyword,

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -259,6 +259,9 @@ public:
//- Write
virtual void write(Ostream& os) const;
//- Write 'coordinateSystem' dictionary entry
virtual void writeEntry(Ostream& os) const;
//- Write dictionary entry
virtual void writeEntry(const word& keyword, Ostream& os) const;