Go to the documentation of this file.
71 #ifndef vtk_m_worklet_contourtree_augmented_data_set_mesh_h
72 #define vtk_m_worklet_contourtree_augmented_data_set_mesh_h
95 namespace contourtree_augmented
124 ,
NumVertices{ meshSize[0] * meshSize[1] * meshSize[2] }
138 for (
vtkm::Id shifter = this->NumVertices; shifter > 0; shifter >>= 1)
148 template <
typename T,
typename StorageType>
177 template <
typename MeshIdArrayType>
183 meshIds, *localToGlobalIdRelabeler);
187 void DebugPrint(
const char* message,
const char* fileName,
long lineNum);
203 template <
typename MeshTypeObj>
205 const MeshTypeObj* mesh,
210 template <
typename T,
typename StorageType>
215 template <
typename MeshTypeObj>
217 const MeshTypeObj* mesh,
226 auto ownedVerticesWorklet =
228 localToGlobalIdRelabeler);
230 invoke(ownedVerticesWorklet,
242 notNoSuchElementPredicate
248 template <
typename T,
typename StorageType>
265 this->SortOrder.
Allocate(this->NumVertices);
266 this->SortIndices.
Allocate(this->NumVertices);
282 invoke(sortIndicesWorklet, this->SortOrder, this->SortIndices);
285 DebugPrint(
"Data Sorted", __FILE__, __LINE__);
296 std::cout << std::endl;
299 std::cout << std::endl;
304 std::cout << std::endl;
311 std::cout <<
"------------------------------------------------------" << std::endl;
312 std::cout << std::setw(30) << std::left << fileName <<
":" << std::right << std::setw(4)
313 << lineNum << std::endl;
314 std::cout << std::left << std::string(message) << std::endl;
315 std::cout <<
"Mesh Contains: " << std::endl;
316 std::cout <<
"------------------------------------------------------" << std::endl;
320 std::cout << std::endl;
323 std::cout << std::endl;
326 std::cout << std::endl;
335 template <
typename T,
typename StorageType>
341 PrintLabelledDataBlock<T, StorageType>(
"Value", values,
MeshSize[0]);
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
void PrintLabel(std::string label, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:101
vtkm::Id GetNumberOfVertices() const
Definition: DataSetMesh.h:145
Groups connected points that have the same field value.
Definition: Atomic.h:19
IdArrayType SortOrder
Definition: DataSetMesh.h:107
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
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
DataSetMesh()
Definition: DataSetMesh.h:114
DataSetMesh(vtkm::Id3 meshSize)
Definition: DataSetMesh.h:122
void DebugPrintValues(const vtkm::cont::ArrayHandle< T, StorageType > &values)
Definition: DataSetMesh.h:336
vtkm::Id NumVertices
Definition: DataSetMesh.h:104
IdArrayType SortIndices
Definition: DataSetMesh.h:111
void DebugPrint(const char *message, const char *fileName, long lineNum)
Definition: DataSetMesh.h:308
static VTKM_CONT void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:965
void GetOwnedVerticesByGlobalIdImpl(const MeshTypeObj *mesh, const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler &localToGlobalIdRelabeler, IdArrayType &ownedVertices) const
Compute a list of the global Iss of all vertices that logically belong to the data block represented ...
Definition: DataSetMesh.h:216
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
Definition: GetOwnedVerticesByGlobalIdWorklet.h:69
virtual ~DataSetMesh()
Definition: DataSetMesh.h:142
Definition: SortIndices.h:68
Implicitly permutes the values in an array.
Definition: ArrayHandlePermutation.h:227
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
Definition: IdRelabeler.h:75
void ArrayCopy(const SourceArrayType &source, DestArrayType &destination)
Does a deep copy from one array to another array.
Definition: ArrayCopy.h:142
static VTKM_CONT void CopyIf(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: Algorithm.h:435
void PrintSortedValues(std::string label, const vtkm::cont::ArrayHandle< T, StorageType > &dVec, IdArrayType &sortVec, vtkm::Id nValues=-1, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:224
vtkm::Id3 MeshSize
Definition: DataSetMesh.h:103
Definition: NotNoSuchElementPredicate.h:67
A utility class that converts Ids from local to global given a mesh.
Definition: IdRelabeler.h:79
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
void SortData(const vtkm::cont::ArrayHandle< T, StorageType > &values)
Definition: DataSetMesh.h:249
void PrintIndexType(vtkm::Id index, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:127
vtkm::cont::ArrayHandleTransform< vtkm::cont::ArrayHandlePermutation< IdArrayType, IdArrayType >, mesh_dem::IdRelabeler > GetGlobalIdsFromSortIndices(const IdArrayType &sortIds, const mesh_dem::IdRelabeler *localToGlobalIdRelabeler) const
Routine to return the global IDs for a set of vertices We here return a fancy array handle to convert...
Definition: DataSetMesh.h:160
Definition: SimulatedSimplicityComperator.h:105
void PrintHeader(vtkm::Id howMany, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:151
void PrintIndices(std::string label, const vtkm::cont::ArrayHandle< T > &iVec, vtkm::Id nIndices=-1, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:253
virtual void DebugPrintExtends()
Definition: DataSetMesh.h:290
Definition: DataSetMesh.h:97
vtkm::cont::ArrayHandleTransform< MeshIdArrayType, mesh_dem::IdRelabeler > GetGlobalIdsFromMeshIndices(const MeshIdArrayType &meshIds, const mesh_dem::IdRelabeler *localToGlobalIdRelabeler) const
Routine to return the global IDs for a set of vertices We here return a fancy array handle to convert...
Definition: DataSetMesh.h:179
VTKM_CONT void ReleaseResources() const
Releases all resources in both the control and execution environments.
Definition: ArrayHandle.h:559
vtkm::Id NumLogSteps
Definition: DataSetMesh.h:104
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:54