Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ParaView ParaView
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,846
    • Issues 1,846
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 87
    • Merge requests 87
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ParaView
  • ParaViewParaView
  • Issues
  • #20523

Closed
Open
Created Mar 03, 2021 by chart3388@chart3388Developer

TimeValues not updating from OpenFoam reader when using Python interface

Might be related to #20418

TimestepValues are not being updated when using the OpenFOAM Reader via Python Shell. I performed these actions via the Pipeline Browser / Properties panel and always got the correct values back. When I wrote a test case, and then just used the trace mechanism you can see the values are not what are expected. Via Pipeline Browser With Skip Zero Time unchecked I get back

runfoam.TimestepValues [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] image

With Skip Zero Time checked I get back

runfoam.TimestepValues [1.0, 2.0, 3.0, 4.0, 5.0] image

When I do this via python

# trace generated using paraview version 5.9.0
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'OpenFOAMReader'
runfoam = OpenFOAMReader(registrationName='run.foam', FileName='/opt/dev/temp/reconstruct/run.foam')
# get animation scene
animationScene1 = GetAnimationScene()
# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()
# Properties modified on runfoam
runfoam.SkipZeroTime = 0
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# show data in view
runfoamDisplay = Show(runfoam, renderView1, 'UnstructuredGridRepresentation')
# trace defaults for the display properties.
runfoamDisplay.Representation = 'Surface'
# reset view to fit data
renderView1.ResetCamera(False)
# show color bar/color legend
runfoamDisplay.SetScalarBarVisibility(renderView1, True)
# update the view to ensure updated data information
renderView1.Update()
# get color transfer function/color map for 'p'
pLUT = GetColorTransferFunction('p')
# get opacity transfer function/opacity map for 'p'
pPWF = GetOpacityTransferFunction('p')
# get TimestepValues
runfoam.TimestepValues
# Properties modified on runfoam
runfoam.SkipZeroTime = 1
# update the view to ensure updated data information
renderView1.Update()
# get TimestepValues
runfoam.TimestepValues

TimestepValues comes back the same

runfoam.TimestepValues [1.0, 2.0, 3.0, 4.0, 5.0]

The only way to get the TimestepValues correct is to utilize the pipeline browser and properties panel and force something to expose the apply button to trigger the operation again.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking