tsimulation.c: use VTK macro for positions as well - granular - granular dynami… | |
git clone git://src.adamsgaard.dk/granular | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 40c0ea35478dfb9751ec376e907ab09659afbfe1 | |
parent 30537b9a4c16e1f9607e2f95a106420e0452c93a | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 25 Mar 2021 20:14:09 +0100 | |
simulation.c: use VTK macro for positions as well | |
Diffstat: | |
M simulation.c | 16 ++++------------ | |
1 file changed, 4 insertions(+), 12 deletions(-) | |
--- | |
diff --git a/simulation.c b/simulation.c | |
t@@ -7,7 +7,7 @@ | |
#include "arrays.h" | |
#include "util.h" | |
-#define VTK_FLOAT_FMT "%.17g" | |
+#define VTK_FLOAT_FMT "%.17g " | |
#define VTK_XML_SCALAR(M, N, T, F) \ | |
fprintf(stream,\ | |
t@@ -96,17 +96,9 @@ print_grains_vtk(FILE *stream, const struct grain *grains, … | |
"byte_order=\"LittleEndian\">\n" | |
"\t<UnstructuredGrid>\n" | |
"\t\t<Piece NumberOfPoints=\"%zu\" NumberOfCells=\"0\">\n", n); | |
- fprintf(stream, | |
- "\t\t\t<Points>\n" | |
- "\t\t\t\t<DataArray type=\"Float64\" Name=\"Points\" " | |
- "NumberOfComponents=\"3\" format=\"ascii\">\n"); | |
- for (i = 0; i < n; i++) | |
- for (d = 0; d < 3; d++) | |
- fprintf(stream, VTK_FLOAT_FMT, grains[i].pos[d]); | |
- fprintf(stream, "\n"); | |
- fprintf(stream, | |
- "\t\t\t\t</DataArray>\n" | |
- "\t\t\t</Points>\n"); | |
+ fprintf(stream, "\t\t\t<Points>\n"); | |
+ VTK_XML_VECTOR(pos, "Position [m]", "Float64", VTK_FLOAT_FMT); | |
+ fprintf(stream, "\t\t\t</Points>\n"); | |
fprintf(stream, | |
"\t\t\t<Cells>\n" |