-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refinement_partitioner
- Loading branch information
Showing
17 changed files
with
324 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This file was generated by running | ||
# | ||
# python cmake/scripts/generate-cmakefiles from dolfinx/cpp | ||
# | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
set(PROJECT_NAME demo_codim_0_assembly) | ||
project(${PROJECT_NAME} LANGUAGES C CXX) | ||
|
||
# Set C++20 standard | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
if(NOT TARGET dolfinx) | ||
find_package(DOLFINX REQUIRED) | ||
endif() | ||
|
||
include(CheckSymbolExists) | ||
set(CMAKE_REQUIRED_INCLUDES ${PETSC_INCLUDE_DIRS}) | ||
check_symbol_exists(PETSC_USE_COMPLEX petscsystypes.h PETSC_SCALAR_COMPLEX) | ||
check_symbol_exists(PETSC_USE_REAL_DOUBLE petscsystypes.h PETSC_REAL_DOUBLE) | ||
|
||
# Add target to compile UFL files | ||
if(PETSC_SCALAR_COMPLEX EQUAL 1) | ||
if(PETSC_REAL_DOUBLE EQUAL 1) | ||
set(SCALAR_TYPE "--scalar_type=complex128") | ||
else() | ||
set(SCALAR_TYPE "--scalar_type=complex64") | ||
endif() | ||
else() | ||
if(PETSC_REAL_DOUBLE EQUAL 1) | ||
set(SCALAR_TYPE "--scalar_type=float64") | ||
else() | ||
set(SCALAR_TYPE "--scalar_type=float32") | ||
endif() | ||
endif() | ||
add_custom_command( | ||
OUTPUT mixed_codim0.c | ||
COMMAND ffcx ${CMAKE_CURRENT_SOURCE_DIR}/mixed_codim0.py ${SCALAR_TYPE} | ||
VERBATIM | ||
DEPENDS mixed_codim0.py | ||
COMMENT "Compile mixed_codim0.py using FFCx" | ||
) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
add_executable(${PROJECT_NAME} main.cpp ${CMAKE_CURRENT_BINARY_DIR}/mixed_codim0.c) | ||
target_link_libraries(${PROJECT_NAME} dolfinx) | ||
|
||
# Do not throw error for 'multi-line comments' (these are typical in rst which | ||
# includes LaTeX) | ||
include(CheckCXXCompilerFlag) | ||
check_cxx_compiler_flag("-Wno-comment" HAVE_NO_MULTLINE) | ||
set_source_files_properties( | ||
main.cpp | ||
PROPERTIES | ||
COMPILE_FLAGS | ||
"$<$<BOOL:${HAVE_NO_MULTLINE}>:-Wno-comment -Wall -Wextra -pedantic -Werror>" | ||
) | ||
|
||
# Test targets (used by DOLFINx testing system) | ||
set(TEST_PARAMETERS2 -np 2 ${MPIEXEC_PARAMS} "./${PROJECT_NAME}") | ||
set(TEST_PARAMETERS3 -np 3 ${MPIEXEC_PARAMS} "./${PROJECT_NAME}") | ||
add_test(NAME ${PROJECT_NAME}_mpi_2 COMMAND "mpirun" ${TEST_PARAMETERS2}) | ||
add_test(NAME ${PROJECT_NAME}_mpi_3 COMMAND "mpirun" ${TEST_PARAMETERS3}) | ||
add_test(NAME ${PROJECT_NAME}_serial COMMAND ${PROJECT_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.