From 69b913df65b0799ab422202913211e7098b75f12 Mon Sep 17 00:00:00 2001 From: LBer Date: Tue, 25 Jan 2022 16:18:22 +0100 Subject: [PATCH] clamped bar examples missing seldon files #1 --- example/clamped_bar/CMakeLists.txt | 9 +++++ example/petsc_clamped_bar/CMakeLists.txt | 49 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 example/clamped_bar/CMakeLists.txt create mode 100644 example/petsc_clamped_bar/CMakeLists.txt diff --git a/example/clamped_bar/CMakeLists.txt b/example/clamped_bar/CMakeLists.txt new file mode 100644 index 0000000..ceca499 --- /dev/null +++ b/example/clamped_bar/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(clamped_bar) +ADD_CUSTOM_TARGET(clamped_bar_sync ALL + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configuration ${CMAKE_CURRENT_BINARY_DIR}/configuration + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/result ${CMAKE_CURRENT_BINARY_DIR}/result) +add_dependencies(clamped_bar clamped_bar_sync) + +add_executable(clamped_bar_forward forward.cpp) +target_link_libraries(clamped_bar_forward verdandi) +add_dependencies(clamped_bar clamped_bar_forward) \ No newline at end of file diff --git a/example/petsc_clamped_bar/CMakeLists.txt b/example/petsc_clamped_bar/CMakeLists.txt new file mode 100644 index 0000000..7cf39a8 --- /dev/null +++ b/example/petsc_clamped_bar/CMakeLists.txt @@ -0,0 +1,49 @@ +add_custom_target(petsc_clamped_bar) +ADD_CUSTOM_TARGET(petsc_clamped_bar_sync ALL + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configuration ${CMAKE_CURRENT_BINARY_DIR}/configuration + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/result ${CMAKE_CURRENT_BINARY_DIR}/result) +add_dependencies(petsc_clamped_bar petsc_clamped_bar_sync) + +find_package(MPI REQUIRED) +if (MPI_FOUND) + include_directories(SYSTEM ${MPI_INCLUDE_PATH}) +else (MPI_FOUND) + message(SEND_ERROR "This application cannot compile without MPI") +endif (MPI_FOUND) + +# PkgConfig +find_package(PkgConfig) + +# PETSc +if (PKG_CONFIG_FOUND) + pkg_check_modules(PETSC PETSc) +endif() + +if (PETSC_FOUND) + list(APPEND COMPILE_OPTIONS ${PETSC_CFLAGS}) + + include_directories(${PETSC_INCLUDE_DIRS}) + + set(LINK_FLAGS "${LINK_FLAGS} ${PETSC_LDFLAGS}") + + list(APPEND LIBRARIES ${PETSC_LINK_LIBRARIES}) + + set(CMAKE_REQUIRED_FLAGS ${PETSC_CFLAGS}) + + set(CMAKE_REQUIRED_INCLUDES "${PETSC_INCLUDE_DIRS}") +else (PETSC_FOUND) + message(SEND_ERROR "This application cannot compile without PETSC") +endif (PETSC_FOUND) + +add_executable(petsc_clamped_bar_forward forward.cpp) +target_link_libraries(petsc_clamped_bar_forward verdandi ${MPI_LIBRARIES} ${PETSC_LIBRARIES}) +add_dependencies(petsc_clamped_bar petsc_clamped_bar_forward) + +# add_executable(petsc_clamped_bar_optimal_interpolation optimal_interpolation.cpp) +# target_link_libraries(petsc_clamped_bar_optimal_interpolation verdandi) +# add_dependencies(petsc_clamped_bar petsc_clamped_bar_optimal_interpolation) + + +# add_executable(petsc_clamped_bar_enkf ensemble_kalman_filter.cpp) +# target_link_libraries(petsc_clamped_bar_enkf verdandi) +# add_dependencies(petsc_clamped_bar petsc_clamped_bar_enkf) \ No newline at end of file