mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use double for VTK legacy output (issue #891)
- some paraview versions (eg, on windows) don't support float, only double. This mostly affected the vtkSurfaceWriter. The foamToVTK is also affected, but since it also supports the XML output formats (vtp, vtu) these can be used instead.
This commit is contained in:
@ -200,13 +200,14 @@ int main(int argc, char *argv[])
|
||||
<< objName << nl
|
||||
<< "ASCII\n"
|
||||
<< "DATASET POLYDATA\n"
|
||||
<< "POINTS " << points.size() << " float\n";
|
||||
<< "POINTS " << points.size() << " double\n";
|
||||
|
||||
forAll(points, i)
|
||||
for (const point& pt : points)
|
||||
{
|
||||
const point& pt = points[i];
|
||||
|
||||
outFile << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
outFile
|
||||
<< float(pt.x()) << ' '
|
||||
<< float(pt.y()) << ' '
|
||||
<< float(pt.z()) << nl;
|
||||
}
|
||||
|
||||
outFile
|
||||
@ -265,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
outFile
|
||||
<< "POINT_DATA " << points.size() << nl
|
||||
<< "SCALARS pointID float 1\n"
|
||||
<< "SCALARS pointID double 1\n"
|
||||
<< "LOOKUP_TABLE default\n";
|
||||
|
||||
forAll(points, i)
|
||||
@ -284,13 +285,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!pointNormals.empty())
|
||||
{
|
||||
outFile << nl << "NORMALS pointNormals float\n";
|
||||
outFile << nl << "NORMALS pointNormals double\n";
|
||||
|
||||
forAll(pointNormals, i)
|
||||
for(const vector& n : pointNormals)
|
||||
{
|
||||
const vector& n = pointNormals[i];
|
||||
|
||||
outFile << n.x() << ' ' << n.y() << ' ' << n.z() << nl;
|
||||
outFile
|
||||
<< float(n.x()) << ' '
|
||||
<< float(n.y()) << ' '
|
||||
<< float(n.z()) << nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user