ENH: add VTP, VTU output for most vtk writers (insitu only)

- with the xml append format it is possible to write raw binary
  (instead of base64), but the writer becomes more complicated.
  Either needs two passes to create, or need to allocate a block
  of space for the header information (like VTK itself does) and
  write later.

    * internalWriter
    * patchWriter
    * surfaceMeshWriter
    * lagrangianWriter

 Also these special purpose ones:
    * foamVtkWriteSurfFields
This commit is contained in:
Mark Olesen
2017-06-01 18:28:40 +02:00
parent c4f1349496
commit a2e978d43e
25 changed files with 1762 additions and 435 deletions

View File

@ -28,7 +28,7 @@ Group
grpPostProcessingUtilities
Description
Legacy VTK file format writer.
VTK file format writer.
- Handles volFields, pointFields, surfaceScalarField, surfaceVectorField
fields.
@ -46,6 +46,9 @@ Usage
- \par -ascii
Write VTK data in ASCII format instead of binary.
- \par -xml
Write VTK data in XML format instead of legacy format
- \par -mesh \<name\>
Use a different mesh name (instead of -region)
@ -243,6 +246,11 @@ foamVtkOutput::outputOptions getOutputOptions(const argList& args)
{
foamVtkOutput::outputOptions opts;
if (args.optionFound("xml"))
{
opts.ascii(args.optionFound("ascii"));
}
else
{
opts.legacy(true);
@ -335,6 +343,11 @@ int main(int argc, char *argv[])
"write in ASCII format instead of binary"
);
argList::addBoolOption
(
"xml",
"write VTK xml instead of legacy format"
);
argList::addBoolOption
(
"poly",
"write polyhedral cells without tet/pyramid decomposition"
@ -902,6 +915,8 @@ int main(int argc, char *argv[])
writer.endPointData();
}
writer.writeFooter();
}
//---------------------------------------------------------------------
@ -1041,6 +1056,8 @@ int main(int argc, char *argv[])
writer.endPointData();
}
writer.writeFooter();
}
else
{
@ -1118,6 +1135,8 @@ int main(int argc, char *argv[])
writer.endPointData();
}
}
writer.writeFooter();
}
}
@ -1190,6 +1209,8 @@ int main(int argc, char *argv[])
writer.write(sVectorFld);
writer.endCellData();
writer.writeFooter();
}
}
@ -1288,6 +1309,8 @@ int main(int argc, char *argv[])
writer.writeIOField<tensor>(tensorNames);
writer.endParcelData();
writer.writeFooter();
}
else
{
@ -1304,6 +1327,8 @@ int main(int argc, char *argv[])
writer.beginParcelData(0);
writer.endParcelData();
writer.writeFooter();
}
}