I was trying to plot streamlines on a slice and the following errors are popping out
( 185.850s) [paraview ]vtkPolyDataPlaneCutter.:520 INFO| Executing vtkPolyData plane cutter
( 630.501s) [ 4BFFF640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.501s) [ 4BFFF640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.501s) [ 513F9640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
NULL instance of vtkPointSet
( 630.502s) [ 48FF3640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.502s) [ 693FA640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.502s) [ 48FF3640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.502s) [ 693FA640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.502s) [ 48FF3640]vtkFindCellStrategy.cxx:37 ERR| Initialize must be called with non-NULL instance of vtkPointSet
( 630.524s) [paraview ] vtkStreamTracer.cxx:1673 ERR| vtkPStreamTracer (0x7f582ea2b500): Bad velocity array.
I had plotted Glyph and it seems to be working fine. Can anyone help me with this error
Regards
- Open .h5 file from converge cfd using convergereader
- applied the filter celltopointdata
- slice the domain at the midpoint in y normal direction
- applied streamtracer on top of it
and the error throws up
I am uploading the data file for your reference
# trace generated using paraview version 5.11.0
#import paraview
#paraview.compatibility.major = 5
#paraview.compatibility.minor = 11
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'CONVERGECFDReader'
post000041_400000e04h5 = CONVERGECFDReader(registrationName='post000041_+4.00000e+04.h5', FileName='/home/rameshkolluru/CARES1/ShipHeadWind/post000041_+4.00000e+04.h5')
post000041_400000e04h5.CellArrayStatus = ['DENSITY', 'EPS', 'PRESSURE', 'TEMPERATURE', 'TKE', 'TURB_LENGTH', 'TURB_VISCOSITY', 'XI', 'XIVAR', 'YPLUS', 'VELOCITY', 'VORTICITY', 'WALL_STRESS']
# get animation scene
animationScene1 = GetAnimationScene()
# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# show data in view
post000041_400000e04h5Display = Show(post000041_400000e04h5, renderView1, 'GeometryRepresentation')
# trace defaults for the display properties.
post000041_400000e04h5Display.Representation = 'Surface'
post000041_400000e04h5Display.ColorArrayName = [None, '']
post000041_400000e04h5Display.SelectTCoordArray = 'None'
post000041_400000e04h5Display.SelectNormalArray = 'None'
post000041_400000e04h5Display.SelectTangentArray = 'None'
post000041_400000e04h5Display.OSPRayScaleFunction = 'PiecewiseFunction'
post000041_400000e04h5Display.SelectOrientationVectors = 'None'
post000041_400000e04h5Display.ScaleFactor = 186.2000594906749
post000041_400000e04h5Display.SelectScaleArray = 'None'
post000041_400000e04h5Display.GlyphType = 'Arrow'
post000041_400000e04h5Display.GlyphTableIndexArray = 'None'
post000041_400000e04h5Display.GaussianRadius = 9.310002974533745
post000041_400000e04h5Display.SetScaleArray = [None, '']
post000041_400000e04h5Display.ScaleTransferFunction = 'PiecewiseFunction'
post000041_400000e04h5Display.OpacityArray = [None, '']
post000041_400000e04h5Display.OpacityTransferFunction = 'PiecewiseFunction'
post000041_400000e04h5Display.DataAxesGrid = 'GridAxesRepresentation'
post000041_400000e04h5Display.PolarAxes = 'PolarAxesRepresentation'
post000041_400000e04h5Display.SelectInputVectors = [None, '']
post000041_400000e04h5Display.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
post000041_400000e04h5Display.OSPRayScaleFunction.Points = [0.028162928713872735, 0.0, 0.5, 0.0, 12.152114924155239, 1.0, 0.5, 0.0]
# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
post000041_400000e04h5Display.DataAxesGrid.XTitleBold = 1
post000041_400000e04h5Display.DataAxesGrid.YTitleBold = 1
post000041_400000e04h5Display.DataAxesGrid.ZTitleBold = 1
post000041_400000e04h5Display.DataAxesGrid.GridColor = [0.0, 0.0, 0.0]
post000041_400000e04h5Display.DataAxesGrid.XLabelBold = 1
post000041_400000e04h5Display.DataAxesGrid.XLabelFontSize = 18
post000041_400000e04h5Display.DataAxesGrid.YLabelBold = 1
post000041_400000e04h5Display.DataAxesGrid.YLabelFontSize = 18
post000041_400000e04h5Display.DataAxesGrid.ZLabelBold = 1
post000041_400000e04h5Display.DataAxesGrid.ZLabelFontSize = 18
# reset view to fit data
renderView1.ResetCamera(False)
# get the material library
materialLibrary1 = GetMaterialLibrary()
# update the view to ensure updated data information
renderView1.Update()
# set scalar coloring
ColorBy(post000041_400000e04h5Display, ('FIELD', 'vtkBlockColors'))
# show color bar/color legend
post000041_400000e04h5Display.SetScalarBarVisibility(renderView1, True)
# get color transfer function/color map for 'vtkBlockColors'
vtkBlockColorsLUT = GetColorTransferFunction('vtkBlockColors')
# get opacity transfer function/opacity map for 'vtkBlockColors'
vtkBlockColorsPWF = GetOpacityTransferFunction('vtkBlockColors')
# get 2D transfer function for 'vtkBlockColors'
vtkBlockColorsTF2D = GetTransferFunction2D('vtkBlockColors')
# create a new 'Cell Data to Point Data'
cellDatatoPointData1 = CellDatatoPointData(registrationName='CellDatatoPointData1', Input=post000041_400000e04h5)
cellDatatoPointData1.CellDataArraytoprocess = ['DENSITY', 'EPS', 'PRESSURE', 'TEMPERATURE', 'TKE', 'TURB_LENGTH', 'TURB_VISCOSITY', 'VELOCITY', 'VORTICITY', 'WALL_STRESS', 'XI', 'XIVAR', 'YPLUS']
# Properties modified on cellDatatoPointData1
cellDatatoPointData1.PassCellData = 1
cellDatatoPointData1.PieceInvariant = 1
# show data in view
cellDatatoPointData1Display = Show(cellDatatoPointData1, renderView1, 'GeometryRepresentation')
# trace defaults for the display properties.
cellDatatoPointData1Display.Representation = 'Surface'
cellDatatoPointData1Display.ColorArrayName = [None, '']
cellDatatoPointData1Display.SelectTCoordArray = 'None'
cellDatatoPointData1Display.SelectNormalArray = 'None'
cellDatatoPointData1Display.SelectTangentArray = 'None'
cellDatatoPointData1Display.OSPRayScaleArray = 'DENSITY'
cellDatatoPointData1Display.OSPRayScaleFunction = 'PiecewiseFunction'
cellDatatoPointData1Display.SelectOrientationVectors = 'None'
cellDatatoPointData1Display.ScaleFactor = 186.2000594906749
cellDatatoPointData1Display.SelectScaleArray = 'DENSITY'
cellDatatoPointData1Display.GlyphType = 'Arrow'
cellDatatoPointData1Display.GlyphTableIndexArray = 'DENSITY'
cellDatatoPointData1Display.GaussianRadius = 9.310002974533745
cellDatatoPointData1Display.SetScaleArray = ['POINTS', 'DENSITY']
cellDatatoPointData1Display.ScaleTransferFunction = 'PiecewiseFunction'
cellDatatoPointData1Display.OpacityArray = ['POINTS', 'DENSITY']
cellDatatoPointData1Display.OpacityTransferFunction = 'PiecewiseFunction'
cellDatatoPointData1Display.DataAxesGrid = 'GridAxesRepresentation'
cellDatatoPointData1Display.PolarAxes = 'PolarAxesRepresentation'
cellDatatoPointData1Display.SelectInputVectors = ['POINTS', 'VELOCITY']
cellDatatoPointData1Display.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
cellDatatoPointData1Display.OSPRayScaleFunction.Points = [0.028162928713872735, 0.0, 0.5, 0.0, 12.152114924155239, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
cellDatatoPointData1Display.ScaleTransferFunction.Points = [1.166041374206543, 0.0, 0.5, 0.0, 1.2514169216156006, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
cellDatatoPointData1Display.OpacityTransferFunction.Points = [1.166041374206543, 0.0, 0.5, 0.0, 1.2514169216156006, 1.0, 0.5, 0.0]
# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
cellDatatoPointData1Display.DataAxesGrid.XTitleBold = 1
cellDatatoPointData1Display.DataAxesGrid.YTitleBold = 1
cellDatatoPointData1Display.DataAxesGrid.ZTitleBold = 1
cellDatatoPointData1Display.DataAxesGrid.GridColor = [0.0, 0.0, 0.0]
cellDatatoPointData1Display.DataAxesGrid.XLabelBold = 1
cellDatatoPointData1Display.DataAxesGrid.XLabelFontSize = 18
cellDatatoPointData1Display.DataAxesGrid.YLabelBold = 1
cellDatatoPointData1Display.DataAxesGrid.YLabelFontSize = 18
cellDatatoPointData1Display.DataAxesGrid.ZLabelBold = 1
cellDatatoPointData1Display.DataAxesGrid.ZLabelFontSize = 18
# hide data in view
Hide(post000041_400000e04h5, renderView1)
# update the view to ensure updated data information
renderView1.Update()
# set scalar coloring
ColorBy(cellDatatoPointData1Display, ('FIELD', 'vtkBlockColors'))
# show color bar/color legend
cellDatatoPointData1Display.SetScalarBarVisibility(renderView1, True)
# create a new 'Slice'
slice1 = Slice(registrationName='Slice1', Input=cellDatatoPointData1)
slice1.SliceType = 'Plane'
slice1.HyperTreeGridSlicer = 'Plane'
slice1.SliceOffsetValues = [0.0]
# init the 'Plane' selected for 'SliceType'
slice1.SliceType.Origin = [931.000312898188, 822.5001871975301, 104.99999604386176]
# init the 'Plane' selected for 'HyperTreeGridSlicer'
slice1.HyperTreeGridSlicer.Origin = [931.000312898188, 822.5001871975301, 104.99999604386176]
# Properties modified on slice1.SliceType
slice1.SliceType.Origin = [931.000312898188, 820.0948, 104.99999604386176]
slice1.SliceType.Normal = [0.0, 1.0, 0.0]
# show data in view
slice1Display = Show(slice1, renderView1, 'GeometryRepresentation')
# trace defaults for the display properties.
slice1Display.Representation = 'Surface'
slice1Display.ColorArrayName = [None, '']
slice1Display.SelectTCoordArray = 'None'
slice1Display.SelectNormalArray = 'None'
slice1Display.SelectTangentArray = 'None'
slice1Display.OSPRayScaleArray = 'DENSITY'
slice1Display.OSPRayScaleFunction = 'PiecewiseFunction'
slice1Display.SelectOrientationVectors = 'None'
slice1Display.ScaleFactor = 186.2000594906749
slice1Display.SelectScaleArray = 'DENSITY'
slice1Display.GlyphType = 'Arrow'
slice1Display.GlyphTableIndexArray = 'DENSITY'
slice1Display.GaussianRadius = 9.310002974533745
slice1Display.SetScaleArray = ['POINTS', 'DENSITY']
slice1Display.ScaleTransferFunction = 'PiecewiseFunction'
slice1Display.OpacityArray = ['POINTS', 'DENSITY']
slice1Display.OpacityTransferFunction = 'PiecewiseFunction'
slice1Display.DataAxesGrid = 'GridAxesRepresentation'
slice1Display.PolarAxes = 'PolarAxesRepresentation'
slice1Display.SelectInputVectors = ['POINTS', 'VELOCITY']
slice1Display.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
slice1Display.OSPRayScaleFunction.Points = [0.028162928713872735, 0.0, 0.5, 0.0, 12.152114924155239, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
slice1Display.ScaleTransferFunction.Points = [1.1660428047180176, 0.0, 0.5, 0.0, 1.2514150142669678, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
slice1Display.OpacityTransferFunction.Points = [1.1660428047180176, 0.0, 0.5, 0.0, 1.2514150142669678, 1.0, 0.5, 0.0]
# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
slice1Display.DataAxesGrid.XTitleBold = 1
slice1Display.DataAxesGrid.YTitleBold = 1
slice1Display.DataAxesGrid.ZTitleBold = 1
slice1Display.DataAxesGrid.GridColor = [0.0, 0.0, 0.0]
slice1Display.DataAxesGrid.XLabelBold = 1
slice1Display.DataAxesGrid.XLabelFontSize = 18
slice1Display.DataAxesGrid.YLabelBold = 1
slice1Display.DataAxesGrid.YLabelFontSize = 18
slice1Display.DataAxesGrid.ZLabelBold = 1
slice1Display.DataAxesGrid.ZLabelFontSize = 18
# hide data in view
Hide(cellDatatoPointData1, renderView1)
# update the view to ensure updated data information
renderView1.Update()
# set scalar coloring
ColorBy(slice1Display, ('FIELD', 'vtkBlockColors'))
# show color bar/color legend
slice1Display.SetScalarBarVisibility(renderView1, True)
# toggle interactive widget visibility (only when running from the GUI)
HideInteractiveWidgets(proxy=slice1.SliceType)
renderView1.ResetActiveCameraToPositiveY()
# reset view to fit data
renderView1.ResetCamera(False)
# set scalar coloring
ColorBy(slice1Display, ('POINTS', 'VELOCITY', 'Magnitude'))
# Hide the scalar bar for this color map if no visible data is colored by it.
HideScalarBarIfNotNeeded(vtkBlockColorsLUT, renderView1)
# rescale color and/or opacity maps used to include current data range
slice1Display.RescaleTransferFunctionToDataRange(True, False)
# show color bar/color legend
slice1Display.SetScalarBarVisibility(renderView1, True)
# get color transfer function/color map for 'VELOCITY'
vELOCITYLUT = GetColorTransferFunction('VELOCITY')
# get opacity transfer function/opacity map for 'VELOCITY'
vELOCITYPWF = GetOpacityTransferFunction('VELOCITY')
# get 2D transfer function for 'VELOCITY'
vELOCITYTF2D = GetTransferFunction2D('VELOCITY')
# create a new 'Stream Tracer'
streamTracer1 = StreamTracer(registrationName='StreamTracer1', Input=slice1,
SeedType='Line')
streamTracer1.Vectors = ['POINTS', 'VELOCITY']
streamTracer1.MaximumStreamlineLength = 1862.000594906749
# init the 'Line' selected for 'SeedType'
streamTracer1.SeedType.Point1 = [1.5444813470821828e-05, 820.0947875976562, -7.912276487331837e-06]
streamTracer1.SeedType.Point2 = [1862.0006103515625, 820.0947875976562, 210.0]
# show data in view
streamTracer1Display = Show(streamTracer1, renderView1, 'GeometryRepresentation')
# trace defaults for the display properties.
streamTracer1Display.Representation = 'Surface'
streamTracer1Display.ColorArrayName = [None, '']
streamTracer1Display.SelectTCoordArray = 'None'
streamTracer1Display.SelectNormalArray = 'None'
streamTracer1Display.SelectTangentArray = 'None'
streamTracer1Display.OSPRayScaleArray = 'AngularVelocity'
streamTracer1Display.OSPRayScaleFunction = 'PiecewiseFunction'
streamTracer1Display.SelectOrientationVectors = 'None'
streamTracer1Display.ScaleFactor = 186.2000594906749
streamTracer1Display.SelectScaleArray = 'AngularVelocity'
streamTracer1Display.GlyphType = 'Arrow'
streamTracer1Display.GlyphTableIndexArray = 'AngularVelocity'
streamTracer1Display.GaussianRadius = 9.310002974533745
streamTracer1Display.SetScaleArray = ['POINTS', 'AngularVelocity']
streamTracer1Display.ScaleTransferFunction = 'PiecewiseFunction'
streamTracer1Display.OpacityArray = ['POINTS', 'AngularVelocity']
streamTracer1Display.OpacityTransferFunction = 'PiecewiseFunction'
streamTracer1Display.DataAxesGrid = 'GridAxesRepresentation'
streamTracer1Display.PolarAxes = 'PolarAxesRepresentation'
streamTracer1Display.SelectInputVectors = ['POINTS', 'Vorticity']
streamTracer1Display.WriteLog = ''
# init the 'PiecewiseFunction' selected for 'OSPRayScaleFunction'
streamTracer1Display.OSPRayScaleFunction.Points = [0.028162928713872735, 0.0, 0.5, 0.0, 12.152114924155239, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
streamTracer1Display.ScaleTransferFunction.Points = [-0.02222755894653712, 0.0, 0.5, 0.0, 0.016390641197338664, 1.0, 0.5, 0.0]
# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
streamTracer1Display.OpacityTransferFunction.Points = [-0.02222755894653712, 0.0, 0.5, 0.0, 0.016390641197338664, 1.0, 0.5, 0.0]
# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
streamTracer1Display.DataAxesGrid.XTitleBold = 1
streamTracer1Display.DataAxesGrid.YTitleBold = 1
streamTracer1Display.DataAxesGrid.ZTitleBold = 1
streamTracer1Display.DataAxesGrid.GridColor = [0.0, 0.0, 0.0]
streamTracer1Display.DataAxesGrid.XLabelBold = 1
streamTracer1Display.DataAxesGrid.XLabelFontSize = 18
streamTracer1Display.DataAxesGrid.YLabelBold = 1
streamTracer1Display.DataAxesGrid.YLabelFontSize = 18
streamTracer1Display.DataAxesGrid.ZLabelBold = 1
streamTracer1Display.DataAxesGrid.ZLabelFontSize = 18
# hide data in view
Hide(slice1, renderView1)
# update the view to ensure updated data information
renderView1.Update()
#================================================================
# addendum: following script captures some of the application
# state to faithfully reproduce the visualization during playback
#================================================================
# get layout
layout1 = GetLayout()
#--------------------------------
# saving layout sizes for layouts
# layout/tab size in pixels
layout1.SetSize(1471, 789)
#-----------------------------------
# saving camera placements for views
# current camera placement for renderView1
renderView1.CameraPosition = [931.000312898188, -2799.819034746966, 104.99999604386176]
renderView1.CameraFocalPoint = [931.000312898188, 820.0947875976562, 104.99999604386176]
renderView1.CameraViewUp = [0.0, 0.0, 1.0]
renderView1.CameraParallelScale = 936.902638852651
#--------------------------------------------
# uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).