Commit 004dbffc authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic 'add_negative_volume_test'

ca2a5e50 Add test D3CellsWithNegativeVolumes.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !2093
parents 8f6bc2dd ca2a5e50
Pipeline #85159 failed with stage
in 0 seconds
......@@ -91,6 +91,11 @@ set(PVBATCH_TESTS
UserTransformOnRepresentation.py
)
if (numpy_found AND PARAVIEW_USE_MPI)
list(APPEND PVBATCH_TESTS
D3CellsWithNegativeVolumes.py,NO_VALID)
endif()
# Saving animation currently doesn't work in symmetric mode.
# paraview/paraview#17329
set(PVBATCH_NO_SYMMETRIC_TESTS
......
# There were issues with D3 and/or Python calculator which
# caused the following to generated cells with negative volumes in ParaView 5.2.
# It has been since fixed. This test will ensure it stays fixed.
# Ref: Helpdesk Ticket #KW00001698.
from paraview.simple import *
# create a new 'Wavelet'
wavelet1 = Wavelet()
wavelet1.WholeExtent = [-20, 20, -20, 20, -20, 20]
# create a new 'Clip'
clip1 = Clip(Input=wavelet1)
clip1.ClipType = 'Plane'
clip1.Scalars = ['POINTS', 'RTData']
clip1.Value = 157.0909652709961
clip1.InsideOut = 1
# init the 'Plane' selected for 'ClipType'
clip1.ClipType.Origin = [1.0, 0.0, 0.0]
clip1.ClipType.Normal = [1.0, 2.0, 4.0]
# create a new 'D3'
d31 = D3(Input=clip1)
calculator = PythonCalculator(Expression="volume(inputs[0])", ArrayAssociation="Cell Data", CopyArrays=0, ArrayName="cellVolume")
assert calculator.CellData["cellVolume"].GetRange(0)[0] >= 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment