mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: retain compound type on List output (continuation of 68de05285a)
- can help in circumstances when an zero-sized entry is written on some processors, but the compound-type may be useful for determining a particular code path when re-reading the files. Ensures that the information is consistent on all processors. STYLE: adjust separation of includes between List.H and UList.H
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,7 +36,7 @@ License
|
|||||||
template<class T, unsigned N>
|
template<class T, unsigned N>
|
||||||
void Foam::FixedList<T, N>::writeEntry(Ostream& os) const
|
void Foam::FixedList<T, N>::writeEntry(Ostream& os) const
|
||||||
{
|
{
|
||||||
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
|
const word tag("List<" + word(pTraits<T>::typeName) + '>');
|
||||||
if (token::compound::isCompound(tag))
|
if (token::compound::isCompound(tag))
|
||||||
{
|
{
|
||||||
os << tag << token::SPACE;
|
os << tag << token::SPACE;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -45,11 +45,8 @@ SourceFiles
|
|||||||
|
|
||||||
#include "UList.H"
|
#include "UList.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "one.H"
|
|
||||||
#include "SLListFwd.H"
|
#include "SLListFwd.H"
|
||||||
|
|
||||||
#include <initializer_list>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
|||||||
@ -49,6 +49,7 @@ SourceFiles
|
|||||||
#include "label.H"
|
#include "label.H"
|
||||||
#include "uLabel.H"
|
#include "uLabel.H"
|
||||||
#include "zero.H"
|
#include "zero.H"
|
||||||
|
#include "one.H"
|
||||||
#include "contiguous.H"
|
#include "contiguous.H"
|
||||||
#include "nullObject.H"
|
#include "nullObject.H"
|
||||||
#include "stdFoam.H"
|
#include "stdFoam.H"
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -37,13 +37,14 @@ License
|
|||||||
template<class T>
|
template<class T>
|
||||||
void Foam::UList<T>::writeEntry(Ostream& os) const
|
void Foam::UList<T>::writeEntry(Ostream& os) const
|
||||||
{
|
{
|
||||||
if (size())
|
const word tag("List<" + word(pTraits<T>::typeName) + '>');
|
||||||
{
|
|
||||||
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
|
|
||||||
if (token::compound::isCompound(tag))
|
if (token::compound::isCompound(tag))
|
||||||
{
|
{
|
||||||
os << tag << token::SPACE;
|
os << tag << token::SPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size())
|
||||||
|
{
|
||||||
os << *this;
|
os << *this;
|
||||||
}
|
}
|
||||||
else if (os.format() == IOstream::ASCII)
|
else if (os.format() == IOstream::ASCII)
|
||||||
|
|||||||
Reference in New Issue
Block a user