Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O OpenFOAM-plus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 339
    • Issues 339
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • OpenFOAM-plus
  • Issues
  • #891
Closed
Open
Issue created Jun 20, 2018 by Karl Meredith@kvm

"double" instead of "float"

The vtkSurfaceWriter places the "float" string in vtk files, where some versions of ParaView (specifically windows versions) require the "double" string to be present. As far as I can tell, all versions of ParaView work fine with the "double" string. I'm working on the master branch of OpenFOAM, commit 0770f9a3.

The following changes fix the problem:

diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C index 14a2716..f24b0cf 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C @@ -96,7 +96,7 @@ namespace Foam const Field& values ) {

  •    os  << "1 " << values.size() << " float" << nl;
  •    os  << "1 " << values.size() << " double" << nl;
    
       forAll(values, elemI)
       {

@@ -125,7 +125,7 @@ namespace Foam const Field& values ) {

  •    os  << "3 " << values.size() << " float" << nl;
  •    os  << "3 " << values.size() << " double" << nl;
    
       for (const vector& v : values)
       {

@@ -143,7 +143,7 @@ namespace Foam const Field& values ) {

  •    os  << "1 " << values.size() << " float" << nl;
  •    os  << "1 " << values.size() << " double" << nl;
    
       for (const sphericalTensor& v : values)
       {

@@ -159,7 +159,7 @@ namespace Foam const Field& values ) {

  •    os  << "6 " << values.size() << " float" << nl;
  •    os  << "6 " << values.size() << " double" << nl;
    
       for (const symmTensor& v : values)
       {

@@ -179,7 +179,7 @@ namespace Foam const Field& values ) {

  •    os  << "9 " << values.size() << " float" << nl;
  •    os  << "9 " << values.size() << " double" << nl;
    
       for (const tensor& v : values)
       {

diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterTemplates.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterTemplates.C index ee7c129..ddcf499 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterTemplates.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriterTemplates.C @@ -35,7 +35,7 @@ void Foam::vtkSurfaceWriter::writeData const Field& values ) {

  • os << "1 " << values.size() << " float" << nl;
  • os << "1 " << values.size() << " double" << nl;

    forAll(values, elemI) {

Assignee
Assign to
Time tracking