VTK-m  2.2
CellSetPermutation.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_CellSetPermutation_h
11 #define vtk_m_cont_CellSetPermutation_h
12 
13 #include <vtkm/CellShape.h>
14 #include <vtkm/CellTraits.h>
15 #include <vtkm/Deprecated.h>
16 #include <vtkm/cont/ArrayCopy.h>
20 #include <vtkm/cont/CellSet.h>
22 #include <vtkm/cont/Invoker.h>
28 
30 
31 #ifndef VTKM_DEFAULT_CELLSET_PERMUTATION_STORAGE_TAG
32 #define VTKM_DEFAULT_CELLSET_PERMUTATION_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
33 #endif
34 
35 namespace vtkm
36 {
37 namespace cont
38 {
39 
40 namespace internal
41 {
42 
43 // To generate the reverse connectivity table with the
44 // ReverseConnectivityBuilder, we need a compact connectivity array that
45 // contains only the cell definitions from the permuted dataset, and an offsets
46 // array. These helpers are used to generate these arrays so that they can be
47 // converted in the reverse conn table.
48 class RConnTableHelpers
49 {
50 public:
51  struct WriteNumIndices : public vtkm::worklet::WorkletVisitCellsWithPoints
52  {
53  using ControlSignature = void(CellSetIn cellset, FieldOutCell numIndices);
54  using ExecutionSignature = void(PointCount, _2);
55  using InputDomain = _1;
56 
57  VTKM_EXEC void operator()(vtkm::IdComponent pointCount, vtkm::IdComponent& numIndices) const
58  {
59  numIndices = pointCount;
60  }
61  };
62 
63  struct WriteConnectivity : public vtkm::worklet::WorkletVisitCellsWithPoints
64  {
65  using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivity);
66  using ExecutionSignature = void(PointCount, PointIndices, _2);
67  using InputDomain = _1;
68 
69  template <typename PointIndicesType, typename OutConnectivityType>
70  VTKM_EXEC void operator()(vtkm::IdComponent pointCount,
71  const PointIndicesType& pointIndices,
72  OutConnectivityType& connectivity) const
73  {
74  for (vtkm::IdComponent i = 0; i < pointCount; ++i)
75  {
76  connectivity[i] = pointIndices[i];
77  }
78  }
79  };
80 
81  template <typename CellSetPermutationType>
82  static VTKM_CONT vtkm::cont::ArrayHandle<vtkm::IdComponent> GetNumIndicesArray(
83  const CellSetPermutationType& cs,
85  {
87  vtkm::cont::Invoker{ device }(WriteNumIndices{}, cs, numIndices);
88  return numIndices;
89  }
90 
91  template <typename NumIndicesStorageType>
92  static VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Id> GetOffsetsArray(
94  vtkm::Id& connectivityLength /* outparam */,
96  {
97  return vtkm::cont::internal::ConvertNumComponentsToOffsetsTemplate(numIndices,
98  connectivityLength);
99  }
100 
101  template <typename CellSetPermutationType, typename OffsetsStorageType>
102  static vtkm::cont::ArrayHandle<vtkm::Id> GetConnectivityArray(
103  const CellSetPermutationType& cs,
105  vtkm::Id connectivityLength,
107  {
109  connectivity.Allocate(connectivityLength);
110  auto connWrap = vtkm::cont::make_ArrayHandleGroupVecVariable(connectivity, offsets);
111  vtkm::cont::Invoker{ device }(WriteConnectivity{}, cs, connWrap);
112  return connectivity;
113  }
114 };
115 
116 // This holds the temporary input arrays for the ReverseConnectivityBuilder
117 // algorithm.
118 template <typename ConnectivityStorageTag = VTKM_DEFAULT_STORAGE_TAG,
119  typename OffsetsStorageTag = VTKM_DEFAULT_STORAGE_TAG,
120  typename NumIndicesStorageTag = VTKM_DEFAULT_STORAGE_TAG>
121 struct RConnBuilderInputData
122 {
123  using ConnectivityArrayType = vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag>;
126 
127  ConnectivityArrayType Connectivity;
128  OffsetsArrayType Offsets; // Includes the past-the-end offset.
129  NumIndicesArrayType NumIndices;
130 };
131 
132 // default for CellSetPermutations of any cell type
133 template <typename CellSetPermutationType>
134 class RConnBuilderInput
135 {
136 public:
137  using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<>;
138 
139  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
141  {
142  using Helper = RConnTableHelpers;
143  ConnectivityArrays conn;
144  vtkm::Id connectivityLength = 0;
145 
146  conn.NumIndices = Helper::GetNumIndicesArray(cellset, device);
147  conn.Offsets = Helper::GetOffsetsArray(conn.NumIndices, connectivityLength, device);
148  conn.Connectivity =
149  Helper::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
150 
151  return conn;
152  }
153 };
154 
155 // Specialization for CellSetExplicit/CellSetSingleType
156 template <typename InShapesST,
157  typename InConnST,
158  typename InOffsetsST,
159  typename PermutationArrayHandleType>
160 class RConnBuilderInput<CellSetPermutation<CellSetExplicit<InShapesST, InConnST, InOffsetsST>,
161  PermutationArrayHandleType>>
162 {
163 private:
164  using BaseCellSetType = CellSetExplicit<InShapesST, InConnST, InOffsetsST>;
165  using CellSetPermutationType = CellSetPermutation<BaseCellSetType, PermutationArrayHandleType>;
166 
167  using InShapesArrayType = typename BaseCellSetType::ShapesArrayType;
168  using InNumIndicesArrayType = typename BaseCellSetType::NumIndicesArrayType;
169 
170  using ConnectivityStorageTag = vtkm::cont::ArrayHandle<vtkm::Id>::StorageTag;
171  using OffsetsStorageTag = vtkm::cont::ArrayHandle<vtkm::Id>::StorageTag;
172  using NumIndicesStorageTag =
173  typename vtkm::cont::ArrayHandlePermutation<PermutationArrayHandleType,
174  InNumIndicesArrayType>::StorageTag;
175 
176 
177 public:
178  using ConnectivityArrays = vtkm::cont::internal::
179  RConnBuilderInputData<ConnectivityStorageTag, OffsetsStorageTag, NumIndicesStorageTag>;
180 
181  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
183  {
184  using Helper = RConnTableHelpers;
185 
186  static constexpr vtkm::TopologyElementTagCell cell{};
187  static constexpr vtkm::TopologyElementTagPoint point{};
188 
189  auto fullCellSet = cellset.GetFullCellSet();
190 
191  vtkm::Id connectivityLength = 0;
192  ConnectivityArrays conn;
193 
194  fullCellSet.GetOffsetsArray(cell, point);
195 
196  // We can use the implicitly generated NumIndices array to save a bit of
197  // memory:
198  conn.NumIndices = vtkm::cont::make_ArrayHandlePermutation(
199  cellset.GetValidCellIds(), fullCellSet.GetNumIndicesArray(cell, point));
200 
201  // Need to generate the offsets from scratch so that they're ordered for the
202  // lower-bounds binary searches in ReverseConnectivityBuilder.
203  conn.Offsets = Helper::GetOffsetsArray(conn.NumIndices, connectivityLength, device);
204 
205  // Need to create a copy of this containing *only* the permuted cell defs,
206  // in order, since the ReverseConnectivityBuilder will process every entry
207  // in the connectivity array and we don't want the removed cells to be
208  // included.
209  conn.Connectivity =
210  Helper::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
211 
212  return conn;
213  }
214 };
215 
216 // Specialization for CellSetStructured
217 template <vtkm::IdComponent DIMENSION, typename PermutationArrayHandleType>
218 class RConnBuilderInput<
219  CellSetPermutation<CellSetStructured<DIMENSION>, PermutationArrayHandleType>>
220 {
221 private:
222  using CellSetPermutationType =
223  CellSetPermutation<CellSetStructured<DIMENSION>, PermutationArrayHandleType>;
224 
225 public:
226  using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<
227  VTKM_DEFAULT_STORAGE_TAG,
230 
231  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
233  {
234  vtkm::Id numberOfCells = cellset.GetNumberOfCells();
235  vtkm::IdComponent numPointsInCell =
236  vtkm::internal::ConnectivityStructuredInternals<DIMENSION>::NUM_POINTS_IN_CELL;
237  vtkm::Id connectivityLength = numberOfCells * numPointsInCell;
238 
239  ConnectivityArrays conn;
240  conn.NumIndices = make_ArrayHandleConstant(numPointsInCell, numberOfCells);
241  conn.Offsets = ArrayHandleCounting<vtkm::Id>(0, numPointsInCell, numberOfCells + 1);
242  conn.Connectivity =
243  RConnTableHelpers::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
244 
245  return conn;
246  }
247 };
248 
249 template <typename CellSetPermutationType>
250 struct CellSetPermutationTraits;
251 
252 template <typename OriginalCellSet_, typename PermutationArrayHandleType_>
253 struct CellSetPermutationTraits<CellSetPermutation<OriginalCellSet_, PermutationArrayHandleType_>>
254 {
255  using OriginalCellSet = OriginalCellSet_;
256  using PermutationArrayHandleType = PermutationArrayHandleType_;
257 };
258 
259 template <typename OriginalCellSet_,
260  typename OriginalPermutationArrayHandleType,
261  typename PermutationArrayHandleType_>
262 struct CellSetPermutationTraits<
263  CellSetPermutation<CellSetPermutation<OriginalCellSet_, OriginalPermutationArrayHandleType>,
264  PermutationArrayHandleType_>>
265 {
266  using PreviousCellSet = CellSetPermutation<OriginalCellSet_, OriginalPermutationArrayHandleType>;
267  using PermutationArrayHandleType = vtkm::cont::ArrayHandlePermutation<
268  PermutationArrayHandleType_,
269  typename CellSetPermutationTraits<PreviousCellSet>::PermutationArrayHandleType>;
270  using OriginalCellSet = typename CellSetPermutationTraits<PreviousCellSet>::OriginalCellSet;
271  using Superclass = CellSetPermutation<OriginalCellSet, PermutationArrayHandleType>;
272 };
273 
274 template <typename VisitTopology,
275  typename IncidentTopology,
276  typename OriginalCellSetType,
277  typename PermutationArrayHandleType>
278 struct CellSetPermutationConnectivityChooser;
279 
280 template <typename OriginalCellSetType, typename PermutationArrayHandleType>
281 struct CellSetPermutationConnectivityChooser<vtkm::TopologyElementTagCell,
283  OriginalCellSetType,
284  PermutationArrayHandleType>
285 {
286  using ExecPortalType = typename PermutationArrayHandleType::ReadPortalType;
287  using OrigExecObjectType =
288  typename OriginalCellSetType::template ExecConnectivityType<vtkm::TopologyElementTagCell,
290 
291  using ExecConnectivityType =
293 };
294 
295 template <typename OriginalCellSetType, typename PermutationArrayHandleType>
296 struct CellSetPermutationConnectivityChooser<vtkm::TopologyElementTagPoint,
298  OriginalCellSetType,
299  PermutationArrayHandleType>
300 {
301  using ConnectivityPortalType = typename vtkm::cont::ArrayHandle<vtkm::Id>::ReadPortalType;
302  using NumIndicesPortalType = typename vtkm::cont::ArrayHandle<vtkm::IdComponent>::ReadPortalType;
303  using OffsetPortalType = typename vtkm::cont::ArrayHandle<vtkm::Id>::ReadPortalType;
304 
305  using ExecConnectivityType =
307 };
308 
309 } // internal
310 
321 template <typename OriginalCellSetType_,
322  typename PermutationArrayHandleType_ =
324 class CellSetPermutation : public CellSet
325 {
326  VTKM_IS_CELL_SET(OriginalCellSetType_);
327  VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType_);
329  (std::is_same<vtkm::Id, typename PermutationArrayHandleType_::ValueType>::value),
330  "Must use ArrayHandle with value type of Id for permutation array.");
331 
332 public:
333  using OriginalCellSetType = OriginalCellSetType_;
334  using PermutationArrayHandleType = PermutationArrayHandleType_;
335 
343  const OriginalCellSetType& cellset)
344  : CellSet()
345  , ValidCellIds(validCellIds)
346  , FullCellSet(cellset)
347  {
348  }
349 
351  : CellSet()
352  , ValidCellIds()
353  , FullCellSet()
354  {
355  }
356 
357  ~CellSetPermutation() override {}
358 
360  : CellSet()
362  , FullCellSet(src.FullCellSet)
363  {
364  }
365 
366 
368  {
369  this->ValidCellIds = src.ValidCellIds;
370  this->FullCellSet = src.FullCellSet;
371  return *this;
372  }
373 
375  VTKM_CONT
376  const OriginalCellSetType& GetFullCellSet() const { return this->FullCellSet; }
377 
379  VTKM_CONT
380  const PermutationArrayHandleType& GetValidCellIds() const { return this->ValidCellIds; }
381 
382  VTKM_CONT
383  vtkm::Id GetNumberOfCells() const override { return this->ValidCellIds.GetNumberOfValues(); }
384 
385  VTKM_CONT
386  vtkm::Id GetNumberOfPoints() const override { return this->FullCellSet.GetNumberOfPoints(); }
387 
388  VTKM_CONT
389  vtkm::Id GetNumberOfFaces() const override { return -1; }
390 
391  VTKM_CONT
392  vtkm::Id GetNumberOfEdges() const override { return -1; }
393 
394  VTKM_CONT
396  {
397  this->ValidCellIds.ReleaseResourcesExecution();
398  this->FullCellSet.ReleaseResourcesExecution();
399  this->VisitPointsWithCells.ReleaseResourcesExecution();
400  }
401 
402  VTKM_CONT
404  {
405  // Looping over GetNumberOfPointsInCell is a performance bug.
406  return this->FullCellSet.GetNumberOfPointsInCell(
407  this->ValidCellIds.ReadPortal().Get(cellIndex));
408  }
409 
410  VTKM_DEPRECATED(1.6,
411  "Calling GetCellShape(cellid) is a performance bug. Call ShapesReadPortal() "
412  "and loop over the Get.")
413  vtkm::UInt8 GetCellShape(vtkm::Id id) const override
414  {
415  // Looping over GetCellShape is a performance bug.
417  return this->FullCellSet.GetCellShape(this->ValidCellIds.ReadPortal().Get(id));
419  }
420 
421  void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const override
422  {
423  // Looping over GetCellPointsIdx is a performance bug.
424  return this->FullCellSet.GetCellPointIds(this->ValidCellIds.ReadPortal().Get(id), ptids);
425  }
426 
427  std::shared_ptr<CellSet> NewInstance() const override
428  {
429  return std::make_shared<CellSetPermutation>();
430  }
431 
432  void DeepCopy(const CellSet* src) override
433  {
434  const auto* other = dynamic_cast<const CellSetPermutation*>(src);
435  if (!other)
436  {
437  throw vtkm::cont::ErrorBadType("CellSetPermutation::DeepCopy types don't match");
438  }
439 
440  this->FullCellSet.DeepCopy(&(other->GetFullCellSet()));
441  vtkm::cont::ArrayCopy(other->GetValidCellIds(), this->ValidCellIds);
442  }
443 
450  VTKM_CONT
451  void Fill(const PermutationArrayHandleType& validCellIds, const OriginalCellSetType& cellset)
452  {
453  this->ValidCellIds = validCellIds;
454  this->FullCellSet = cellset;
455  }
456 
458  {
459  return this->ValidCellIds.GetNumberOfValues();
460  }
461 
463  {
464  return this->FullCellSet.GetNumberOfPoints();
465  }
466 
467  template <typename VisitTopology, typename IncidentTopology>
468  using ExecConnectivityType = typename internal::CellSetPermutationConnectivityChooser<
469  VisitTopology,
470  IncidentTopology,
473 
490  vtkm::TopologyElementTagCell visitTopology,
491  vtkm::TopologyElementTagPoint incidentTopology,
492  vtkm::cont::Token& token) const
493  {
494  using ConnectivityType =
496  return ConnectivityType(
497  this->ValidCellIds.PrepareForInput(device, token),
498  this->FullCellSet.PrepareForInput(device, visitTopology, incidentTopology, token));
499  }
500 
502  VTKM_CONT ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
504  vtkm::TopologyElementTagPoint visitTopology,
505  vtkm::TopologyElementTagCell incidentTopology,
506  vtkm::cont::Token& token) const
507  {
508  (void)visitTopology;
509  (void)incidentTopology;
510  if (!this->VisitPointsWithCells.ElementsValid)
511  {
512  auto connTable = internal::RConnBuilderInput<CellSetPermutation>::Get(*this, device);
513  internal::ComputeRConnTable(
514  this->VisitPointsWithCells, connTable, this->GetNumberOfPoints(), device);
515  }
516 
517  using ConnectivityType =
519  return ConnectivityType(this->VisitPointsWithCells.Connectivity.PrepareForInput(device, token),
520  this->VisitPointsWithCells.Offsets.PrepareForInput(device, token));
521  }
522 
523  VTKM_CONT
524  void PrintSummary(std::ostream& out) const override
525  {
526  out << "CellSetPermutation of: " << std::endl;
527  this->FullCellSet.PrintSummary(out);
528  out << "Permutation Array: " << std::endl;
530  }
531 
532 private:
533  using VisitPointsWithCellsConnectivity = vtkm::cont::internal::ConnectivityExplicitInternals<
535 
539 };
540 
541 template <typename CellSetType,
542  typename PermutationArrayHandleType1,
543  typename PermutationArrayHandleType2>
544 class CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
545  PermutationArrayHandleType2>
546  : public internal::CellSetPermutationTraits<
547  CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
548  PermutationArrayHandleType2>>::Superclass
549 {
550 private:
551  using Superclass = typename internal::CellSetPermutationTraits<CellSetPermutation>::Superclass;
552 
553 public:
554  VTKM_CONT
555  CellSetPermutation(const PermutationArrayHandleType2& validCellIds,
557  : Superclass(vtkm::cont::make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds()),
558  cellset.GetFullCellSet())
559  {
560  }
561 
562  VTKM_CONT
564  : Superclass()
565  {
566  }
567 
568  ~CellSetPermutation() override {}
569 
570  VTKM_CONT
571  void Fill(const PermutationArrayHandleType2& validCellIds,
573  {
574  this->ValidCellIds = make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds());
575  this->FullCellSet = cellset.GetFullCellSet();
576  }
577 
578  std::shared_ptr<CellSet> NewInstance() const override
579  {
580  return std::make_shared<CellSetPermutation>();
581  }
582 };
583 
584 template <typename OriginalCellSet, typename PermutationArrayHandleType>
586  const PermutationArrayHandleType& cellIndexMap,
587  const OriginalCellSet& cellSet)
588 {
589  VTKM_IS_CELL_SET(OriginalCellSet);
590  VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType);
591 
593  cellSet);
594 }
595 }
596 } // namespace vtkm::cont
597 
598 //=============================================================================
599 // Specializations of serialization related classes
601 namespace vtkm
602 {
603 namespace cont
604 {
605 
606 template <typename CSType, typename AHValidCellIds>
607 struct SerializableTypeString<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
608 {
609  static VTKM_CONT const std::string& Get()
610  {
611  static std::string name = "CS_Permutation<" + SerializableTypeString<CSType>::Get() + "," +
613  return name;
614  }
615 };
616 }
617 } // vtkm::cont
618 
619 namespace mangled_diy_namespace
620 {
621 
622 template <typename CSType, typename AHValidCellIds>
623 struct Serialization<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
624 {
625 private:
627 
628 public:
629  static VTKM_CONT void save(BinaryBuffer& bb, const Type& cs)
630  {
631  vtkmdiy::save(bb, cs.GetFullCellSet());
632  vtkmdiy::save(bb, cs.GetValidCellIds());
633  }
634 
635  static VTKM_CONT void load(BinaryBuffer& bb, Type& cs)
636  {
637  CSType fullCS;
638  vtkmdiy::load(bb, fullCS);
639  AHValidCellIds validCellIds;
640  vtkmdiy::load(bb, validCellIds);
641 
642  cs = make_CellSetPermutation(validCellIds, fullCS);
643  }
644 };
645 
646 } // diy
648 
649 #endif //vtk_m_cont_CellSetPermutation_h
vtkm::TopologyElementTagPoint
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
vtkm::cont::ArrayHandle< vtkm::IdComponent >
vtkm::cont::CellSetPermutation::GetNumberOfCells
vtkm::Id GetNumberOfCells() const override
Definition: CellSetPermutation.h:383
vtkm::cont::CellSetPermutation::GetNumberOfEdges
vtkm::Id GetNumberOfEdges() const override
Definition: CellSetPermutation.h:392
vtkm::cont::CellSetPermutation::PermutationArrayHandleType
PermutationArrayHandleType_ PermutationArrayHandleType
Definition: CellSetPermutation.h:334
vtkm::cont::CellSetPermutation::GetCellShape
vtkm::UInt8 GetCellShape(vtkm::Id id) const override
Definition: CellSetPermutation.h:413
vtkm::exec::arg::load
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::CellSetPermutation
CellSetPermutation(const PermutationArrayHandleType2 &validCellIds, const CellSetPermutation< CellSetType, PermutationArrayHandleType1 > &cellset)
Definition: CellSetPermutation.h:555
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::CellSetPermutation::OriginalCellSetType
OriginalCellSetType_ OriginalCellSetType
Definition: CellSetPermutation.h:333
ConnectivityStructuredInternals.h
vtkm::Get
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
ArrayHandleCast.h
vtkm::cont::CellSetPermutation
Rearranges the cells of one cell set to create another cell set.
Definition: CastAndCall.h:38
CellSetExplicit.h
vtkm::cont::CellSetPermutation::CellSetPermutation
CellSetPermutation()
Definition: CellSetPermutation.h:350
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::~CellSetPermutation
~CellSetPermutation() override
Definition: CellSetPermutation.h:568
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::cont::printSummary_ArrayHandle
void printSummary_ArrayHandle(const vtkm::cont::ArrayHandle< T, StorageT > &array, std::ostream &out, bool full=false)
Definition: ArrayHandle.h:814
vtkm::cont::CellSetPermutation::ValidCellIds
PermutationArrayHandleType ValidCellIds
Definition: CellSetPermutation.h:536
vtkm::cont::CellSetPermutation::VisitPointsWithCellsConnectivity
vtkm::cont::internal::ConnectivityExplicitInternals< typename ArrayHandleConstant< vtkm::UInt8 >::StorageTag > VisitPointsWithCellsConnectivity
Definition: CellSetPermutation.h:534
vtkm::cont::ArrayHandleConstant::StorageTag
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleConstant.h:75
ConnectivityPermuted.h
vtkm::cont::make_ArrayHandleConstant
vtkm::cont::ArrayHandleConstant< T > make_ArrayHandleConstant(T value, vtkm::Id numberOfValues)
make_ArrayHandleConstant is convenience function to generate an ArrayHandleImplicit.
Definition: ArrayHandleConstant.h:95
Invoker.h
vtkm::cont::ErrorBadType
This class is thrown when VTK-m encounters data of a type that is incompatible with the current opera...
Definition: ErrorBadType.h:25
CellShape.h
vtkm::cont::CellSetPermutation::CellSetPermutation
CellSetPermutation(const PermutationArrayHandleType &validCellIds, const OriginalCellSetType &cellset)
Create a CellSetPermutation.
Definition: CellSetPermutation.h:342
vtkm::cont::ArrayHandle::ReadPortalType
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:312
mangled_diy_namespace
Definition: Particle.h:351
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::Superclass
typename internal::CellSetPermutationTraits< CellSetPermutation >::Superclass Superclass
Definition: CellSetPermutation.h:551
ArrayCopy.h
vtkm::cont::CellSetPermutation::DeepCopy
void DeepCopy(const CellSet *src) override
Definition: CellSetPermutation.h:432
VTKM_DEPRECATED_SUPPRESS_END
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
vtkm::cont::CellSetPermutation::GetValidCellIds
const PermutationArrayHandleType & GetValidCellIds() const
Returns the array used to permute the cell indices.
Definition: CellSetPermutation.h:380
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::CellSetPermutation::PrepareForInput
ExecConnectivityType< vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint > PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagCell visitTopology, vtkm::TopologyElementTagPoint incidentTopology, vtkm::cont::Token &token) const
Prepares the data for a particular device and returns the execution object for it.
Definition: CellSetPermutation.h:489
vtkm::cont::CellSetPermutation::GetFullCellSet
const OriginalCellSetType & GetFullCellSet() const
Returns the original CellSet that this one is permuting.
Definition: CellSetPermutation.h:376
ArrayHandlePermutation.h
vtkm::cont::CellSetPermutation::GetNumberOfPoints
vtkm::Id GetNumberOfPoints() const override
Definition: CellSetPermutation.h:386
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::Fill
void Fill(const PermutationArrayHandleType2 &validCellIds, const CellSetPermutation< CellSetType, PermutationArrayHandleType1 > &cellset)
Definition: CellSetPermutation.h:571
vtkm::cont::CellSetPermutation::GetSchedulingRange
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagPoint) const
Definition: CellSetPermutation.h:462
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Checks that the given type is a vtkm::cont::ArrayHandle.
Definition: ArrayHandle.h:137
vtkm::cont::ArrayHandlePermutation
Implicitly permutes the values in an array.
Definition: ArrayHandlePermutation.h:233
vtkm::cont::CellSetPermutation::GetCellPointIds
void GetCellPointIds(vtkm::Id id, vtkm::Id *ptids) const override
Definition: CellSetPermutation.h:421
vtkm::cont::Invoker
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
vtkm::worklet::WorkletVisitCellsWithPoints
Base class for worklets that map from Points to Cells.
Definition: WorkletMapTopology.h:256
ReverseConnectivityBuilder.h
vtkm::cont::ArrayCopy
void ArrayCopy(const SourceArrayType &source, DestArrayType &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopy.h:120
vtkm::cont::CellSetPermutation::GetSchedulingRange
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
Definition: CellSetPermutation.h:457
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
CellSet.h
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::CellSet
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:28
vtkm::exec::ConnectivityPermutedVisitPointsWithCells
Definition: ConnectivityPermuted.h:79
vtkm::UInt8
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
vtkm::cont::CellSetPermutation::FullCellSet
OriginalCellSetType FullCellSet
Definition: CellSetPermutation.h:537
vtkm::cont::CellSetPermutation::~CellSetPermutation
~CellSetPermutation() override
Definition: CellSetPermutation.h:357
VTKM_DEPRECATED_SUPPRESS_BEGIN
#define VTKM_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:122
vtkm::cont::CellSetPermutation::ExecConnectivityType
typename internal::CellSetPermutationConnectivityChooser< VisitTopology, IncidentTopology, OriginalCellSetType, PermutationArrayHandleType >::ExecConnectivityType ExecConnectivityType
Definition: CellSetPermutation.h:472
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::NewInstance
std::shared_ptr< CellSet > NewInstance() const override
Definition: CellSetPermutation.h:578
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::CellSetPermutation
CellSetPermutation()
Definition: CellSetPermutation.h:563
vtkm::cont::CellSetPermutation::CellSetPermutation
CellSetPermutation(const CellSetPermutation &src)
Definition: CellSetPermutation.h:359
vtkm::cont::CellSetPermutation::PrintSummary
void PrintSummary(std::ostream &out) const override
Definition: CellSetPermutation.h:524
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::cont::CellSetPermutation::VisitPointsWithCells
VisitPointsWithCellsConnectivity VisitPointsWithCells
Definition: CellSetPermutation.h:538
ConvertNumComponentsToOffsetsTemplate.h
ConnectivityExplicitInternals.h
vtkm::cont::CellSetPermutation::GetNumberOfFaces
vtkm::Id GetNumberOfFaces() const override
Definition: CellSetPermutation.h:389
Deprecated.h
vtkm::cont::ArrayHandle::StorageTag
StorageTag_ StorageTag
Definition: ArrayHandle.h:308
vtkm::cont::CellSetPermutation::Fill
void Fill(const PermutationArrayHandleType &validCellIds, const OriginalCellSetType &cellset)
Set the topology.
Definition: CellSetPermutation.h:451
ArrayHandleGroupVecVariable.h
vtkm::cont::ArrayHandle::Allocate
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:490
vtkm::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
CellTraits.h
vtkm::cont::make_ArrayHandleGroupVecVariable
vtkm::cont::ArrayHandleGroupVecVariable< ComponentsArrayHandleType, OffsetsArrayHandleType > make_ArrayHandleGroupVecVariable(const ComponentsArrayHandleType &componentsArray, const OffsetsArrayHandleType &offsetsArray)
make_ArrayHandleGroupVecVariable is convenience function to generate an ArrayHandleGroupVecVariable.
Definition: ArrayHandleGroupVecVariable.h:323
vtkm::cont::make_CellSetPermutation
vtkm::cont::CellSetPermutation< OriginalCellSet, PermutationArrayHandleType > make_CellSetPermutation(const PermutationArrayHandleType &cellIndexMap, const OriginalCellSet &cellSet)
Definition: CellSetPermutation.h:585
WorkletMapTopology.h
vtkm::cont::CellSetPermutation::GetNumberOfPointsInCell
vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellIndex) const override
Definition: CellSetPermutation.h:403
vtkm::cont::CellSetPermutation::operator=
CellSetPermutation & operator=(const CellSetPermutation &src)
Definition: CellSetPermutation.h:367
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
vtkm::exec::ConnectivityPermutedVisitCellsWithPoints
Definition: ConnectivityPermuted.h:25
vtkm::cont::ArrayHandleCounting::StorageTag
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleCounting.h:136
vtkm::cont::CellSetPermutation::PrepareForInput
ExecConnectivityType< vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell > PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint visitTopology, vtkm::TopologyElementTagCell incidentTopology, vtkm::cont::Token &token) const
Prepares the data for a particular device and returns the execution object for it.
Definition: CellSetPermutation.h:503
vtkm::cont::CellSetPermutation::ReleaseResourcesExecution
void ReleaseResourcesExecution() override
Definition: CellSetPermutation.h:395
vtkm::cont::make_ArrayHandlePermutation
vtkm::cont::ArrayHandlePermutation< IndexArrayHandleType, ValueArrayHandleType > make_ArrayHandlePermutation(IndexArrayHandleType indexArray, ValueArrayHandleType valueArray)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandlePermutation.h:291
VTKM_IS_CELL_SET
#define VTKM_IS_CELL_SET(T)
Definition: CellSet.h:89
vtkm::cont::CellSetPermutation::NewInstance
std::shared_ptr< CellSet > NewInstance() const override
Definition: CellSetPermutation.h:427