ENH: add vtk::writeIdentity() and optional repeat value for vtk::write()

- An identity is often useful when generating connectivity and offset
  information.

- The optional repeat value for vtk::write() allows it to also be used
  as a fill method.
This commit is contained in:
Mark Olesen
2019-07-11 13:42:02 +02:00
committed by Andrew Heather
parent 10a03ceba2
commit 4380349f45
13 changed files with 128 additions and 179 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,10 +69,8 @@ void Foam::functionObjects::vtkCloud::writeVerts
format().beginDataArray<label>(vtk::dataArrayAttr::CONNECTIVITY);
format().writeSize(payLoad);
for (label i=0; i < nTotParcels; ++i)
{
format().write(i);
}
vtk::writeIdentity(format(), nTotParcels);
format().flush();
format().endDataArray();
}
@ -85,10 +83,8 @@ void Foam::functionObjects::vtkCloud::writeVerts
format().beginDataArray<label>(vtk::dataArrayAttr::OFFSETS);
format().writeSize(payLoad);
for (label i=0; i < nTotParcels; ++i)
{
format().write(i+1);
}
vtk::writeIdentity(format(), nTotParcels, 1);
format().flush();
format().endDataArray();
}