Go to the documentation of this file.
18 #ifndef viskores_exec_CellLocatorUniformBins_h
19 #define viskores_exec_CellLocatorUniformBins_h
48 template <
typename CellStructureType>
55 typename viskores::cont::CoordinateSystem::MultiplexerArrayType::ReadPortalType;
64 template <
typename CellSetType>
73 const CellSetType& cellSet,
80 , InvSpacing(invSpacing)
81 , MaxCellIds(maxCellIds)
82 , CellIds(cellIds.PrepareForInput(device, token))
83 , CellSet(cellSet.PrepareForInput(device,
87 , Coords(coords.GetDataAsMultiplexer().PrepareForInput(device, token))
104 return this->FindCellImpl(point, cellId, parametric, lastCell);
123 else if (binIdx == lastCell.
BinIdx && this->LastCellValid(lastCell))
127 if (this->PointInCell(point, lastCell.
CellId, pc))
134 else if (this->PointInBin(point, lastCell.
BinIdx, cellId, pc, lastCell.
CellId))
144 return this->FindCellImpl(point, cellId, parametric, lastCell, binIdx);
155 if (!this->IsInside(point))
159 temp = point - this->Origin;
160 temp = temp * this->InvSpacing;
166 (logicalCell[2] * this->CellDims[1] + logicalCell[1]) * this->CellDims[0] + logicalCell[0];
173 return lastCell.
BinIdx >= 0 && lastCell.
BinIdx < this->CellIds.GetNumberOfValues() &&
174 lastCell.
CellId >= 0 && lastCell.
CellId < this->CellSet.GetNumberOfElements();
179 if (point[0] < this->Origin[0] || point[0] > this->MaxPoint[0])
181 if (point[1] < this->Origin[1] || point[1] > this->MaxPoint[1])
183 if (point[2] < this->Origin[2] || point[2] > this->MaxPoint[2])
202 binIdx = this->FindBinIdx(point);
215 if (this->PointInBin(point, binIdx, cellId, pc))
226 template <
typename Po
intsVecType>
241 template <
typename CellShapeTag,
typename CoordsType>
243 CellShapeTag cellShape,
244 CoordsType cellPoints,
248 auto bounds = this->ComputeCellBounds(cellPoints);
249 if (bounds.Contains(point))
252 cellPoints, point, cellShape, parametricCoordinates));
253 inside = viskores::exec::CellInside(parametricCoordinates, cellShape);
270 auto binIds = this->CellIds.Get(binIdx);
276 if (cid != skipCellId && this->PointInCell(point, cid, pc))
292 auto indices = this->CellSet.GetIndices(cid);
296 auto status = this->PointInsideCell(point, this->CellSet.GetCellShape(cid), pts, pc, inside);
321 #endif //viskores_exec_CellLocatorUniformBins_h
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:32
Represent an axis-aligned 3D bounds in space.
Definition: Bounds.h:37
ErrorCode
Identifies whether an operation was successful or what type of error it had.
Definition: ErrorCode.h:36
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:38
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:325
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:42
#define VISKORES_RETURN_ON_ERROR(call)
Definition: ErrorCode.h:210
VecFromPortalPermute< IndexVecType, PortalType > make_VecFromPortalPermute(const IndexVecType *index, const PortalType &portal)
Definition: VecFromPortalPermute.h:181
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
static constexpr viskores::IdComponent GetNumberOfComponents(const T &)
Returns the number of components in the given vector.
Definition: VecTraits.h:102
Groups connected points that have the same field value.
Definition: Atomic.h:27
#define VISKORES_DEPRECATED(...)
Definition: Deprecated.h:156
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
@ CellNotFound
A cell matching some given criteria could not be found.
@ Success
A successful operation.
void Include(const viskores::Vec< T, 3 > &point)
Expand bounds to include a point.
Definition: Bounds.h:203
Fancy array handle that groups values into vectors of different sizes.
Definition: ArrayHandleGroupVecVariable.h:279
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
#define VISKORES_EXEC
Definition: ExportMacros.h:59