STYLE: VTK ascii output with 9 items per line

- corresponds to the more recent VTK convention
This commit is contained in:
Mark Olesen
2021-05-28 15:24:22 +02:00
parent f2d634c49f
commit 82cc00b153
2 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2018 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,7 +41,7 @@ Foam::vtk::asciiFormatter::opts_(formatType::INLINE_ASCII);
inline void Foam::vtk::asciiFormatter::next() inline void Foam::vtk::asciiFormatter::next()
{ {
if (pos_ == 6) if (pos_ >= itemsPerLine_)
{ {
os()<< '\n'; os()<< '\n';
pos_ = 0; pos_ = 0;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2018 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -28,7 +28,7 @@ Class
Description Description
Inline ASCII output. Inline ASCII output.
Adds spaces between entries and a newline every 6 items Adds spaces between entries and a newline every 9 items
(for consistency with what VTK itself outputs). (for consistency with what VTK itself outputs).
SourceFiles SourceFiles
@ -61,6 +61,9 @@ class asciiFormatter
static const char* name_; static const char* name_;
static const outputOptions opts_; static const outputOptions opts_;
//- Number of items per line
static constexpr unsigned short itemsPerLine_ = 9;
//- Track the current output position //- Track the current output position
unsigned short pos_; unsigned short pos_;