Thursday, 2 May 2019

Paraview - Using python script to export data in x3d format

I am trying to export in x3d format OpenFOAM results using paraview-python script. When I do it via paraview graphical interface it works and results can be visualized in Blender, see the following picture

enter image description here

However, when I try to do the same operation using the following script

 from paraview.simple import *

 exporters=servermanager.createModule("exporters")
 case1=OpenFOAMReader(FileName='field.foam')
 case1.CellArrays = ['U']
 case1.MeshRegions = ['internalMesh']
 servermanager.Fetch(case1)
 pointData=CellDatatoPointData(Input=case1)

 Show( pointData )

 render=Render()
 x3dExporter=exporters.X3DExporter( FileName="field.x3d" )
 x3dExporter.SetView(render)
 x3dExporter.Write()

the field values (velocity U) are not exported as you can see from this picture!

enter image description here

Can someone tell me what I am doing wrong? Thank you!



from Paraview - Using python script to export data in x3d format

No comments:

Post a Comment