10 #ifndef vtk_m_exec_arg_FetchTagArrayTopologyMapIn_h
11 #define vtk_m_exec_arg_FetchTagArrayTopologyMapIn_h
56 template <
typename ConnectivityType,
typename FieldExecObjectType,
typename ThreadIndicesType>
57 struct FetchArrayTopologyMapInImplementation
60 using IndexVecType =
typename ThreadIndicesType::IndicesIncidentType;
63 using PortalType = FieldExecObjectType;
69 static ValueType Load(
const ThreadIndicesType& indices,
const FieldExecObjectType& field)
75 return ValueType(indices.GetIndicesIncidentPointer(), field);
80 static ValueType Load(
const ThreadIndicesType& indices,
const FieldExecObjectType*
const field)
86 return ValueType(indices.GetIndicesIncidentPointer(), field);
96 origin[0] + spacing[0] *
static_cast<vtkm::FloatDefault>(logicalId[0]), origin[1], origin[2]);
130 template <vtkm::IdComponent NumDimensions,
typename ThreadIndicesType>
131 struct FetchArrayTopologyMapInImplementation<
132 vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
133 vtkm::TopologyElementTagPoint,
135 vtkm::internal::ArrayPortalUniformPointCoordinates,
147 static ValueType Load(
const ThreadIndicesType& indices,
148 const vtkm::internal::ArrayPortalUniformPointCoordinates& field)
152 return vtkm::exec::arg::detail::make_VecAxisAlignedPointCoordinates(
153 field.GetOrigin(), field.GetSpacing(), indices.GetIndexLogical());
157 template <
typename PermutationPortal, vtkm::IdComponent NumDimensions,
typename ThreadIndicesType>
158 struct FetchArrayTopologyMapInImplementation<
159 vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<
161 vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
162 vtkm::TopologyElementTagPoint,
164 vtkm::internal::ArrayPortalUniformPointCoordinates,
178 static ValueType Load(
const ThreadIndicesType& indices,
179 const vtkm::internal::ArrayPortalUniformPointCoordinates& field)
186 return vtkm::exec::arg::detail::make_VecAxisAlignedPointCoordinates(
187 field.GetOrigin(), field.GetSpacing(), indices.GetIndexLogical());
194 template <
typename ExecObjectType>
202 template <
typename ThreadIndicesType>
203 VTKM_EXEC auto Load(
const ThreadIndicesType& indices,
const ExecObjectType& field)
const
205 detail::FetchArrayTopologyMapInImplementation<
typename ThreadIndicesType::Connectivity,
207 ThreadIndicesType>::
Load(indices, field))
209 using Implementation =
210 detail::FetchArrayTopologyMapInImplementation<
typename ThreadIndicesType::Connectivity,
213 return Implementation::Load(indices, field);
218 template <
typename ScatterAndMaskMode>
221 ScatterAndMaskMode>& indices,
225 const auto& xgcidx = indices.GetIndicesIncident();
226 const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane);
227 const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane);
232 result[0] = portal.Get(offset1 + xgcidx.PointIds[0][0]);
233 result[1] = portal.Get(offset1 + xgcidx.PointIds[0][1]);
234 result[2] = portal.Get(offset1 + xgcidx.PointIds[0][2]);
235 result[3] = portal.Get(offset2 + xgcidx.PointIds[1][0]);
236 result[4] = portal.Get(offset2 + xgcidx.PointIds[1][1]);
237 result[5] = portal.Get(offset2 + xgcidx.PointIds[1][2]);
242 template <
typename ThreadIndicesType,
typename T>
243 VTKM_EXEC void Store(
const ThreadIndicesType&,
const ExecObjectType&,
const T&)
const
252 #endif //vtk_m_exec_arg_FetchTagArrayTopologyMapIn_h