diff --git a/src/fileFormats/vtk/format/foamVtkAsciiFormatter.C b/src/fileFormats/vtk/format/foamVtkAsciiFormatter.C index d850bf186f..8533d20ac0 100644 --- a/src/fileFormats/vtk/format/foamVtkAsciiFormatter.C +++ b/src/fileFormats/vtk/format/foamVtkAsciiFormatter.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,7 +41,7 @@ Foam::vtk::asciiFormatter::opts_(formatType::INLINE_ASCII); inline void Foam::vtk::asciiFormatter::next() { - if (pos_ == 6) + if (pos_ >= itemsPerLine_) { os()<< '\n'; pos_ = 0; diff --git a/src/fileFormats/vtk/format/foamVtkAsciiFormatter.H b/src/fileFormats/vtk/format/foamVtkAsciiFormatter.H index f01a0dbef6..49d00918f7 100644 --- a/src/fileFormats/vtk/format/foamVtkAsciiFormatter.H +++ b/src/fileFormats/vtk/format/foamVtkAsciiFormatter.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2018 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,7 @@ Class Description 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). SourceFiles @@ -61,6 +61,9 @@ class asciiFormatter static const char* name_; static const outputOptions opts_; + //- Number of items per line + static constexpr unsigned short itemsPerLine_ = 9; + //- Track the current output position unsigned short pos_;