mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 21:33:55 +00:00
Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m
This commit is contained in:
commit
c076fd8781
@ -7,7 +7,6 @@ build:centos7_gcc73:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .centos7
|
||||
|
@ -7,7 +7,6 @@ build:ubuntu1604_gcc5:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .ubuntu1604_cuda
|
||||
@ -46,7 +45,6 @@ build:ubuntu1604_gcc5_2:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .ubuntu1604_cuda
|
||||
|
@ -46,7 +46,6 @@ build:ubuntu1804_gcc7:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .ubuntu1804_cuda
|
||||
@ -85,7 +84,6 @@ build:ubuntu1804_clang_cuda:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .ubuntu1804_cuda
|
||||
@ -193,7 +191,6 @@ build:ubuntu1804_kokkos:
|
||||
- vtkm
|
||||
- docker
|
||||
- linux
|
||||
- cuda-rt
|
||||
- large-memory
|
||||
extends:
|
||||
- .ubuntu1804_cuda_kokkos
|
||||
|
@ -62,6 +62,12 @@ if(TARGET vtkm_vectorization_flags)
|
||||
endif()
|
||||
|
||||
add_library(vtkm_vectorization_flags INTERFACE)
|
||||
set_target_properties(
|
||||
vtkm_vectorization_flags
|
||||
PROPERTIES
|
||||
EXPORT_NAME vectorization_flags
|
||||
)
|
||||
|
||||
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
install(TARGETS vtkm_vectorization_flags EXPORT ${VTKm_EXPORT_NAME})
|
||||
endif()
|
||||
@ -193,7 +199,7 @@ target_compile_options(vtkm_vectorization_flags
|
||||
INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${flags}>
|
||||
)
|
||||
|
||||
if(TARGET vtkm::cuda AND flags AND NOT CMAKE_CUDA_HOST_COMPILER)
|
||||
if(TARGET vtkm_cuda AND flags AND NOT CMAKE_CUDA_HOST_COMPILER)
|
||||
# Also propagate down these optimizations when building host side code
|
||||
# with cuda. To be safe we only do this when we know the C++ and CUDA
|
||||
# host compiler are from the same vendor
|
||||
|
@ -30,6 +30,11 @@ endif()
|
||||
# vtkm_compiler_flags is used by all the vtkm targets and consumers of VTK-m
|
||||
# The flags on vtkm_compiler_flags are needed when using/building vtk-m
|
||||
add_library(vtkm_compiler_flags INTERFACE)
|
||||
set_target_properties(
|
||||
vtkm_compiler_flags
|
||||
PROPERTIES
|
||||
EXPORT_NAME compiler_flags
|
||||
)
|
||||
|
||||
# When building libraries/tests that are part of the VTK-m repository
|
||||
# inherit the properties from vtkm_vectorization_flags.
|
||||
@ -50,12 +55,12 @@ target_compile_features(vtkm_compiler_flags INTERFACE cxx_std_14)
|
||||
# they don't use.
|
||||
if(VTKM_COMPILER_IS_MSVC)
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/Gy>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler="/Gy">)
|
||||
endif()
|
||||
elseif(NOT (VTKM_COMPILER_IS_PGI OR VTKM_COMPILER_IS_XL)) #can't find an equivalant PGI/XL flag
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-ffunction-sections>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-ffunction-sections>)
|
||||
endif()
|
||||
endif()
|
||||
@ -63,7 +68,7 @@ endif()
|
||||
# Enable large object support so we can have 2^32 addressable sections
|
||||
if(VTKM_COMPILER_IS_MSVC)
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/bigobj>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler="/bigobj">)
|
||||
endif()
|
||||
endif()
|
||||
@ -79,6 +84,11 @@ target_include_directories(vtkm_compiler_flags INTERFACE
|
||||
# vtkm_developer_flags is used ONLY BY libraries that are built as part of this
|
||||
# repository
|
||||
add_library(vtkm_developer_flags INTERFACE)
|
||||
set_target_properties(
|
||||
vtkm_developer_flags
|
||||
PROPERTIES
|
||||
EXPORT_NAME developer_flags
|
||||
)
|
||||
|
||||
# Additional warnings just for Clang 3.5+, and AppleClang 7+
|
||||
# about failures to vectorize.
|
||||
@ -101,7 +111,7 @@ if(VTKM_COMPILER_IS_MSVC)
|
||||
|
||||
#Setup MSVC warnings with CUDA and CXX
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${cuda_flags} -Xcudafe=--diag_suppress=1394,--diag_suppress=766>)
|
||||
endif()
|
||||
|
||||
@ -109,7 +119,7 @@ if(VTKM_COMPILER_IS_MSVC)
|
||||
# In VS2013 the C4127 warning has a bug in the implementation and
|
||||
# generates false positive warnings for lots of template code
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-wd4127>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-wd4127>)
|
||||
endif()
|
||||
endif()
|
||||
@ -165,7 +175,7 @@ elseif(VTKM_COMPILER_IS_GNU OR VTKM_COMPILER_IS_CLANG)
|
||||
endif()
|
||||
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>)
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${cuda_flags}>)
|
||||
endif()
|
||||
endif()
|
||||
@ -176,10 +186,10 @@ function(setup_cuda_flags)
|
||||
endfunction()
|
||||
|
||||
#common warnings for all platforms when building cuda
|
||||
if ((TARGET vtkm::cuda) OR (TARGET vtkm::kokkos_cuda))
|
||||
if ((TARGET vtkm_cuda) OR (TARGET vtkm::kokkos_cuda))
|
||||
setup_cuda_flags()
|
||||
endif()
|
||||
|
||||
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
install(TARGETS vtkm_compiler_flags vtkm_developer_flags EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_compiler_flags vtkm_developer_flags)
|
||||
endif()
|
||||
|
@ -10,22 +10,22 @@
|
||||
|
||||
# When this file is run by CMake through the find_package command, the
|
||||
# following targets will exist:
|
||||
# vtkm_cont Target that contains most of VTK-m
|
||||
# vtkm::cont Target that contains most of VTK-m
|
||||
#
|
||||
# vtkm_rendering Target that contains all the rendering code
|
||||
# vtkm::rendering Target that contains all the rendering code
|
||||
#
|
||||
# vtkm_filter Target that contains all of VTK-m pre-built filters
|
||||
# vtkm::filter Target that contains all of VTK-m pre-built filters
|
||||
#
|
||||
# vtkm_source Target that contains all of VTK-m pre-built sources
|
||||
# vtkm::source Target that contains all of VTK-m pre-built sources
|
||||
#
|
||||
# vtkm::tbb Target that contains tbb related link information
|
||||
# implicitly linked to by `vtkm_cont` if tbb is enabled
|
||||
# vtkm::tbb Target that contains tbb related link information
|
||||
# implicitly linked to by `vtkm_cont` if tbb is enabled
|
||||
#
|
||||
# vtkm::openmp Target that contains openmp related link information
|
||||
# implicitly linked to by `vtkm_cont` if openmp is enabled
|
||||
# vtkm::openmp Target that contains openmp related link information
|
||||
# implicitly linked to by `vtkm_cont` if openmp is enabled
|
||||
#
|
||||
# vtkm::cuda Target that contains cuda related link information
|
||||
# implicitly linked to by `vtkm_cont` if cuda is enabled
|
||||
# vtkm::cuda Target that contains cuda related link information
|
||||
# implicitly linked to by `vtkm_cont` if cuda is enabled
|
||||
#
|
||||
# The following local variables will also be defined:
|
||||
#
|
||||
@ -47,7 +47,6 @@
|
||||
# VTKm_ENABLE_OSMESA_CONTEXT Will be enabled if VTK-m rendering was built with a osmesa context
|
||||
# VTKm_ENABLE_EGL_CONTEXT Will be enabled if VTK-m rendering was built with a EGL context
|
||||
#
|
||||
#
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.12")
|
||||
message(FATAL_ERROR "VTK-m requires CMake 3.12+")
|
||||
@ -109,11 +108,20 @@ set(VTKM_FROM_INSTALL_DIR FALSE)
|
||||
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "@VTKm_BINARY_DIR@")
|
||||
set(VTKM_FROM_INSTALL_DIR TRUE)
|
||||
include(${VTKm_CONFIG_DIR}/VTKmTargets.cmake)
|
||||
|
||||
if(DEFINED PACKAGE_FIND_VERSION AND PACKAGE_FIND_VERSION VERSION_LESS 2.0)
|
||||
add_library(vtkm_cont ALIAS vtkm::cont)
|
||||
add_library(vtkm_filter ALIAS vtkm::filter)
|
||||
add_library(vtkm_io ALIAS vtkm::io)
|
||||
add_library(vtkm_rendering ALIAS vtkm::rendering)
|
||||
add_library(vtkm_source ALIAS vtkm::source)
|
||||
add_library(vtkm_worklet ALIAS vtkm::worklet)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Once we can require CMake 3.15 for all cuda builds we can
|
||||
# replace this with setting `cuda_architecture_flags` as part of the
|
||||
# EXPORT_PROPERTIES of the vtkm_cuda target
|
||||
# EXPORT_PROPERTIES of the vtkm::cuda target
|
||||
if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR)
|
||||
# Canonical way of setting CUDA arch
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
|
||||
|
@ -8,6 +8,14 @@
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##============================================================================
|
||||
|
||||
macro(vtkm_diy_get_general_target target)
|
||||
if(PROJECT_NAME STREQUAL "VTKm" OR CMAKE_PROJECT_NAME STREQUAL "VTKm")
|
||||
set(${target} "vtkm_diy")
|
||||
else()
|
||||
set(${target} "vtkm::diy")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(_vtkm_diy_target flag target)
|
||||
set(${target} "vtkmdiympi")
|
||||
if (NOT ${flag})
|
||||
@ -19,7 +27,8 @@ function(vtkm_diy_init_target)
|
||||
set(vtkm_diy_default_flag "${VTKm_ENABLE_MPI}")
|
||||
_vtkm_diy_target(vtkm_diy_default_flag vtkm_diy_default_target)
|
||||
|
||||
set_target_properties(vtkm_diy PROPERTIES
|
||||
vtkm_diy_get_general_target(diy_target)
|
||||
set_target_properties(${diy_target} PROPERTIES
|
||||
vtkm_diy_use_mpi_stack ${vtkm_diy_default_flag}
|
||||
vtkm_diy_target ${vtkm_diy_default_target})
|
||||
endfunction()
|
||||
@ -30,30 +39,33 @@ function(vtkm_diy_use_mpi_push)
|
||||
if (NOT ARGC EQUAL 0)
|
||||
set(topval ${ARGV0})
|
||||
endif()
|
||||
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
|
||||
vtkm_diy_get_general_target(diy_target)
|
||||
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
|
||||
list (APPEND stack ${topval})
|
||||
_vtkm_diy_target(topval target)
|
||||
set_target_properties(vtkm_diy PROPERTIES
|
||||
set_target_properties(${diy_target} PROPERTIES
|
||||
vtkm_diy_use_mpi_stack "${stack}"
|
||||
vtkm_diy_target "${target}")
|
||||
endfunction()
|
||||
|
||||
function(vtkm_diy_use_mpi value)
|
||||
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
|
||||
vtkm_diy_get_general_target(diy_target)
|
||||
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
|
||||
list (REMOVE_AT stack -1)
|
||||
list (APPEND stack ${value})
|
||||
_vtkm_diy_target(value target)
|
||||
set_target_properties(vtkm_diy PROPERTIES
|
||||
set_target_properties(${diy_target} PROPERTIES
|
||||
vtkm_diy_use_mpi_stack "${stack}"
|
||||
vtkm_diy_target "${target}")
|
||||
endfunction()
|
||||
|
||||
function(vtkm_diy_use_mpi_pop)
|
||||
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
|
||||
vtkm_diy_get_general_target(diy_target)
|
||||
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
|
||||
list (GET stack -1 value)
|
||||
list (REMOVE_AT stack -1)
|
||||
_vtkm_diy_target(value target)
|
||||
set_target_properties(vtkm_diy PROPERTIES
|
||||
set_target_properties(${diy_target} PROPERTIES
|
||||
vtkm_diy_use_mpi_stack "${stack}"
|
||||
vtkm_diy_target "${target}")
|
||||
endfunction()
|
||||
|
@ -41,38 +41,39 @@ function(vtkm_extract_real_library library real_library)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(VTKm_ENABLE_TBB AND NOT TARGET vtkm::tbb)
|
||||
if(VTKm_ENABLE_TBB AND NOT TARGET vtkm_tbb)
|
||||
# Skip find_package(TBB) if we already have it
|
||||
if (NOT TARGET TBB::tbb)
|
||||
find_package(TBB REQUIRED)
|
||||
endif()
|
||||
|
||||
add_library(vtkmTBB INTERFACE)
|
||||
add_library(vtkm::tbb ALIAS vtkmTBB)
|
||||
target_link_libraries(vtkmTBB INTERFACE TBB::tbb)
|
||||
target_compile_definitions(vtkmTBB INTERFACE "TBB_VERSION_MAJOR=${TBB_VERSION_MAJOR}")
|
||||
set_target_properties(vtkmTBB PROPERTIES EXPORT_NAME vtkm::tbb)
|
||||
install(TARGETS vtkmTBB EXPORT ${VTKm_EXPORT_NAME})
|
||||
add_library(vtkm_tbb INTERFACE)
|
||||
target_link_libraries(vtkm_tbb INTERFACE TBB::tbb)
|
||||
target_compile_definitions(vtkm_tbb INTERFACE "TBB_VERSION_MAJOR=${TBB_VERSION_MAJOR}")
|
||||
set_target_properties(vtkm_tbb PROPERTIES EXPORT_NAME tbb)
|
||||
install(TARGETS vtkm_tbb EXPORT ${VTKm_EXPORT_NAME})
|
||||
endif()
|
||||
|
||||
if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm::openmp)
|
||||
if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm_openmp)
|
||||
find_package(OpenMP 4.0 REQUIRED COMPONENTS CXX QUIET)
|
||||
|
||||
add_library(vtkm::openmp INTERFACE IMPORTED GLOBAL)
|
||||
add_library(vtkm_openmp INTERFACE)
|
||||
set_target_properties(vtkm_openmp PROPERTIES EXPORT_NAME openmp)
|
||||
if(OpenMP_CXX_FLAGS)
|
||||
set_property(TARGET vtkm::openmp
|
||||
set_property(TARGET vtkm_openmp
|
||||
APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_FLAGS}>)
|
||||
|
||||
if(VTKm_ENABLE_CUDA)
|
||||
string(REPLACE ";" "," openmp_cuda_flags "-Xcompiler=${OpenMP_CXX_FLAGS}")
|
||||
set_property(TARGET vtkm::openmp
|
||||
set_property(TARGET vtkm_openmp
|
||||
APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CUDA>:${openmp_cuda_flags}>)
|
||||
endif()
|
||||
endif()
|
||||
if(OpenMP_CXX_LIBRARIES)
|
||||
set_target_properties(vtkm::openmp PROPERTIES
|
||||
set_target_properties(vtkm_openmp PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "${OpenMP_CXX_LIBRARIES}")
|
||||
endif()
|
||||
install(TARGETS vtkm_openmp EXPORT ${VTKm_EXPORT_NAME})
|
||||
endif()
|
||||
|
||||
if(VTKm_ENABLE_CUDA)
|
||||
@ -84,10 +85,9 @@ if(VTKm_ENABLE_CUDA)
|
||||
message(FATAL_ERROR "VTK-m CUDA support requires version 9.2+")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET vtkm::cuda)
|
||||
if(NOT TARGET vtkm_cuda)
|
||||
add_library(vtkm_cuda INTERFACE)
|
||||
add_library(vtkm::cuda ALIAS vtkm_cuda)
|
||||
set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME vtkm::cuda)
|
||||
set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME cuda)
|
||||
|
||||
install(TARGETS vtkm_cuda EXPORT ${VTKm_EXPORT_NAME})
|
||||
# Reserve `requires_static_builds` to potential work around issues
|
||||
|
@ -92,10 +92,9 @@ endif()
|
||||
#-----------------------------------------------------------------------------
|
||||
if(VTKm_ENABLE_RENDERING AND NOT TARGET vtkm_rendering_gl_context)
|
||||
add_library(vtkm_rendering_gl_context INTERFACE)
|
||||
|
||||
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
install(TARGETS vtkm_rendering_gl_context
|
||||
EXPORT ${VTKm_EXPORT_NAME}
|
||||
)
|
||||
vtkm_install_targets(TARGETS vtkm_rendering_gl_context)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -197,7 +197,7 @@ endfunction()
|
||||
#
|
||||
# If VTK-m was built with CMake 3.18+ and you are using CMake 3.18+ and have
|
||||
# a cmake_minimum_required of 3.18 or have set policy CMP0105 to new, this will
|
||||
# return an empty string as the `vtkm::cuda` target will correctly propagate
|
||||
# return an empty string as the `vtkm_cuda` target will correctly propagate
|
||||
# all the necessary flags.
|
||||
#
|
||||
# This is required for CMake < 3.18 as they don't support the `$<DEVICE_LINK>`
|
||||
@ -211,11 +211,11 @@ endfunction()
|
||||
#
|
||||
function(vtkm_get_cuda_flags settings_var)
|
||||
|
||||
if(TARGET vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
if(POLICY CMP0105)
|
||||
cmake_policy(GET CMP0105 does_device_link)
|
||||
get_property(arch_flags
|
||||
TARGET vtkm::cuda
|
||||
TARGET vtkm_cuda
|
||||
PROPERTY INTERFACE_LINK_OPTIONS)
|
||||
if(arch_flags AND CMP0105 STREQUAL "NEW")
|
||||
return()
|
||||
@ -223,7 +223,7 @@ function(vtkm_get_cuda_flags settings_var)
|
||||
endif()
|
||||
|
||||
get_property(arch_flags
|
||||
TARGET vtkm::cuda
|
||||
TARGET vtkm_cuda
|
||||
PROPERTY cuda_architecture_flags)
|
||||
set(${settings_var} "${${settings_var}} ${arch_flags}" PARENT_SCOPE)
|
||||
endif()
|
||||
@ -259,6 +259,66 @@ function(vtkm_add_drop_unused_function_flags uses_vtkm_target)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# This function takes a target name and returns the mangled version of its name
|
||||
# in a form that complies with the VTK-m export target naming scheme.
|
||||
macro(vtkm_target_mangle output target)
|
||||
string(REPLACE "vtkm_" "" ${output} ${target})
|
||||
endmacro()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Enable VTK-m targets to be installed.
|
||||
#
|
||||
# This function decorates the `install` CMake function mangling the exported
|
||||
# target names to comply with the VTK-m exported target names scheme. Use this
|
||||
# function instead of the canonical CMake `install` function for VTK-m targets.
|
||||
#
|
||||
# Signature:
|
||||
# vtkm_install_targets(
|
||||
# TARGETS <target[s]>
|
||||
# [EXPORT <export_name>]
|
||||
# [ARGS <cmake_install_args>]
|
||||
# )
|
||||
#
|
||||
# Usage:
|
||||
# add_library(vtkm_library)
|
||||
# vtkm_install_targets(TARGETS vtkm_library ARGS COMPONENT core)
|
||||
#
|
||||
# TARGETS: List of targets to be installed.
|
||||
#
|
||||
# EXPORT: [OPTIONAL] The name of the export set to which this target will be
|
||||
# added. If omitted vtkm_install_targets will use the value of
|
||||
# VTKm_EXPORT_NAME by default.
|
||||
#
|
||||
# ARGS: [OPTIONAL] Any argument other than `TARGETS` and `EXPORT` accepted
|
||||
# by the `install` CMake function:
|
||||
# <https://cmake.org/cmake/help/latest/command/install.html>
|
||||
#
|
||||
function(vtkm_install_targets)
|
||||
set(oneValueArgs EXPORT)
|
||||
set(multiValueArgs TARGETS ARGS)
|
||||
cmake_parse_arguments(VTKm_INSTALL "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
set(export_name ${VTKm_EXPORT_NAME})
|
||||
if(VTKm_INSTALL_EXPORT)
|
||||
set(export_name ${VTKm_INSTALL_EXPORT})
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED VTKm_INSTALL_TARGETS)
|
||||
message(FATAL_ERROR "vtkm_install_targets invoked without TARGETS arguments.")
|
||||
endif()
|
||||
|
||||
if(DEFINED VTKm_INSTALL_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "vtkm_install_targets missing ARGS keyword prepending install arguments")
|
||||
endif()
|
||||
|
||||
foreach(tgt IN LISTS VTKm_INSTALL_TARGETS)
|
||||
vtkm_target_mangle(tgt_mangled ${tgt})
|
||||
set_target_properties(${tgt} PROPERTIES EXPORT_NAME ${tgt_mangled})
|
||||
endforeach()
|
||||
|
||||
install(TARGETS ${VTKm_INSTALL_TARGETS} EXPORT ${export_name} ${VTKm_INSTALL_ARGS})
|
||||
endfunction(vtkm_install_targets)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add a relevant information to target that wants to use VTK-m.
|
||||
@ -301,7 +361,7 @@ endfunction()
|
||||
#
|
||||
# If VTK-m was built with CMake 3.18+ and you are using CMake 3.18+ and have
|
||||
# a cmake_minimum_required of 3.18 or have set policy CMP0105 to new, this will
|
||||
# return an empty string as the `vtkm::cuda` target will correctly propagate
|
||||
# return an empty string as the `vtkm_cuda` target will correctly propagate
|
||||
# all the necessary flags.
|
||||
#
|
||||
# Note: calling `vtkm_add_target_information` multiple times with
|
||||
@ -374,7 +434,7 @@ function(vtkm_add_target_information uses_vtkm_target)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if((TARGET vtkm::cuda) OR (TARGET vtkm::kokkos_cuda))
|
||||
if((TARGET vtkm_cuda) OR (TARGET vtkm::kokkos_cuda))
|
||||
set_source_files_properties(${VTKm_TI_DEVICE_SOURCES} PROPERTIES LANGUAGE "CUDA")
|
||||
elseif(TARGET vtkm::kokkos_hip)
|
||||
set_source_files_properties(${VTKm_TI_DEVICE_SOURCES} PROPERTIES LANGUAGE "HIP")
|
||||
@ -513,8 +573,7 @@ function(vtkm_library)
|
||||
endif()
|
||||
|
||||
#install the library itself
|
||||
install(TARGETS ${lib_name}
|
||||
EXPORT ${VTKm_EXPORT_NAME}
|
||||
vtkm_install_targets(TARGETS ${lib_name} ARGS
|
||||
ARCHIVE DESTINATION ${VTKm_INSTALL_LIB_DIR}
|
||||
LIBRARY DESTINATION ${VTKm_INSTALL_LIB_DIR}
|
||||
RUNTIME DESTINATION ${VTKm_INSTALL_BIN_DIR}
|
||||
|
@ -111,14 +111,14 @@ function(add_benchmark_test benchmark)
|
||||
|
||||
add_test(NAME "${test_name}Report"
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DBENCHMARK_NAME=${benchmark}"
|
||||
"-DVTKm_PERF_ALPHA=${VTKm_PERF_ALPHA}"
|
||||
"-DVTKm_PERF_DIST=${VTKm_PERF_DIST}"
|
||||
"-DVTKm_PERF_REPO=${VTKm_PERF_REPO}"
|
||||
"-DVTKm_PERF_COMPARE_JSON=${VTKm_PERF_COMPARE_JSON}"
|
||||
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
|
||||
"-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}"
|
||||
"-DVTKm_PERF_ALPHA=${VTKm_PERF_ALPHA}"
|
||||
"-DVTKm_PERF_COMPARE_JSON=${VTKm_PERF_COMPARE_JSON}"
|
||||
"-DVTKm_PERF_COMPARE_STDOUT=${VTKm_PERF_COMPARE_STDOUT}"
|
||||
"-DVTKm_PERF_DIST=${VTKm_PERF_DIST}"
|
||||
"-DVTKm_PERF_NAME=${VTKm_PERF_NAME}"
|
||||
"-DVTKm_PERF_REPO=${VTKm_PERF_REPO}"
|
||||
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
|
||||
-P "${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestReport.cmake"
|
||||
)
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake")
|
||||
|
||||
REQUIRE_FLAG("BENCHMARK_NAME")
|
||||
REQUIRE_FLAG("VTKm_PERF_NAME")
|
||||
REQUIRE_FLAG("VTKm_PERF_COMPARE_JSON")
|
||||
REQUIRE_FLAG("VTKm_PERF_COMPARE_STDOUT")
|
||||
|
||||
@ -34,8 +34,8 @@ execute_process(COMMAND /usr/bin/git -C "${VTKm_SOURCE_DIR}" log --format=%H --f
|
||||
string(REPLACE "\n" ";" GIT_ANCESTOR_COMMITS ${GIT_ANCESTOR_COMMITS})
|
||||
|
||||
foreach(commit IN LISTS GIT_ANCESTOR_COMMITS)
|
||||
if (EXISTS "${VTKm_PERF_REPO}/${commit}_${BENCHMARK_NAME}.json")
|
||||
set(BASELINE_REPORT "${VTKm_PERF_REPO}/${commit}_${BENCHMARK_NAME}.json")
|
||||
if (EXISTS "${VTKm_PERF_REPO}/${commit}_${VTKm_PERF_NAME}.json")
|
||||
set(BASELINE_REPORT "${VTKm_PERF_REPO}/${commit}_${VTKm_PERF_NAME}.json")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
@ -412,9 +412,11 @@ if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
|
||||
# Create and install exports for external projects
|
||||
export(EXPORT ${VTKm_EXPORT_NAME}
|
||||
NAMESPACE vtkm::
|
||||
FILE ${VTKm_BUILD_CMAKE_BASE_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmTargets.cmake
|
||||
)
|
||||
install(EXPORT ${VTKm_EXPORT_NAME}
|
||||
NAMESPACE vtkm::
|
||||
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
|
||||
FILE VTKmTargets.cmake
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
VTKm License Version 1.9
|
||||
VTKm License Version 2.0
|
||||
========================================================================
|
||||
|
||||
Copyright (c) 2014-2022
|
||||
|
133
README.md
133
README.md
@ -132,10 +132,10 @@ and then build. Here are some example *nix commands for the process
|
||||
(individual commands may vary).
|
||||
|
||||
```sh
|
||||
$ tar xvzf ~/Downloads/vtk-m-v1.4.0.tar.gz
|
||||
$ tar xvzf ~/Downloads/vtk-m-v2.0.0.tar.gz
|
||||
$ mkdir vtkm-build
|
||||
$ cd vtkm-build
|
||||
$ cmake-gui ../vtk-m-v1.4.0
|
||||
$ cmake-gui ../vtk-m-v2.0.0
|
||||
$ cmake --build -j . # Runs make (or other build program)
|
||||
```
|
||||
|
||||
@ -147,76 +147,109 @@ Users Guide].
|
||||
|
||||
The VTK-m source distribution includes a number of examples. The goal of the
|
||||
VTK-m examples is to illustrate specific VTK-m concepts in a consistent and
|
||||
simple format. However, these examples only cover a small part of the
|
||||
simple format. However, these examples only cover a small portion of the
|
||||
capabilities of VTK-m.
|
||||
|
||||
Below is a simple example of using VTK-m to load a VTK image file, run the
|
||||
Marching Cubes algorithm on it, and render the results to an image:
|
||||
Below is a simple example of using VTK-m to create a simple data set and use VTK-m's rendering
|
||||
engine to render an image and write that image to a file. It then computes an isosurface on the
|
||||
input data set and renders this output data set in a separate image file:
|
||||
|
||||
```cpp
|
||||
#include <vtkm/Bounds.h>
|
||||
#include <vtkm/Range.h>
|
||||
#include <vtkm/cont/ColorTable.h>
|
||||
#include <vtkm/filter/Contour.h>
|
||||
#include <vtkm/io/VTKDataSetReader.h>
|
||||
#include <vtkm/cont/Initialize.h>
|
||||
#include <vtkm/source/Tangle.h>
|
||||
|
||||
#include <vtkm/rendering/Actor.h>
|
||||
#include <vtkm/rendering/Camera.h>
|
||||
#include <vtkm/rendering/CanvasRayTracer.h>
|
||||
#include <vtkm/rendering/Color.h>
|
||||
#include <vtkm/rendering/MapperRayTracer.h>
|
||||
#include <vtkm/rendering/MapperVolume.h>
|
||||
#include <vtkm/rendering/MapperWireframer.h>
|
||||
#include <vtkm/rendering/Scene.h>
|
||||
#include <vtkm/rendering/View3D.h>
|
||||
|
||||
vtkm::io::VTKDataSetReader reader("path/to/vtk_image_file.vtk");
|
||||
vtkm::cont::DataSet inputData = reader.ReadDataSet();
|
||||
std::string fieldName = "scalars";
|
||||
#include <vtkm/filter/contour/Contour.h>
|
||||
|
||||
vtkm::Range range;
|
||||
inputData.GetPointField(fieldName).GetRange(&range);
|
||||
vtkm::Float64 isovalue = range.Center();
|
||||
using vtkm::rendering::CanvasRayTracer;
|
||||
using vtkm::rendering::MapperRayTracer;
|
||||
using vtkm::rendering::MapperVolume;
|
||||
using vtkm::rendering::MapperWireframer;
|
||||
|
||||
// Create an isosurface filter
|
||||
vtkm::filter::Contour filter;
|
||||
filter.SetIsoValue(0, isovalue);
|
||||
filter.SetActiveField(fieldName);
|
||||
vtkm::cont::DataSet outputData = filter.Execute(inputData);
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
vtkm::cont::Initialize(argc, argv, vtkm::cont::InitializeOptions::Strict);
|
||||
|
||||
// compute the bounds and extends of the input data
|
||||
vtkm::Bounds coordsBounds = inputData.GetCoordinateSystem().GetBounds();
|
||||
auto tangle = vtkm::source::Tangle(vtkm::Id3{ 50, 50, 50 });
|
||||
vtkm::cont::DataSet tangleData = tangle.Execute();
|
||||
std::string fieldName = "tangle";
|
||||
|
||||
// setup a camera and point it to towards the center of the input data
|
||||
vtkm::rendering::Camera camera;
|
||||
camera.ResetToBounds(coordsBounds);
|
||||
vtkm::cont::ColorTable colorTable("inferno");
|
||||
// Set up a camera for rendering the input data
|
||||
vtkm::rendering::Camera camera;
|
||||
camera.SetLookAt(vtkm::Vec3f_32(0.5, 0.5, 0.5));
|
||||
camera.SetViewUp(vtkm::make_Vec(0.f, 1.f, 0.f));
|
||||
camera.SetClippingRange(1.f, 10.f);
|
||||
camera.SetFieldOfView(60.f);
|
||||
camera.SetPosition(vtkm::Vec3f_32(1.5, 1.5, 1.5));
|
||||
vtkm::cont::ColorTable colorTable("inferno");
|
||||
|
||||
// Create a mapper, canvas and view that will be used to render the scene
|
||||
vtkm::rendering::Scene scene;
|
||||
vtkm::rendering::MapperRayTracer mapper;
|
||||
vtkm::rendering::CanvasRayTracer canvas(512, 512);
|
||||
vtkm::rendering::Color bg(0.2f, 0.2f, 0.2f, 1.0f);
|
||||
// Background color:
|
||||
vtkm::rendering::Color bg(0.2f, 0.2f, 0.2f, 1.0f);
|
||||
vtkm::rendering::Actor actor(tangleData.GetCellSet(),
|
||||
tangleData.GetCoordinateSystem(),
|
||||
tangleData.GetField(fieldName),
|
||||
colorTable);
|
||||
vtkm::rendering::Scene scene;
|
||||
scene.AddActor(actor);
|
||||
// 2048x2048 pixels in the canvas:
|
||||
CanvasRayTracer canvas(2048, 2048);
|
||||
// Create a view and use it to render the input data using OS Mesa
|
||||
|
||||
// Render an image of the output isosurface
|
||||
scene.AddActor(vtkm::rendering::Actor(outputData.GetCellSet(),
|
||||
outputData.GetCoordinateSystem(),
|
||||
outputData.GetField(fieldName),
|
||||
colorTable));
|
||||
vtkm::rendering::View3D view(scene, mapper, canvas, camera, bg);
|
||||
view.Paint();
|
||||
view.SaveAs("demo_output.png");
|
||||
vtkm::rendering::View3D view(scene, MapperVolume(), canvas, camera, bg);
|
||||
view.Paint();
|
||||
view.SaveAs("volume.png");
|
||||
|
||||
// Compute an isosurface:
|
||||
vtkm::filter::contour::Contour filter;
|
||||
// [min, max] of the tangle field is [-0.887, 24.46]:
|
||||
filter.SetIsoValue(3.0);
|
||||
filter.SetActiveField(fieldName);
|
||||
vtkm::cont::DataSet isoData = filter.Execute(tangleData);
|
||||
// Render a separate image with the output isosurface
|
||||
vtkm::rendering::Actor isoActor(
|
||||
isoData.GetCellSet(), isoData.GetCoordinateSystem(), isoData.GetField(fieldName), colorTable);
|
||||
// By default, the actor will automatically scale the scalar range of the color table to match
|
||||
// that of the data. However, we are coloring by the scalar that we just extracted a contour
|
||||
// from, so we want the scalar range to match that of the previous image.
|
||||
isoActor.SetScalarRange(actor.GetScalarRange());
|
||||
vtkm::rendering::Scene isoScene;
|
||||
isoScene.AddActor(isoActor);
|
||||
|
||||
// Wireframe surface:
|
||||
vtkm::rendering::View3D isoView(isoScene, MapperWireframer(), canvas, camera, bg);
|
||||
isoView.Paint();
|
||||
isoView.SaveAs("isosurface_wireframer.png");
|
||||
|
||||
// Smooth surface:
|
||||
vtkm::rendering::View3D solidView(isoScene, MapperRayTracer(), canvas, camera, bg);
|
||||
solidView.Paint();
|
||||
solidView.SaveAs("isosurface_raytracer.png");
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
A minimal CMakeLists.txt such as the following one can be used to build this
|
||||
example.
|
||||
|
||||
```CMake
|
||||
project(example)
|
||||
cmake_minimum_required(VERSION 3.12...3.15 FATAL_ERROR)
|
||||
project(VTKmDemo CXX)
|
||||
|
||||
set(VTKm_DIR "/somepath/lib/cmake/vtkm-XYZ")
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
find_package(VTKm REQUIRED)
|
||||
|
||||
add_executable(example example.cxx)
|
||||
target_link_libraries(example vtkm_cont vtkm_rendering)
|
||||
if(TARGET vtkm::rendering)
|
||||
add_executable(Demo Demo.cxx)
|
||||
target_link_libraries(Demo PRIVATE vtkm::filter vtkm::rendering vtkm::source)
|
||||
endif()
|
||||
```
|
||||
|
||||
## License ##
|
||||
@ -229,11 +262,11 @@ See [LICENSE.txt](LICENSE.txt) for details.
|
||||
[VTK-m Coding Conventions]: docs/CodingConventions.md
|
||||
[VTK-m Doxygen latest]: https://docs-m.vtk.org/latest/index.html
|
||||
[VTK-m Doxygen nightly]: https://docs-m.vtk.org/nightly/
|
||||
[VTK-m download page]: http://m.vtk.org/index.php/VTK-m_Releases
|
||||
[VTK-m download page]: https://gitlab.kitware.com/vtk/vtk-m/-/releases
|
||||
[VTK-m git repository]: https://gitlab.kitware.com/vtk/vtk-m/
|
||||
[VTK-m Issue Tracker]: https://gitlab.kitware.com/vtk/vtk-m/-/issues
|
||||
[VTK-m Overview]: http://m.vtk.org/images/2/29/VTKmVis2016.pptx
|
||||
[VTK-m Users Guide]: http://m.vtk.org/images/c/c8/VTKmUsersGuide.pdf
|
||||
[VTK-m Users Guide]: https://gitlab.kitware.com/vtk/vtk-m-user-guide/-/wikis/home
|
||||
[VTK-m users email list]: http://vtk.org/mailman/listinfo/vtkm
|
||||
[VTK-m Wiki]: http://m.vtk.org/
|
||||
[VTK-m Tutorial]: http://m.vtk.org/index.php/Tutorial
|
||||
|
377
docs/changelog/2.0/release-notes.md
Normal file
377
docs/changelog/2.0/release-notes.md
Normal file
@ -0,0 +1,377 @@
|
||||
VTK-m 2.0 Release Notes
|
||||
=======================
|
||||
|
||||
# Table of Contents
|
||||
|
||||
1. [Core](#Core)
|
||||
- Added modules to the build system
|
||||
- Remove deprecated features from VTK-m
|
||||
2. [ArrayHandle](#ArrayHandle)
|
||||
- Support providing a Token to ReadPortal and WritePortal
|
||||
3. [Control Environment](#Control-Environment)
|
||||
- Coordinate systems are stored as Fields
|
||||
- Check to make sure that the fields in a DataSet are the proper length
|
||||
- Change name of method to set the cell ghost levels in a DataSet
|
||||
- Automatically make the fields with the global cell ghosts the cell ghosts
|
||||
- Particle class members are hidden
|
||||
- Allow FieldSelection to simultaneously include and exclude fields
|
||||
- New partitioned cell locator class
|
||||
- Fix reading global ids of permuted cells
|
||||
- Setting source parameters is more clear
|
||||
- Attach compressed ZFP data as WholeDataSet field
|
||||
4. [Execution Environment](#Execution-Environment)
|
||||
- Removed ExecutionWholeArray class
|
||||
5. [Worklets and Filters](#Worklets-and-Filters)
|
||||
- Correct particle density filter output field
|
||||
- Rename NewFilter base classes to Filter
|
||||
- Fix handling of cell fields in Tube filter
|
||||
6. [Build](#Build)
|
||||
- More performance test options
|
||||
- Output complete list of libraries for external Makefiles
|
||||
- VTK-m namespace for its exported CMake targets
|
||||
7. [Other](#Other)
|
||||
- Expose the Variant helper class
|
||||
- Fix VTKM_LOG_SCOPE
|
||||
|
||||
# Core
|
||||
|
||||
## Added modules to the build system
|
||||
|
||||
VTK-m libraries and other targets can now be built as modules. The
|
||||
advantage of modules is that you can selectively choose which
|
||||
modules/libraries will be built. This makes it easy to create a more
|
||||
stripped down compile of VTK-m. For example, you might want a reduced set
|
||||
of libraries to save memory or you might want to turn off certain libraries
|
||||
to save compile time.
|
||||
|
||||
The module system will automatically determine dependencies among the
|
||||
modules. It is capable of weakly turning off a module where it will still
|
||||
be compiled if needed. Likewise, it is capable of weakly turning on a
|
||||
module where the build will still work if it cannot be created.
|
||||
|
||||
The use of modules is described in the `Modules.md` file in the `docs`
|
||||
directory of the VTK-m source.
|
||||
|
||||
## Remove deprecated features from VTK-m
|
||||
|
||||
With the major revision 2.0 of VTK-m, many items previously marked as
|
||||
deprecated were removed. If updating to a new version of VTK-m, it is
|
||||
recommended to first update to VTK-m 1.9, which will include the deprecated
|
||||
features but provide warnings (with the right compiler) that will point to
|
||||
the replacement code. Once the deprecations have been fixed, updating to
|
||||
2.0 should be smoother.
|
||||
|
||||
# ArrayHandle
|
||||
|
||||
## Support providing a Token to ReadPortal and WritePortal
|
||||
|
||||
When managing portals in the execution environment, `ArrayHandle` uses the
|
||||
`Token` object to ensure that the memory associated with a portal exists
|
||||
for the length of time that it is needed. This is done by creating the
|
||||
portal with a `Token` object, and the associated portal objects are
|
||||
guaranteed to be valid while that `Token` object exists. This is supported
|
||||
by essentially locking the array from further changes.
|
||||
|
||||
`Token` objects are typically used when creating a control-side portal with
|
||||
the `ReadPortal` or `WritePortal`. This is not to say that a `Token` would
|
||||
not be useful; a control-side portal going out of scope is definitely a
|
||||
problem. But the creation and destruction of portals in the control
|
||||
environment is generally too much work for the possible benefits.
|
||||
|
||||
However, under certain circumstances it could be useful to use a `Token` to
|
||||
get a control-side portal. For example, if the `PrepareForExecution` method
|
||||
of an `ExecutionObjectBase` needs to fill a small `ArrayHandle` on the
|
||||
control side to pass to the execution side, it would be better to use the
|
||||
provided `Token` object when doing so. This change allows you to optionally
|
||||
provide that `Token` when creating these control-side portals.
|
||||
|
||||
# Control Environment
|
||||
|
||||
## Coordinate systems are stored as Fields
|
||||
|
||||
Previously, `DataSet` managed `CoordinateSystem`s separately from `Field`s.
|
||||
However, a `CoordinateSystem` is really just a `Field` with some special
|
||||
attributes. Thus, coordinate systems are now just listed along with the
|
||||
rest of the fields, and the coordinate systems are simply strings that
|
||||
point back to the appropriate field. (This was actually the original
|
||||
concept for `DataSet`, but the coordinate systems were separated from
|
||||
fields for some now obsolete reasons.)
|
||||
|
||||
This change should not be very noticeable, but there are a few consequences
|
||||
that should be noted.
|
||||
|
||||
1. The `GetCoordinateSystem` methods no longer return a reference to a
|
||||
`CoordinateSystem` object. This is because the `CoordinateSystem` object
|
||||
is made on the fly from the field.
|
||||
2. When mapping fields in filters, the coordinate systems get mapped as
|
||||
part of this process. This has allowed us to remove some of the special
|
||||
cases needed to set the coordinate system in the output.
|
||||
3. If a filter is generating a coordinate system in a special way
|
||||
(different than mapping other point fields), then it can use the special
|
||||
`CreateResultCoordinateSystem` method to attach this custom coordinate
|
||||
system to the output.
|
||||
4. The `DataSet::GetCoordinateSystems()` method to get a `vector<>` of all
|
||||
coordinate systems is removed. `DataSet` no longer internally has this
|
||||
structure. Although it could be built, the only reason for its existence
|
||||
was to support passing coordinate systems in filters. Now that this is
|
||||
done automatically, the method is no longer needed.
|
||||
|
||||
## Check to make sure that the fields in a DataSet are the proper length
|
||||
|
||||
It is possible in a `DataSet` to add a point field (or coordinate system)
|
||||
that has a different number of points than reported in the cell set.
|
||||
Likewise for the number of cells in cell fields. This is very bad practice
|
||||
because it is likely to lead to crashes in worklets that are expecting
|
||||
arrays of an appropriate length.
|
||||
|
||||
Although `DataSet` will still allow this, a warning will be added to the
|
||||
VTK-m logging to alert users of the inconsistency introduced into the
|
||||
`DataSet`. Since warnings are by default printed to standard error, users
|
||||
are likely to see it.
|
||||
|
||||
## Change name of method to set the cell ghost levels in a DataSet
|
||||
|
||||
Previously, the method was named `AddGhostCellField`. However, only one
|
||||
ghost cell field can be marked at a time, so `SetGhostCellField` is more
|
||||
appropriate.
|
||||
|
||||
## Automatically make the fields with the global cell ghosts the cell ghosts
|
||||
|
||||
Previously, if you added a cell field to a `DataSet` with a name that was
|
||||
the same as that returned from `GetGlobalCellFieldName`, it was still only
|
||||
recognized as a normal field. Now, that field is automatically recognized
|
||||
as the cell ghost levels (unless the global cell field name is changed or
|
||||
a different field is explicitly set as the cell ghost levels).
|
||||
|
||||
## Particle class members are hidden
|
||||
|
||||
The member variables of the `vtkm::Particle` classes are now hidden. This
|
||||
means that external code will not be directly able to access member
|
||||
variables like `Pos`, `Time`, and `ID`. Instead, these need to be retrieved
|
||||
and changed through accessor methods.
|
||||
|
||||
This follows standard C++ principles. It also helps us future-proof the
|
||||
classes. It means that we can provide subclasses or alternate forms of
|
||||
`Particle` that operate differently. It also makes it possible to change
|
||||
interfaces while maintaining a deprecated interface.
|
||||
|
||||
## Allow FieldSelection to simultaneously include and exclude fields
|
||||
|
||||
The basic use of `FieldSelection` is to construct the class with a mode
|
||||
(`None`, `Any`, `Select`, `Exclude`), and then specify particular fields
|
||||
based off of this mode. This works fine for basic uses where the same code
|
||||
that constructs a `FieldSelection` sets all the fields.
|
||||
|
||||
But what happens, for example, if you have code that takes an existing
|
||||
`FieldSelection` and wants to exclude the field named `foo`? If the
|
||||
`FieldSelection` mode happens to be anything other than `Exclude`, the code
|
||||
would have to go through several hoops to construct a new `FieldSelection`
|
||||
object with this modified selection.
|
||||
|
||||
To make this case easier, `FieldSelection` now has the ability to specify
|
||||
the mode independently for each field. The `AddField` method now has an
|
||||
optional mode argument the specifies whether the mode for that field should
|
||||
be `Select` or `Exclude`.
|
||||
|
||||
In the example above, the code can simply add the `foo` field with the
|
||||
`Exclude` mode. Regardless of whatever state the `FieldSelection` was in
|
||||
before, it will now report the `foo` field as not selected.
|
||||
|
||||
## New partitioned cell locator class
|
||||
|
||||
A new version of a locator, `CellLocatorParitioned`, is now available. This version of a
|
||||
locator takes a `PartitionedDataSet` and builds a structure that will find the partition Ids and
|
||||
cell Ids for the input array of locations. It runs CellLocatorGeneral for each partition. We
|
||||
expect multiple hits and only return the first one (lowest partition Id) where the detected cell
|
||||
is of type REGULAR (no ghost, not blanked) in the vtkGhostType array. If this array does not
|
||||
exist in a partition, we assume that all cells are regular.
|
||||
|
||||
vtkm::cont::CellLocatorPartitioned produces an Arrayhandle of the size of the number of
|
||||
partitions filled with the execution objects of CellLocatorGeneral. It further produces an
|
||||
Arrayhandle filled with the ReadPortals of the vtkGhost arrays to then select the non-blanked
|
||||
cells from the potentially multiple detected cells on the different partitions. Its counterpart
|
||||
on the exec side, vtkm::exec::CellLocatorPartitioned, contains the actual FindCell function.
|
||||
|
||||
## Fix reading global ids of permuted cells
|
||||
|
||||
The legacy VTK reader sometimes has to permute cell data because some VTK
|
||||
cells are not directly supported in VTK-m. (For example, triangle strips
|
||||
are not supported. They have to be converted to triangles.)
|
||||
|
||||
The global and pedigree identifiers were not properly getting permuted.
|
||||
This is now fixed.
|
||||
|
||||
## Setting source parameters is more clear
|
||||
|
||||
Originally, most of the sources used constructor parameters to set the
|
||||
various options of the source. Although convenient, it was difficult to
|
||||
keep track of what each parameter meant. To make the code more clear,
|
||||
source parameters are now set with accessor functions (e.g.
|
||||
`SetPointDimensions`). Although this makes code more verbose, it helps
|
||||
prevent mistakes and makes the changes more resilient to future changes.
|
||||
|
||||
## Attach compressed ZFP data as WholeDataSet field
|
||||
|
||||
Previously, point fields compressed by ZFP were attached as point fields
|
||||
on the output. However, using them as a point field would cause
|
||||
problems. So, instead attache them as `WholeDataSet` fields.
|
||||
|
||||
Also fixed a problem where the 1D decompressor created an output of the
|
||||
wrong size.
|
||||
|
||||
# Execution Environment
|
||||
|
||||
## Removed ExecutionWholeArray class
|
||||
|
||||
`ExecutionWholeArray` is an archaic class in VTK-m that is a thin wrapper
|
||||
around an array portal. In the early days of VTK-m, this class was used to
|
||||
transfer whole arrays to the execution environment. However, now the
|
||||
supported method is to use `WholeArray*` tags in the `ControlSignature` of
|
||||
a worklet.
|
||||
|
||||
Nevertheless, the `WholeArray*` tags caused the array portal transferred to
|
||||
the worklet to be wrapped inside of an `ExecutionWholeArray` class. This
|
||||
is unnecessary and can cause confusion about the types of data being used.
|
||||
|
||||
Most code is unaffected by this change. Some code that had to work around
|
||||
the issue of the portal wrapped in another class used the `GetPortal`
|
||||
method which is no longer needed (for obvious reasons). One extra feature
|
||||
that `ExecutionWholeArray` had was that it provided an subscript operator
|
||||
(somewhat incorrectly). Thus, any use of '[..]' to index the array portal
|
||||
have to be changed to use the `Get` method.
|
||||
|
||||
# Worklets and Filters
|
||||
|
||||
## Correct particle density filter output field
|
||||
|
||||
The field being created by `ParticleDensityNearestGridPoint` was supposed
|
||||
to be associated with cells, but it was sized to the number of points.
|
||||
Although the number of points will always be more than the number of cells
|
||||
(so the array will be big enough), having inappropriately sized arrays can
|
||||
cause further problems downstream.
|
||||
|
||||
## Rename NewFilter base classes to Filter
|
||||
|
||||
During the VTK-m 1.8 and 1.9 development, the filter infrastructure was
|
||||
overhauled. Part of this created a completely new set of base classes. To
|
||||
avoid confusion with the original filter base classes and ease transition,
|
||||
the new filter base classes were named `NewFilter*`. Eventually after all
|
||||
filters were transitioned, the old filter base classes were deprecated.
|
||||
|
||||
With the release of VTK-m 2.0, the old filter base classes are removed. The
|
||||
"new" filter base classes are no longer new. Thus, they have been renamed
|
||||
simply `Filter` (and `FilterField`).
|
||||
|
||||
## Fix handling of cell fields in Tube filter
|
||||
|
||||
The `Tube` filter wraps a tube of polygons around poly line cells.
|
||||
During this process it had a strange (and wrong) handling of cell data.
|
||||
It assumed that each line had an independent field entry for each
|
||||
segment of each line. It thus had lots of extra code to find the length
|
||||
and offsets of the segment data in the cell data.
|
||||
|
||||
This is simply not how cell fields work in VTK-m. In VTK-m, each cell
|
||||
has exactly one entry in the cell field array. Even if a polyline has
|
||||
100 segments, it only gets one cell field value. This behavior is
|
||||
consistent with how VTK treats cell field arrays.
|
||||
|
||||
The behavior the `Tube` filter was trying to implement was closer to an
|
||||
"edge" field. However, edge fields are currently not supported in VTK-m.
|
||||
The proper implementation would be to add edge fields to VTK-m. (This
|
||||
would also get around some problems with the implementation that was
|
||||
removed here when mixing polylines with other cell types and degenerate
|
||||
lines.)
|
||||
|
||||
# Build
|
||||
|
||||
## More performance test options
|
||||
|
||||
More options are available for adding performance regression tests. These
|
||||
options allow you to pass custom options to the benchmark test so that you
|
||||
are not limited to the default values. They also allow multiple tests to be
|
||||
created from the same benchmark executable. Separating out the benchmarks
|
||||
allows the null hypothesis testing to better catch performance problems
|
||||
when only one of the tested filters regresses. It also allows passing
|
||||
different arguments to different benchmarks.
|
||||
|
||||
## Output complete list of libraries for external Makefiles
|
||||
|
||||
There is a Makefile include, `vtkm_config.mk`, and a package include,
|
||||
`vtkm.pc`, that are configured so that external programs that do not use
|
||||
CMake have a way of importing VTK-m's configuration. However, the set of
|
||||
libraries was hardcoded. In particular, many of the new filter libraries
|
||||
were missing.
|
||||
|
||||
Rather than try to maintain this list manually, the new module mechanism
|
||||
in the CMake configuration is used to get a list of libraries built and
|
||||
automatically build these lists.
|
||||
|
||||
## VTK-m namespace for its exported CMake targets
|
||||
|
||||
VTK-m exported CMake targets are now prefixed with the `vtkm::` namespace.
|
||||
|
||||
### What it means for VTK-m users
|
||||
|
||||
VTK-m users will now need to prepend a `vtkm::` prefix when they refer to a
|
||||
VTK-m CMake target in their projects as shown below:
|
||||
|
||||
```
|
||||
add_executable(example example.cxx)
|
||||
## Before:
|
||||
target_link_libraries(example vtkm_cont vtkm_rendering)
|
||||
## Now:
|
||||
target_link_libraries(example vtkm::cont vtkm::rendering)
|
||||
```
|
||||
|
||||
For compatibility purposes we still provide additional exported targets with the
|
||||
previous naming scheme, in the form of `vtkm_TARGET`, when VTK-m is found
|
||||
using:
|
||||
|
||||
```
|
||||
## With any version less than 2.0
|
||||
find_package(VTK-m 1.9)
|
||||
|
||||
add_executable(example example.cxx)
|
||||
## This is still valid
|
||||
target_link_libraries(example vtkm_cont vtkm_rendering)
|
||||
```
|
||||
|
||||
Use with care since we might remove those targets in future releases.
|
||||
|
||||
### What it means for VTK-m developers
|
||||
|
||||
While VTK-m exported targets are now prefixed with the `vtkm::` prefix, internal
|
||||
target names are still in the form of `vtkm_TARGET`.
|
||||
|
||||
To perform this name transformation in VTK-m targets a new CMake function has
|
||||
been provided that decorates the canonical `install` routine. Use this functions
|
||||
instead of `install` when creating new `VTK-m` targets, further information can
|
||||
be found at the `vtkm_install_targets` function header at
|
||||
`CMake/VTKmWrappers.cmake`.
|
||||
|
||||
# Other
|
||||
|
||||
## Expose the Variant helper class
|
||||
|
||||
For several versions, VTK-m has had a `Variant` templated class. This acts
|
||||
like a templated union where the object will store one of a list of types
|
||||
specified as the template arguments. (There are actually 2 versions for the
|
||||
control and execution environments, respectively.)
|
||||
|
||||
Because this is a complex class that required several iterations to work
|
||||
through performance and compiler issues, `Variant` was placed in the
|
||||
`internal` namespace to avoid complications with backward compatibility.
|
||||
However, the class has been stable for a while, so let us expose this
|
||||
helpful tool for wider use.
|
||||
|
||||
## Fix VTKM_LOG_SCOPE
|
||||
|
||||
The `VTKM_LOG_SCOPE` macro was not working as intended. It was supposed to
|
||||
print a log message immediately and then print a second log message when
|
||||
leaving the scope along with the number of seconds that elapsed between the
|
||||
two messages.
|
||||
|
||||
This was not what was happening. The second log message was being printed
|
||||
immediately after the first. This is because the scope was taken inside of
|
||||
the `LogScope` method. The macro has been rewritten to put the tracking in
|
||||
the right scope.
|
@ -1,9 +0,0 @@
|
||||
# More performance test options
|
||||
|
||||
More options are available for adding performance regression tests. These
|
||||
options allow you to pass custom options to the benchmark test so that you
|
||||
are not limited to the default values. They also allow multiple tests to be
|
||||
created from the same benchmark executable. Separating out the benchmarks
|
||||
allows the null hypothesis testing to better catch performance problems
|
||||
when only one of the tested filters regresses. It also allows passing
|
||||
different arguments to different benchmarks.
|
@ -1,16 +0,0 @@
|
||||
# Added modules to the build system
|
||||
|
||||
VTK-m libraries and other targets can now be built as modules. The
|
||||
advantage of modules is that you can selectively choose which
|
||||
modules/libraries will be built. This makes it easy to create a more
|
||||
stripped down compile of VTK-m. For example, you might want a reduced set
|
||||
of libraries to save memory or you might want to turn off certain libraries
|
||||
to save compile time.
|
||||
|
||||
The module system will automatically determine dependencies among the
|
||||
modules. It is capable of weakly turning off a module where it will still
|
||||
be compiled if needed. Likewise, it is capabile of weakly turning on a
|
||||
module where the build will still work if it cannot be created.
|
||||
|
||||
The use of modules is described in the `Modules.md` file in the `docs`
|
||||
directory of the VTK-m source.
|
@ -1,21 +0,0 @@
|
||||
# Support providing a Token to ReadPortal and WritePortal
|
||||
|
||||
When managing portals in the execution environment, `ArrayHandle` uses the
|
||||
`Token` object to ensure that the memory associated with a portal exists
|
||||
for the length of time that it is needed. This is done by creating the
|
||||
portal with a `Token` object, and the associated portal objects are
|
||||
guaranteed to be valid while that `Token` object exists. This is supported
|
||||
by essentially locking the array from further changes.
|
||||
|
||||
`Token` objects are typically used when creating a control-side portal with
|
||||
the `ReadPortal` or `WritePortal`. This is not to say that a `Token` would
|
||||
not be useful; a control-side portal going out of scope is definitely a
|
||||
problem. But the creation and distruction of portals in the control
|
||||
environment is generally too much work for the possible benefits.
|
||||
|
||||
However, under certain circumstances it could be useful to use a `Token` to
|
||||
get a control-side portal. For example, if the `PrepareForExecution` method
|
||||
of an `ExecutionObjectBase` needs to fill a small `ArrayHandle` on the
|
||||
control side to pass to the execution side, it would be better to use the
|
||||
provided `Token` object when doing so. This change allows you to optionally
|
||||
provide that `Token` when creating these control-side portals.
|
@ -1,29 +0,0 @@
|
||||
# Coordiante systems are stored as Fields
|
||||
|
||||
Previously, `DataSet` managed `CoordinateSystem`s separately from `Field`s.
|
||||
However, a `CoordinateSystem` is really just a `Field` with some special
|
||||
attributes. Thus, coordiante systems are now just listed along with the
|
||||
rest of the fields, and the coordinate systems are simply strings that
|
||||
point back to the appropriate field. (This was actually the original
|
||||
concept for `DataSet`, but the coordinate systems were separated from
|
||||
fields for some now obsolete reasons.)
|
||||
|
||||
This change should not be very noticible, but there are a few consequences
|
||||
that should be noted.
|
||||
|
||||
1. The `GetCoordinateSystem` methods no longer return a reference to a
|
||||
`CoordinateSystem` object. This is because the `CoordinateSystem` object
|
||||
is made on the fly from the field.
|
||||
2. When mapping fields in filters, the coordinate systems get mapped as
|
||||
part of this process. This has allowed us to remove some of the special
|
||||
cases needed to set the coordinate system in the output.
|
||||
3. If a filter is generating a coordinate system in a special way
|
||||
(different than mapping other point fields), then it can use the special
|
||||
`CreateResultCoordianteSystem` method to attach this custom coordinate
|
||||
system to the output.
|
||||
4. The `DataSet::GetCoordianteSystems()` method to get a `vector<>` of all
|
||||
coordiante systems is removed. `DataSet` no longer internally has this
|
||||
structure. Although it could be built, the only reason for its existance
|
||||
was to support passing coordinate systems in filters. Now that this is
|
||||
done autmoatically, the method is no longer needed.
|
||||
|
@ -1,7 +0,0 @@
|
||||
# Delete deprecated features
|
||||
|
||||
With the major release of VTK-m 2.0, we are cleaning up the code by
|
||||
removing deprecated features. For software using VTK-m 1.9, you should have
|
||||
gotten deprecation warnings about any feature that is removed. Thus, to
|
||||
ease porting to VTK-m 2.0, software should consider updating to VTK-m 1.9
|
||||
first.
|
@ -1,12 +0,0 @@
|
||||
# Expose the Variant helper class
|
||||
|
||||
For several versions, VTK-m has had a `Variant` templated class. This acts
|
||||
like a templated union where the object will store one of a list of types
|
||||
specified as the template arguments. (There are actually 2 versions for the
|
||||
control and execution environments, respectively.)
|
||||
|
||||
Because this is a complex class that required several iterations to work
|
||||
through performance and compiler issues, `Variant` was placed in the
|
||||
`internal` namespace to avoid complications with backward compatibility.
|
||||
However, the class has been stable for a while, so let us expose this
|
||||
helpful tool for wider use.
|
@ -1,11 +0,0 @@
|
||||
# Output complete list of libraries for external Makefiles
|
||||
|
||||
There is a Makefile include, `vtkm_config.mk`, and a package include,
|
||||
`vtkm.pc`, that are configured so that external programs that do not use
|
||||
CMake have a way of importing VTK-m's configuration. However, the set of
|
||||
libraries was hardcoded. In particular, many of the new filter libraries
|
||||
were missing.
|
||||
|
||||
Rather than try to maintain this list manually, the new module mechanism
|
||||
in the CMake configuration is used to get a list of libraries built and
|
||||
automatically build these lists.
|
@ -1,12 +0,0 @@
|
||||
# Check to make sure that the fields in a DataSet are the proper length
|
||||
|
||||
It is possible in a `DataSet` to add a point field (or coordinate system)
|
||||
that has a different number of points than reported in the cell set.
|
||||
Likewise for the number of cells in cell fields. This is very bad practice
|
||||
because it is likely to lead to crashes in worklets that are expecting
|
||||
arrays of an appropriate length.
|
||||
|
||||
Although `DataSet` will still allow this, a warning will be added to the
|
||||
VTK-m logging to alert users of the inconsistency introduced into the
|
||||
`DataSet`. Since warnings are by default printed to standard error, users
|
||||
are likely to see it.
|
@ -1,11 +0,0 @@
|
||||
# Fix VTKM_LOG_SCOPE
|
||||
|
||||
The `VTKM_LOG_SCOPE` macro was not working as intended. It was supposed to
|
||||
print a log message immediately and then print a second log message when
|
||||
leaving the scope along with the number of seconds that elapsed between the
|
||||
two messages.
|
||||
|
||||
This was not what was happening. The second log message was being printed
|
||||
immediately after the first. This is because the scope was taken inside of
|
||||
the `LogScope` method. The macro has been rewritten to put the tracking in
|
||||
the right scope.
|
@ -1,5 +0,0 @@
|
||||
# Change name of method to set the cell ghost levels in a DataSet
|
||||
|
||||
Previously, the method was named `AddGhostCellField`. However, only one
|
||||
ghost cell field can be marked at a time, so `SetGhostCellField` is more
|
||||
appropriate.
|
@ -1,7 +0,0 @@
|
||||
# Automatically make the fields with the global cell ghosts the cell ghosts
|
||||
|
||||
Previously, if you added a cell field to a `DataSet` with a name that was
|
||||
the same as that returned from `GetGlobalCellFieldName`, it was still only
|
||||
recognized as a normal field. Now, that field is automatically recognized
|
||||
as a the cell ghost levels (unless the global cell field name is changed or
|
||||
a different field is explicitly set as the cell ghost levels).
|
@ -1,21 +0,0 @@
|
||||
# Allow FieldSelection to simultaneously include and exclude fields
|
||||
|
||||
The basic use of `FieldSelection` is to construct the class with a mode
|
||||
(`None`, `Any`, `Select`, `Exclude`), and then specify particular fields
|
||||
based off of this mode. This works fine for basic uses where the same code
|
||||
that constructs a `FieldSelection` sets all the fields.
|
||||
|
||||
But what happens, for example, if you have code that takes an existing
|
||||
`FieldSelection` and wants to exclude the field named `foo`? If the
|
||||
`FieldSelection` mode happens to be anything other than `Exclude`, the code
|
||||
would have to go through several hoops to construct a new `FieldSelection`
|
||||
object with this modified selection.
|
||||
|
||||
To make this case easier, `FieldSelection` now has the ability to specify
|
||||
the mode independently for each field. The `AddField` method now has an
|
||||
optional mode argument the specifies whether the mode for that field should
|
||||
be `Select` or `Exclude`.
|
||||
|
||||
In the example above, the code can simply add the `foo` field with the
|
||||
`Exclude` mode. Regardless of whatever state the `FieldSelection` was in
|
||||
before, it will now report the `foo` field as not selected.
|
@ -1,18 +0,0 @@
|
||||
# Removed ExecutionWholeArray class
|
||||
|
||||
`ExecutionWholeArray` is an archaic class in VTK-m that is a thin wrapper
|
||||
around an array portal. In the early days of VTK-m, this class was used to
|
||||
transfer whole arrays to the execution environment. However, now the
|
||||
supported method is to use `WholeArray*` tags in the `ControlSignature` of
|
||||
a worklet.
|
||||
|
||||
Nevertheless, the `WholeArray*` tags caused the array portal transferred to
|
||||
the worklet to be wrapped inside of an `ExecutionWholeArray` class. This
|
||||
is unnecessary and can cause confusion about the types of data being used.
|
||||
|
||||
Most code is unaffected by this change. Some code that had to work around
|
||||
the issue of the portal wrapped in another class used the `GetPortal`
|
||||
method which is no longer needed (for obvious reasons). One extra feature
|
||||
that `ExecutionWholeArray` had was that it provided an subscript operator
|
||||
(somewhat incorrectly). Thus, any use of '[..]' to index the array portal
|
||||
have to be changed to use the `Get` method.
|
@ -1,7 +0,0 @@
|
||||
# Correct particle density filter output field
|
||||
|
||||
The field being created by `ParticleDensityNearestGridPoint` was supposed
|
||||
to be associated with cells, but it was sized to the number of points.
|
||||
Although the number of points will always be more than the number of cells
|
||||
(so the array will be big enough), having inappropriately sized arrays can
|
||||
cause further problems downstream.
|
@ -1,14 +0,0 @@
|
||||
# New partitioned cell locator class
|
||||
|
||||
A new version of a locator, `CellLocatorParitioned`, is now available. This version of a
|
||||
locator takes a `PartitionedDataSet` and builds a structure that will find the partition Ids and
|
||||
cell Ids for the input array of locations. It runs CellLocatorGeneral for each partition. We
|
||||
expect multiple hits and only return the first one (lowest partition Id) where the detected cell
|
||||
is of type REGULAR (no ghost, not blanked) in the vtkGhostType array. If this array does not
|
||||
exist in a partition, we assume that all cells are regular.
|
||||
|
||||
vtkm::cont::CellLocatorPartitioned produces an Arrayhandle of the size of the number of
|
||||
partitions filled with the execution objects of CellLocatorGeneral. It further produces an
|
||||
Arrayhandle filled with the ReadPortals of the vtkGhost arrays to then select the non-blanked
|
||||
cells from the potentially multiple detected cells on the different partitions. Its counterpart
|
||||
on the exec side, vtkm::exec::CellLocatorPartitioned, contains the actual FindCell function.
|
@ -1,8 +0,0 @@
|
||||
# Fix reading global ids of permuted cells
|
||||
|
||||
The legacy VTK reader sometimes has to permute cell data because some VTK
|
||||
cells are not directly supported in VTK-m. (For example, triangle strips
|
||||
are not supported. They have to be converted to triangles.)
|
||||
|
||||
The global and petigree identifiers were not properly getting permuted.
|
||||
This is now fixed.
|
@ -1,8 +0,0 @@
|
||||
# Remove deprecated features from VTK-m
|
||||
|
||||
With the major revision 2.0 of VTK-m, many items previously marked as
|
||||
deprecated were removed. If updating to a new version of VTK-m, it is
|
||||
recommended to first update to VTK-m 1.9, which will include the deprecated
|
||||
features but provide warnings (with the right compiler) that will point to
|
||||
the replacement code. Once the deprecations have been fixed, updating to
|
||||
2.0 should be smoother.
|
@ -1,11 +0,0 @@
|
||||
# Rename NewFilter base classes to Filter
|
||||
|
||||
During the VTK-m 1.8 and 1.9 development, the filter infrastructure was
|
||||
overhauled. Part of this created a completely new set of base classes. To
|
||||
avoid confusion with the original filter base classes and ease transition,
|
||||
the new filter base classes were named `NewFilter*`. Eventually after all
|
||||
filters were transitioned, the old filter base classes were deprecated.
|
||||
|
||||
With the release of VTK-m 2.0, the old filter base classes are removed. The
|
||||
"new" filter base classes are no longer new. Thus, they have been renamed
|
||||
simply `Filter` (and `FilterField`).
|
@ -1,8 +0,0 @@
|
||||
# Setting source parameters is more clear
|
||||
|
||||
Originally, most of the sources used constructor parameters to set the
|
||||
various options of the source. Although convenient, it was difficult to
|
||||
keep track of what each parameter meant. To make the code more clear,
|
||||
source parameters are now set with accessor functions (e.g.
|
||||
`SetPointDimensions`). Although this makes code more verbose, it helps
|
||||
prevent mistakes and makes the changes more resilient to future changes.
|
@ -1,19 +0,0 @@
|
||||
# Fix handling of cell fields in Tube filter
|
||||
|
||||
The `Tube` filter wraps a tube of polygons around poly line cells.
|
||||
During this process it had a strange (and wrong) handling of cell data.
|
||||
It assumed that each line had an independent field entry for each
|
||||
segment of each line. It thus had lots of extra code to find the length
|
||||
and offsets of the segment data in the cell data.
|
||||
|
||||
This is simply not how cell fields work in VTK-m. In VTK-m, each cell
|
||||
has exactly one entry in the cell field array. Even if a polyline has
|
||||
100 segments, it only gets one cell field value. This behavior is
|
||||
consistent with how VTK treats cell field arrays.
|
||||
|
||||
The behavior the `Tube` filter was trying to implement was closer to an
|
||||
"edge" field. However, edge fields are currently not supported in VTK-m.
|
||||
The proper implementation would be to add edge fields to VTK-m. (This
|
||||
would also get around some problems with the implementation that was
|
||||
removed here when mixing polylines with other cell types and degenerate
|
||||
lines.)
|
@ -1,8 +0,0 @@
|
||||
# Attach compressed ZFP data as WholeDatSet field
|
||||
|
||||
Previously, point fields compressed by ZFP were attached as point fields
|
||||
on the output. However, using them as a point field would cause
|
||||
problems. So, instead attache them as `WholeDataSet` fields.
|
||||
|
||||
Also fixed a problem where the 1D decompressor created an output of the
|
||||
wrong size.
|
@ -8,10 +8,27 @@
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##============================================================================
|
||||
|
||||
#add the directory that contains the VTK-m config file to the cmake
|
||||
#path so that our examples can find VTK-m
|
||||
|
||||
if(VTKm_ENABLE_EXAMPLES)
|
||||
# VTKm examples expects vtkm libraries to be namespaced with the prefix vtkm::.
|
||||
# However as the examples are also built as just another part of the VTK-m code
|
||||
# those prefix are not added to the targets (This happens during the
|
||||
# installation). To workaround this issue here, we create IMPORTED libs linking
|
||||
# to the vtkm libraries used by the examples with expected the vtkm:: prefix.
|
||||
vtkm_module_get_list(module_list)
|
||||
foreach(tgt IN LISTS module_list)
|
||||
if(TARGET ${tgt})
|
||||
# The reason of creating this phony IMPORTED libraries instead of making
|
||||
# ALIAS libraries is that ALIAS libraries are GLOBAL whereas IMPORTED are
|
||||
# local at the directory level where they are created. We do not want these
|
||||
# phony targets to be visible outside of the example directory.
|
||||
vtkm_target_mangle(tgt_name_mangled ${tgt})
|
||||
add_library("vtkm::${tgt_name_mangled}" INTERFACE IMPORTED)
|
||||
target_link_libraries("vtkm::${tgt_name_mangled}" INTERFACE ${tgt})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#add the directory that contains the VTK-m config file to the cmake
|
||||
#path so that our examples can find VTK-m
|
||||
set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR})
|
||||
add_subdirectory(clipping)
|
||||
add_subdirectory(contour_tree)
|
||||
|
@ -13,7 +13,7 @@ project(Clipping CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_contour AND TARGET vtkm_io)
|
||||
if(TARGET vtkm::filter_contour AND TARGET vtkm::io)
|
||||
add_executable(Clipping Clipping.cxx)
|
||||
target_link_libraries(Clipping PRIVATE vtkm_filter_contour vtkm_io)
|
||||
target_link_libraries(Clipping PRIVATE vtkm::filter_contour vtkm::io)
|
||||
endif()
|
||||
|
@ -13,10 +13,10 @@ project(ContourTree CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if (TARGET vtkm_filter_scalar_topology)
|
||||
if (TARGET vtkm::filter_scalar_topology)
|
||||
add_executable(ContourTreeMesh2D ContourTreeMesh2D.cxx)
|
||||
target_link_libraries(ContourTreeMesh2D vtkm_filter_core vtkm_filter_scalar_topology)
|
||||
target_link_libraries(ContourTreeMesh2D vtkm::filter_core vtkm::filter_scalar_topology)
|
||||
|
||||
add_executable(ContourTreeMesh3D ContourTreeMesh3D.cxx)
|
||||
target_link_libraries(ContourTreeMesh3D vtkm_filter_core vtkm_filter_scalar_topology)
|
||||
target_link_libraries(ContourTreeMesh3D vtkm::filter_core vtkm::filter_scalar_topology)
|
||||
endif()
|
||||
|
@ -55,7 +55,7 @@ cmake_minimum_required(VERSION 3.12...3.15 FATAL_ERROR)
|
||||
# Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(NOT TARGET vtkm_io OR NOT TARGET vtkm_filter_scalar_topology)
|
||||
if(NOT TARGET vtkm::io OR NOT TARGET vtkm::filter_scalar_topology)
|
||||
# Libraries needed are not built.
|
||||
return()
|
||||
endif()
|
||||
@ -64,7 +64,7 @@ endif()
|
||||
# Serial
|
||||
####################################
|
||||
add_executable(ContourTree_Augmented ContourTreeApp.cxx)
|
||||
target_link_libraries(ContourTree_Augmented vtkm_filter_scalar_topology vtkm_io)
|
||||
target_link_libraries(ContourTree_Augmented vtkm::filter_scalar_topology vtkm::io)
|
||||
vtkm_add_target_information(ContourTree_Augmented
|
||||
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES ContourTreeApp.cxx)
|
||||
@ -84,7 +84,7 @@ endif()
|
||||
####################################
|
||||
if (VTKm_ENABLE_MPI)
|
||||
add_executable(ContourTree_Augmented_MPI ContourTreeApp.cxx)
|
||||
target_link_libraries(ContourTree_Augmented_MPI vtkm_filter_scalar_topology vtkm_io MPI::MPI_CXX)
|
||||
target_link_libraries(ContourTree_Augmented_MPI vtkm::filter_scalar_topology vtkm::io MPI::MPI_CXX)
|
||||
vtkm_add_target_information(ContourTree_Augmented_MPI
|
||||
MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES ContourTreeApp.cxx)
|
||||
|
@ -58,9 +58,9 @@ find_package(VTKm REQUIRED QUIET)
|
||||
####################################
|
||||
# MPI
|
||||
####################################
|
||||
if (VTKm_ENABLE_MPI AND TARGET vtkm_filter_scalar_topology AND TARGET vtkm_io)
|
||||
if (VTKm_ENABLE_MPI AND TARGET vtkm::filter_scalar_topology AND TARGET vtkm::io)
|
||||
add_executable(ContourTree_Distributed ContourTreeApp.cxx)
|
||||
target_link_libraries(ContourTree_Distributed vtkm_filter_scalar_topology vtkm_io MPI::MPI_CXX)
|
||||
target_link_libraries(ContourTree_Distributed vtkm::filter_scalar_topology vtkm::io MPI::MPI_CXX)
|
||||
vtkm_add_target_information(ContourTree_Distributed
|
||||
MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES ContourTreeApp.cxx)
|
||||
@ -78,11 +78,11 @@ if (VTKm_ENABLE_MPI AND TARGET vtkm_filter_scalar_topology AND TARGET vtkm_io)
|
||||
endif()
|
||||
|
||||
add_executable(TreeCompiler TreeCompilerApp.cxx)
|
||||
target_link_libraries(TreeCompiler vtkm_filter_core)
|
||||
target_link_libraries(TreeCompiler vtkm::filter_core)
|
||||
vtkm_add_target_information(TreeCompiler DROP_UNUSED_SYMBOLS)
|
||||
|
||||
add_executable(BranchCompiler BranchCompilerApp.cxx)
|
||||
target_link_libraries(BranchCompiler vtkm_filter)
|
||||
target_link_libraries(BranchCompiler vtkm::filter)
|
||||
vtkm_add_target_information(BranchCompiler DROP_UNUSED_SYMBOLS)
|
||||
|
||||
configure_file(split_data_2d.py split_data_2d.py COPYONLY)
|
||||
|
@ -15,8 +15,8 @@ find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
add_executable(CosmoCenterFinder CosmoCenterFinder.cxx)
|
||||
add_executable(CosmoHaloFinder CosmoHaloFinder.cxx)
|
||||
target_link_libraries(CosmoCenterFinder PRIVATE vtkm_filter_core)
|
||||
target_link_libraries(CosmoHaloFinder PRIVATE vtkm_filter_core)
|
||||
target_link_libraries(CosmoCenterFinder PRIVATE vtkm::filter_core)
|
||||
target_link_libraries(CosmoHaloFinder PRIVATE vtkm::filter_core)
|
||||
|
||||
vtkm_add_target_information(CosmoCenterFinder CosmoHaloFinder
|
||||
DROP_UNUSED_SYMBOLS
|
||||
|
@ -13,7 +13,7 @@ project(VTKmDemo CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_rendering AND TARGET vtkm_filter_contour AND TARGET vtkm_source)
|
||||
if(TARGET vtkm::rendering AND TARGET vtkm::filter_contour AND TARGET vtkm::source)
|
||||
add_executable(Demo Demo.cxx)
|
||||
target_link_libraries(Demo PRIVATE vtkm_rendering vtkm_filter_contour vtkm_source)
|
||||
target_link_libraries(Demo PRIVATE vtkm::rendering vtkm::filter_contour vtkm::source)
|
||||
endif()
|
||||
|
@ -19,7 +19,7 @@ if(TARGET OpenGL::GL AND
|
||||
TARGET GLEW::GLEW)
|
||||
|
||||
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
|
||||
target_link_libraries(GameOfLife PRIVATE vtkm_filter OpenGL::GL GLEW::GLEW GLUT::GLUT)
|
||||
target_link_libraries(GameOfLife PRIVATE vtkm::filter_core OpenGL::GL GLEW::GLEW GLUT::GLUT)
|
||||
vtkm_add_target_information(GameOfLife
|
||||
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES GameOfLife.cxx)
|
||||
|
@ -13,9 +13,9 @@ project(HelloWorklet CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_io)
|
||||
if(TARGET vtkm::io)
|
||||
add_executable(HelloWorklet HelloWorklet.cxx)
|
||||
target_link_libraries(HelloWorklet PRIVATE vtkm_filter_core vtkm_io)
|
||||
target_link_libraries(HelloWorklet PRIVATE vtkm::filter_core vtkm::io)
|
||||
|
||||
vtkm_add_target_information(HelloWorklet
|
||||
DROP_UNUSED_SYMBOLS
|
||||
|
@ -12,12 +12,12 @@ project(Histogram CXX)
|
||||
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
if (VTKm_ENABLE_MPI AND vtkm_filter_density_estimate)
|
||||
if (VTKm_ENABLE_MPI AND vtkm::filter_density_estimate)
|
||||
# TODO: this example desperately needs to be updated. The histogram filter has
|
||||
# improved immensely since this has originally been written, and the code can
|
||||
# be simplified a lot, which will make it more illustrative of using VTK-m.
|
||||
add_executable(Histogram Histogram.cxx HistogramMPI.h HistogramMPI.cxx)
|
||||
target_link_libraries(Histogram PRIVATE vtkm_filter_density_estimate MPI::MPI_CXX)
|
||||
target_link_libraries(Histogram PRIVATE vtkm::filter_density_estimate MPI::MPI_CXX)
|
||||
vtkm_add_target_information(Histogram
|
||||
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES HistogramMPI.cxx)
|
||||
|
@ -13,9 +13,9 @@ project(IsingModel CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_rendering)
|
||||
if(TARGET vtkm::rendering)
|
||||
add_executable(Ising Ising.cxx)
|
||||
target_link_libraries(Ising PRIVATE vtkm_worklet vtkm_rendering)
|
||||
target_link_libraries(Ising PRIVATE vtkm::worklet vtkm::rendering)
|
||||
|
||||
vtkm_add_target_information(Ising
|
||||
DROP_UNUSED_SYMBOLS
|
||||
|
@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.12...3.15 FATAL_ERROR)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_flow)
|
||||
if(TARGET vtkm::filter_flow)
|
||||
add_executable(Lagrangian lagrangian.cxx ABCfield.h)
|
||||
target_link_libraries(Lagrangian PRIVATE vtkm_filter_flow)
|
||||
target_link_libraries(Lagrangian PRIVATE vtkm::filter_flow)
|
||||
endif()
|
||||
|
@ -16,7 +16,7 @@ project(ParticleAdvection CXX)
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
add_executable(ftle LagrangianStructures.cxx)
|
||||
target_link_libraries(ftle PRIVATE vtkm_cont vtkm_worklet)
|
||||
target_link_libraries(ftle PRIVATE vtkm::cont vtkm::worklet)
|
||||
vtkm_add_target_information(ftle
|
||||
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES LagrangianStructures.cxx)
|
||||
|
@ -12,9 +12,9 @@ project(LogisticMap CXX)
|
||||
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_io)
|
||||
if(TARGET vtkm::io)
|
||||
add_executable(LogisticMap LogisticMap.cxx)
|
||||
target_link_libraries(LogisticMap PRIVATE vtkm_io)
|
||||
target_link_libraries(LogisticMap PRIVATE vtkm::io)
|
||||
|
||||
vtkm_add_target_information(LogisticMap
|
||||
DROP_UNUSED_SYMBOLS
|
||||
|
@ -25,7 +25,7 @@ project(MeshQuality CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_mesh_info AND TARGET vtkm_io)
|
||||
if(TARGET vtkm::filter_mesh_info AND TARGET vtkm::io)
|
||||
add_executable(MeshQuality MeshQuality.cxx)
|
||||
target_link_libraries(MeshQuality PRIVATE vtkm_filter_mesh_info vtkm_io)
|
||||
target_link_libraries(MeshQuality PRIVATE vtkm::filter_mesh_info vtkm::io)
|
||||
endif()
|
||||
|
@ -26,9 +26,9 @@ set(srcs
|
||||
IOGenerator.cxx
|
||||
)
|
||||
|
||||
if(TARGET vtkm_filter_vector_analysis)
|
||||
if(TARGET vtkm::filter_vector_analysis)
|
||||
add_executable(MultiBackend ${srcs} ${headers})
|
||||
target_link_libraries(MultiBackend PRIVATE vtkm_filter_vector_analysis Threads::Threads)
|
||||
target_link_libraries(MultiBackend PRIVATE vtkm::filter_vector_analysis Threads::Threads)
|
||||
vtkm_add_target_information(MultiBackend
|
||||
DROP_UNUSED_SYMBOLS
|
||||
MODIFY_CUDA_FLAGS
|
||||
|
@ -13,7 +13,7 @@ project(Oscillator CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_source)
|
||||
if(TARGET vtkm::source)
|
||||
add_executable(Oscillator Oscillator.cxx)
|
||||
target_link_libraries(Oscillator PRIVATE vtkm_source)
|
||||
target_link_libraries(Oscillator PRIVATE vtkm::source)
|
||||
endif()
|
||||
|
@ -13,7 +13,7 @@ project(ParticleAdvection CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_flow AND TARGET vtkm_io)
|
||||
if(TARGET vtkm::filter_flow AND TARGET vtkm::io)
|
||||
add_executable(Particle_Advection ParticleAdvection.cxx)
|
||||
target_link_libraries(Particle_Advection PRIVATE vtkm_filter_flow vtkm_io)
|
||||
target_link_libraries(Particle_Advection PRIVATE vtkm::filter_flow vtkm::io)
|
||||
endif()
|
||||
|
@ -66,10 +66,10 @@ int main(int argc, char** argv)
|
||||
vtkm::FloatDefault rx = (vtkm::FloatDefault)rand() / (vtkm::FloatDefault)RAND_MAX;
|
||||
vtkm::FloatDefault ry = (vtkm::FloatDefault)rand() / (vtkm::FloatDefault)RAND_MAX;
|
||||
vtkm::FloatDefault rz = (vtkm::FloatDefault)rand() / (vtkm::FloatDefault)RAND_MAX;
|
||||
p.Pos[0] = static_cast<vtkm::FloatDefault>(bounds.X.Min + rx * bounds.X.Length());
|
||||
p.Pos[1] = static_cast<vtkm::FloatDefault>(bounds.Y.Min + ry * bounds.Y.Length());
|
||||
p.Pos[2] = static_cast<vtkm::FloatDefault>(bounds.Z.Min + rz * bounds.Z.Length());
|
||||
p.ID = i;
|
||||
p.SetPosition({ static_cast<vtkm::FloatDefault>(bounds.X.Min + rx * bounds.X.Length()),
|
||||
static_cast<vtkm::FloatDefault>(bounds.Y.Min + ry * bounds.Y.Length()),
|
||||
static_cast<vtkm::FloatDefault>(bounds.Z.Min + rz * bounds.Z.Length()) });
|
||||
p.SetID(i);
|
||||
seeds.push_back(p);
|
||||
}
|
||||
auto seedArray = vtkm::cont::make_ArrayHandle(seeds, vtkm::CopyFlag::Off);
|
||||
|
@ -12,13 +12,13 @@ project(PolyLineArchimedeanHelix CXX)
|
||||
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if (TARGET vtkm_rendering)
|
||||
if (TARGET vtkm::rendering)
|
||||
# TODO: This example should be changed from using the Tube worklet to using
|
||||
# the Tube filter (in the vtkm_filter_geometry_refinement library). Then
|
||||
# the Tube filter (in the vtkm::filter_geometry_refinement library). Then
|
||||
# compiling it would no longer require a device compiler and the example
|
||||
# would generally be simpler.
|
||||
add_executable(PolyLineArchimedeanHelix PolyLineArchimedeanHelix.cxx)
|
||||
target_link_libraries(PolyLineArchimedeanHelix PRIVATE vtkm_rendering)
|
||||
target_link_libraries(PolyLineArchimedeanHelix PRIVATE vtkm::rendering)
|
||||
vtkm_add_target_information(PolyLineArchimedeanHelix
|
||||
DROP_UNUSED_SYMBOLS
|
||||
MODIFY_CUDA_FLAGS
|
||||
|
@ -13,9 +13,9 @@ project(RedistributePoints CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_io AND TARGET vtkm_filter_entity_extraction)
|
||||
if(TARGET vtkm::io AND TARGET vtkm::filter_entity_extraction)
|
||||
add_executable(RedistributePoints RedistributePoints.cxx RedistributePoints.h main.cxx)
|
||||
target_link_libraries(RedistributePoints PRIVATE vtkm_io vtkm_filter_entity_extraction)
|
||||
target_link_libraries(RedistributePoints PRIVATE vtkm::io vtkm::filter_entity_extraction)
|
||||
vtkm_add_target_information(RedistributePoints
|
||||
DROP_UNUSED_SYMBOLS
|
||||
MODIFY_CUDA_FLAGS
|
||||
|
@ -14,9 +14,9 @@ include(CTest)
|
||||
|
||||
find_package(VTKm REQUIRED)
|
||||
|
||||
if(TARGET vtkm_source)
|
||||
if(TARGET vtkm::source)
|
||||
add_executable(smoke_test smoke_test.cxx)
|
||||
target_link_libraries(smoke_test PRIVATE vtkm_source)
|
||||
target_link_libraries(smoke_test PRIVATE vtkm::source)
|
||||
|
||||
# Only add this test when this a standalone project
|
||||
if (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
|
@ -13,8 +13,8 @@ project(StreamlineMPI CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if (VTKm_ENABLE_MPI AND TARGET vtkm_io AND TARGET vtkm_filter_flow)
|
||||
if (VTKm_ENABLE_MPI AND TARGET vtkm::io AND TARGET vtkm::filter_flow)
|
||||
add_executable(StreamlineMPI StreamlineMPI.cxx)
|
||||
target_compile_definitions(StreamlineMPI PRIVATE "MPI_ENABLED")
|
||||
target_link_libraries(StreamlineMPI PRIVATE vtkm_filter_flow vtkm_io MPI::MPI_CXX)
|
||||
target_link_libraries(StreamlineMPI PRIVATE vtkm::filter_flow vtkm::io MPI::MPI_CXX)
|
||||
endif()
|
||||
|
@ -15,10 +15,10 @@ project(TemporalAdvection CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_flow AND TARGET vtkm_io)
|
||||
if(TARGET vtkm::filter_flow AND TARGET vtkm::io)
|
||||
add_executable(Temporal_Advection TemporalAdvection.cxx)
|
||||
vtkm_add_target_information(Temporal_Advection
|
||||
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
|
||||
DEVICE_SOURCES TemporalAdvection.cxx)
|
||||
target_link_libraries(Temporal_Advection PRIVATE vtkm_filter_flow vtkm_io)
|
||||
target_link_libraries(Temporal_Advection PRIVATE vtkm::filter_flow vtkm::io)
|
||||
endif()
|
||||
|
@ -87,8 +87,8 @@ int main(int argc, char** argv)
|
||||
for (vtkm::Id i = 0; i < numPts; i++)
|
||||
{
|
||||
vtkm::Particle p;
|
||||
p.Pos = ptsPortal.Get(i);
|
||||
p.ID = i;
|
||||
p.SetPosition(ptsPortal.Get(i));
|
||||
p.SetID(i);
|
||||
seedPortal.Set(i, p);
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,10 @@ project(Tetrahedra CXX)
|
||||
#Find the VTK-m package
|
||||
find_package(VTKm REQUIRED QUIET)
|
||||
|
||||
if(TARGET vtkm_filter_geometry_refinement AND TARGET vtkm_io)
|
||||
if(TARGET vtkm::filter_geometry_refinement AND TARGET vtkm::io)
|
||||
add_executable(Tetrahedralize Tetrahedralize.cxx)
|
||||
target_link_libraries(Tetrahedralize PRIVATE vtkm_filter_geometry_refinement vtkm_io)
|
||||
target_link_libraries(Tetrahedralize PRIVATE vtkm::filter_geometry_refinement vtkm::io)
|
||||
|
||||
add_executable(Triangulate Triangulate.cxx)
|
||||
target_link_libraries(Triangulate PRIVATE vtkm_filter_geometry_refinement vtkm_io)
|
||||
target_link_libraries(Triangulate PRIVATE vtkm::filter_geometry_refinement vtkm::io)
|
||||
endif()
|
||||
|
@ -1 +1 @@
|
||||
1.9.9999
|
||||
2.0.9999
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
const vtkm::Id& numSteps = 0,
|
||||
const vtkm::ParticleStatus& status = vtkm::ParticleStatus(),
|
||||
const vtkm::FloatDefault& time = 0)
|
||||
: Pos(p)
|
||||
: Position(p)
|
||||
, ID(id)
|
||||
, NumSteps(numSteps)
|
||||
, Status(status)
|
||||
@ -109,7 +109,7 @@ public:
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
Particle(const vtkm::Particle& p)
|
||||
: Pos(p.Pos)
|
||||
: Position(p.Position)
|
||||
, ID(p.ID)
|
||||
, NumSteps(p.NumSteps)
|
||||
, Status(p.Status)
|
||||
@ -125,6 +125,22 @@ public:
|
||||
// troublesome with CUDA __host__ __device__ markup.
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT const vtkm::Vec3f& GetPosition() const { return this->Position; }
|
||||
VTKM_EXEC_CONT void SetPosition(const vtkm::Vec3f& position) { this->Position = position; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::Id GetID() const { return this->ID; }
|
||||
VTKM_EXEC_CONT void SetID(vtkm::Id id) { this->ID = id; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::Id GetNumberOfSteps() const { return this->NumSteps; }
|
||||
VTKM_EXEC_CONT void SetNumberOfSteps(vtkm::Id numSteps) { this->NumSteps = numSteps; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::ParticleStatus GetStatus() const { return this->Status; }
|
||||
VTKM_EXEC_CONT vtkm::ParticleStatus& GetStatus() { return this->Status; }
|
||||
VTKM_EXEC_CONT void SetStatus(vtkm::ParticleStatus status) { this->Status = status; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::FloatDefault GetTime() const { return this->Time; }
|
||||
VTKM_EXEC_CONT void SetTime(vtkm::FloatDefault time) { this->Time = time; }
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::Vec3f Velocity(const vtkm::VecVariable<vtkm::Vec3f, 2>& vectors,
|
||||
const vtkm::FloatDefault& vtkmNotUsed(length))
|
||||
@ -139,22 +155,24 @@ public:
|
||||
vtkm::Vec3f GetEvaluationPosition(const vtkm::FloatDefault& deltaT) const
|
||||
{
|
||||
(void)deltaT; // unused for a general particle advection case
|
||||
return this->Pos;
|
||||
return this->Position;
|
||||
}
|
||||
|
||||
inline VTKM_CONT friend std::ostream& operator<<(std::ostream& out, const vtkm::Particle& p)
|
||||
{
|
||||
out << "v(" << p.Time << ") = " << p.Pos << ", ID: " << p.ID << ", NumSteps: " << p.NumSteps
|
||||
<< ", Status: " << p.Status;
|
||||
out << "v(" << p.Time << ") = " << p.Position << ", ID: " << p.ID
|
||||
<< ", NumSteps: " << p.NumSteps << ", Status: " << p.Status;
|
||||
return out;
|
||||
}
|
||||
|
||||
vtkm::Vec3f Pos;
|
||||
private:
|
||||
vtkm::Vec3f Position;
|
||||
vtkm::Id ID = -1;
|
||||
vtkm::Id NumSteps = 0;
|
||||
vtkm::ParticleStatus Status;
|
||||
vtkm::FloatDefault Time = 0;
|
||||
|
||||
public:
|
||||
static size_t Sizeof()
|
||||
{
|
||||
constexpr std::size_t sz = sizeof(vtkm::Vec3f) // Pos
|
||||
@ -183,7 +201,7 @@ public:
|
||||
const vtkm::Id& numSteps = 0,
|
||||
const vtkm::ParticleStatus& status = vtkm::ParticleStatus(),
|
||||
const vtkm::FloatDefault& time = 0)
|
||||
: Pos(position)
|
||||
: Position(position)
|
||||
, ID(id)
|
||||
, NumSteps(numSteps)
|
||||
, Status(status)
|
||||
@ -195,6 +213,22 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT const vtkm::Vec3f& GetPosition() const { return this->Position; }
|
||||
VTKM_EXEC_CONT void SetPosition(const vtkm::Vec3f& position) { this->Position = position; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::Id GetID() const { return this->ID; }
|
||||
VTKM_EXEC_CONT void SetID(vtkm::Id id) { this->ID = id; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::Id GetNumberOfSteps() const { return this->NumSteps; }
|
||||
VTKM_EXEC_CONT void SetNumberOfSteps(vtkm::Id numSteps) { this->NumSteps = numSteps; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::ParticleStatus GetStatus() const { return this->Status; }
|
||||
VTKM_EXEC_CONT vtkm::ParticleStatus& GetStatus() { return this->Status; }
|
||||
VTKM_EXEC_CONT void SetStatus(vtkm::ParticleStatus status) { this->Status = status; }
|
||||
|
||||
VTKM_EXEC_CONT vtkm::FloatDefault GetTime() const { return this->Time; }
|
||||
VTKM_EXEC_CONT void SetTime(vtkm::FloatDefault time) { this->Time = time; }
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::Float64 Gamma(vtkm::Vec3f momentum, bool reciprocal = false) const
|
||||
{
|
||||
@ -248,24 +282,23 @@ public:
|
||||
// Translation is in -ve Z direction,
|
||||
// this needs to be a parameter.
|
||||
auto translation = this->NumSteps * deltaT * SPEED_OF_LIGHT * vtkm::Vec3f{ 0., 0., -1.0 };
|
||||
return this->Pos + translation;
|
||||
return this->Position + translation;
|
||||
}
|
||||
|
||||
inline VTKM_CONT friend std::ostream& operator<<(std::ostream& out,
|
||||
const vtkm::ChargedParticle& p)
|
||||
{
|
||||
out << "v(" << p.Time << ") = " << p.Pos << ", ID: " << p.ID << ", NumSteps: " << p.NumSteps
|
||||
<< ", Status: " << p.Status;
|
||||
out << "v(" << p.Time << ") = " << p.Position << ", ID: " << p.ID
|
||||
<< ", NumSteps: " << p.NumSteps << ", Status: " << p.Status;
|
||||
return out;
|
||||
}
|
||||
|
||||
vtkm::Vec3f Pos;
|
||||
private:
|
||||
vtkm::Vec3f Position;
|
||||
vtkm::Id ID = -1;
|
||||
vtkm::Id NumSteps = 0;
|
||||
vtkm::ParticleStatus Status;
|
||||
vtkm::FloatDefault Time = 0;
|
||||
|
||||
private:
|
||||
vtkm::Float64 Mass;
|
||||
vtkm::Float64 Charge;
|
||||
vtkm::Float64 Weighting;
|
||||
@ -303,20 +336,34 @@ struct Serialization<vtkm::Particle>
|
||||
public:
|
||||
static VTKM_CONT void save(BinaryBuffer& bb, const vtkm::Particle& p)
|
||||
{
|
||||
vtkmdiy::save(bb, p.Pos);
|
||||
vtkmdiy::save(bb, p.ID);
|
||||
vtkmdiy::save(bb, p.NumSteps);
|
||||
vtkmdiy::save(bb, p.Status);
|
||||
vtkmdiy::save(bb, p.Time);
|
||||
vtkmdiy::save(bb, p.GetPosition());
|
||||
vtkmdiy::save(bb, p.GetID());
|
||||
vtkmdiy::save(bb, p.GetNumberOfSteps());
|
||||
vtkmdiy::save(bb, p.GetStatus());
|
||||
vtkmdiy::save(bb, p.GetTime());
|
||||
}
|
||||
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, vtkm::Particle& p)
|
||||
{
|
||||
vtkmdiy::load(bb, p.Pos);
|
||||
vtkmdiy::load(bb, p.ID);
|
||||
vtkmdiy::load(bb, p.NumSteps);
|
||||
vtkmdiy::load(bb, p.Status);
|
||||
vtkmdiy::load(bb, p.Time);
|
||||
vtkm::Vec3f pos;
|
||||
vtkmdiy::load(bb, pos);
|
||||
p.SetPosition(pos);
|
||||
|
||||
vtkm::Id id;
|
||||
vtkmdiy::load(bb, id);
|
||||
p.SetID(id);
|
||||
|
||||
vtkm::Id numSteps;
|
||||
vtkmdiy::load(bb, numSteps);
|
||||
p.SetNumberOfSteps(numSteps);
|
||||
|
||||
vtkm::ParticleStatus status;
|
||||
vtkmdiy::load(bb, status);
|
||||
p.SetStatus(status);
|
||||
|
||||
vtkm::FloatDefault time;
|
||||
vtkmdiy::load(bb, time);
|
||||
p.SetTime(time);
|
||||
}
|
||||
};
|
||||
|
||||
@ -326,7 +373,7 @@ struct Serialization<vtkm::ChargedParticle>
|
||||
public:
|
||||
static VTKM_CONT void save(BinaryBuffer& bb, const vtkm::ChargedParticle& e)
|
||||
{
|
||||
vtkmdiy::save(bb, e.Pos);
|
||||
vtkmdiy::save(bb, e.Position);
|
||||
vtkmdiy::save(bb, e.ID);
|
||||
vtkmdiy::save(bb, e.NumSteps);
|
||||
vtkmdiy::save(bb, e.Status);
|
||||
@ -339,7 +386,7 @@ public:
|
||||
|
||||
static VTKM_CONT void load(BinaryBuffer& bb, vtkm::ChargedParticle& e)
|
||||
{
|
||||
vtkmdiy::load(bb, e.Pos);
|
||||
vtkmdiy::load(bb, e.Position);
|
||||
vtkmdiy::load(bb, e.ID);
|
||||
vtkmdiy::load(bb, e.NumSteps);
|
||||
vtkmdiy::load(bb, e.Status);
|
||||
|
@ -271,14 +271,14 @@ add_subdirectory(internal)
|
||||
add_subdirectory(arg)
|
||||
|
||||
set(backends )
|
||||
if(TARGET vtkm::tbb)
|
||||
list(APPEND backends vtkm::tbb)
|
||||
if(TARGET vtkm_tbb)
|
||||
list(APPEND backends vtkm_tbb)
|
||||
endif()
|
||||
if(TARGET vtkm::cuda)
|
||||
list(APPEND backends vtkm::cuda)
|
||||
if(TARGET vtkm_cuda)
|
||||
list(APPEND backends vtkm_cuda)
|
||||
endif()
|
||||
if(TARGET vtkm::openmp)
|
||||
list(APPEND backends vtkm::openmp)
|
||||
if(TARGET vtkm_openmp)
|
||||
list(APPEND backends vtkm_openmp)
|
||||
endif()
|
||||
if(TARGET vtkm::kokkos)
|
||||
list(APPEND backends vtkm::kokkos)
|
||||
|
@ -29,14 +29,14 @@ template <typename ParticleType>
|
||||
struct ExtractPositionFunctor
|
||||
{
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::Vec3f operator()(const ParticleType& p) const { return p.Pos; }
|
||||
vtkm::Vec3f operator()(const ParticleType& p) const { return p.GetPosition(); }
|
||||
};
|
||||
|
||||
template <typename ParticleType>
|
||||
struct ExtractTerminatedFunctor
|
||||
{
|
||||
VTKM_EXEC_CONT
|
||||
bool operator()(const ParticleType& p) const { return p.Status.CheckTerminate(); }
|
||||
bool operator()(const ParticleType& p) const { return p.GetStatus().CheckTerminate(); }
|
||||
};
|
||||
|
||||
template <typename ParticleType>
|
||||
@ -56,11 +56,11 @@ struct CopyParticleAllWorklet : public vtkm::worklet::WorkletMapField
|
||||
vtkm::ParticleStatus& outStatus,
|
||||
vtkm::FloatDefault& outTime) const
|
||||
{
|
||||
outPos = inParticle.Pos;
|
||||
outID = inParticle.ID;
|
||||
outSteps = inParticle.NumSteps;
|
||||
outStatus = inParticle.Status;
|
||||
outTime = inParticle.Time;
|
||||
outPos = inParticle.GetPosition();
|
||||
outID = inParticle.GetID();
|
||||
outSteps = inParticle.GetNumberOfSteps();
|
||||
outStatus = inParticle.GetStatus();
|
||||
outTime = inParticle.GetTime();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,7 @@ set(headers
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
|
||||
if (TARGET vtkm::cuda)
|
||||
if (TARGET vtkm_cuda)
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CudaAllocator.cu
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmCuda.cu
|
||||
|
@ -6,4 +6,4 @@ DEPENDS
|
||||
vtkm_cont
|
||||
TEST_DEPENDS
|
||||
vtkm_worklet
|
||||
vtkm::cuda
|
||||
vtkm_cuda
|
||||
|
@ -29,7 +29,7 @@ target_sources(vtkm_cont PRIVATE
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::openmp)
|
||||
if (TARGET vtkm_openmp)
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmOpenMP.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ParallelRadixSortOpenMP.cxx
|
||||
|
@ -6,4 +6,4 @@ DEPENDS
|
||||
vtkm_cont
|
||||
TEST_DEPENDS
|
||||
vtkm_worklet
|
||||
vtkm::openmp
|
||||
vtkm_openmp
|
||||
|
@ -28,7 +28,7 @@ target_sources(vtkm_cont PRIVATE
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
if (TARGET vtkm::tbb)
|
||||
if (TARGET vtkm_tbb)
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmTBB.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ParallelSortTBB.cxx
|
||||
|
@ -6,4 +6,4 @@ DEPENDS
|
||||
vtkm_cont
|
||||
TEST_DEPENDS
|
||||
vtkm_worklet
|
||||
vtkm::tbb
|
||||
vtkm_tbb
|
||||
|
@ -45,7 +45,7 @@ void TestParticleArrayCopy()
|
||||
{
|
||||
auto p = pPortal.Get(j);
|
||||
auto pt = pos.ReadPortal().Get(j);
|
||||
VTKM_TEST_ASSERT(p.Pos == pt, "Positions do not match");
|
||||
VTKM_TEST_ASSERT(p.GetPosition() == pt, "Positions do not match");
|
||||
}
|
||||
}
|
||||
else //Test copy everything
|
||||
@ -62,11 +62,11 @@ void TestParticleArrayCopy()
|
||||
{
|
||||
auto p = pPortal.Get(j);
|
||||
auto pt = pos.ReadPortal().Get(j);
|
||||
VTKM_TEST_ASSERT(p.Pos == pt, "Positions do not match");
|
||||
VTKM_TEST_ASSERT(p.ID == ids.ReadPortal().Get(j), "IDs do not match");
|
||||
VTKM_TEST_ASSERT(p.NumSteps == steps.ReadPortal().Get(j), "Steps do not match");
|
||||
VTKM_TEST_ASSERT(p.Status == status.ReadPortal().Get(j), "Status do not match");
|
||||
VTKM_TEST_ASSERT(p.Time == ptime.ReadPortal().Get(j), "Times do not match");
|
||||
VTKM_TEST_ASSERT(p.GetPosition() == pt, "Positions do not match");
|
||||
VTKM_TEST_ASSERT(p.GetID() == ids.ReadPortal().Get(j), "IDs do not match");
|
||||
VTKM_TEST_ASSERT(p.GetNumberOfSteps() == steps.ReadPortal().Get(j), "Steps do not match");
|
||||
VTKM_TEST_ASSERT(p.GetStatus() == status.ReadPortal().Get(j), "Status do not match");
|
||||
VTKM_TEST_ASSERT(p.GetTime() == ptime.ReadPortal().Get(j), "Times do not match");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ void TestParticleArrayCopy()
|
||||
{
|
||||
auto p = portal.Get(i);
|
||||
auto pRes = resPortal.Get(resIdx);
|
||||
VTKM_TEST_ASSERT(p.Pos == pRes, "Positions do not match");
|
||||
VTKM_TEST_ASSERT(p.GetPosition() == pRes, "Positions do not match");
|
||||
resIdx++;
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ GROUPS
|
||||
DEPENDS
|
||||
vtkm_exec
|
||||
TEST_DEPENDS
|
||||
vtkm::cuda
|
||||
vtkm_cuda
|
||||
|
@ -5,4 +5,4 @@ GROUPS
|
||||
DEPENDS
|
||||
vtkm_exec
|
||||
TEST_DEPENDS
|
||||
vtkm::openmp
|
||||
vtkm_openmp
|
||||
|
@ -5,4 +5,4 @@ GROUPS
|
||||
DEPENDS
|
||||
vtkm_exec
|
||||
TEST_DEPENDS
|
||||
vtkm::tbb
|
||||
vtkm_tbb
|
||||
|
@ -47,4 +47,4 @@ target_link_libraries(vtkm_filter PUBLIC INTERFACE
|
||||
vtkm_filter_core
|
||||
)
|
||||
|
||||
install(TARGETS vtkm_filter EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_filter)
|
||||
|
@ -45,10 +45,10 @@ public:
|
||||
template <typename ValidityType>
|
||||
VTKM_EXEC void operator()(const vtkm::Particle& end_point, ValidityType& res) const
|
||||
{
|
||||
vtkm::Id steps = end_point.NumSteps;
|
||||
vtkm::Id steps = end_point.GetNumberOfSteps();
|
||||
if (steps > 0 && res == 1)
|
||||
{
|
||||
if (bounds.Contains(end_point.Pos))
|
||||
if (bounds.Contains(end_point.GetPosition()))
|
||||
{
|
||||
res = 1;
|
||||
}
|
||||
@ -79,9 +79,9 @@ public:
|
||||
const vtkm::Particle& start_point,
|
||||
DisplacementType& res) const
|
||||
{
|
||||
res[0] = end_point.Pos[0] - start_point.Pos[0];
|
||||
res[1] = end_point.Pos[1] - start_point.Pos[1];
|
||||
res[2] = end_point.Pos[2] - start_point.Pos[2];
|
||||
res[0] = end_point.GetPosition()[0] - start_point.GetPosition()[0];
|
||||
res[1] = end_point.GetPosition()[1] - start_point.GetPosition()[1];
|
||||
res[2] = end_point.GetPosition()[2] - start_point.GetPosition()[2];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
|
||||
VTKM_EXEC void operator()(const vtkm::Particle& particle, vtkm::Vec3f& pt) const
|
||||
{
|
||||
pt = particle.Pos;
|
||||
pt = particle.GetPosition();
|
||||
}
|
||||
};
|
||||
|
||||
@ -72,8 +72,8 @@ public:
|
||||
const vtkm::Vec3f& seed,
|
||||
vtkm::Particle& particle) const
|
||||
{
|
||||
particle.ID = index;
|
||||
particle.Pos = seed;
|
||||
particle.SetID(index);
|
||||
particle.SetPosition(seed);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
for (vtkm::Id i = 0; i < n; i++)
|
||||
{
|
||||
const ParticleType p = portal.Get(i);
|
||||
std::vector<vtkm::Id> ids = this->BoundsMap.FindBlocks(p.Pos);
|
||||
std::vector<vtkm::Id> ids = this->BoundsMap.FindBlocks(p.GetPosition());
|
||||
|
||||
if (!ids.empty() && this->BoundsMap.FindRank(ids[0]) == this->Rank)
|
||||
{
|
||||
@ -155,7 +155,7 @@ public:
|
||||
auto bit = blockIds.begin();
|
||||
while (pit != particles.end() && bit != blockIds.end())
|
||||
{
|
||||
this->ParticleBlockIDsMap[pit->ID] = *bit;
|
||||
this->ParticleBlockIDsMap[pit->GetID()] = *bit;
|
||||
pit++;
|
||||
bit++;
|
||||
}
|
||||
@ -170,12 +170,12 @@ public:
|
||||
if (this->Active.empty())
|
||||
return false;
|
||||
|
||||
blockId = this->ParticleBlockIDsMap[this->Active.front().ID][0];
|
||||
blockId = this->ParticleBlockIDsMap[this->Active.front().GetID()][0];
|
||||
auto it = this->Active.begin();
|
||||
while (it != this->Active.end())
|
||||
{
|
||||
auto p = *it;
|
||||
if (blockId == this->ParticleBlockIDsMap[p.ID][0])
|
||||
if (blockId == this->ParticleBlockIDsMap[p.GetID()][0])
|
||||
{
|
||||
particles.emplace_back(p);
|
||||
it = this->Active.erase(it);
|
||||
|
@ -161,32 +161,32 @@ VTKM_CONT inline void DataSetIntegrator<Derived>::ClassifyParticles(
|
||||
{
|
||||
auto p = portal.Get(i);
|
||||
|
||||
if (p.Status.CheckTerminate())
|
||||
if (p.GetStatus().CheckTerminate())
|
||||
{
|
||||
dsiInfo.TermIdx.emplace_back(i);
|
||||
dsiInfo.TermID.emplace_back(p.ID);
|
||||
dsiInfo.TermID.emplace_back(p.GetID());
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& it = dsiInfo.ParticleBlockIDsMap.find(p.ID);
|
||||
const auto& it = dsiInfo.ParticleBlockIDsMap.find(p.GetID());
|
||||
VTKM_ASSERT(it != dsiInfo.ParticleBlockIDsMap.end());
|
||||
auto currBIDs = it->second;
|
||||
VTKM_ASSERT(!currBIDs.empty());
|
||||
|
||||
std::vector<vtkm::Id> newIDs;
|
||||
if (p.Status.CheckSpatialBounds() && !p.Status.CheckTookAnySteps())
|
||||
if (p.GetStatus().CheckSpatialBounds() && !p.GetStatus().CheckTookAnySteps())
|
||||
newIDs.assign(std::next(currBIDs.begin(), 1), currBIDs.end());
|
||||
else
|
||||
newIDs = dsiInfo.BoundsMap.FindBlocks(p.Pos, currBIDs);
|
||||
newIDs = dsiInfo.BoundsMap.FindBlocks(p.GetPosition(), currBIDs);
|
||||
|
||||
//reset the particle status.
|
||||
p.Status = vtkm::ParticleStatus();
|
||||
p.GetStatus() = vtkm::ParticleStatus();
|
||||
|
||||
if (newIDs.empty()) //No blocks, we're done.
|
||||
{
|
||||
p.Status.SetTerminate();
|
||||
p.GetStatus().SetTerminate();
|
||||
dsiInfo.TermIdx.emplace_back(i);
|
||||
dsiInfo.TermID.emplace_back(p.ID);
|
||||
dsiInfo.TermID.emplace_back(p.GetID());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -210,12 +210,12 @@ VTKM_CONT inline void DataSetIntegrator<Derived>::ClassifyParticles(
|
||||
if (dstRank == this->Rank)
|
||||
{
|
||||
dsiInfo.A.emplace_back(p);
|
||||
dsiInfo.IdMapA[p.ID] = newIDs;
|
||||
dsiInfo.IdMapA[p.GetID()] = newIDs;
|
||||
}
|
||||
else
|
||||
{
|
||||
dsiInfo.I.emplace_back(p);
|
||||
dsiInfo.IdMapI[p.ID] = newIDs;
|
||||
dsiInfo.IdMapI[p.GetID()] = newIDs;
|
||||
}
|
||||
}
|
||||
portal.Set(i, p);
|
||||
|
@ -174,9 +174,9 @@ void ParticleMessenger<ParticleType>::SerialExchange(
|
||||
{
|
||||
for (auto& p : outData)
|
||||
{
|
||||
const auto& bids = outBlockIDsMap.find(p.ID)->second;
|
||||
const auto& bids = outBlockIDsMap.find(p.GetID())->second;
|
||||
inData.emplace_back(p);
|
||||
inDataBlockIDsMap[p.ID] = bids;
|
||||
inDataBlockIDsMap[p.GetID()] = bids;
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ void ParticleMessenger<ParticleType>::Exchange(
|
||||
|
||||
for (const auto& p : outData)
|
||||
{
|
||||
const auto& bids = outBlockIDsMap.find(p.ID)->second;
|
||||
const auto& bids = outBlockIDsMap.find(p.GetID())->second;
|
||||
int dstRank = this->BoundsMap.FindRank(bids[0]);
|
||||
sendData[dstRank].emplace_back(std::make_pair(p, bids));
|
||||
}
|
||||
@ -227,7 +227,7 @@ void ParticleMessenger<ParticleType>::Exchange(
|
||||
const auto& p = v.first;
|
||||
const auto& bids = v.second;
|
||||
inData.emplace_back(p);
|
||||
inDataBlockIDsMap[p.ID] = bids;
|
||||
inDataBlockIDsMap[p.GetID()] = bids;
|
||||
}
|
||||
|
||||
for (const auto& m : msgData)
|
||||
|
@ -85,13 +85,15 @@ void ValidateReceivedParticles(
|
||||
const auto& reqP = particles[static_cast<std::size_t>(sendRank)][i];
|
||||
const auto& p = recvP[i].first;
|
||||
|
||||
VTKM_TEST_ASSERT(p.Pos == reqP.Pos, "Received particle has wrong Position.");
|
||||
VTKM_TEST_ASSERT(p.Time == reqP.Time, "Received particle has wrong Time.");
|
||||
VTKM_TEST_ASSERT(p.ID == reqP.ID, "Received particle has wrong ID.");
|
||||
VTKM_TEST_ASSERT(p.NumSteps == reqP.NumSteps, "Received particle has wrong NumSteps.");
|
||||
VTKM_TEST_ASSERT(p.GetPosition() == reqP.GetPosition(),
|
||||
"Received particle has wrong Position.");
|
||||
VTKM_TEST_ASSERT(p.GetTime() == reqP.GetTime(), "Received particle has wrong Time.");
|
||||
VTKM_TEST_ASSERT(p.GetID() == reqP.GetID(), "Received particle has wrong ID.");
|
||||
VTKM_TEST_ASSERT(p.GetNumberOfSteps() == reqP.GetNumberOfSteps(),
|
||||
"Received particle has wrong NumSteps.");
|
||||
|
||||
VTKM_TEST_ASSERT(p.Pos == reqP.Pos && p.Time == reqP.Time && p.ID == reqP.ID &&
|
||||
p.NumSteps == reqP.NumSteps,
|
||||
VTKM_TEST_ASSERT(p.GetPosition() == reqP.GetPosition() && p.GetTime() == reqP.GetTime() &&
|
||||
p.GetID() == reqP.GetID() && p.GetNumberOfSteps() == reqP.GetNumberOfSteps(),
|
||||
"Received particle has wrong values.");
|
||||
|
||||
const auto& reqBids = particleBlockIds[static_cast<std::size_t>(sendRank)][i];
|
||||
@ -153,12 +155,10 @@ void TestParticleMessenger()
|
||||
for (int p = 0; p < nP; p++)
|
||||
{
|
||||
vtkm::Particle particle;
|
||||
particle.Pos[0] = floatDist(generator);
|
||||
particle.Pos[1] = floatDist(generator);
|
||||
particle.Pos[2] = floatDist(generator);
|
||||
particle.Time = floatDist(generator);
|
||||
particle.ID = pid++;
|
||||
particle.NumSteps = nStepsDist(generator);
|
||||
particle.SetPosition({ floatDist(generator), floatDist(generator), floatDist(generator) });
|
||||
particle.SetTime(floatDist(generator));
|
||||
particle.SetID(pid++);
|
||||
particle.SetNumberOfSteps(nStepsDist(generator));
|
||||
pvec.push_back(particle);
|
||||
|
||||
std::vector<vtkm::Id> bids(bidDist(generator));
|
||||
|
@ -147,7 +147,7 @@ public:
|
||||
vtkm::Vec3f& pointOut) const
|
||||
{
|
||||
vtkm::VecVariable<vtkm::Vec3f, 2> values;
|
||||
status = evaluator.Evaluate(pointIn.Pos, pointIn.Time, values);
|
||||
status = evaluator.Evaluate(pointIn.GetPosition(), pointIn.GetTime(), values);
|
||||
pointOut = values[0];
|
||||
}
|
||||
};
|
||||
@ -228,7 +228,7 @@ void ValidateIntegrator(const IntegratorType& integrator,
|
||||
vtkm::Vec3f result = resultsPortal.Get(index);
|
||||
VTKM_TEST_ASSERT(status.CheckOk(), "Error in evaluator for " + msg);
|
||||
if (status.CheckSpatialBounds())
|
||||
VTKM_TEST_ASSERT(result == pointsPortal.Get(index).Pos,
|
||||
VTKM_TEST_ASSERT(result == pointsPortal.Get(index).GetPosition(),
|
||||
"Error in evaluator result for [OUTSIDE SPATIAL]" + msg);
|
||||
else
|
||||
VTKM_TEST_ASSERT(result == expStepResults[static_cast<size_t>(index)],
|
||||
@ -322,7 +322,7 @@ void TestEvaluators()
|
||||
|
||||
GenerateRandomParticles(pointIns, 38, interiorBounds);
|
||||
for (auto& p : pointIns)
|
||||
stepResult.push_back(p.Pos + vec * stepSize);
|
||||
stepResult.push_back(p.GetPosition() + vec * stepSize);
|
||||
|
||||
vtkm::Range xRange, yRange, zRange;
|
||||
|
||||
@ -414,14 +414,16 @@ void TestGhostCellEvaluators()
|
||||
for (vtkm::Id i = 0; i < numSeeds; i++)
|
||||
{
|
||||
const auto& p = posPortal.Get(i);
|
||||
VTKM_TEST_ASSERT(p.Status.CheckSpatialBounds(), "Particle did not leave the dataset.");
|
||||
VTKM_TEST_ASSERT(p.Status.CheckInGhostCell(), "Particle did not end up in ghost cell.");
|
||||
VTKM_TEST_ASSERT(p.GetStatus().CheckSpatialBounds(), "Particle did not leave the dataset.");
|
||||
VTKM_TEST_ASSERT(p.GetStatus().CheckInGhostCell(), "Particle did not end up in ghost cell.");
|
||||
|
||||
//Particles that start in a ghost cell should take no steps.
|
||||
if (p.ID == 0 || p.ID == 1 || p.ID == 2)
|
||||
VTKM_TEST_ASSERT(p.NumSteps == 0, "Particle in ghost cell should *not* take any steps");
|
||||
else if (p.ID == 3)
|
||||
VTKM_TEST_ASSERT(p.NumSteps == 21, "Wrong number of steps for particle with ghost cells");
|
||||
if (p.GetID() == 0 || p.GetID() == 1 || p.GetID() == 2)
|
||||
VTKM_TEST_ASSERT(p.GetNumberOfSteps() == 0,
|
||||
"Particle in ghost cell should *not* take any steps");
|
||||
else if (p.GetID() == 3)
|
||||
VTKM_TEST_ASSERT(p.GetNumberOfSteps() == 21,
|
||||
"Wrong number of steps for particle with ghost cells");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -436,8 +438,8 @@ void ValidateParticleAdvectionResult(
|
||||
auto portal = res.Particles.ReadPortal();
|
||||
for (vtkm::Id i = 0; i < nSeeds; i++)
|
||||
{
|
||||
auto stepsTaken = portal.Get(i).NumSteps;
|
||||
auto status = portal.Get(i).Status;
|
||||
auto stepsTaken = portal.Get(i).GetNumberOfSteps();
|
||||
auto status = portal.Get(i).GetStatus();
|
||||
VTKM_TEST_ASSERT(stepsTaken <= maxSteps, "Too many steps taken in particle advection");
|
||||
if (stepsTaken == maxSteps)
|
||||
VTKM_TEST_ASSERT(status.CheckTerminate(), "Particle expected to be terminated");
|
||||
@ -456,8 +458,9 @@ void ValidateStreamlineResult(const vtkm::worklet::flow::StreamlineResult<vtkm::
|
||||
auto portal = res.Particles.ReadPortal();
|
||||
for (vtkm::Id i = 0; i < nSeeds; i++)
|
||||
{
|
||||
VTKM_TEST_ASSERT(portal.Get(i).NumSteps <= maxSteps, "Too many steps taken in streamline");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Status.CheckOk(), "Bad status in streamline");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetNumberOfSteps() <= maxSteps,
|
||||
"Too many steps taken in streamline");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetStatus().CheckOk(), "Bad status in streamline");
|
||||
}
|
||||
VTKM_TEST_ASSERT(res.Particles.GetNumberOfValues() == nSeeds,
|
||||
"Number of output particles does not match input.");
|
||||
@ -556,7 +559,7 @@ void TestParticleWorkletsWithDataSetTypes()
|
||||
vtkm::Id nSeeds = static_cast<vtkm::Id>(pts.size());
|
||||
std::vector<vtkm::Id> stepsTaken = { 10, 20, 600 };
|
||||
for (std::size_t i = 0; i < stepsTaken.size(); i++)
|
||||
pts2[i].NumSteps = stepsTaken[i];
|
||||
pts2[i].SetNumberOfSteps(stepsTaken[i]);
|
||||
|
||||
for (auto& ds : dataSets)
|
||||
{
|
||||
@ -644,10 +647,10 @@ void TestParticleStatus()
|
||||
pa.Run(rk4, seedsArray, maxSteps);
|
||||
auto portal = seedsArray.ReadPortal();
|
||||
|
||||
bool tookStep0 = portal.Get(0).Status.CheckTookAnySteps();
|
||||
bool tookStep1 = portal.Get(1).Status.CheckTookAnySteps();
|
||||
bool isZero0 = portal.Get(0).Status.CheckZeroVelocity();
|
||||
bool isZero1 = portal.Get(1).Status.CheckZeroVelocity();
|
||||
bool tookStep0 = portal.Get(0).GetStatus().CheckTookAnySteps();
|
||||
bool tookStep1 = portal.Get(1).GetStatus().CheckTookAnySteps();
|
||||
bool isZero0 = portal.Get(0).GetStatus().CheckZeroVelocity();
|
||||
bool isZero1 = portal.Get(1).GetStatus().CheckZeroVelocity();
|
||||
|
||||
if (vtkm::Magnitude(vec) > 0)
|
||||
{
|
||||
@ -662,7 +665,8 @@ void TestParticleStatus()
|
||||
VTKM_TEST_ASSERT(tookStep1 == false, "Particle took a step when it should not have.");
|
||||
VTKM_TEST_ASSERT(isZero0 == true, "Particle in zero velocity when it should not be.");
|
||||
VTKM_TEST_ASSERT(isZero1 == false, "Particle in zero velocity when it should not be.");
|
||||
VTKM_TEST_ASSERT(portal.Get(0).NumSteps == 1, "Particle should have taken only 1 step.");
|
||||
VTKM_TEST_ASSERT(portal.Get(0).GetNumberOfSteps() == 1,
|
||||
"Particle should have taken only 1 step.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -744,14 +748,15 @@ void TestWorkletsBasic()
|
||||
auto portal = res.Particles.ReadPortal();
|
||||
for (vtkm::Id i = 0; i < res.Particles.GetNumberOfValues(); i++)
|
||||
{
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Pos == endPts[static_cast<std::size_t>(i)],
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetPosition() == endPts[static_cast<std::size_t>(i)],
|
||||
"Particle advection point is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).NumSteps == maxSteps,
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetNumberOfSteps() == maxSteps,
|
||||
"Particle advection NumSteps is wrong");
|
||||
VTKM_TEST_ASSERT(vtkm::Abs(portal.Get(i).Time - endT) < stepSize / 100,
|
||||
VTKM_TEST_ASSERT(vtkm::Abs(portal.Get(i).GetTime() - endT) < stepSize / 100,
|
||||
"Particle advection Time is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Status.CheckOk(), "Particle advection Status is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Status.CheckTerminate(),
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetStatus().CheckOk(),
|
||||
"Particle advection Status is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetStatus().CheckTerminate(),
|
||||
"Particle advection particle did not terminate");
|
||||
}
|
||||
}
|
||||
@ -770,13 +775,14 @@ void TestWorkletsBasic()
|
||||
auto parPortal = res.Particles.ReadPortal();
|
||||
for (vtkm::Id i = 0; i < res.Particles.GetNumberOfValues(); i++)
|
||||
{
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).Pos == endPts[static_cast<std::size_t>(i)],
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).GetPosition() == endPts[static_cast<std::size_t>(i)],
|
||||
"Streamline end point is wrong");
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).NumSteps == maxSteps, "Streamline NumSteps is wrong");
|
||||
VTKM_TEST_ASSERT(vtkm::Abs(parPortal.Get(i).Time - endT) < stepSize / 100,
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).GetNumberOfSteps() == maxSteps,
|
||||
"Streamline NumSteps is wrong");
|
||||
VTKM_TEST_ASSERT(vtkm::Abs(parPortal.Get(i).GetTime() - endT) < stepSize / 100,
|
||||
"Streamline Time is wrong");
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).Status.CheckOk(), "Streamline Status is wrong");
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).Status.CheckTerminate(),
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).GetStatus().CheckOk(), "Streamline Status is wrong");
|
||||
VTKM_TEST_ASSERT(parPortal.Get(i).GetStatus().CheckTerminate(),
|
||||
"Streamline particle did not terminate");
|
||||
}
|
||||
|
||||
@ -815,17 +821,19 @@ void ValidateResult(const ResultType& res,
|
||||
auto portal = res.Particles.ReadPortal();
|
||||
for (vtkm::Id i = 0; i < 3; i++)
|
||||
{
|
||||
vtkm::Vec3f p = portal.Get(i).Pos;
|
||||
vtkm::Vec3f p = portal.Get(i).GetPosition();
|
||||
vtkm::Vec3f e = endPts[static_cast<std::size_t>(i)];
|
||||
|
||||
|
||||
VTKM_TEST_ASSERT(vtkm::Magnitude(p - e) <= eps, "Particle advection point is wrong");
|
||||
if (portal.Get(i).Status.CheckZeroVelocity())
|
||||
VTKM_TEST_ASSERT(portal.Get(i).NumSteps > 0, "Particle advection NumSteps is wrong");
|
||||
if (portal.Get(i).GetStatus().CheckZeroVelocity())
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetNumberOfSteps() > 0,
|
||||
"Particle advection NumSteps is wrong");
|
||||
else
|
||||
VTKM_TEST_ASSERT(portal.Get(i).NumSteps == maxSteps, "Particle advection NumSteps is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Status.CheckOk(), "Particle advection Status is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).Status.CheckTerminate(),
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetNumberOfSteps() == maxSteps,
|
||||
"Particle advection NumSteps is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetStatus().CheckOk(), "Particle advection Status is wrong");
|
||||
VTKM_TEST_ASSERT(portal.Get(i).GetStatus().CheckTerminate(),
|
||||
"Particle advection particle did not terminate");
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
vtkm::Vec3f& pointOut) const
|
||||
{
|
||||
vtkm::VecVariable<vtkm::Vec3f, 2> values;
|
||||
status = evaluator.Evaluate(pointIn.Pos, 0.5f, values);
|
||||
status = evaluator.Evaluate(pointIn.GetPosition(), 0.5f, values);
|
||||
if (values.GetNumberOfComponents() > 0)
|
||||
pointOut = values[0];
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
vtkm::FloatDefault stepLength,
|
||||
vtkm::Vec3f& velocity) const
|
||||
{
|
||||
auto time = particle.Time;
|
||||
auto time = particle.GetTime();
|
||||
auto inpos = particle.GetEvaluationPosition(stepLength);
|
||||
vtkm::VecVariable<vtkm::Vec3f, 2> vectors;
|
||||
GridEvaluatorStatus evalStatus = this->Evaluator.Evaluate(inpos, time, vectors);
|
||||
|
@ -38,11 +38,11 @@ public:
|
||||
const vtkm::Id& step,
|
||||
ParticleType& particle) const
|
||||
{
|
||||
particle.Pos = pt;
|
||||
particle.ID = id;
|
||||
particle.Time = time;
|
||||
particle.NumSteps = step;
|
||||
particle.Status.SetOk();
|
||||
particle.SetPosition(pt);
|
||||
particle.SetID(id);
|
||||
particle.SetTime(time);
|
||||
particle.SetNumberOfSteps(step);
|
||||
particle.GetStatus().SetOk();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
const vtkm::Id& maxSteps) const
|
||||
{
|
||||
auto particle = integralCurve.GetParticle(idx);
|
||||
vtkm::FloatDefault time = particle.Time;
|
||||
vtkm::FloatDefault time = particle.GetTime();
|
||||
bool tookAnySteps = false;
|
||||
|
||||
//the integrator status needs to be more robust:
|
||||
@ -143,7 +143,7 @@ public:
|
||||
template <typename ParticleType>
|
||||
VTKM_EXEC void operator()(const ParticleType& p, vtkm::Id& numSteps) const
|
||||
{
|
||||
numSteps = p.NumSteps;
|
||||
numSteps = p.GetNumberOfSteps();
|
||||
}
|
||||
};
|
||||
|
||||
@ -156,13 +156,13 @@ public:
|
||||
using ExecutionSignature = void(_1, _2, _3);
|
||||
|
||||
// Offset is number of points in streamline.
|
||||
// 1 (inital point) + number of steps taken (p.NumSteps - initalNumSteps)
|
||||
// 1 (inital point) + number of steps taken (p.GetNumberOfSteps() - initalNumSteps)
|
||||
template <typename ParticleType>
|
||||
VTKM_EXEC void operator()(const ParticleType& p,
|
||||
const vtkm::Id& initialNumSteps,
|
||||
vtkm::Id& diff) const
|
||||
{
|
||||
diff = 1 + p.NumSteps - initialNumSteps;
|
||||
diff = 1 + p.GetNumberOfSteps() - initialNumSteps;
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
|
@ -54,9 +54,9 @@ public:
|
||||
const vtkm::Vec3f& pt)
|
||||
{
|
||||
ParticleType newParticle(particle);
|
||||
newParticle.Pos = pt;
|
||||
newParticle.Time = time;
|
||||
newParticle.NumSteps++;
|
||||
newParticle.SetPosition(pt);
|
||||
newParticle.SetTime(time);
|
||||
newParticle.SetNumberOfSteps(particle.GetNumberOfSteps() + 1);
|
||||
this->Particles.Set(idx, newParticle);
|
||||
}
|
||||
|
||||
@ -67,37 +67,37 @@ public:
|
||||
{
|
||||
ParticleType p(this->GetParticle(idx));
|
||||
|
||||
if (p.NumSteps == maxSteps)
|
||||
p.Status.SetTerminate();
|
||||
if (p.GetNumberOfSteps() == maxSteps)
|
||||
p.GetStatus().SetTerminate();
|
||||
|
||||
if (status.CheckFail())
|
||||
p.Status.SetFail();
|
||||
p.GetStatus().SetFail();
|
||||
if (status.CheckSpatialBounds())
|
||||
p.Status.SetSpatialBounds();
|
||||
p.GetStatus().SetSpatialBounds();
|
||||
if (status.CheckTemporalBounds())
|
||||
p.Status.SetTemporalBounds();
|
||||
p.GetStatus().SetTemporalBounds();
|
||||
if (status.CheckInGhostCell())
|
||||
p.Status.SetInGhostCell();
|
||||
p.GetStatus().SetInGhostCell();
|
||||
if (status.CheckZeroVelocity())
|
||||
{
|
||||
p.Status.SetZeroVelocity();
|
||||
p.Status.SetTerminate();
|
||||
p.GetStatus().SetZeroVelocity();
|
||||
p.GetStatus().SetTerminate();
|
||||
}
|
||||
|
||||
this->Particles.Set(idx, p);
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
bool CanContinue(const vtkm::Id& idx) { return this->GetParticle(idx).Status.CanContinue(); }
|
||||
bool CanContinue(const vtkm::Id& idx) { return this->GetParticle(idx).GetStatus().CanContinue(); }
|
||||
|
||||
VTKM_EXEC
|
||||
void UpdateTookSteps(const vtkm::Id& idx, bool val)
|
||||
{
|
||||
ParticleType p(this->GetParticle(idx));
|
||||
if (val)
|
||||
p.Status.SetTookAnySteps();
|
||||
p.GetStatus().SetTookAnySteps();
|
||||
else
|
||||
p.Status.ClearTookAnySteps();
|
||||
p.GetStatus().ClearTookAnySteps();
|
||||
this->Particles.Set(idx, p);
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ public:
|
||||
if (this->StepCount.Get(idx) == 0)
|
||||
{
|
||||
vtkm::Id loc = idx * Length;
|
||||
this->History.Set(loc, p.Pos);
|
||||
this->History.Set(loc, p.GetPosition());
|
||||
this->ValidPoint.Set(loc, 1);
|
||||
this->StepCount.Set(idx, 1);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
vtkm::FloatDefault stepLength,
|
||||
vtkm::Vec3f& velocity) const
|
||||
{
|
||||
auto time = particle.Time;
|
||||
auto time = particle.GetTime();
|
||||
auto inpos = particle.GetEvaluationPosition(stepLength);
|
||||
vtkm::FloatDefault boundary = this->Evaluator.GetTemporalBoundary(static_cast<vtkm::Id>(1));
|
||||
if ((time + stepLength + vtkm::Epsilon<vtkm::FloatDefault>() - boundary) > 0.0)
|
||||
|
@ -57,11 +57,11 @@ public:
|
||||
auto status = this->Integrator.CheckStep(particle, this->DeltaT, velocity);
|
||||
if (status.CheckOk())
|
||||
{
|
||||
outpos = particle.Pos + this->DeltaT * velocity;
|
||||
outpos = particle.GetPosition() + this->DeltaT * velocity;
|
||||
time += this->DeltaT;
|
||||
}
|
||||
else
|
||||
outpos = particle.Pos;
|
||||
outpos = particle.GetPosition();
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -84,7 +84,7 @@ public:
|
||||
vtkm::Vec3f currPos(particle.GetEvaluationPosition(this->DeltaT));
|
||||
vtkm::Vec3f currVelocity(0, 0, 0);
|
||||
vtkm::VecVariable<vtkm::Vec3f, 2> currValue, tmp;
|
||||
auto evalStatus = this->Evaluator.Evaluate(currPos, particle.Time, currValue);
|
||||
auto evalStatus = this->Evaluator.Evaluate(currPos, particle.GetTime(), currValue);
|
||||
if (evalStatus.CheckFail())
|
||||
return IntegratorStatus(evalStatus, false);
|
||||
|
||||
@ -102,8 +102,8 @@ public:
|
||||
if (status.CheckOk()) //Integration step succedded.
|
||||
{
|
||||
//See if this point is in/out.
|
||||
auto newPos = particle.Pos + currStep * currVelocity;
|
||||
evalStatus = this->Evaluator.Evaluate(newPos, particle.Time + currStep, tmp);
|
||||
auto newPos = particle.GetPosition() + currStep * currVelocity;
|
||||
evalStatus = this->Evaluator.Evaluate(newPos, particle.GetTime() + currStep, tmp);
|
||||
if (evalStatus.CheckOk())
|
||||
{
|
||||
//Point still in. Update currPos and set range to {currStep, stepRange[1]}
|
||||
@ -124,7 +124,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
evalStatus = this->Evaluator.Evaluate(currPos, particle.Time + stepRange[0], currValue);
|
||||
evalStatus = this->Evaluator.Evaluate(currPos, particle.GetTime() + stepRange[0], currValue);
|
||||
// The eval at Time + stepRange[0] better be *inside*
|
||||
VTKM_ASSERT(evalStatus.CheckOk() && !evalStatus.CheckSpatialBounds());
|
||||
if (evalStatus.CheckFail() || evalStatus.CheckSpatialBounds())
|
||||
|
@ -128,7 +128,7 @@ struct PerlinNoiseWorklet : public vtkm::worklet::WorkletVisitPointsWithCells
|
||||
class PerlinNoiseField : public vtkm::filter::FilterField
|
||||
{
|
||||
public:
|
||||
VTKM_CONT PerlinNoiseField(vtkm::IdComponent tableSize, vtkm::Id seed)
|
||||
VTKM_CONT PerlinNoiseField(vtkm::IdComponent tableSize, vtkm::IdComponent seed)
|
||||
: TableSize(tableSize)
|
||||
, Seed(seed)
|
||||
{
|
||||
@ -149,26 +149,7 @@ private:
|
||||
VTKM_CONT void GeneratePermutations()
|
||||
{
|
||||
std::mt19937_64 rng;
|
||||
if (this->Seed != 0)
|
||||
{
|
||||
rng.seed(this->Seed);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If a seed has not been chosen, create a unique seed here. It is done here instead
|
||||
// of the `PerlinNoise` source constructor for 2 reasons. First, `std::random_device`
|
||||
// can be slow. If the user wants to specify a seed, it makes no sense to spend
|
||||
// time generating a random seed only to overwrite it. Second, creating the seed
|
||||
// here allows subsequent runs of the `PerlinNoise` source to have different random
|
||||
// results if a seed is not specified.
|
||||
//
|
||||
// It is also worth noting that the current time is added to the random number.
|
||||
// This is because the spec for std::random_device allows it to be deterministic
|
||||
// if nondeterministic hardware is unavailable and the deterministic numbers can
|
||||
// be the same for every execution of the program. Adding the current time is
|
||||
// a fallback for that case.
|
||||
rng.seed(std::random_device{}() + time(NULL));
|
||||
}
|
||||
rng.seed(this->Seed);
|
||||
std::uniform_int_distribution<vtkm::IdComponent> distribution(0, this->TableSize - 1);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> perms;
|
||||
@ -187,7 +168,7 @@ private:
|
||||
}
|
||||
|
||||
vtkm::IdComponent TableSize;
|
||||
vtkm::Id Seed;
|
||||
vtkm::IdComponent Seed;
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> Permutations;
|
||||
};
|
||||
|
||||
@ -243,7 +224,26 @@ vtkm::cont::DataSet PerlinNoise::DoExecute() const
|
||||
|
||||
auto tableSize =
|
||||
static_cast<vtkm::IdComponent>(vtkm::Max(cellDims[0], vtkm::Max(cellDims[1], cellDims[2])));
|
||||
PerlinNoiseField noiseGenerator(tableSize, this->Seed);
|
||||
|
||||
vtkm::IdComponent seed = this->Seed;
|
||||
if (!this->SeedSet)
|
||||
{
|
||||
// If a seed has not been chosen, create a unique seed here. It is done here instead
|
||||
// of the `PerlinNoise` source constructor for 2 reasons. First, `std::random_device`
|
||||
// can be slow. If the user wants to specify a seed, it makes no sense to spend
|
||||
// time generating a random seed only to overwrite it. Second, creating the seed
|
||||
// here allows subsequent runs of the `PerlinNoise` source to have different random
|
||||
// results if a seed is not specified.
|
||||
//
|
||||
// It is also worth noting that the current time is added to the random number.
|
||||
// This is because the spec for std::random_device allows it to be deterministic
|
||||
// if nondeterministic hardware is unavailable and the deterministic numbers can
|
||||
// be the same for every execution of the program. Adding the current time is
|
||||
// a fallback for that case.
|
||||
seed = static_cast<vtkm::IdComponent>(std::random_device{}() + time(NULL));
|
||||
}
|
||||
|
||||
PerlinNoiseField noiseGenerator(tableSize, seed);
|
||||
noiseGenerator.SetOutputFieldName("perlinnoise");
|
||||
dataSet = noiseGenerator.Execute(dataSet);
|
||||
|
||||
|
@ -57,9 +57,13 @@ public:
|
||||
|
||||
/// \brief The seed used for the pseudorandom number generation of the noise.
|
||||
///
|
||||
/// If the seed is set to 0, then a new, unique seed is picked each time `Execute` is run.
|
||||
/// If the seed is not set, then a new, unique seed is picked each time `Execute` is run.
|
||||
VTKM_CONT vtkm::IdComponent GetSeed() const { return this->Seed; }
|
||||
VTKM_CONT void SetSeed(vtkm::IdComponent seed) { this->Seed = seed; }
|
||||
VTKM_CONT void SetSeed(vtkm::IdComponent seed)
|
||||
{
|
||||
this->Seed = seed;
|
||||
this->SeedSet = true;
|
||||
}
|
||||
|
||||
private:
|
||||
vtkm::cont::DataSet DoExecute() const override;
|
||||
@ -67,6 +71,7 @@ private:
|
||||
vtkm::Id3 PointDimensions = { 16, 16, 16 };
|
||||
vtkm::Vec3f Origin = { 0, 0, 0 };
|
||||
vtkm::IdComponent Seed = 0;
|
||||
bool SeedSet = false;
|
||||
};
|
||||
} //namespace source
|
||||
} //namespace vtkm
|
||||
|
3
vtkm/thirdparty/diy/CMakeLists.txt
vendored
3
vtkm/thirdparty/diy/CMakeLists.txt
vendored
@ -82,6 +82,7 @@ endif()
|
||||
include(VTKmDIYUtils)
|
||||
|
||||
add_library(vtkm_diy INTERFACE)
|
||||
|
||||
vtkm_diy_init_target()
|
||||
target_include_directories(vtkm_diy INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
@ -113,7 +114,7 @@ else()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
install(TARGETS vtkm_diy EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_diy)
|
||||
|
||||
## Install headers
|
||||
if (NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
|
3
vtkm/thirdparty/lcl/CMakeLists.txt
vendored
3
vtkm/thirdparty/lcl/CMakeLists.txt
vendored
@ -18,8 +18,7 @@ target_include_directories(vtkm_lcl INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/vtkmlcl>
|
||||
$<INSTALL_INTERFACE:${VTKm_INSTALL_INCLUDE_DIR}/vtkm/thirdparty/lcl/vtkmlcl>)
|
||||
|
||||
install(TARGETS vtkm_lcl
|
||||
EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_lcl)
|
||||
|
||||
## Install headers
|
||||
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
|
2
vtkm/thirdparty/lodepng/CMakeLists.txt
vendored
2
vtkm/thirdparty/lodepng/CMakeLists.txt
vendored
@ -15,4 +15,4 @@ set_target_properties(vtkm_lodepng PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# This will not install anything but it is needed for CMake <= 3.21 since it
|
||||
# does not fully support $<TARGET_OBJECTS> in target_link_library.
|
||||
install(TARGETS vtkm_lodepng EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_lodepng)
|
||||
|
3
vtkm/thirdparty/loguru/CMakeLists.txt
vendored
3
vtkm/thirdparty/loguru/CMakeLists.txt
vendored
@ -20,5 +20,4 @@ target_include_directories(vtkm_loguru INTERFACE
|
||||
|
||||
target_link_libraries(vtkm_loguru INTERFACE ${CMAKE_DL_LIBS} Threads::Threads)
|
||||
|
||||
install(TARGETS vtkm_loguru
|
||||
EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_loguru)
|
||||
|
3
vtkm/thirdparty/optionparser/CMakeLists.txt
vendored
3
vtkm/thirdparty/optionparser/CMakeLists.txt
vendored
@ -15,8 +15,7 @@ target_include_directories(vtkm_optionparser INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:${VTKm_INSTALL_INCLUDE_DIR}/vtkm/thirdparty/optionparser>)
|
||||
|
||||
install(TARGETS vtkm_optionparser
|
||||
EXPORT ${VTKm_EXPORT_NAME})
|
||||
vtkm_install_targets(TARGETS vtkm_optionparser)
|
||||
|
||||
## Install headers
|
||||
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
||||
|
@ -53,7 +53,7 @@ vtkm_unit_tests(
|
||||
LIBRARIES vtkm_source vtkm_worklet vtkm_filter vtkm_io
|
||||
USE_VTKM_JOB_POOL
|
||||
)
|
||||
if (TARGET vtkm::cuda)
|
||||
if (TARGET vtkm_cuda)
|
||||
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
|
||||
CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.0.0)
|
||||
set(problematic_cuda_srcs
|
||||
|
Loading…
Reference in New Issue
Block a user