Go to the documentation of this file.
10 #ifndef vtk_m_worklet_Probe_h
11 #define vtk_m_worklet_Probe_h
44 template <
typename LocatorType>
46 const LocatorType& locator,
50 locator.FindCell(point, cellId, pcoords);
57 template <
typename LocatorType,
typename Po
intsType>
58 void operator()(
const LocatorType& locator,
Probe& worklet,
const PointsType& points)
const
65 template <
typename CellSetType,
typename Po
intsType,
typename Po
intsStorage>
83 WholeArrayInOut cellIds,
84 WholeArrayOut parametricCoords);
88 template <
typename CellShapeTag,
89 typename CoordsVecType,
90 typename UniformPoints,
92 typename ParametricCoordsType>
94 CellShapeTag cellShape,
95 const CoordsVecType& cellPoints,
96 const UniformPoints& points,
98 ParametricCoordsType& pcoords)
const
104 CoordsType cbmin = cellPoints[0], cbmax = cellPoints[0];
107 cbmin = vtkm::Min(cbmin, cellPoints[i]);
108 cbmax = vtkm::Max(cbmax, cellPoints[i]);
119 maxp = vtkm::Min(maxp, points.GetDimensions() -
vtkm::Id3(1));
121 for (
vtkm::Id k = minp[2]; k <= maxp[2]; ++k)
123 for (
vtkm::Id j = minp[1]; j <= maxp[1]; ++j)
125 for (
vtkm::Id i = minp[0]; i <= maxp[0]; ++i)
127 auto pt = points.Get(
vtkm::Id3(i, j, k));
130 vtkm::exec::WorldCoordinatesToParametricCoordinates(cellPoints, pt, cellShape, pc);
133 auto pointId = i + points.GetDimensions()[0] * (j + points.GetDimensions()[1] * k);
134 cellIds.Set(pointId, cellId);
135 pcoords.Set(pointId, pc);
144 template <
typename CellSetType>
147 const vtkm::cont::ArrayHandleUniformPointCoordinates::Superclass& points)
162 template <
typename Po
intsArrayType,
typename CellSetType>
165 const CellSetType& cells,
168 worklet.
RunImpl(cells, coords, points);
173 template <
typename CellSetType,
typename Po
intsArrayType>
174 void Run(
const CellSetType& cells,
176 const PointsArrayType& points)
182 template <
typename T>
193 FieldIn parametricCoords,
194 WholeCellSetIn<> inputCells,
195 WholeArrayIn inputField,
199 template <
typename ParametricCoordType,
typename CellSetType,
typename InputFieldPortalType>
201 const ParametricCoordType& pc,
202 const CellSetType& cells,
203 const InputFieldPortalType& in,
204 typename InputFieldPortalType::ValueType& out)
const
208 auto indices = cells.GetIndices(cellId);
220 template <
typename T,
222 typename InputCellSetTypeList = VTKM_DEFAULT_CELL_SET_LIST>
225 const T& invalidValue,
226 InputCellSetTypeList icsTypes = InputCellSetTypeList())
const
267 template <
typename CellIdsVecType>
273 if (cellIds[i] == -1)
285 template <
typename CellSetType>
306 #endif // vtk_m_worklet_Probe_h
void(_1, _2, _3, _4) ExecutionSignature
Definition: worklet/Probe.h:42
vtkm::cont::ArrayHandle< T > ProcessPointField(const vtkm::cont::ArrayHandle< T, Storage > &field, const T &invalidValue, InputCellSetTypeList icsTypes=InputCellSetTypeList()) const
Intepolate the input point field data at the points of the geometry.
Definition: worklet/Probe.h:223
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ErrorCode
Definition: ErrorCode.h:19
vtkm::cont::ArrayHandle< vtkm::Id > GetCellIds() const
Definition: worklet/Probe.h:240
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
Definition: worklet/Probe.h:160
VTKM_EXEC VecFromPortalPermute< IndexVecType, PortalType > make_VecFromPortalPermute(const IndexVecType *index, const PortalType &portal)
Definition: VecFromPortalPermute.h:166
VTKM_EXEC_CONT vtkm::Float32 Ceil(vtkm::Float32 x)
Round x to the smallest integer value not less than x.
Definition: Math.h:2145
void(FieldIn cellIds, FieldIn parametricCoords, WholeCellSetIn<> inputCells, WholeArrayIn inputField, FieldOut result) ControlSignature
Definition: worklet/Probe.h:196
void operator()(const LocatorType &locator, Probe &worklet, const PointsType &points) const
Definition: worklet/Probe.h:58
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
A control signature tag for output fields.
Definition: WorkletMapField.h:60
IncidentElementCount PointCount
Definition: WorkletMapTopology.h:267
T InvalidValue
Definition: worklet/Probe.h:186
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_CONT vtkm::cont::UncertainCellSet< CellSetList > ResetCellSetList(CellSetList) const
Assigns potential cell set types.
_3(_2, PointCount) ExecutionSignature
Definition: worklet/Probe.h:265
Definition: worklet/Probe.h:35
vtkm::cont::ArrayHandleConstant< T > make_ArrayHandleConstant(T value, vtkm::Id numberOfValues)
make_ArrayHandleConstant is convenience function to generate an ArrayHandleImplicit.
Definition: ArrayHandleConstant.h:89
void(_1, _2, _3, _4, _5) ExecutionSignature
Definition: worklet/Probe.h:197
VTKM_EXEC void operator()(vtkm::Id cellId, const ParametricCoordType &pc, const CellSetType &cells, const InputFieldPortalType &in, typename InputFieldPortalType::ValueType &out) const
Definition: worklet/Probe.h:200
vtkm::cont::ArrayHandle< vtkm::Id > CellIds
Definition: worklet/Probe.h:297
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::cont::Invoker Invoke
Definition: worklet/Probe.h:301
void CastAndCall(const DynamicObject &dynamicObject, Functor &&f, Args &&... args)
A Generic interface to CastAndCall.
Definition: CastAndCall.h:47
VTKM_EXEC vtkm::UInt8 operator()(vtkm::Id cellId) const
Definition: worklet/Probe.h:248
static constexpr vtkm::UInt8 HIDDEN
Definition: worklet/Probe.h:295
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_EXEC void operator()(const vtkm::Vec3f &point, const LocatorType &locator, vtkm::Id &cellId, vtkm::Vec3f &pcoords) const
Definition: worklet/Probe.h:45
Definition: worklet/Probe.h:183
Definition: CoordinateSystem.h:25
vtkm::cont::ArrayHandle< vtkm::Vec3f > ParametricCoordinates
Definition: worklet/Probe.h:298
VTKM_EXEC_CONT vtkm::Float32 Floor(vtkm::Float32 x)
Round x to the largest integer value not greater than x.
Definition: Math.h:2204
_2(_1) ExecutionSignature
Definition: worklet/Probe.h:246
void(FieldIn points, ExecObject locator, FieldOut cellIds, FieldOut pcoords) ControlSignature
Definition: worklet/Probe.h:41
Definition: worklet/Probe.h:262
VTKM_CONT void CastAndCallCellLocatorChooser(const CellSetType &cellSet, const vtkm::cont::CoordinateSystem &coordinateSystem, Functor &&functor, Args &&... args)
Calls a functor with the appropriate type of CellLocator.
Definition: CellLocatorChooser.h:130
void Run(const CellSetType &cells, const vtkm::cont::CoordinateSystem &coords, const PointsArrayType &points)
Definition: worklet/Probe.h:174
A control signature tag for input fields.
Definition: WorkletMapField.h:49
void(FieldIn cellids, FieldOut hfield) ControlSignature
Definition: worklet/Probe.h:245
vtkm::cont::ArrayHandle< vtkm::UInt8 > GetHiddenPointsField() const
Get an array of flags marking the invalid points (points that do not fall inside any of the cells of ...
Definition: worklet/Probe.h:254
void RunImpl(const CellSetType &cells, const vtkm::cont::CoordinateSystem &coords, const vtkm::cont::ArrayHandle< PointsType, PointsStorage > &points)
Definition: worklet/Probe.h:66
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
Base class for worklets that map from Points to Cells.
Definition: WorkletMapTopology.h:255
void ArrayCopy(const SourceArrayType &source, DestArrayType &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopy.h:142
vtkm::cont::ArrayHandle< vtkm::UInt8 > GetHiddenCellsField(CellSetType cellset) const
Get an array of flags marking the invalid cells.
Definition: worklet/Probe.h:286
void(CellSetIn cellset, FieldInPoint cellids, FieldOutCell) ControlSignature
Definition: worklet/Probe.h:264
FieldInIncident FieldInPoint
Definition: WorkletMapTopology.h:259
VTKM_EXEC vtkm::ErrorCode CellInterpolate(const FieldVecType &pointFieldValues, const vtkm::Vec< ParametricCoordType, 3 > &pcoords, CellShapeTag tag, typename FieldVecType::ComponentType &result)
Definition: CellInterpolate.h:56
Definition: worklet/Probe.h:31
uint8_t UInt8
Definition: Types.h:157
VTKM_EXEC vtkm::UInt8 operator()(const CellIdsVecType &cellIds, vtkm::IdComponent numPoints) const
Definition: worklet/Probe.h:268
Definition: worklet/Probe.h:243
Definition: worklet/Probe.h:55
InterpolatePointField(const T &invalidValue)
Definition: worklet/Probe.h:187
typename VecType::ComponentType ComponentType
Type of the components in the vector.
Definition: VecTraits.h:73
void RunImpl(const CellSetType &cells, const vtkm::cont::CoordinateSystem &coords, const vtkm::cont::ArrayHandleUniformPointCoordinates::Superclass &points)
Definition: worklet/Probe.h:145
vtkm::cont::UnknownCellSet InputCellSet
Definition: worklet/Probe.h:299
static vtkm::IdComponent GetNumberOfComponents(const VecType &vec)
Number of components in the given vector.
void operator()(const PointsArrayType &points, Probe &worklet, const CellSetType &cells, const vtkm::cont::CoordinateSystem &coords) const
Definition: worklet/Probe.h:163
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
FieldOut FieldOutCell
Definition: WorkletMapTopology.h:263