MCPcopy Create free account
hub / github.com/Kitware/VTK / CheckCell

Function CheckCell

Common/DataModel/Testing/Python/Test3DCellsEvaluatePosition.py:85–101  ·  view source on GitHub ↗
(cell, checkCellFunction)

Source from the content-addressed store, hash-verified

83 return True
84
85def CheckCell(cell, checkCellFunction):
86 closestPoint = [0., 0., 0.]
87 subId = reference(0)
88 pcoords = [0., 0., 0.]
89 dist2 = reference(0.)
90 weights = [0.]*30
91 x = [.25, .25, .25]
92 for i in range(21):
93 x[0] = -1.+3.*i/20.
94 for j in range(21):
95 x[1] = -1.+3.*j/20.
96 for k in range(21):
97 x[2] = -1.+3.*k/20.
98 success = c.EvaluatePosition(x, closestPoint, subId, pcoords, dist2, weights)
99 if not checkCellFunction(success, x, pcoords):
100 return False
101 return True
102
103pts = vtkPoints()
104pts.SetNumberOfPoints(20) # quadratic hex has the most points with 20

Callers 2

TestCellValidatorFunction · 0.85

Calls 3

referenceFunction · 0.85
rangeClass · 0.50
EvaluatePositionMethod · 0.45

Tested by

no test coverage detected