VTK-m  2.0
exec/CellLocatorPartitioned.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 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_exec_CellLocatorPartitioned_h
11 #define vtk_m_exec_CellLocatorPartitioned_h
12 
13 #include <vtkm/Types.h>
14 #include <vtkm/cont/ArrayHandle.h>
16 
17 namespace vtkm
18 {
19 namespace exec
20 {
22 {
23 private:
27 
28 public:
32  locators,
34  ghosts)
35  : Locators(locators)
36  , Ghosts(ghosts)
37  {
38  }
39 
40  VTKM_EXEC
42  vtkm::Id& partitionId,
43  vtkm::Id& cellId,
44  vtkm::Vec3f& parametric) const
45  {
46  bool found = 0;
47  for (vtkm::Id partitionIndex = 0; partitionIndex < this->Locators.GetNumberOfValues();
48  ++partitionIndex)
49  {
50  vtkm::Id cellIndex;
51  vtkm ::Vec3f parametricLocal;
52  vtkm ::ErrorCode status =
53  Locators.Get(partitionIndex).FindCell(point, cellIndex, parametricLocal);
54  if (status != vtkm ::ErrorCode ::Success)
55  {
56  }
57  else
58  {
59  if (Ghosts.Get(partitionIndex).Get(cellIndex) == 0)
60  {
61  partitionId = partitionIndex;
62  cellId = cellIndex;
63  parametric = parametricLocal;
64  found = true;
65  break;
66  }
67  }
68  }
69  if (found)
70  {
72  }
73  else
74  {
76  }
77  }
78 };
79 } //namespace exec
80 } //namespace vtkm
81 
82 #endif //vtk_m_exec_CellLocatorPartitioned_h
vtkm::cont::ArrayHandle::GetNumberOfValues
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
vtkm::exec::CellLocatorPartitioned::Locators
vtkm::cont::ArrayHandle< vtkm::cont::CellLocatorGeneral::ExecObjType >::ReadPortalType Locators
Definition: exec/CellLocatorPartitioned.h:24
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ArrayHandle.h
vtkm::ErrorCode
ErrorCode
Definition: ErrorCode.h:19
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::ErrorCode::Success
@ Success
vtkm::cont::ArrayHandle::ReadPortalType
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::exec::CellLocatorPartitioned::Ghosts
vtkm::cont::ArrayHandle< vtkm::cont::ArrayHandle< vtkm::UInt8 >::ReadPortalType >::ReadPortalType Ghosts
Definition: exec/CellLocatorPartitioned.h:26
vtkm::exec::CellLocatorPartitioned
Definition: exec/CellLocatorPartitioned.h:21
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::ErrorCode::CellNotFound
@ CellNotFound
vtkm::Vec3f
vtkm::Vec< vtkm::FloatDefault, 3 > Vec3f
Vec3f corresponds to a 3-dimensional vector of floating point values.
Definition: Types.h:1014
vtkm::Vec< vtkm::FloatDefault, 3 >
vtkm::exec::CellLocatorPartitioned::FindCell
VTKM_EXEC vtkm::ErrorCode FindCell(const vtkm::Vec3f &point, vtkm::Id &partitionId, vtkm::Id &cellId, vtkm::Vec3f &parametric) const
Definition: exec/CellLocatorPartitioned.h:41
vtkm::exec::CellLocatorPartitioned::CellLocatorPartitioned
VTKM_CONT CellLocatorPartitioned(const vtkm::cont::ArrayHandle< vtkm::cont::CellLocatorGeneral::ExecObjType >::ReadPortalType &locators, vtkm::cont::ArrayHandle< vtkm::cont::ArrayHandle< vtkm::UInt8 >::ReadPortalType >::ReadPortalType ghosts)
Definition: exec/CellLocatorPartitioned.h:30
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
CellLocatorGeneral.h