Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from paraview.simple import *
- import numpy as np
- #import paraview.simple as pv
- #times = np.arange(0,1,0.011)
- # create a new 'OpenFOAMReader'
- chamberfoam = OpenFOAMReader(FileName='/data/data05/lhcamilo/simQuarterTemplate/chamber00/chamber.foam')
- chamberfoam.SkipZeroTime = 0
- chamberfoam.MeshRegions = ['internalMesh']
- chamberfoam.CellArrays = ['U', 'p']
- # get animation scene
- animationScene1 = GetAnimationScene()
- SetActiveSource(chamberfoam)
- # get the time-keeper
- tk = GetTimeKeeper()
- times = tk.TimestepValues
- #print(times)
- # Setup probe
- probeLocation1 = ProbeLocation(Input=chamberfoam,
- ProbeType='Fixed Radius Point Source')
- # init the 'Fixed Radius Point Source' selected for 'ProbeType'
- probeLocation1.ProbeType.Center = [0.05, 0.05, 0.34]
- probeLocation1.UpdatePipeline()
- SetActiveSource(probeLocation1)
- polyData = servermanager.Fetch(probeLocation1)
- pointData = polyData.GetPointData()
- uArray = pointData.GetArray('U')
- value = np.array(uArray.GetTuple(0))
- print(value)
- tk.Time = 0.33
- tk.UpdateTimeInformation()
- probeLocation1.UpdatePipeline()
- polyData = servermanager.Fetch(probeLocation1)
- pointData = polyData.GetPointData()
- uArray = pointData.GetArray('U')
- value2 = np.array(uArray.GetTuple(0))
- print(value2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement