Viskores  1.0
exec/CellLocatorPartitioned.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_exec_CellLocatorPartitioned_h
19 #define viskores_exec_CellLocatorPartitioned_h
20 
21 #include <viskores/Types.h>
24 
25 namespace viskores
26 {
27 namespace exec
28 {
29 class VISKORES_ALWAYS_EXPORT CellLocatorPartitioned
30 {
31 private:
36 
37 public:
41  viskores::cont::CellLocatorGeneral::ExecObjType>::ReadPortalType& locators,
44  : Locators(locators)
45  , Ghosts(ghosts)
46  {
47  }
48 
51  viskores::Id& partitionId,
52  viskores::Id& cellId,
53  viskores::Vec3f& parametric) const
54  {
55  bool found = 0;
56  for (viskores::Id partitionIndex = 0; partitionIndex < this->Locators.GetNumberOfValues();
57  ++partitionIndex)
58  {
59  viskores::Id cellIndex;
60  viskores ::Vec3f parametricLocal;
61  viskores ::ErrorCode status =
62  Locators.Get(partitionIndex).FindCell(point, cellIndex, parametricLocal);
63  if (status != viskores ::ErrorCode ::Success)
64  {
65  }
66  else
67  {
68  if (Ghosts.Get(partitionIndex).Get(cellIndex) == 0)
69  {
70  partitionId = partitionIndex;
71  cellId = cellIndex;
72  parametric = parametricLocal;
73  found = true;
74  break;
75  }
76  }
77  }
78  if (found)
79  {
81  }
82  else
83  {
85  }
86  }
87 };
88 } //namespace exec
89 } //namespace viskores
90 
91 #endif //viskores_exec_CellLocatorPartitioned_h
ArrayHandle.h
Types.h
viskores::cont::ArrayHandleStride::ReadPortalType
typename Superclass::ReadPortalType ReadPortalType
Definition: ArrayHandleStride.h:349
viskores::cont::CellLocatorGeneral::ExecObjType
viskores::ListApply< ExecLocatorList, viskores::exec::CellLocatorMultiplexer > ExecObjType
Definition: CellLocatorGeneral.h:61
viskores::ErrorCode
ErrorCode
Identifies whether an operation was successful or what type of error it had.
Definition: ErrorCode.h:36
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
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::exec::CellLocatorPartitioned
Definition: exec/CellLocatorPartitioned.h:29
viskores::exec::CellLocatorPartitioned::Locators
viskores::cont::ArrayHandle< viskores::cont::CellLocatorGeneral::ExecObjType >::ReadPortalType Locators
Definition: exec/CellLocatorPartitioned.h:33
viskores::exec::CellLocatorPartitioned::Ghosts
viskores::cont::ArrayHandle< viskores::cont::ArrayHandleStride< viskores::UInt8 >::ReadPortalType >::ReadPortalType Ghosts
Definition: exec/CellLocatorPartitioned.h:35
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::ErrorCode::CellNotFound
@ CellNotFound
A cell matching some given criteria could not be found.
viskores::ErrorCode::Success
@ Success
A successful operation.
viskores::exec::CellLocatorPartitioned::FindCell
viskores::ErrorCode FindCell(const viskores::Vec3f &point, viskores::Id &partitionId, viskores::Id &cellId, viskores::Vec3f &parametric) const
Definition: exec/CellLocatorPartitioned.h:50
CellLocatorGeneral.h
viskores::Vec< viskores::FloatDefault, 3 >
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59
viskores::exec::CellLocatorPartitioned::CellLocatorPartitioned
CellLocatorPartitioned(const viskores::cont::ArrayHandle< viskores::cont::CellLocatorGeneral::ExecObjType >::ReadPortalType &locators, viskores::cont::ArrayHandle< viskores::cont::ArrayHandleStride< viskores::UInt8 >::ReadPortalType >::ReadPortalType ghosts)
Definition: exec/CellLocatorPartitioned.h:39
viskores::Vec3f
viskores::Vec< viskores::FloatDefault, 3 > Vec3f
Vec3f corresponds to a 3-dimensional vector of floating point values.
Definition: Types.h:1064