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
vtkm::ErrorCode PointInCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:304
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:28
ErrorCode
Identifies whether an operation was successful or what type of error it had.
Definition: ErrorCode.h:28
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
void AscendFromNode(FindCellState &state, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:219
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
static vtkm::ErrorCode IsPointInCell(const vtkm::Vec3f &point, vtkm::Vec3f ¶metric, CellShapeTag cellShape, const CoordsType &cellPoints, bool &isInside)
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:323
vtkm::Id ParentIndex
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:35
@ Success
A successful operation.
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
CellSetPortal CellSet
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:346
vtkm::ErrorCode FindInLeaf(const vtkm::Vec3f &point, vtkm::Vec3f ¶metric, const vtkm::exec::CellLocatorBoundingIntervalHierarchyNode &node, vtkm::Id &containingCellId) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:282
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:312
typename vtkm::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType CoordsPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:342
vtkm::ErrorCode FindCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric, LastCell &lastCell) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:102
vtkm::ErrorCode FindCell(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:93
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
typename CellSetType::template ExecConnectivityType< VisitType, IncidentType > CellSetPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:341
vtkm::cont::ArrayHandleMultiplexerFromList< vtkm::ListAppend< ArraysFloatDefault, ArraysFloatNonDefault > > MultiplexerArrayType
Definition: CoordinateSystem.h:100
vtkm::Id Size
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:46
vtkm::FloatDefault RMin
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:41
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
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:86
CoordsPortal Coords
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:347
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
struct vtkm::exec::CellLocatorBoundingIntervalHierarchyNode::@1::@4 Leaf
void DescendLeftChild(FindCellState &state, const vtkm::Vec3f &point, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:243
@ CellNotFound
A cell matching some given criteria could not be found.
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::ErrorCode FindCellImpl(const vtkm::Vec3f &point, vtkm::Id &cellId, vtkm::Vec3f ¶metric, LastCell &lastCell) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:140
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
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:202
typename CellIdArrayHandle::ReadPortalType CellIdPortal
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:339
void DescendRightChild(FindCellState &state, const vtkm::Vec3f &point, vtkm::Id &nodeIndex) const
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:263
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
CellLocatorBoundingIntervalHierarchyNode()
Definition: exec/CellLocatorBoundingIntervalHierarchy.h:54
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
struct vtkm::exec::CellLocatorBoundingIntervalHierarchyNode::@1::@3 Node
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
A short vector from an ArrayPortal and a vector of indices.
Definition: VecFromPortalPermute.h:28