Skip to content
Snippets Groups Projects
Commit a45cc411 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added new tool: tnl-decompose-mesh

parent 0f4f0f39
No related branches found
No related tags found
1 merge request!65VTK formats, distributed mesh and synchronizer
# This module will try to find METIS and define the following:
# METIS_FOUND - True iff METIS was found
# METIS_INCLUDE_DIRS - METIS include directories
# METIS_LIBRARIES - METIS library paths
find_path(METIS_INCLUDE_DIR metis.h
PATHS /usr/include /usr/local/include
DOC "METIS include directory")
find_library(METIS_LIBRARY metis
PATHS /usr/lib /usr/local/lib ${PROJECT_SOURCE_DIR}/metis
DOC "Path to METIS library")
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set METIS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(METIS DEFAULT_MSG
METIS_LIBRARY METIS_INCLUDE_DIR)
mark_as_advanced(METIS_INCLUDE_DIR METIS_LIBRARY)
set(METIS_LIBRARIES ${METIS_LIBRARY})
set(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
......@@ -157,6 +157,44 @@ inline std::string getTypeName( std::uint64_t ) { return "UInt64"; }
inline std::string getTypeName( float ) { return "Float32"; }
inline std::string getTypeName( double ) { return "Float64"; }
/**
* Ghost points and ghost cells
*
* The following bit fields are consistent with the corresponding VTK enums [1], which in turn
* are consistent with VisIt ghost zones specification [2].
*
* - [1] https://github.com/Kitware/VTK/blob/060f626b8df0b8144ec8f10c41f936b712c0330b/Common/DataModel/vtkDataSetAttributes.h#L118-L138
* - [2] http://www.visitusers.org/index.php?title=Representing_ghost_data
*/
enum class CellGhostTypes
: std::uint8_t
{
DUPLICATECELL = 1, // the cell is present on multiple processors
HIGHCONNECTIVITYCELL = 2, // the cell has more neighbors than in a regular mesh
LOWCONNECTIVITYCELL = 4, // the cell has less neighbors than in a regular mesh
REFINEDCELL = 8, // other cells are present that refines it.
EXTERIORCELL = 16, // the cell is on the exterior of the data set
HIDDENCELL = 32 // the cell is needed to maintain connectivity, but the data values should be ignored.
};
enum class PointGhostTypes
: std::uint8_t
{
DUPLICATEPOINT = 1, // the cell is present on multiple processors
HIDDENPOINT = 2 // the point is needed to maintain connectivity, but the data values should be ignored.
};
/**
* A DataArray with this name is used in the parallel VTK files to indicate ghost regions.
* Each value must be assigned according to the bit fields PointGhostTypes or CellGhostType.
*
* For details, see https://blog.kitware.com/ghost-and-blanking-visibility-changes/
*/
inline const char* ghostArrayName()
{
return "vtkGhostType";
}
} // namespace VTK
} // namespace Meshes
} // namespace TNL
......@@ -41,6 +41,23 @@ if( tinyxml2_FOUND )
target_link_libraries(tnl-mesh-converter tinyxml2::tinyxml2)
endif()
find_package( METIS QUIET )
if( METIS_FOUND )
add_executable(tnl-decompose-mesh tnl-decompose-mesh.cpp)
target_include_directories(tnl-decompose-mesh PUBLIC ${METIS_INCLUDE_DIRS})
target_link_libraries(tnl-decompose-mesh ${METIS_LIBRARIES})
if( ZLIB_FOUND )
target_compile_definitions(tnl-decompose-mesh PUBLIC "-DHAVE_ZLIB")
target_include_directories(tnl-decompose-mesh PUBLIC ${ZLIB_INCLUDE_DIRS})
target_link_libraries(tnl-decompose-mesh ${ZLIB_LIBRARIES})
endif()
if( tinyxml2_FOUND )
target_compile_definitions(tnl-decompose-mesh PUBLIC "-DHAVE_TINYXML2")
target_link_libraries(tnl-decompose-mesh tinyxml2::tinyxml2)
endif()
install( TARGETS tnl-decompose-mesh DESTINATION bin )
endif()
IF( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( tnl-cuda-arch tnl-cuda-arch.cu )
INSTALL( TARGETS tnl-cuda-arch
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment