Go to the documentation of this file.
53 #ifndef vtk_m_worklet_contourtree_augmented_meshtypes_MeshStructureFreudenthal2D_h
54 #define vtk_m_worklet_contourtree_augmented_meshtypes_MeshStructureFreudenthal2D_h
68 namespace contourtree_augmented
77 m2d_freudenthal::EdgeBoundaryDetectionMasksType::ReadPortalType;
105 EdgeBoundaryDetectionMasksIn.PrepareForInput(device, token);
140 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
141 #pragma GCC diagnostic push
142 #pragma GCC diagnostic ignored "-Wconversion"
143 #endif // gcc || clang
149 using namespace m2d_freudenthal;
155 vtkm::Int8 boundaryConfig = ((pos[0] == 0) ? LeftBit : 0) |
156 ((pos[0] == this->
MeshSize[0] - 1) ? RightBit : 0) | ((pos[1] == 0) ? TopBit : 0) |
157 ((pos[1] == this->
MeshSize[1] - 1) ? BottomBit : 0);
169 if (
GetMax ? (nbrSortIndex > sortIndex) : (nbrSortIndex < sortIndex))
185 bool getMaxComponents)
const
187 using namespace m2d_freudenthal;
194 vtkm::Int8 boundaryConfig = ((pos[0] == 0) ? LeftBit : 0) |
195 ((pos[0] == this->
MeshSize[0] - 1) ? RightBit : 0) | ((pos[1] == 0) ? TopBit : 0) |
196 ((pos[1] == this->
MeshSize[1] - 1) ? BottomBit : 0);
210 if (getMaxComponents ? (nbrSortIndex > sortIndex) : (nbrSortIndex < sortIndex))
213 neighbourhoodMask |=
vtkm::Id{ 1 } << edgeNo;
220 vtkm::Id neighbourComponentMask = 0;
222 if (neighbourhoodMask == 0x3F)
228 if ((neighbourhoodMask & 0x30) == 0x20)
231 neighbourComponentMask |=
vtkm::Id{ 1 } << 5;
233 if ((neighbourhoodMask & 0x18) == 0x10)
236 neighbourComponentMask |=
vtkm::Id{ 1 } << 4;
238 if ((neighbourhoodMask & 0x0C) == 0x08)
241 neighbourComponentMask |=
vtkm::Id{ 1 } << 3;
243 if ((neighbourhoodMask & 0x06) == 0x04)
246 neighbourComponentMask |=
vtkm::Id{ 1 } << 2;
248 if ((neighbourhoodMask & 0x03) == 0x02)
251 neighbourComponentMask |=
vtkm::Id{ 1 } << 1;
253 if ((neighbourhoodMask & 0x21) == 0x01)
256 neighbourComponentMask |=
vtkm::Id{ 1 } << 0;
263 #if (defined(VTKM_GCC) || defined(VTKM_CLANG))
264 #pragma GCC diagnostic pop
265 #endif // gcc || clang
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
SortIndicesPortalType SortIndicesPortal
Definition: MeshStructureFreudenthal2D.h:268
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
typename vtkm::cont::ArrayHandle< vtkm::Int8 > EdgeBoundaryDetectionMasksType
Definition: filter/scalar_topology/worklet/contourtree_augmented/meshtypes/freudenthal_2D/Types.h:68
VTKM_CONT ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used as an input to an operation in the execution environment.
Definition: ArrayHandle.h:574
#define N_INCIDENT_EDGES
Definition: Mesh2D_DEM_Triangulation_Macros.h:75
VTKM_EXEC_CONT MeshStructureFreudenthal2D()
Definition: MeshStructureFreudenthal2D.h:81
m2d_freudenthal::EdgeBoundaryDetectionMasksType::ReadPortalType EdgeBoundaryDetectionMasksPortalType
Definition: MeshStructureFreudenthal2D.h:77
constexpr vtkm::Id TERMINAL_ELEMENT
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:74
EdgeBoundaryDetectionMasksPortalType EdgeBoundaryDetectionMasksPortal
Definition: MeshStructureFreudenthal2D.h:270
Definition: MeshStructure2D.h:69
VTKM_EXEC vtkm::Id2 VertexPos(vtkm::Id v) const
Get the (x,y) position of the vertex based on its index.
Definition: MeshStructure2D.h:90
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_EXEC_CONT MeshStructure2D()
Definition: MeshStructure2D.h:73
int8_t Int8
Definition: Types.h:156
VTKM_EXEC vtkm::Pair< vtkm::Id, vtkm::Id > GetNeighbourComponentsMaskAndDegree(vtkm::Id sortIndex, bool getMaxComponents) const
Definition: MeshStructureFreudenthal2D.h:183
VTKM_EXEC vtkm::Id GetMaxNumberOfNeighbours() const
Definition: MeshStructureFreudenthal2D.h:109
Definition: MeshStructureFreudenthal2D.h:72
VTKM_EXEC vtkm::Id GetExtremalNeighbour(vtkm::Id sortIndex) const
Definition: MeshStructureFreudenthal2D.h:147
MeshStructureFreudenthal2D(vtkm::Id2 meshSize, vtkm::Int32 nincident_edges, bool getmax, const IdArrayType &sortIndices, const IdArrayType &SortOrder, const m2d_freudenthal::EdgeBoundaryDetectionMasksType &EdgeBoundaryDetectionMasksIn, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
Definition: MeshStructureFreudenthal2D.h:89
Definition: DeviceAdapterTag.h:52
vtkm::Id NumIncidentEdges
Definition: MeshStructureFreudenthal2D.h:272
int32_t Int32
Definition: Types.h:160
IdArrayType::ReadPortalType SortIndicesPortalType
Definition: MeshStructureFreudenthal2D.h:75
VTKM_EXEC vtkm::Id GetNeighbourIndex(vtkm::Id sortIndex, vtkm::Id edgeNo) const
Definition: MeshStructureFreudenthal2D.h:112
vtkm::Id2 MeshSize
Definition: MeshStructure2D.h:126
SortIndicesPortalType SortOrderPortal
Definition: MeshStructureFreudenthal2D.h:269
A vtkm::Pair is essentially the same as an STL pair object except that the methods (constructors and ...
Definition: Pair.h:29
bool GetMax
Definition: MeshStructureFreudenthal2D.h:271