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