Go to the documentation of this file.
10 #ifndef vtk_m_exec_CellLocatorBoundingIntervalHierarchy_h
11 #define vtk_m_exec_CellLocatorBoundingIntervalHierarchy_h
30 #if defined(VTKM_CLANG)
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wnested-anon-types"
33 #endif // gcc || clang
49 #if defined(VTKM_CLANG)
50 #pragma GCC diagnostic pop
51 #endif // gcc || clang
63 template <
typename CellSetType>
75 const CellSetType& cellSet,
79 : Nodes(nodes.PrepareForInput(device, token))
80 , CellIds(cellIds.PrepareForInput(device, token))
82 , Coords(coords.PrepareForInput(device, token))
98 return this->FindCellImpl(point, cellId, parametric, lastCell);
110 if ((lastCell.
CellId >= 0) && (lastCell.
CellId < this->CellSet.GetNumberOfElements()))
120 if ((lastCell.
NodeIdx >= 0) && (lastCell.
NodeIdx < this->Nodes.GetNumberOfValues()))
122 const auto& node = this->Nodes.Get(lastCell.
NodeIdx);
124 if (node.ChildIndex < 0)
136 return this->FindCellImpl(point, cellId, parametric, lastCell);
149 while ((cellId < 0) && !((nodeIndex == 0) && (state == FindCellState::AscendFromNode)))
153 case FindCellState::EnterNode:
155 this->EnterNode(state, point, cellId, nodeIndex, parametric, lastCell));
157 case FindCellState::AscendFromNode:
158 this->AscendFromNode(state, nodeIndex);
160 case FindCellState::DescendLeftChild:
161 this->DescendLeftChild(state, point, nodeIndex);
163 case FindCellState::DescendRightChild:
164 this->DescendRightChild(state, point, nodeIndex);
204 state = FindCellState::AscendFromNode;
213 state = FindCellState::DescendLeftChild;
221 VTKM_ASSERT(state == FindCellState::AscendFromNode);
223 vtkm::Id childNodeIndex = nodeIndex;
225 this->Nodes.Get(childNodeIndex);
228 this->Nodes.Get(nodeIndex);
233 state = FindCellState::DescendRightChild;
245 VTKM_ASSERT(state == FindCellState::DescendLeftChild);
249 if (coordinate <= node.
Node.LMax)
253 state = FindCellState::EnterNode;
258 state = FindCellState::DescendRightChild;
265 VTKM_ASSERT(state == FindCellState::DescendRightChild);
269 if (coordinate >= node.
Node.RMin)
273 state = FindCellState::EnterNode;
278 state = FindCellState::AscendFromNode;
290 vtkm::Id cellId = this->CellIds.Get(i);
294 containingCellId = cellId;
299 containingCellId = -1;
308 using IndicesType =
typename CellSetPortal::IndicesType;
309 IndicesType cellPointIndices = this->CellSet.GetIndices(cellId);
312 auto cellShape = this->CellSet.GetCellShape(cellId);
316 if (isInside && vtkm::exec::CellInside(parametric, cellShape))
322 template <
typename CoordsType,
typename CellShapeTag>
325 CellShapeTag cellShape,
326 const CoordsType& cellPoints,
331 cellPoints, point, cellShape, parametric));
332 isInside = vtkm::exec::CellInside(parametric, cellShape);
341 typename CellSetType::template ExecConnectivityType<VisitType, IncidentType>;
342 using CoordsPortal =
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType;
354 #endif //vtk_m_exec_CellLocatorBoundingIntervalHierarchy_h
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:28
ErrorCode
Definition: ErrorCode.h:19
typename NodeArrayHandle::ReadPortalType NodePortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:338
#define VTKM_EXEC
Definition: ExportMacros.h:51
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:64
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::Id ParentIndex
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:35
vtkm::IdComponent Dimension
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:34
vtkm::Id NodeIdx
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:89
vtkm::Id ChildIndex
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:36
vtkm::FloatDefault LMax
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:40
VTKM_EXEC vtkm::ErrorCode EnterNode(FindCellState &state, const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Id nodeIndex, vtkm::Vec3f ¶metric, LastCell &lastCell) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:189
CellSetPortal CellSet
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:346
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
VTKM_CONT CellLocatorBoundingIntervalHierarchy(const NodeArrayHandle &nodes, const CellIdArrayHandle &cellIds, const CellSetType &cellSet, const vtkm::cont::CoordinateSystem::MultiplexerArrayType &coords, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:72
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_EXEC void AscendFromNode(FindCellState &state, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:219
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType CoordsPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:342
NodePortal Nodes
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:344
CellIdPortal CellIds
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:345
FindCellState
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:180
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_EXEC vtkm::ErrorCode FindCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric, LastCell &lastCell) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:102
typename CellSetType::template ExecConnectivityType< VisitType, IncidentType > CellSetPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:341
vtkm::cont::ArrayHandleMultiplexerFromList< vtkm::ListAppend< ArraysFloatDefault, ArraysFloatNonDefault > > MultiplexerArrayType
Definition: CoordinateSystem.h:95
vtkm::Id Size
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:46
vtkm::FloatDefault RMin
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:41
VTKM_EXEC vtkm::ErrorCode FindCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:93
VTKM_EXEC vtkm::ErrorCode FindInLeaf(const vtkm::Vec3f &point, vtkm::Vec3f ¶metric, const vtkm::exec::CellLocatorBoundingIntervalHierarchyNode &node, vtkm::Id &containingCellId) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:282
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:86
VTKM_EXEC_CONT CellLocatorBoundingIntervalHierarchyNode()
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:54
CoordsPortal Coords
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:347
#define VTKM_CONT
Definition: ExportMacros.h:57
struct vtkm::exec::CellLocatorBoundingIntervalHierarchyNode::@1::@4 Leaf
VTKM_EXEC vtkm::ErrorCode FindCellImpl(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric, LastCell &lastCell) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:140
Definition: DeviceAdapterTag.h:52
VTKM_EXEC vtkm::ErrorCode PointInCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:304
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
vtkm::Id Start
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:45
vtkm::Id CellId
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:88
#define VTKM_RETURN_ON_ERROR(call)
Definition: ErrorCode.h:111
typename CellIdArrayHandle::ReadPortalType CellIdPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:339
static VTKM_EXEC vtkm::ErrorCode IsPointInCell(const vtkm::Vec3f &point, vtkm::Vec3f ¶metric, CellShapeTag cellShape, const CoordsType &cellPoints, bool &isInside)
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:323
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
VTKM_EXEC void DescendRightChild(FindCellState &state, const vtkm::Vec3f &point, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:263
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
struct vtkm::exec::CellLocatorBoundingIntervalHierarchyNode::@1::@3 Node
VTKM_EXEC void DescendLeftChild(FindCellState &state, const vtkm::Vec3f &point, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:243
A short vector from an ArrayPortal and a vector of indices.
Definition: VecFromPortalPermute.h:28