Commit 394a3a9b authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: retain compound type on List output (continuation of 68de0528)

- 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
parent bfa20286
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -36,7 +36,7 @@ License
template<class T, unsigned N>
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))
{
os << tag << token::SPACE;
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,11 +45,8 @@ SourceFiles
#include "UList.H"
#include "autoPtr.H"
#include "one.H"
#include "SLListFwd.H"
#include <initializer_list>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......
......@@ -49,6 +49,7 @@ SourceFiles
#include "label.H"
#include "uLabel.H"
#include "zero.H"
#include "one.H"
#include "contiguous.H"
#include "nullObject.H"
#include "stdFoam.H"
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -37,13 +37,14 @@ License
template<class T>
void Foam::UList<T>::writeEntry(Ostream& os) const
{
const word tag("List<" + word(pTraits<T>::typeName) + '>');
if (token::compound::isCompound(tag))
{
os << tag << token::SPACE;
}
if (size())
{
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
if (token::compound::isCompound(tag))
{
os << tag << token::SPACE;
}
os << *this;
}
else if (os.format() == IOstream::ASCII)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment