Skip to content
Snippets Groups Projects
Commit 166164da authored by Mark OLESEN's avatar Mark OLESEN
Browse files

BUG: vtk::coordSetWriter produces incorrect VTK legacy format (fixes #2678)

- has a special purpose beginPiece() method, but was missing an update
  on the numberOfPoints, numberOfCells values required by the base class.
parent 1f68e7f9
Branches
Tags
No related merge requests found
......@@ -80,6 +80,19 @@ void Foam::vtk::coordSetWriter::beginPiece()
}
}
// Update sizes, similar to
// vtk::polyWriter::beginPiece(const pointField&, const edgeList&)
numberOfPoints_ = nLocalPoints_;
numberOfCells_ = nLocalLines_;
// if (parallel_)
// {
// reduce(numberOfPoints_, sumOp<label>());
// reduce(numberOfCells_, sumOp<label>());
// }
// Nothing else to do for legacy
if (legacy()) return;
......@@ -88,7 +101,7 @@ void Foam::vtk::coordSetWriter::beginPiece()
format().openTag
(
vtk::fileTag::PIECE,
vtk::fileAttr::NUMBER_OF_POINTS, nLocalPoints_
vtk::fileAttr::NUMBER_OF_POINTS, numberOfPoints_
);
if (nLocalVerts_)
{
......@@ -105,7 +118,7 @@ void Foam::vtk::coordSetWriter::beginPiece()
void Foam::vtk::coordSetWriter::writePoints()
{
this->beginPoints(nLocalPoints_);
this->beginPoints(numberOfPoints_); //<- same as nLocalPoints_
{
for (const pointField& pts : points_)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment