VTK-m  2.1
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 
476  vtkm::TopologyElementTagCell visitTopology,
477  vtkm::TopologyElementTagPoint incidentTopology,
478  vtkm::cont::Token& token) const
479  {
480  using ConnectivityType =
482  return ConnectivityType(
483  this->ValidCellIds.PrepareForInput(device, token),
484  this->FullCellSet.PrepareForInput(device, visitTopology, incidentTopology, token));
485  }
486 
487  VTKM_CONT ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
491  vtkm::cont::Token& token) const
492  {
493  if (!this->VisitPointsWithCells.ElementsValid)
494  {
495  auto connTable = internal::RConnBuilderInput<CellSetPermutation>::Get(*this, device);
496  internal::ComputeRConnTable(
497  this->VisitPointsWithCells, connTable, this->GetNumberOfPoints(), device);
498  }
499 
500  using ConnectivityType =
502  return ConnectivityType(this->VisitPointsWithCells.Connectivity.PrepareForInput(device, token),
503  this->VisitPointsWithCells.Offsets.PrepareForInput(device, token));
504  }
505 
506  VTKM_CONT
507  void PrintSummary(std::ostream& out) const override
508  {
509  out << "CellSetPermutation of: " << std::endl;
510  this->FullCellSet.PrintSummary(out);
511  out << "Permutation Array: " << std::endl;
513  }
514 
515 private:
516  using VisitPointsWithCellsConnectivity = vtkm::cont::internal::ConnectivityExplicitInternals<
518 
522 };
523 
524 template <typename CellSetType,
525  typename PermutationArrayHandleType1,
526  typename PermutationArrayHandleType2>
527 class CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
528  PermutationArrayHandleType2>
529  : public internal::CellSetPermutationTraits<
530  CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
531  PermutationArrayHandleType2>>::Superclass
532 {
533 private:
534  using Superclass = typename internal::CellSetPermutationTraits<CellSetPermutation>::Superclass;
535 
536 public:
537  VTKM_CONT
538  CellSetPermutation(const PermutationArrayHandleType2& validCellIds,
540  : Superclass(vtkm::cont::make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds()),
541  cellset.GetFullCellSet())
542  {
543  }
544 
545  VTKM_CONT
547  : Superclass()
548  {
549  }
550 
551  ~CellSetPermutation() override {}
552 
553  VTKM_CONT
554  void Fill(const PermutationArrayHandleType2& validCellIds,
556  {
557  this->ValidCellIds = make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds());
558  this->FullCellSet = cellset.GetFullCellSet();
559  }
560 
561  std::shared_ptr<CellSet> NewInstance() const override
562  {
563  return std::make_shared<CellSetPermutation>();
564  }
565 };
566 
567 template <typename OriginalCellSet, typename PermutationArrayHandleType>
569  const PermutationArrayHandleType& cellIndexMap,
570  const OriginalCellSet& cellSet)
571 {
572  VTKM_IS_CELL_SET(OriginalCellSet);
573  VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType);
574 
576  cellSet);
577 }
578 }
579 } // namespace vtkm::cont
580 
581 //=============================================================================
582 // Specializations of serialization related classes
584 namespace vtkm
585 {
586 namespace cont
587 {
588 
589 template <typename CSType, typename AHValidCellIds>
590 struct SerializableTypeString<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
591 {
592  static VTKM_CONT const std::string& Get()
593  {
594  static std::string name = "CS_Permutation<" + SerializableTypeString<CSType>::Get() + "," +
596  return name;
597  }
598 };
599 }
600 } // vtkm::cont
601 
602 namespace mangled_diy_namespace
603 {
604 
605 template <typename CSType, typename AHValidCellIds>
606 struct Serialization<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
607 {
608 private:
610 
611 public:
612  static VTKM_CONT void save(BinaryBuffer& bb, const Type& cs)
613  {
614  vtkmdiy::save(bb, cs.GetFullCellSet());
615  vtkmdiy::save(bb, cs.GetValidCellIds());
616  }
617 
618  static VTKM_CONT void load(BinaryBuffer& bb, Type& cs)
619  {
620  CSType fullCS;
621  vtkmdiy::load(bb, fullCS);
622  AHValidCellIds validCellIds;
623  vtkmdiy::load(bb, validCellIds);
624 
625  cs = make_CellSetPermutation(validCellIds, fullCS);
626  }
627 };
628 
629 } // diy
631 
632 #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:538
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:551
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:812
vtkm::cont::CellSetPermutation::ValidCellIds
PermutationArrayHandleType ValidCellIds
Definition: CellSetPermutation.h:519
vtkm::cont::CellSetPermutation::VisitPointsWithCellsConnectivity
vtkm::cont::internal::ConnectivityExplicitInternals< typename ArrayHandleConstant< vtkm::UInt8 >::StorageTag > VisitPointsWithCellsConnectivity
Definition: CellSetPermutation.h:517
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:96
vtkm::cont::CellSetPermutation::PrepareForInput
ExecConnectivityType< vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell > PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, vtkm::cont::Token &token) const
Definition: CellSetPermutation.h:488
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
Definition: ArrayHandle.h:311
mangled_diy_namespace
Definition: Particle.h:351
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::Superclass
typename internal::CellSetPermutationTraits< CellSetPermutation >::Superclass Superclass
Definition: CellSetPermutation.h:534
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
Definition: CellSetPermutation.h:475
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:554
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:520
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:561
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::CellSetPermutation
CellSetPermutation()
Definition: CellSetPermutation.h:546
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:507
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::cont::CellSetPermutation::VisitPointsWithCells
VisitPointsWithCellsConnectivity VisitPointsWithCells
Definition: CellSetPermutation.h:521
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:488
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:320
vtkm::cont::make_CellSetPermutation
vtkm::cont::CellSetPermutation< OriginalCellSet, PermutationArrayHandleType > make_CellSetPermutation(const PermutationArrayHandleType &cellIndexMap, const OriginalCellSet &cellSet)
Definition: CellSetPermutation.h:568
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:127
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:281
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