VTK-m  2.0
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 public:
82  template <typename CellSetPermutationType>
83  static VTKM_CONT vtkm::cont::ArrayHandle<vtkm::IdComponent> GetNumIndicesArray(
84  const CellSetPermutationType& cs,
86  {
88  vtkm::cont::Invoker{ device }(WriteNumIndices{}, cs, numIndices);
89  return numIndices;
90  }
91 
92  template <typename NumIndicesStorageType>
93  static VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Id> GetOffsetsArray(
95  vtkm::Id& connectivityLength /* outparam */,
97  {
98  return vtkm::cont::internal::ConvertNumComponentsToOffsetsTemplate(numIndices,
99  connectivityLength);
100  }
101 
102  template <typename CellSetPermutationType, typename OffsetsStorageType>
103  static vtkm::cont::ArrayHandle<vtkm::Id> GetConnectivityArray(
104  const CellSetPermutationType& cs,
106  vtkm::Id connectivityLength,
108  {
110  connectivity.Allocate(connectivityLength);
111  auto connWrap = vtkm::cont::make_ArrayHandleGroupVecVariable(connectivity, offsets);
112  vtkm::cont::Invoker{ device }(WriteConnectivity{}, cs, connWrap);
113  return connectivity;
114  }
115 };
116 
117 // This holds the temporary input arrays for the ReverseConnectivityBuilder
118 // algorithm.
119 template <typename ConnectivityStorageTag = VTKM_DEFAULT_STORAGE_TAG,
120  typename OffsetsStorageTag = VTKM_DEFAULT_STORAGE_TAG,
121  typename NumIndicesStorageTag = VTKM_DEFAULT_STORAGE_TAG>
122 struct RConnBuilderInputData
123 {
124  using ConnectivityArrayType = vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag>;
127 
128  ConnectivityArrayType Connectivity;
129  OffsetsArrayType Offsets; // Includes the past-the-end offset.
130  NumIndicesArrayType NumIndices;
131 };
132 
133 // default for CellSetPermutations of any cell type
134 template <typename CellSetPermutationType>
135 class RConnBuilderInput
136 {
137 public:
138  using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<>;
139 
140  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
142  {
143  using Helper = RConnTableHelpers;
144  ConnectivityArrays conn;
145  vtkm::Id connectivityLength = 0;
146 
147  conn.NumIndices = Helper::GetNumIndicesArray(cellset, device);
148  conn.Offsets = Helper::GetOffsetsArray(conn.NumIndices, connectivityLength, device);
149  conn.Connectivity =
150  Helper::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
151 
152  return conn;
153  }
154 };
155 
156 // Specialization for CellSetExplicit/CellSetSingleType
157 template <typename InShapesST,
158  typename InConnST,
159  typename InOffsetsST,
160  typename PermutationArrayHandleType>
161 class RConnBuilderInput<CellSetPermutation<CellSetExplicit<InShapesST, InConnST, InOffsetsST>,
162  PermutationArrayHandleType>>
163 {
164 private:
165  using BaseCellSetType = CellSetExplicit<InShapesST, InConnST, InOffsetsST>;
166  using CellSetPermutationType = CellSetPermutation<BaseCellSetType, PermutationArrayHandleType>;
167 
168  using InShapesArrayType = typename BaseCellSetType::ShapesArrayType;
169  using InNumIndicesArrayType = typename BaseCellSetType::NumIndicesArrayType;
170 
171  using ConnectivityStorageTag = vtkm::cont::ArrayHandle<vtkm::Id>::StorageTag;
172  using OffsetsStorageTag = vtkm::cont::ArrayHandle<vtkm::Id>::StorageTag;
173  using NumIndicesStorageTag =
174  typename vtkm::cont::ArrayHandlePermutation<PermutationArrayHandleType,
175  InNumIndicesArrayType>::StorageTag;
176 
177 
178 public:
179  using ConnectivityArrays = vtkm::cont::internal::
180  RConnBuilderInputData<ConnectivityStorageTag, OffsetsStorageTag, NumIndicesStorageTag>;
181 
182  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
184  {
185  using Helper = RConnTableHelpers;
186 
187  static constexpr vtkm::TopologyElementTagCell cell{};
188  static constexpr vtkm::TopologyElementTagPoint point{};
189 
190  auto fullCellSet = cellset.GetFullCellSet();
191 
192  vtkm::Id connectivityLength = 0;
193  ConnectivityArrays conn;
194 
195  fullCellSet.GetOffsetsArray(cell, point);
196 
197  // We can use the implicitly generated NumIndices array to save a bit of
198  // memory:
199  conn.NumIndices = vtkm::cont::make_ArrayHandlePermutation(
200  cellset.GetValidCellIds(), fullCellSet.GetNumIndicesArray(cell, point));
201 
202  // Need to generate the offsets from scratch so that they're ordered for the
203  // lower-bounds binary searches in ReverseConnectivityBuilder.
204  conn.Offsets = Helper::GetOffsetsArray(conn.NumIndices, connectivityLength, device);
205 
206  // Need to create a copy of this containing *only* the permuted cell defs,
207  // in order, since the ReverseConnectivityBuilder will process every entry
208  // in the connectivity array and we don't want the removed cells to be
209  // included.
210  conn.Connectivity =
211  Helper::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
212 
213  return conn;
214  }
215 };
216 
217 // Specialization for CellSetStructured
218 template <vtkm::IdComponent DIMENSION, typename PermutationArrayHandleType>
219 class RConnBuilderInput<
220  CellSetPermutation<CellSetStructured<DIMENSION>, PermutationArrayHandleType>>
221 {
222 private:
223  using CellSetPermutationType =
224  CellSetPermutation<CellSetStructured<DIMENSION>, PermutationArrayHandleType>;
225 
226 public:
227  using ConnectivityArrays = vtkm::cont::internal::RConnBuilderInputData<
228  VTKM_DEFAULT_STORAGE_TAG,
231 
232  static ConnectivityArrays Get(const CellSetPermutationType& cellset,
234  {
235  vtkm::Id numberOfCells = cellset.GetNumberOfCells();
236  vtkm::IdComponent numPointsInCell =
237  vtkm::internal::ConnectivityStructuredInternals<DIMENSION>::NUM_POINTS_IN_CELL;
238  vtkm::Id connectivityLength = numberOfCells * numPointsInCell;
239 
240  ConnectivityArrays conn;
241  conn.NumIndices = make_ArrayHandleConstant(numPointsInCell, numberOfCells);
242  conn.Offsets = ArrayHandleCounting<vtkm::Id>(0, numPointsInCell, numberOfCells + 1);
243  conn.Connectivity =
244  RConnTableHelpers::GetConnectivityArray(cellset, conn.Offsets, connectivityLength, device);
245 
246  return conn;
247  }
248 };
249 
250 template <typename CellSetPermutationType>
251 struct CellSetPermutationTraits;
252 
253 template <typename OriginalCellSet_, typename PermutationArrayHandleType_>
254 struct CellSetPermutationTraits<CellSetPermutation<OriginalCellSet_, PermutationArrayHandleType_>>
255 {
256  using OriginalCellSet = OriginalCellSet_;
257  using PermutationArrayHandleType = PermutationArrayHandleType_;
258 };
259 
260 template <typename OriginalCellSet_,
261  typename OriginalPermutationArrayHandleType,
262  typename PermutationArrayHandleType_>
263 struct CellSetPermutationTraits<
264  CellSetPermutation<CellSetPermutation<OriginalCellSet_, OriginalPermutationArrayHandleType>,
265  PermutationArrayHandleType_>>
266 {
267  using PreviousCellSet = CellSetPermutation<OriginalCellSet_, OriginalPermutationArrayHandleType>;
268  using PermutationArrayHandleType = vtkm::cont::ArrayHandlePermutation<
269  PermutationArrayHandleType_,
270  typename CellSetPermutationTraits<PreviousCellSet>::PermutationArrayHandleType>;
271  using OriginalCellSet = typename CellSetPermutationTraits<PreviousCellSet>::OriginalCellSet;
272  using Superclass = CellSetPermutation<OriginalCellSet, PermutationArrayHandleType>;
273 };
274 
275 template <typename VisitTopology,
276  typename IncidentTopology,
277  typename OriginalCellSetType,
278  typename PermutationArrayHandleType>
279 struct CellSetPermutationConnectivityChooser;
280 
281 template <typename OriginalCellSetType, typename PermutationArrayHandleType>
282 struct CellSetPermutationConnectivityChooser<vtkm::TopologyElementTagCell,
284  OriginalCellSetType,
285  PermutationArrayHandleType>
286 {
287  using ExecPortalType = typename PermutationArrayHandleType::ReadPortalType;
288  using OrigExecObjectType =
289  typename OriginalCellSetType::template ExecConnectivityType<vtkm::TopologyElementTagCell,
291 
292  using ExecConnectivityType =
294 };
295 
296 template <typename OriginalCellSetType, typename PermutationArrayHandleType>
297 struct CellSetPermutationConnectivityChooser<vtkm::TopologyElementTagPoint,
299  OriginalCellSetType,
300  PermutationArrayHandleType>
301 {
302  using ConnectivityPortalType = typename vtkm::cont::ArrayHandle<vtkm::Id>::ReadPortalType;
303  using NumIndicesPortalType = typename vtkm::cont::ArrayHandle<vtkm::IdComponent>::ReadPortalType;
304  using OffsetPortalType = typename vtkm::cont::ArrayHandle<vtkm::Id>::ReadPortalType;
305 
306  using ExecConnectivityType =
308 };
309 
310 } // internal
311 
312 template <typename OriginalCellSetType_,
313  typename PermutationArrayHandleType_ =
315 class CellSetPermutation : public CellSet
316 {
317  VTKM_IS_CELL_SET(OriginalCellSetType_);
318  VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType_);
320  (std::is_same<vtkm::Id, typename PermutationArrayHandleType_::ValueType>::value),
321  "Must use ArrayHandle with value type of Id for permutation array.");
322 
323 public:
324  using OriginalCellSetType = OriginalCellSetType_;
325  using PermutationArrayHandleType = PermutationArrayHandleType_;
326 
327  VTKM_CONT
329  const OriginalCellSetType& cellset)
330  : CellSet()
331  , ValidCellIds(validCellIds)
332  , FullCellSet(cellset)
333  {
334  }
335 
336  VTKM_CONT
338  : CellSet()
339  , ValidCellIds()
340  , FullCellSet()
341  {
342  }
343 
344  ~CellSetPermutation() override {}
345 
347  : CellSet()
349  , FullCellSet(src.FullCellSet)
350  {
351  }
352 
353 
355  {
356  this->ValidCellIds = src.ValidCellIds;
357  this->FullCellSet = src.FullCellSet;
358  return *this;
359  }
360 
361  VTKM_CONT
362  const OriginalCellSetType& GetFullCellSet() const { return this->FullCellSet; }
363 
364  VTKM_CONT
365  const PermutationArrayHandleType& GetValidCellIds() const { return this->ValidCellIds; }
366 
367  VTKM_CONT
368  vtkm::Id GetNumberOfCells() const override { return this->ValidCellIds.GetNumberOfValues(); }
369 
370  VTKM_CONT
371  vtkm::Id GetNumberOfPoints() const override { return this->FullCellSet.GetNumberOfPoints(); }
372 
373  VTKM_CONT
374  vtkm::Id GetNumberOfFaces() const override { return -1; }
375 
376  VTKM_CONT
377  vtkm::Id GetNumberOfEdges() const override { return -1; }
378 
379  VTKM_CONT
381  {
382  this->ValidCellIds.ReleaseResourcesExecution();
383  this->FullCellSet.ReleaseResourcesExecution();
384  this->VisitPointsWithCells.ReleaseResourcesExecution();
385  }
386 
387  VTKM_CONT
389  {
390  // Looping over GetNumberOfPointsInCell is a performance bug.
391  return this->FullCellSet.GetNumberOfPointsInCell(
392  this->ValidCellIds.ReadPortal().Get(cellIndex));
393  }
394 
396  "Calling GetCellShape(cellid) is a performance bug. Call ShapesReadPortal() "
397  "and loop over the Get.")
398  vtkm::UInt8 GetCellShape(vtkm::Id id) const override
399  {
400  // Looping over GetCellShape is a performance bug.
402  return this->FullCellSet.GetCellShape(this->ValidCellIds.ReadPortal().Get(id));
404  }
405 
406  void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const override
407  {
408  // Looping over GetCellPointsIdx is a performance bug.
409  return this->FullCellSet.GetCellPointIds(this->ValidCellIds.ReadPortal().Get(id), ptids);
410  }
411 
412  std::shared_ptr<CellSet> NewInstance() const override
413  {
414  return std::make_shared<CellSetPermutation>();
415  }
416 
417  void DeepCopy(const CellSet* src) override
418  {
419  const auto* other = dynamic_cast<const CellSetPermutation*>(src);
420  if (!other)
421  {
422  throw vtkm::cont::ErrorBadType("CellSetPermutation::DeepCopy types don't match");
423  }
424 
425  this->FullCellSet.DeepCopy(&(other->GetFullCellSet()));
426  vtkm::cont::ArrayCopy(other->GetValidCellIds(), this->ValidCellIds);
427  }
428 
429  //This is the way you can fill the memory from another system without copying
430  VTKM_CONT
431  void Fill(const PermutationArrayHandleType& validCellIds, const OriginalCellSetType& cellset)
432  {
433  this->ValidCellIds = validCellIds;
434  this->FullCellSet = cellset;
435  }
436 
438  {
439  return this->ValidCellIds.GetNumberOfValues();
440  }
441 
443  {
444  return this->FullCellSet.GetNumberOfPoints();
445  }
446 
447 public:
448  template <typename VisitTopology, typename IncidentTopology>
449  using ExecConnectivityType = typename internal::CellSetPermutationConnectivityChooser<
450  VisitTopology,
451  IncidentTopology,
454 
457  vtkm::TopologyElementTagCell visitTopology,
458  vtkm::TopologyElementTagPoint incidentTopology,
459  vtkm::cont::Token& token) const
460  {
461  using ConnectivityType =
463  return ConnectivityType(
464  this->ValidCellIds.PrepareForInput(device, token),
465  this->FullCellSet.PrepareForInput(device, visitTopology, incidentTopology, token));
466  }
467 
468  VTKM_CONT ExecConnectivityType<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
472  vtkm::cont::Token& token) const
473  {
474  if (!this->VisitPointsWithCells.ElementsValid)
475  {
476  auto connTable = internal::RConnBuilderInput<CellSetPermutation>::Get(*this, device);
477  internal::ComputeRConnTable(
478  this->VisitPointsWithCells, connTable, this->GetNumberOfPoints(), device);
479  }
480 
481  using ConnectivityType =
483  return ConnectivityType(this->VisitPointsWithCells.Connectivity.PrepareForInput(device, token),
484  this->VisitPointsWithCells.Offsets.PrepareForInput(device, token));
485  }
486 
487  VTKM_CONT
488  void PrintSummary(std::ostream& out) const override
489  {
490  out << "CellSetPermutation of: " << std::endl;
491  this->FullCellSet.PrintSummary(out);
492  out << "Permutation Array: " << std::endl;
494  }
495 
496 private:
497  using VisitPointsWithCellsConnectivity = vtkm::cont::internal::ConnectivityExplicitInternals<
499 
503 };
504 
505 template <typename CellSetType,
506  typename PermutationArrayHandleType1,
507  typename PermutationArrayHandleType2>
508 class CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
509  PermutationArrayHandleType2>
510  : public internal::CellSetPermutationTraits<
511  CellSetPermutation<CellSetPermutation<CellSetType, PermutationArrayHandleType1>,
512  PermutationArrayHandleType2>>::Superclass
513 {
514 private:
515  using Superclass = typename internal::CellSetPermutationTraits<CellSetPermutation>::Superclass;
516 
517 public:
518  VTKM_CONT
519  CellSetPermutation(const PermutationArrayHandleType2& validCellIds,
521  : Superclass(vtkm::cont::make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds()),
522  cellset.GetFullCellSet())
523  {
524  }
525 
526  VTKM_CONT
528  : Superclass()
529  {
530  }
531 
532  ~CellSetPermutation() override {}
533 
534  VTKM_CONT
535  void Fill(const PermutationArrayHandleType2& validCellIds,
537  {
538  this->ValidCellIds = make_ArrayHandlePermutation(validCellIds, cellset.GetValidCellIds());
539  this->FullCellSet = cellset.GetFullCellSet();
540  }
541 
542  std::shared_ptr<CellSet> NewInstance() const override
543  {
544  return std::make_shared<CellSetPermutation>();
545  }
546 };
547 
548 template <typename OriginalCellSet, typename PermutationArrayHandleType>
550  const PermutationArrayHandleType& cellIndexMap,
551  const OriginalCellSet& cellSet)
552 {
553  VTKM_IS_CELL_SET(OriginalCellSet);
554  VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType);
555 
557  cellSet);
558 }
559 }
560 } // namespace vtkm::cont
561 
562 //=============================================================================
563 // Specializations of serialization related classes
565 namespace vtkm
566 {
567 namespace cont
568 {
569 
570 template <typename CSType, typename AHValidCellIds>
571 struct SerializableTypeString<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
572 {
573  static VTKM_CONT const std::string& Get()
574  {
575  static std::string name = "CS_Permutation<" + SerializableTypeString<CSType>::Get() + "," +
577  return name;
578  }
579 };
580 }
581 } // vtkm::cont
582 
583 namespace mangled_diy_namespace
584 {
585 
586 template <typename CSType, typename AHValidCellIds>
587 struct Serialization<vtkm::cont::CellSetPermutation<CSType, AHValidCellIds>>
588 {
589 private:
591 
592 public:
593  static VTKM_CONT void save(BinaryBuffer& bb, const Type& cs)
594  {
595  vtkmdiy::save(bb, cs.GetFullCellSet());
596  vtkmdiy::save(bb, cs.GetValidCellIds());
597  }
598 
599  static VTKM_CONT void load(BinaryBuffer& bb, Type& cs)
600  {
601  CSType fullCS;
602  vtkmdiy::load(bb, fullCS);
603  AHValidCellIds validCellIds;
604  vtkmdiy::load(bb, validCellIds);
605 
606  cs = make_CellSetPermutation(validCellIds, fullCS);
607  }
608 };
609 
610 } // diy
612 
613 #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::CellSetPermutation::GetNumberOfPoints
VTKM_CONT vtkm::Id GetNumberOfPoints() const override
Definition: CellSetPermutation.h:371
vtkm::cont::ArrayHandle< vtkm::IdComponent >
vtkm::cont::CellSetPermutation::GetNumberOfCells
VTKM_CONT vtkm::Id GetNumberOfCells() const override
Definition: CellSetPermutation.h:368
vtkm::cont::CellSetPermutation::PermutationArrayHandleType
PermutationArrayHandleType_ PermutationArrayHandleType
Definition: CellSetPermutation.h:325
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:324
ConnectivityStructuredInternals.h
ArrayHandleCast.h
vtkm::cont::CellSetPermutation
Definition: CastAndCall.h:38
vtkm::cont::CellSetPermutation::PrintSummary
VTKM_CONT void PrintSummary(std::ostream &out) const override
Definition: CellSetPermutation.h:488
CellSetExplicit.h
vtkm::cont::ArrayHandle::Allocate
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
vtkm::cont::CellSetPermutation::VTKM_IS_ARRAY_HANDLE
VTKM_IS_ARRAY_HANDLE(PermutationArrayHandleType_)
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::~CellSetPermutation
~CellSetPermutation() override
Definition: CellSetPermutation.h:532
vtkm::Get
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
vtkm::cont::CellSetPermutation::GetSchedulingRange
VTKM_CONT vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagPoint) const
Definition: CellSetPermutation.h:442
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::cont::CellSetPermutation::ValidCellIds
PermutationArrayHandleType ValidCellIds
Definition: CellSetPermutation.h:500
vtkm::cont::printSummary_ArrayHandle
VTKM_NEVER_EXPORT VTKM_CONT void printSummary_ArrayHandle(const vtkm::cont::ArrayHandle< T, StorageT > &array, std::ostream &out, bool full=false)
Definition: ArrayHandle.h:789
vtkm::cont::CellSetPermutation::VisitPointsWithCellsConnectivity
vtkm::cont::internal::ConnectivityExplicitInternals< typename ArrayHandleConstant< vtkm::UInt8 >::StorageTag > VisitPointsWithCellsConnectivity
Definition: CellSetPermutation.h:498
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:89
vtkm::cont::CellSetPermutation::GetNumberOfEdges
VTKM_CONT vtkm::Id GetNumberOfEdges() const override
Definition: CellSetPermutation.h:377
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::ArrayHandle::ReadPortalType
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
mangled_diy_namespace
Definition: Particle.h:331
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::Superclass
typename internal::CellSetPermutationTraits< CellSetPermutation >::Superclass Superclass
Definition: CellSetPermutation.h:515
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::exec::arg::load
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
ArrayCopy.h
vtkm::cont::CellSetPermutation::VTKM_DEPRECATED
VTKM_DEPRECATED(1.6, "Calling GetCellShape(cellid) is a performance bug. Call ShapesReadPortal() " "and loop over the Get.") vtkm
Definition: CellSetPermutation.h:395
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::CellSetPermutation
VTKM_CONT CellSetPermutation()
Definition: CellSetPermutation.h:527
VTKM_DEPRECATED_SUPPRESS_END
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
vtkm::cont::CellSetPermutation::VTKM_IS_CELL_SET
VTKM_IS_CELL_SET(OriginalCellSetType_)
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::Fill
VTKM_CONT void Fill(const PermutationArrayHandleType2 &validCellIds, const CellSetPermutation< CellSetType, PermutationArrayHandleType1 > &cellset)
Definition: CellSetPermutation.h:535
vtkm::cont::StorageTagConstant
Definition: ArrayHandleConstant.h:20
vtkm::cont::CellSetPermutation::PrepareForInput
VTKM_CONT ExecConnectivityType< vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell > PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, vtkm::cont::Token &token) const
Definition: CellSetPermutation.h:469
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::StorageTagCounting
Definition: ArrayHandleCounting.h:23
ArrayHandlePermutation.h
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
vtkm::cont::ArrayHandlePermutation
Implicitly permutes the values in an array.
Definition: ArrayHandlePermutation.h:227
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::CellSetPermutation
VTKM_CONT CellSetPermutation(const PermutationArrayHandleType2 &validCellIds, const CellSetPermutation< CellSetType, PermutationArrayHandleType1 > &cellset)
Definition: CellSetPermutation.h:519
vtkm::cont::Invoker
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
vtkm::worklet::WorkletVisitCellsWithPoints
Base class for worklets that map from Points to Cells.
Definition: WorkletMapTopology.h:255
vtkm::cont::CellSetPermutation::ReleaseResourcesExecution
VTKM_CONT void ReleaseResourcesExecution() override
Definition: CellSetPermutation.h:380
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:142
vtkm::cont::make_ArrayHandleGroupVecVariable
VTKM_CONT 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:308
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
CellSet.h
vtkm::cont::CellSet
Definition: CellSet.h:24
vtkm::cont::CellSetPermutation::GetFullCellSet
const VTKM_CONT OriginalCellSetType & GetFullCellSet() const
Definition: CellSetPermutation.h:362
vtkm::exec::ConnectivityPermutedVisitPointsWithCells
Definition: ConnectivityPermuted.h:79
vtkm::UInt8
uint8_t UInt8
Definition: Types.h:157
vtkm::cont::CellSetPermutation::FullCellSet
OriginalCellSetType FullCellSet
Definition: CellSetPermutation.h:501
vtkm::cont::CellSetPermutation::~CellSetPermutation
~CellSetPermutation() override
Definition: CellSetPermutation.h:344
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:453
vtkm::cont::CellSetPermutation< CellSetPermutation< CellSetType, PermutationArrayHandleType1 >, PermutationArrayHandleType2 >::NewInstance
std::shared_ptr< CellSet > NewInstance() const override
Definition: CellSetPermutation.h:542
vtkm::cont::CellSetPermutation::CellSetPermutation
CellSetPermutation(const CellSetPermutation &src)
Definition: CellSetPermutation.h:346
vtkm::cont::CellSetPermutation::GetNumberOfFaces
VTKM_CONT vtkm::Id GetNumberOfFaces() const override
Definition: CellSetPermutation.h:374
vtkm::cont::CellSetPermutation::GetNumberOfPointsInCell
VTKM_CONT vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id cellIndex) const override
Definition: CellSetPermutation.h:388
vtkm::cont::make_ArrayHandlePermutation
VTKM_CONT vtkm::cont::ArrayHandlePermutation< IndexArrayHandleType, ValueArrayHandleType > make_ArrayHandlePermutation(IndexArrayHandleType indexArray, ValueArrayHandleType valueArray)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandlePermutation.h:279
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::cont::CellSetPermutation::VTKM_STATIC_ASSERT_MSG
VTKM_STATIC_ASSERT_MSG((std::is_same< vtkm::Id, typename PermutationArrayHandleType_::ValueType >::value), "Must use ArrayHandle with value type of Id for permutation array.")
vtkm::cont::CellSetPermutation::VisitPointsWithCells
VisitPointsWithCellsConnectivity VisitPointsWithCells
Definition: CellSetPermutation.h:502
ConvertNumComponentsToOffsetsTemplate.h
vtkm::cont::CellSetPermutation::PrepareForInput
VTKM_CONT ExecConnectivityType< vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint > PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagCell visitTopology, vtkm::TopologyElementTagPoint incidentTopology, vtkm::cont::Token &token) const
Definition: CellSetPermutation.h:456
vtkm::cont::CellSetPermutation::GetValidCellIds
const VTKM_CONT PermutationArrayHandleType & GetValidCellIds() const
Definition: CellSetPermutation.h:365
ConnectivityExplicitInternals.h
Deprecated.h
vtkm::cont::ArrayHandle::StorageTag
StorageTag_ StorageTag
Definition: ArrayHandle.h:291
ArrayHandleGroupVecVariable.h
vtkm::TopologyElementTagCell
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
CellTraits.h
vtkm::cont::make_CellSetPermutation
vtkm::cont::CellSetPermutation< OriginalCellSet, PermutationArrayHandleType > make_CellSetPermutation(const PermutationArrayHandleType &cellIndexMap, const OriginalCellSet &cellSet)
Definition: CellSetPermutation.h:549
WorkletMapTopology.h
vtkm::cont::CellSetPermutation::operator=
CellSetPermutation & operator=(const CellSetPermutation &src)
Definition: CellSetPermutation.h:354
vtkm::cont::CellSetPermutation::CellSetPermutation
VTKM_CONT CellSetPermutation(const PermutationArrayHandleType &validCellIds, const OriginalCellSetType &cellset)
Definition: CellSetPermutation.h:328
vtkm::exec::ConnectivityPermutedVisitCellsWithPoints
Definition: ConnectivityPermuted.h:25
VTKM_IS_CELL_SET
#define VTKM_IS_CELL_SET(T)
Definition: CellSet.h:71
vtkm::cont::CellSetPermutation::CellSetPermutation
VTKM_CONT CellSetPermutation()
Definition: CellSetPermutation.h:337
vtkm::cont::CellSetPermutation::GetSchedulingRange
VTKM_CONT vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
Definition: CellSetPermutation.h:437