18 #ifndef viskores_exec_arg_FetchTagArrayTopologyMapIn_h
19 #define viskores_exec_arg_FetchTagArrayTopologyMapIn_h
64 template <
typename ConnectivityType,
typename FieldExecObjectType,
typename ThreadIndicesType>
65 struct FetchArrayTopologyMapInImplementation
68 using IndexVecType =
typename ThreadIndicesType::IndicesIncidentType;
71 using PortalType = FieldExecObjectType;
77 static ValueType Load(
const ThreadIndicesType& indices,
const FieldExecObjectType& field)
83 return ValueType(indices.GetIndicesIncidentPointer(), field);
88 static ValueType Load(
const ThreadIndicesType& indices,
const FieldExecObjectType*
const field)
94 return ValueType(indices.GetIndicesIncidentPointer(), field);
115 return make_VecAxisAlignedPointCoordinates(
143 template <viskores::IdComponent NumDimensions,
typename ThreadIndicesType>
144 struct FetchArrayTopologyMapInImplementation<
145 viskores::exec::ConnectivityStructured<viskores::TopologyElementTagCell,
146 viskores::TopologyElementTagPoint,
148 viskores::internal::ArrayPortalUniformPointCoordinates,
160 static ValueType Load(
const ThreadIndicesType& indices,
161 const viskores::internal::ArrayPortalUniformPointCoordinates& field)
165 return viskores::exec::arg::detail::make_VecAxisAlignedPointCoordinates(
166 field.GetOrigin(), field.GetSpacing(), indices.GetIndexLogical());
170 template <
typename PermutationPortal,
172 typename ThreadIndicesType>
173 struct FetchArrayTopologyMapInImplementation<
174 viskores::exec::ConnectivityPermutedVisitCellsWithPoints<
176 viskores::exec::ConnectivityStructured<viskores::TopologyElementTagCell,
177 viskores::TopologyElementTagPoint,
179 viskores::internal::ArrayPortalUniformPointCoordinates,
193 static ValueType Load(
const ThreadIndicesType& indices,
194 const viskores::internal::ArrayPortalUniformPointCoordinates& field)
201 return viskores::exec::arg::detail::make_VecAxisAlignedPointCoordinates(
202 field.GetOrigin(), field.GetSpacing(), indices.GetIndexLogical());
209 template <
typename ExecObjectType>
217 template <
typename ThreadIndicesType>
219 -> decltype(detail::FetchArrayTopologyMapInImplementation<
220 typename ThreadIndicesType::Connectivity,
222 ThreadIndicesType>::
Load(indices, field))
224 using Implementation =
225 detail::FetchArrayTopologyMapInImplementation<
typename ThreadIndicesType::Connectivity,
228 return Implementation::Load(indices, field);
233 template <
typename ScatterAndMaskMode>
236 ScatterAndMaskMode>& indices,
240 const auto& xgcidx = indices.GetIndicesIncident();
241 const viskores::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane);
242 const viskores::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane);
246 return ValueType(portal.Get(offset1 + xgcidx.PointIds[0][0]),
247 portal.Get(offset1 + xgcidx.PointIds[0][1]),
248 portal.Get(offset1 + xgcidx.PointIds[0][2]),
249 portal.Get(offset2 + xgcidx.PointIds[1][0]),
250 portal.Get(offset2 + xgcidx.PointIds[1][1]),
251 portal.Get(offset2 + xgcidx.PointIds[1][2]));
255 template <
typename ThreadIndicesType,
typename T>
265 #endif //viskores_exec_arg_FetchTagArrayTopologyMapIn_h