Skip to content

Commit fb96c51

Browse files
committed
Merge branch 'master' into gh-pages
2 parents 2e52c56 + 1ff10fb commit fb96c51

File tree

189 files changed

+25639
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+25639
-0
lines changed

CMakeLists.txt

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
#------------------------------------------------------------------------------#
2+
# Project settings
3+
#------------------------------------------------------------------------------#
4+
5+
cmake_minimum_required(VERSION 3.12)
6+
include(CheckLanguage)
7+
8+
project(VertexCFD LANGUAGES CXX)
9+
set(PROJECT_VERSION "0.0-dev" )
10+
11+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
12+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
13+
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
14+
15+
set(CMAKE_CXX_STANDARD 17)
16+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
17+
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
18+
19+
option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
20+
21+
include(GNUInstallDirs)
22+
23+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
24+
25+
# Set the exodiff path relative to Trilinos installation path
26+
set(EXODIFF_PATH ${Trilinos_ROOT}/bin/exodiff)
27+
28+
# Set the Trilinos lib path relative to Trilinos installation path
29+
set(TRILINOS_LIB ${Trilinos_ROOT}/lib64)
30+
31+
option(NO_PARMETIS_SUPPORT "No parmetis support" ON)
32+
add_compile_definitions(NO_PARMETIS_SUPPORT)
33+
34+
# Add the installation library dir to the executable RPATH
35+
list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
36+
37+
# Add paths to linked libraries outside the build tree to the RPATH
38+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
39+
40+
#------------------------------------------------------------------------------#
41+
# Dependencies
42+
#------------------------------------------------------------------------------#
43+
44+
find_package(CLANG_FORMAT)
45+
46+
find_package(YAPF)
47+
48+
find_package(MPI REQUIRED)
49+
50+
find_package(Trilinos REQUIRED)
51+
if (Trilinos_VERSION VERSION_LESS 16 OR Trilinos_VERSION VERSION_GREATER_EQUAL 17)
52+
message(FATAL_ERROR "Incompatible Trilinos version ${Trilinos_VERSION}. Only Trilinos version 16 and above are supported.")
53+
endif ()
54+
55+
# FIXME Tacho requires rocblas, rocsparse, and rocsolver with HIP but doesn't
56+
# enforce this dependency explicitly through version 16.0.0
57+
if(Kokkos_ENABLE_HIP AND NOT (ShyLU_NodeTacho_ENABLE_ROCSOLVER AND ShyLU_NodeTacho_ENABLE_ROCSPARSE AND ShyLU_NodeTacho_ENABLE_ROCBLAS))
58+
message(FATAL_ERROR "ShyLU_NodeTacho wasn't configured with the ROC* TPLs enabled!")
59+
endif()
60+
61+
if (VertexCFD_ENABLE_HYPRE)
62+
find_package(HYPRE REQUIRED)
63+
find_package(HYPREDRV REQUIRED)
64+
add_compile_definitions(VERTEXCFD_HAVE_HYPRE)
65+
endif()
66+
67+
find_package(Python COMPONENTS Interpreter Development.Module)
68+
69+
if (VertexCFD_ENABLE_SUPERLU)
70+
find_package(SuperLU_dist REQUIRED)
71+
add_compile_definitions(HAVE_SUPERLUDIST)
72+
endif()
73+
74+
#------------------------------------------------------------------------------#
75+
# Performance Portability
76+
# ------------------------------------------------------------------------------#
77+
# Set the kokkos node type used by panzer/phalanx. We do this because phalanx
78+
# explicitly sets a node type to be used by all of its data structures which
79+
# is subsequently used by panzer. Below we copy the logic from Phalanx for
80+
# choosing the default node type so our choice matches that of Panzer. The
81+
# phalanx CMake variable ${Phalanx_KOKKOS_DEVICE_TYPE} is not exported and
82+
# therefore is not accessible here which would have been perferable.
83+
if (Kokkos_ENABLE_CUDA)
84+
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "CUDA")
85+
elseif (Kokkos_ENABLE_HIP)
86+
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "HIP")
87+
elseif (Kokkos_ENABLE_OPENMP)
88+
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "OPENMP")
89+
elseif (Kokkos_ENABLE_SERIAL)
90+
set(VERTEXCFD_KOKKOS_DEVICE_TYPE "SERIAL")
91+
else()
92+
message(FATAL_ERROR "No Kokkos execution space is enabled.")
93+
endif()
94+
95+
# Check that the kokkos device type we want is available.
96+
kokkos_check( DEVICES ${VERTEXCFD_KOKKOS_DEVICE_TYPE} )
97+
98+
# ensure that we can use lambdas if we are using cuda.
99+
if(${VERTEXCFD_KOKKOS_DEVICE_TYPE} STREQUAL "CUDA")
100+
kokkos_check(OPTIONS CUDA_LAMBDA)
101+
endif()
102+
103+
# output Phalanx/Panzer device type
104+
message( STATUS "Phalanx/Panzer Kokkos device type: ${VERTEXCFD_KOKKOS_DEVICE_TYPE}" )
105+
106+
#------------------------------------------------------------------------------#
107+
# Tests and Documentation
108+
#------------------------------------------------------------------------------#
109+
110+
option(VertexCFD_ENABLE_TESTING "Build tests" OFF)
111+
if(VertexCFD_ENABLE_TESTING)
112+
include(CTest)
113+
find_package(GTest REQUIRED)
114+
enable_testing()
115+
endif()
116+
117+
if (VertexCFD_BUILD_DOC)
118+
find_package(Doxygen)
119+
if (DOXYGEN_FOUND)
120+
# ignore dep packages like gtest/gmock
121+
set(DOXYGEN_EXCLUDE_PATTERNS "*/_deps/*")
122+
doxygen_add_docs( vertexcfddocs
123+
${PROJECT_SOURCE_DIR}
124+
COMMENT "Generate doxygen pages"
125+
)
126+
else (DOXYGEN_FOUND)
127+
message(STATUS "Doxygen need to be installed to generate the doxygen documentation")
128+
endif (DOXYGEN_FOUND)
129+
else (VertexCFD_BUILD_DOC)
130+
message(STATUS "Doxygen documentation disabled!")
131+
endif (VertexCFD_BUILD_DOC)
132+
133+
134+
##---------------------------------------------------------------------------##
135+
## Code coverage testing
136+
##---------------------------------------------------------------------------##
137+
option(VertexCFD_ENABLE_COVERAGE_BUILD "Do a coverage build" OFF)
138+
if(VertexCFD_ENABLE_COVERAGE_BUILD)
139+
message(STATUS "Enabling coverage build")
140+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -O0")
141+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
142+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
143+
endif()
144+
145+
##---------------------------------------------------------------------------##
146+
## Print the revision number to stdout
147+
##---------------------------------------------------------------------------##
148+
find_package(Git)
149+
if(GIT_FOUND AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.git)
150+
execute_process(
151+
COMMAND ${GIT_EXECUTABLE} log --pretty=format:%H -n 1
152+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
153+
OUTPUT_VARIABLE VertexCFD_GIT_COMMIT_HASH
154+
)
155+
else()
156+
set(VertexCFD_GIT_COMMIT_HASH "Not a git repository")
157+
endif()
158+
message(STATUS "VertexCFD Revision = '${VertexCFD_GIT_COMMIT_HASH}'")
159+
160+
##---------------------------------------------------------------------------##
161+
## Library
162+
##---------------------------------------------------------------------------##
163+
164+
add_subdirectory(src)
165+
166+
add_subdirectory(examples)
167+
168+
file(COPY regression_test DESTINATION .)
169+
170+
# Delete the unwanted file from the destination
171+
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/regression_test/vertexcfd_test.py.in)
172+
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/regression_test/rename_variables_exodus.py.in)
173+
174+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/regression_test/vertexcfd_test.py.in
175+
${CMAKE_CURRENT_BINARY_DIR}/regression_test/vertexcfd_test.py)
176+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/regression_test/rename_variables_exodus.py.in
177+
${CMAKE_CURRENT_BINARY_DIR}/regression_test/rename_variables_exodus.py)
178+
179+
##---------------------------------------------------------------------------##
180+
## Package Configuration
181+
##---------------------------------------------------------------------------##
182+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/VertexCFDConfig.cmake.in
183+
${CMAKE_CURRENT_BINARY_DIR}/VertexCFDConfig.cmake @ONLY)
184+
185+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/VertexCFDConfig.cmake"
186+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VertexCFD)
187+
188+
##---------------------------------------------------------------------------##
189+
## Clang Format
190+
##---------------------------------------------------------------------------##
191+
if(CLANG_FORMAT_FOUND)
192+
file(GLOB_RECURSE FORMAT_SOURCES src/*.cpp src/*.hpp)
193+
add_custom_target(format-cpp
194+
COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file ${FORMAT_SOURCES}
195+
DEPENDS ${FORMAT_SOURCES})
196+
add_custom_target(format-cpp-dry-run
197+
COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file --dry-run -Werror ${FORMAT_SOURCES}
198+
DEPENDS ${FORMAT_SOURCES})
199+
endif()
200+
201+
##---------------------------------------------------------------------------##
202+
## Python Format
203+
##---------------------------------------------------------------------------##
204+
if(YAPF_FOUND)
205+
file(GLOB_RECURSE FORMAT_SOURCES *.py)
206+
add_custom_target(format-python
207+
COMMAND ${YAPF_EXECUTABLE} -i -vv ${FORMAT_SOURCES}
208+
DEPENDS ${FORMAT_SOURCES})
209+
add_custom_target(format-python-dry-run
210+
COMMAND ${YAPF_EXECUTABLE} -d ${FORMAT_SOURCES}
211+
DEPENDS ${FORMAT_SOURCES})
212+
endif()
213+
214+
##---------------------------------------------------------------------------##
215+
## Python and Clang Format
216+
##---------------------------------------------------------------------------##
217+
if(YAPF_FOUND OR CLANG_FORMAT_FOUND)
218+
add_custom_target(format)
219+
if(CLANG_FORMAT_FOUND)
220+
add_dependencies(format format-cpp)
221+
endif()
222+
if(YAPF_FOUND)
223+
add_dependencies(format format-python)
224+
endif()
225+
endif()
226+
227+
##---------------------------------------------------------------------------##
228+
## Code coverage report generation
229+
##---------------------------------------------------------------------------##
230+
if(VertexCFD_ENABLE_COVERAGE_BUILD)
231+
message(CHECK_START "Checking for gcovr")
232+
list(APPEND CMAKE_MESSAGE_INDENT " ")
233+
find_package(GCOVR)
234+
list(POP_BACK CMAKE_MESSAGE_INDENT)
235+
if(NOT GCOVR_FOUND)
236+
message(CHECK_FAIL "not found. Coverage report targets disabled.")
237+
else()
238+
message(CHECK_PASS "found. Adding coverage report targets.")
239+
list(APPEND CMAKE_MESSAGE_INDENT " ")
240+
set(gcovr_filter "'${PROJECT_SOURCE_DIR}/src/.*'")
241+
message(STATUS "Adding gcovr_xml target")
242+
add_custom_target(gcovr_xml
243+
COMMAND ${GCOVR_EXECUTABLE}
244+
--filter=${gcovr_filter} --xml-pretty --print-summary -o coverage.xml
245+
-r "${PROJECT_SOURCE_DIR}" .)
246+
message(STATUS "Adding gcovr_html target")
247+
add_custom_target(gcovr_html
248+
COMMAND ${GCOVR_EXECUTABLE}
249+
--filter=${gcovr_filter} --html-details coverage/
250+
-r "${PROJECT_SOURCE_DIR}" .)
251+
list(POP_BACK CMAKE_MESSAGE_INDENT)
252+
endif()
253+
endif()

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# VERTEX-CFD
2+
VERTEX-CFD is a performance portable software package for computational fluid dynamics (CFD) simulations on CPU or GPU architectures, built upon the [Trilinos](https://trilinos.github.io/) numerical library.
3+
4+
## Pipeline status of master branch:
5+
[![pipeline status](https://code-int.ornl.gov/vertex/vertex-cfd/badges/master/pipeline.svg)](https://code-int.ornl.gov/mxd/vertex-cfd/-/commits/master?ref_type=heads)
6+
[![coverage report](https://code-int.ornl.gov/vertex/vertex-cfd/badges/master/coverage.svg)](https://code-int.ornl.gov/mxd/vertex-cfd/-/commits/master?ref_type=heads)
7+
8+
9+
## [CPU BUILD INSTRUCTIONS](doc/install-vertex/install-vertex-on-narsil-cpu.md)
10+
11+
## [GPU BUILD INSTRUCTIONS](doc/install-vertex/install-vertex-on-narsil-gpu.md)
12+
13+
## [RUNNING CASES WITH VERTEX-CFD](doc/run-vertex-cfd/Run-incompressible-channel.md)
14+
15+
test2

examples/CMakeLists.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
set(REGRESSION_XML_FILES
2+
inputs/incompressible/incompressible_2d_backward_facing_step.xml
3+
inputs/incompressible/incompressible_2d_channel_periodic.xml
4+
inputs/incompressible/incompressible_2d_concentric_cylinder_convection.xml
5+
inputs/incompressible/incompressible_2d_heated_channel.xml
6+
inputs/incompressible/incompressible_2d_k_omega_turbulence_channel.xml
7+
inputs/incompressible/incompressible_2d_laminar_airfoil.xml
8+
inputs/incompressible/incompressible_2d_planar_poiseuille.xml
9+
inputs/incompressible/incompressible_2d_planar_poiseuille_cuda.xml
10+
inputs/incompressible/incompressible_2d_realizable_k_epsilon_turbulence_channel.xml
11+
inputs/incompressible/incompressible_2d_rotating_cylinder_viscous.xml
12+
inputs/incompressible/incompressible_2d_spalart_allmaras_turbulence_channel.xml
13+
inputs/incompressible/incompressible_2d_spalart_allmaras_turbulence_heated_channel.xml
14+
inputs/incompressible/incompressible_2d_standard_k_epsilon_turbulence_channel.xml
15+
inputs/incompressible/incompressible_2d_taylor_green_vortex.xml
16+
inputs/incompressible/incompressible_2d_tee_junction.xml
17+
inputs/incompressible/incompressible_3d_channel_periodic.xml
18+
inputs/incompressible/incompressible_2d_triangular_cavity_Re100.xml
19+
inputs/incompressible/incompressible_3d_wale_cavity.xml
20+
inputs/incompressible/incompressible_blunt_plate_laminar_flow_2d.xml
21+
inputs/incompressible/incompressible_oscillating_heated_laminar_flow_2d.xml
22+
inputs/induction_less_mhd/mhd_2d_hartmann_pb_periodic_insulating.xml
23+
inputs/induction_less_mhd/mhd_2d_hartmann_pb_periodic_insulating_cuda.xml
24+
inputs/full_induction_mhd/full_induction_vortex_2d_pb.xml
25+
inputs/full_induction_mhd/divergence_advection_2d.xml
26+
inputs/full_induction_mhd/current_sheet_2d.xml
27+
inputs/full_induction_mhd/ldc_2d_bx_010.xml
28+
inputs/full_induction_mhd/ldc_2d_mixed_b_050_rotated.xml
29+
)
30+
file(COPY ${REGRESSION_XML_FILES} DESTINATION .)
31+
32+
set(REGRESSION_EXO_FILES
33+
mesh/incompressible/2d_backward_facing_step.exo
34+
mesh/incompressible/2d_concentric_convection.exo
35+
mesh/incompressible/2d_concentric_cylinders_rad10.exo
36+
mesh/incompressible/2d_concentric_cylinders_rad20.exo
37+
mesh/incompressible/2d_concentric_cylinders_rad40.exo
38+
mesh/incompressible/2d_concentric_cylinders_rad80.exo
39+
mesh/incompressible/2d_cyclinder_vertex_quad.exo
40+
mesh/incompressible/2d_laminar_airfoil_0aoa.exo
41+
mesh/incompressible/2d_laminar_airfoil_3aoa.exo
42+
mesh/incompressible/2d_laminar_airfoil_8aoa.exo
43+
mesh/incompressible/2d-short-channel-h-1-ret-180-yp-0-10.exo
44+
mesh/incompressible/2d_tee_junction.exo
45+
mesh/incompressible/2d_triangular_cavity.exo
46+
mesh/incompressible/bluntplate_square.exo
47+
mesh/incompressible/pipe_hex.exo
48+
mesh/incompressible/turbulent_channel_mesh_one.exo
49+
mesh/full_induction_mhd/ldc_bl_41x41_30deg.exo
50+
mesh/full_induction_mhd/ldc_bl_81x81.exo
51+
)
52+
file(COPY ${REGRESSION_EXO_FILES} DESTINATION .)
53+
54+
install(FILES
55+
inputs/incompressible/incompressible_2d_backward_facing_step.xml
56+
inputs/incompressible/incompressible_2d_channel_periodic.xml
57+
inputs/incompressible/incompressible_2d_concentric_cylinder_convection.xml
58+
inputs/incompressible/incompressible_2d_laminar_airfoil.xml
59+
inputs/incompressible/incompressible_2d_planar_poiseuille.xml
60+
inputs/incompressible/incompressible_2d_realizable_k_epsilon_turbulence_channel.xml
61+
inputs/incompressible/incompressible_2d_rotating_cylinder_viscous.xml
62+
inputs/incompressible/incompressible_2d_tee_junction.xml
63+
inputs/incompressible/incompressible_3d_channel_periodic.xml
64+
inputs/incompressible/incompressible_3d_wale_cavity.xml
65+
inputs/incompressible/incompressible_blunt_plate_laminar_flow_2d.xml
66+
inputs/incompressible/incompressible_oscillating_heated_laminar_flow_2d.xml
67+
DESTINATION examples/incompressible)
68+
69+
install(FILES
70+
mesh/incompressible/2d_backward_facing_step.exo
71+
mesh/incompressible/2d_concentric_convection.exo
72+
mesh/incompressible/2d_concentric_cylinders_rad40.exo
73+
mesh/incompressible/2d_cyclinder_vertex_quad.exo
74+
mesh/incompressible/2d_laminar_airfoil_0aoa.exo
75+
mesh/incompressible/2d_laminar_airfoil_3aoa.exo
76+
mesh/incompressible/2d_laminar_airfoil_8aoa.exo
77+
mesh/incompressible/2d_tee_junction.exo
78+
mesh/incompressible/bluntplate_square.exo
79+
mesh/incompressible/pipe_hex.exo
80+
DESTINATION examples/incompressible)

0 commit comments

Comments
 (0)