VTK-m  2.0
OrientCellNormals.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 // This software is distributed WITHOUT ANY WARRANTY; without even
6 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7 // PURPOSE. See the above copyright notice for more information.
8 //
9 // Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
10 // Copyright 2019 UT-Battelle, LLC.
11 // Copyright 2019 Los Alamos National Security.
12 //
13 // Under the terms of Contract DE-NA0003525 with NTESS,
14 // the U.S. Government retains certain rights in this software.
15 //
16 // Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
17 // Laboratory (LANL), the U.S. Government retains certain rights in
18 // this software.
19 //============================================================================
20 #ifndef vtkm_m_worklet_OrientCellNormals_h
21 #define vtkm_m_worklet_OrientCellNormals_h
22 
23 #include <vtkm/Range.h>
24 #include <vtkm/Types.h>
25 
26 #include <vtkm/cont/Algorithm.h>
27 #include <vtkm/cont/ArrayHandle.h>
33 #include <vtkm/cont/BitField.h>
34 #include <vtkm/cont/Invoker.h>
35 #include <vtkm/cont/Logging.h>
36 
40 
41 #include <vtkm/VecTraits.h>
42 
43 namespace vtkm
44 {
45 namespace worklet
46 {
47 
54 {
55  static constexpr vtkm::Id INVALID_ID = -1;
56 
57  // Returns true if v1 and v2 are pointing in the same hemisphere.
58  template <typename T>
59  VTKM_EXEC static bool SameDirection(const vtkm::Vec<T, 3>& v1, const vtkm::Vec<T, 3>& v2)
60  {
61  return vtkm::Dot(v1, v2) >= 0;
62  }
63 
64  // Ensure that the normal is pointing in the same hemisphere as ref.
65  // Returns true if normal is modified.
66  template <typename T>
67  VTKM_EXEC static bool Align(vtkm::Vec<T, 3>& normal, const vtkm::Vec<T, 3>& ref)
68  {
69  if (!SameDirection(normal, ref))
70  {
71  normal = -normal;
72  return true;
73  }
74  return false;
75  }
76 
77 public:
78  // Locates starting points for BFS traversal of dataset by finding points
79  // on the dataset boundaries. These points are marked as active.
80  // Initializes the ActivePoints array.
82  {
83  public:
84  using ControlSignature = void(FieldIn coords, WholeArrayIn ranges, FieldOut activePoints);
85  using ExecutionSignature = _3(_1 coord, _2 ranges);
86 
87  template <typename CoordT, typename RangePortal>
88  VTKM_EXEC bool operator()(const vtkm::Vec<CoordT, 3>& point, const RangePortal& ranges) const
89  {
90  bool isActive = false;
91  for (vtkm::IdComponent dim = 0; dim < 3; ++dim)
92  {
93  const auto& range = ranges.Get(dim);
94  const auto val = static_cast<decltype(range.Min)>(point[dim]);
95  if (val <= range.Min || val >= range.Max)
96  {
97  isActive = true;
98  }
99  }
100  return isActive;
101  }
102  };
103 
104  // For each of the source points, determine the boundaries it lies on. Align
105  // each incident cell's normal to point out of the boundary, marking each cell
106  // as both visited and active.
107  // Clears the active flags for points, and marks the current point as visited.
109  {
110  public:
111  using ControlSignature = void(CellSetIn cells,
112  FieldInPoint coords,
113  WholeArrayIn ranges,
114  WholeArrayInOut cellNormals,
115  // InOut for preserve data on masked indices
116  BitFieldInOut activeCells,
117  BitFieldInOut visitedCells,
118  FieldInOutPoint activePoints,
119  FieldInOutPoint visitedPoints);
120  using ExecutionSignature = void(CellIndices cellIds,
121  _2 coords,
122  _3 ranges,
123  _4 cellNormals,
124  _5 activeCells,
125  _6 visitedCells,
126  _7 activePoints,
127  _8 visitedPoints);
128 
130 
131  template <typename CellList,
132  typename CoordComp,
133  typename RangePortal,
134  typename CellNormalPortal,
135  typename ActiveCellsBitPortal,
136  typename VisitedCellsBitPortal>
137  VTKM_EXEC void operator()(const CellList& cellIds,
138  const vtkm::Vec<CoordComp, 3>& coord,
139  const RangePortal& ranges,
140  CellNormalPortal& cellNormals,
141  ActiveCellsBitPortal& activeCells,
142  VisitedCellsBitPortal& visitedCells,
143  bool& pointIsActive,
144  bool& pointIsVisited) const
145  {
146  using NormalType = typename CellNormalPortal::ValueType;
148  "Cell Normals expected to have 3 components.");
149  using NormalCompType = typename NormalType::ComponentType;
150 
151  // Find the vector that points out of the dataset from the current point:
152  const NormalType refNormal = [&]() -> NormalType {
153  NormalType normal{ NormalCompType{ 0 } };
154  NormalCompType numNormals{ 0 };
155  for (vtkm::IdComponent dim = 0; dim < 3; ++dim)
156  {
157  const auto range = ranges.Get(dim);
158  const auto val = static_cast<decltype(range.Min)>(coord[dim]);
159  if (val <= range.Min)
160  {
161  NormalType compNormal{ NormalCompType{ 0 } };
162  compNormal[dim] = NormalCompType{ -1 };
163  normal += compNormal;
164  ++numNormals;
165  }
166  else if (val >= range.Max)
167  {
168  NormalType compNormal{ NormalCompType{ 0 } };
169  compNormal[dim] = NormalCompType{ 1 };
170  normal += compNormal;
171  ++numNormals;
172  }
173  }
174 
175  VTKM_ASSERT("Source point is not on a boundary?" && numNormals > 0.5);
176  return normal / numNormals;
177  }();
178 
179  // Align all cell normals to the reference, marking them as active and
180  // visited.
181  const vtkm::IdComponent numCells = cellIds.GetNumberOfComponents();
182  for (vtkm::IdComponent c = 0; c < numCells; ++c)
183  {
184  const vtkm::Id cellId = cellIds[c];
185 
186  if (!visitedCells.OrBitAtomic(cellId, true))
187  { // This thread is the first to touch this cell.
188  activeCells.SetBitAtomic(cellId, true);
189 
190  NormalType cellNormal = cellNormals.Get(cellId);
191  if (Align(cellNormal, refNormal))
192  {
193  cellNormals.Set(cellId, cellNormal);
194  }
195  }
196  }
197 
198  // Mark current point as inactive but visited:
199  pointIsActive = false;
200  pointIsVisited = true;
201  }
202  };
203 
204  // Mark each incident point as active and visited.
205  // Marks the current cell as inactive.
207  {
208  public:
209  using ControlSignature = void(CellSetIn cell,
210  BitFieldInOut activePoints,
211  BitFieldInOut visitedPoints,
212  FieldInOutCell activeCells);
213  using ExecutionSignature = _4(PointIndices pointIds, _2 activePoints, _3 visitedPoints);
214 
216 
217  template <typename PointList, typename ActivePointsBitPortal, typename VisitedPointsBitPortal>
218  VTKM_EXEC bool operator()(const PointList& pointIds,
219  ActivePointsBitPortal& activePoints,
220  VisitedPointsBitPortal& visitedPoints) const
221  {
222  const vtkm::IdComponent numPoints = pointIds.GetNumberOfComponents();
223  for (vtkm::IdComponent p = 0; p < numPoints; ++p)
224  {
225  const vtkm::Id pointId = pointIds[p];
226  if (!visitedPoints.OrBitAtomic(pointId, true))
227  { // This thread owns this point.
228  activePoints.SetBitAtomic(pointId, true);
229  }
230  }
231 
232  // Mark current cell as inactive:
233  return false;
234  }
235  };
236 
237  // Mark each incident cell as active, setting a visited neighbor
238  // cell as its reference for alignment.
239  // Marks the current point as inactive.
241  {
242  public:
243  using ControlSignature = void(CellSetIn cells,
244  WholeArrayOut refCells,
245  BitFieldInOut activeCells,
246  BitFieldIn visitedCells,
247  FieldInOutPoint activePoints);
248  using ExecutionSignature = _5(CellIndices cellIds,
249  _2 refCells,
250  _3 activeCells,
251  _4 visitedCells);
252 
254 
255  template <typename CellList,
256  typename RefCellPortal,
257  typename ActiveCellBitPortal,
258  typename VisitedCellBitPortal>
259  VTKM_EXEC bool operator()(const CellList& cellIds,
260  RefCellPortal& refCells,
261  ActiveCellBitPortal& activeCells,
262  const VisitedCellBitPortal& visitedCells) const
263  {
264  // One of the cells must be marked visited already. Find it and use it as
265  // an alignment reference for the others:
266  const vtkm::IdComponent numCells = cellIds.GetNumberOfComponents();
267  vtkm::Id refCellId = INVALID_ID;
268  for (vtkm::IdComponent c = 0; c < numCells; ++c)
269  {
270  const vtkm::Id cellId = cellIds[c];
271  if (visitedCells.GetBit(cellId))
272  {
273  refCellId = cellId;
274  break;
275  }
276  }
277 
278  VTKM_ASSERT("No reference cell found." && refCellId != INVALID_ID);
279 
280  for (vtkm::IdComponent c = 0; c < numCells; ++c)
281  {
282  const vtkm::Id cellId = cellIds[c];
283  if (!visitedCells.GetBit(cellId))
284  {
285  if (!activeCells.OrBitAtomic(cellId, true))
286  { // This thread owns this cell.
287  refCells.Set(cellId, refCellId);
288  }
289  }
290  }
291 
292  // Mark current point as inactive:
293  return false;
294  }
295  };
296 
297  // Align the normal of each active cell, to its reference cell normal.
298  // The cell is marked visited.
300  {
301  public:
302  using ControlSignature = void(FieldIn refCells,
303  WholeArrayInOut cellNormals,
304  FieldInOut visitedCells);
305  using ExecutionSignature = _3(InputIndex cellId, _1 refCellId, _2 cellNormals);
306 
308 
309  template <typename CellNormalsPortal>
310  VTKM_EXEC bool operator()(const vtkm::Id cellId,
311  const vtkm::Id refCellId,
312  CellNormalsPortal& cellNormals) const
313  {
314  const auto refNormal = cellNormals.Get(refCellId);
315  auto normal = cellNormals.Get(cellId);
316  if (Align(normal, refNormal))
317  {
318  cellNormals.Set(cellId, normal);
319  }
320 
321  // Mark cell as visited:
322  return true;
323  }
324  };
325 
326  template <typename CellSetType,
327  typename CoordsCompType,
328  typename CoordsStorageType,
329  typename CellNormalCompType,
330  typename CellNormalStorageType>
331  VTKM_CONT static void Run(
332  const CellSetType& cells,
333  const vtkm::cont::ArrayHandle<vtkm::Vec<CoordsCompType, 3>, CoordsStorageType>& coords,
334  vtkm::cont::ArrayHandle<vtkm::Vec<CellNormalCompType, 3>, CellNormalStorageType>& cellNormals)
335  {
336  using RangeType = vtkm::cont::ArrayHandle<vtkm::Range>;
337 
338  const vtkm::Id numPoints = coords.GetNumberOfValues();
339  const vtkm::Id numCells = cells.GetNumberOfCells();
340 
342  "OrientCellNormals worklet (%lld points, %lld cells)",
343  static_cast<vtkm::Int64>(numPoints),
344  static_cast<vtkm::Int64>(numCells));
345 
346  // active = cells / point to be used in the next worklet invocation mask.
347  vtkm::cont::BitField activePointBits; // Initialized by MarkSourcePoints
348  auto activePoints = vtkm::cont::make_ArrayHandleBitField(activePointBits);
349 
350  vtkm::cont::BitField activeCellBits;
351  activeCellBits.AllocateAndFill(numCells, false);
352  auto activeCells = vtkm::cont::make_ArrayHandleBitField(activeCellBits);
353 
354  // visited = cells / points that have been corrected.
355  vtkm::cont::BitField visitedPointBits;
356  visitedPointBits.AllocateAndFill(numPoints, false);
357  auto visitedPoints = vtkm::cont::make_ArrayHandleBitField(visitedPointBits);
358 
359  vtkm::cont::BitField visitedCellBits;
360  visitedCellBits.AllocateAndFill(numCells, false);
361  auto visitedCells = vtkm::cont::make_ArrayHandleBitField(visitedCellBits);
362 
363  vtkm::cont::Invoker invoke;
364  vtkm::cont::ArrayHandle<vtkm::Id> mask; // Allocated as needed
365 
366  // For each cell, store a reference alignment cell.
368  {
370  vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(INVALID_ID, numCells), refCells);
371  }
372 
373  // 1) Compute range of coords.
374  const RangeType ranges = vtkm::cont::ArrayRangeCompute(coords);
375 
376  // 2) Locate points on a boundary, since their normal alignment direction
377  // is known.
378  invoke(WorkletMarkSourcePoints{}, coords, ranges, activePoints);
379 
380  // 3) For each source point, align the normals of the adjacent cells.
381  {
382  vtkm::Id numActive = vtkm::cont::Algorithm::BitFieldToUnorderedSet(activePointBits, mask);
383  (void)numActive;
385  "ProcessSourceCells from " << numActive << " source points.");
386  invoke(WorkletProcessSourceCells{},
388  cells,
389  coords,
390  ranges,
391  cellNormals,
392  activeCellBits,
393  visitedCellBits,
394  activePoints,
395  visitedPoints);
396  }
397 
398  for (size_t iter = 1;; ++iter)
399  {
400  // 4) Mark unvisited points adjacent to active cells
401  {
402  vtkm::Id numActive = vtkm::cont::Algorithm::BitFieldToUnorderedSet(activeCellBits, mask);
403  (void)numActive;
405  "MarkActivePoints from " << numActive << " active cells.");
406  invoke(WorkletMarkActivePoints{},
408  cells,
409  activePointBits,
410  visitedPointBits,
411  activeCells);
412  }
413 
414  // 5) Mark unvisited cells adjacent to active points
415  {
416  vtkm::Id numActive = vtkm::cont::Algorithm::BitFieldToUnorderedSet(activePointBits, mask);
417  (void)numActive;
419  "MarkActiveCells from " << numActive << " active points.");
420  invoke(WorkletMarkActiveCells{},
422  cells,
423  refCells,
424  activeCellBits,
425  visitedCellBits,
426  activePoints);
427  }
428 
429  vtkm::Id numActiveCells = vtkm::cont::Algorithm::BitFieldToUnorderedSet(activeCellBits, mask);
430 
431  if (numActiveCells == 0)
432  { // Done!
433  VTKM_LOG_S(vtkm::cont::LogLevel::Perf, "Iteration " << iter << ": Traversal complete.");
434  break;
435  }
436 
438  "Iteration " << iter << ": Processing " << numActiveCells << " normals.");
439 
440  // 5) Correct normals for active cells.
441  {
442  invoke(WorkletProcessCellNormals{},
444  refCells,
445  cellNormals,
446  visitedCells);
447  }
448  }
449  }
450 };
451 }
452 } // end namespace vtkm::worklet
453 
454 
455 #endif // vtkm_m_worklet_OrientCellNormals_h
VTKM_LOG_SCOPE
#define VTKM_LOG_SCOPE(level,...)
Definition: Logging.h:265
vtkm::cont::ArrayHandle::GetNumberOfValues
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ArrayHandle.h
vtkm::worklet::OrientCellNormals::WorkletProcessCellNormals::operator()
VTKM_EXEC bool operator()(const vtkm::Id cellId, const vtkm::Id refCellId, CellNormalsPortal &cellNormals) const
Definition: OrientCellNormals.h:310
vtkm::worklet::OrientCellNormals::WorkletMarkActivePoints::operator()
VTKM_EXEC bool operator()(const PointList &pointIds, ActivePointsBitPortal &activePoints, VisitedPointsBitPortal &visitedPoints) const
Definition: OrientCellNormals.h:218
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::OrientCellNormals::Run
static VTKM_CONT void Run(const CellSetType &cells, const vtkm::cont::ArrayHandle< vtkm::Vec< CoordsCompType, 3 >, CoordsStorageType > &coords, vtkm::cont::ArrayHandle< vtkm::Vec< CellNormalCompType, 3 >, CellNormalStorageType > &cellNormals)
Definition: OrientCellNormals.h:331
vtkm::cont::Algorithm::BitFieldToUnorderedSet
static VTKM_CONT vtkm::Id BitFieldToUnorderedSet(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::BitField &bits, vtkm::cont::ArrayHandle< Id, IndicesStorage > &indices)
Definition: Algorithm.h:389
ArrayRangeCompute.h
Types.h
WorkletMapField.h
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::worklet::OrientCellNormals::WorkletMarkActiveCells
Definition: OrientCellNormals.h:240
vtkm::worklet::WorkletMapField::FieldOut
A control signature tag for output fields.
Definition: WorkletMapField.h:60
ArrayHandleBitField.h
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::worklet::OrientCellNormals::WorkletMarkActiveCells::ExecutionSignature
_5(CellIndices cellIds, _2 refCells, _3 activeCells, _4 visitedCells) ExecutionSignature
Definition: OrientCellNormals.h:251
BitField.h
vtkm::worklet::OrientCellNormals::WorkletProcessSourceCells
Definition: OrientCellNormals.h:108
vtkm::worklet::OrientCellNormals::WorkletMarkSourcePoints::ControlSignature
void(FieldIn coords, WholeArrayIn ranges, FieldOut activePoints) ControlSignature
Definition: OrientCellNormals.h:84
vtkm::worklet::OrientCellNormals
Orients normals to point outside of the dataset.
Definition: OrientCellNormals.h:53
ArrayHandleTransform.h
vtkm::worklet::OrientCellNormals::Align
static VTKM_EXEC bool Align(vtkm::Vec< T, 3 > &normal, const vtkm::Vec< T, 3 > &ref)
Definition: OrientCellNormals.h:67
ArrayRangeComputeTemplate.h
vtkm::worklet::OrientCellNormals::WorkletMarkActiveCells::operator()
VTKM_EXEC bool operator()(const CellList &cellIds, RefCellPortal &refCells, ActiveCellBitPortal &activeCells, const VisitedCellBitPortal &visitedCells) const
Definition: OrientCellNormals.h:259
ArrayHandleConstant.h
vtkm::worklet::OrientCellNormals::WorkletProcessSourceCells::ExecutionSignature
void(CellIndices cellIds, _2 coords, _3 ranges, _4 cellNormals, _5 activeCells, _6 visitedCells, _7 activePoints, _8 visitedPoints) ExecutionSignature
Definition: OrientCellNormals.h:127
vtkm::cont::Algorithm::Copy
static VTKM_CONT bool Copy(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: Algorithm.h:410
Invoker.h
vtkm::worklet::OrientCellNormals::WorkletMarkActivePoints
Definition: OrientCellNormals.h:206
vtkm::worklet::WorkletVisitCellsWithPoints::PointIndices
IncidentElementIndices PointIndices
Definition: WorkletMapTopology.h:269
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::OrientCellNormals::WorkletMarkActivePoints::ControlSignature
void(CellSetIn cell, BitFieldInOut activePoints, BitFieldInOut visitedPoints, FieldInOutCell activeCells) ControlSignature
Definition: OrientCellNormals.h:212
MaskIndices.h
vtkm::worklet::OrientCellNormals::WorkletMarkSourcePoints
Definition: OrientCellNormals.h:81
vtkm::worklet::OrientCellNormals::WorkletProcessCellNormals::ExecutionSignature
_3(InputIndex cellId, _1 refCellId, _2 cellNormals) ExecutionSignature
Definition: OrientCellNormals.h:305
vtkm::worklet::WorkletVisitPointsWithCells
Base class for worklets that map from Cells to Points.
Definition: WorkletMapTopology.h:274
Algorithm.h
vtkm::worklet::WorkletMapField::FieldIn
A control signature tag for input fields.
Definition: WorkletMapField.h:49
vtkm::worklet::OrientCellNormals::WorkletMarkSourcePoints::ExecutionSignature
_3(_1 coord, _2 ranges) ExecutionSignature
Definition: OrientCellNormals.h:85
vtkm::cont::Invoker
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
vtkm::worklet::WorkletVisitCellsWithPoints
Base class for worklets that map from Points to Cells.
Definition: WorkletMapTopology.h:255
vtkm::worklet::OrientCellNormals::WorkletMarkSourcePoints::operator()
VTKM_EXEC bool operator()(const vtkm::Vec< CoordT, 3 > &point, const RangePortal &ranges) const
Definition: OrientCellNormals.h:88
Range.h
vtkm::worklet::OrientCellNormals::INVALID_ID
static constexpr vtkm::Id INVALID_ID
Definition: OrientCellNormals.h:55
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::worklet::WorkletMapField::FieldInOut
A control signature tag for input-output (in-place) fields.
Definition: WorkletMapField.h:71
vtkm::cont::make_ArrayHandleBitField
VTKM_CONT vtkm::cont::ArrayHandleBitField make_ArrayHandleBitField(const vtkm::cont::BitField &bitField)
Definition: ArrayHandleBitField.h:196
vtkm::cont::BitField::AllocateAndFill
VTKM_CONT void AllocateAndFill(vtkm::Id numberOfBits, ValueType value, vtkm::cont::Token &token) const
Allocate the requested number of bits and fill with the requested bit or word.
Definition: BitField.h:575
vtkm::worklet::OrientCellNormals::WorkletProcessCellNormals::ControlSignature
void(FieldIn refCells, WholeArrayInOut cellNormals, FieldInOut visitedCells) ControlSignature
Definition: OrientCellNormals.h:304
vtkm::worklet::WorkletVisitPointsWithCells::CellIndices
IncidentElementIndices CellIndices
Definition: WorkletMapTopology.h:288
VTKM_LOG_S
#define VTKM_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:261
vtkm::worklet::WorkletVisitPointsWithCells::FieldInPoint
FieldInVisit FieldInPoint
Definition: WorkletMapTopology.h:280
vtkm::Vec< T, 3 >
Definition: Types.h:975
vtkm::Vec
A short fixed-length array.
Definition: Types.h:767
vtkm::worklet::OrientCellNormals::WorkletMarkActivePoints::ExecutionSignature
_4(PointIndices pointIds, _2 activePoints, _3 visitedPoints) ExecutionSignature
Definition: OrientCellNormals.h:213
vtkm::cont::BitField
Definition: BitField.h:497
vtkm::worklet::OrientCellNormals::WorkletProcessSourceCells::ControlSignature
void(CellSetIn cells, FieldInPoint coords, WholeArrayIn ranges, WholeArrayInOut cellNormals, BitFieldInOut activeCells, BitFieldInOut visitedCells, FieldInOutPoint activePoints, FieldInOutPoint visitedPoints) ControlSignature
Definition: OrientCellNormals.h:119
vtkm::worklet::MaskIndices
Mask using a given array of indices to include in the output.
Definition: MaskIndices.h:30
vtkm::VecTraits
The VecTraits class gives several static members that define how to use a given type as a vector.
Definition: VecTraits.h:66
vtkm::worklet::OrientCellNormals::SameDirection
static VTKM_EXEC bool SameDirection(const vtkm::Vec< T, 3 > &v1, const vtkm::Vec< T, 3 > &v2)
Definition: OrientCellNormals.h:59
Logging.h
Logging utilities.
vtkm::cont::ArrayRangeCompute
VTKM_CONT_EXPORT vtkm::cont::ArrayHandle< vtkm::Range > ArrayRangeCompute(const vtkm::cont::UnknownArrayHandle &array, vtkm::cont::DeviceAdapterId device=vtkm::cont::DeviceAdapterTagAny{})
Compute the range of the data in an array handle.
vtkm::worklet::OrientCellNormals::WorkletProcessSourceCells::operator()
VTKM_EXEC void operator()(const CellList &cellIds, const vtkm::Vec< CoordComp, 3 > &coord, const RangePortal &ranges, CellNormalPortal &cellNormals, ActiveCellsBitPortal &activeCells, VisitedCellsBitPortal &visitedCells, bool &pointIsActive, bool &pointIsVisited) const
Definition: OrientCellNormals.h:137
WorkletMapTopology.h
vtkm::worklet::WorkletVisitPointsWithCells::FieldInOutPoint
FieldInOut FieldInOutPoint
Definition: WorkletMapTopology.h:284
vtkm::exec::arg::InputIndex
The ExecutionSignature tag to use to get the input index.
Definition: InputIndex.h:42
vtkm::worklet::OrientCellNormals::WorkletProcessCellNormals
Definition: OrientCellNormals.h:299
VecTraits.h
vtkm::cont::LogLevel::Perf
@ Perf
General timing data and algorithm flow information, such as filter execution, worklet dispatches,...
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
vtkm::worklet::OrientCellNormals::WorkletMarkActiveCells::ControlSignature
void(CellSetIn cells, WholeArrayOut refCells, BitFieldInOut activeCells, BitFieldIn visitedCells, FieldInOutPoint activePoints) ControlSignature
Definition: OrientCellNormals.h:247
vtkm::worklet::WorkletVisitCellsWithPoints::FieldInOutCell
FieldInOut FieldInOutCell
Definition: WorkletMapTopology.h:265