CMAKE_MINIMUM_REQUIRED(VERSION 3.3.0)
-# Set the name of the project and target:
-SET(TARGET "parallel_in_time")
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
-
-SET(PROJECT_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
-SET(SRC_PATH "${PROJECT_PATH}/src")
-SET(TEST_SRC_PATH "${PROJECT_PATH}/test")
-# SET(BIN_PATH "${PROJECT_BINARY_DIR}/bin")
-SET(LIB_NAME "${TARGET}_lib")
-SET(BIN_NAME "${TARGET}")
-SET(TEST_PATH "${PROJECT_BINARY_DIR}/test")
-SET(TEST_NAME "test_${TARGET}")
-
-SET(LIB_SRC
- ${SRC_PATH}/BraidFuncs.cc
- ${SRC_PATH}/Utilities.cc
- )
-
-SET(TARGET_SRC
- ${SRC_PATH}/${TARGET}.cc
- )
-
-SET(TEST_SRC
- ${TEST_SRC_PATH}/test_braid.cc
- )
-
-OPTION(DO_MFG "Do the manufactured solution run" OFF)
-
-IF(DO_MFG)
- # If we are doing the manufactured solution, tell
- # the C++ processor so it can enable MFG solutions
- MESSAGE(STATUS "Manufactured solution enabled")
- ADD_DEFINITIONS(-DDO_MFG)
-ENDIF(DO_MFG)
+PROJECT("parallel_in_time")
+#
+# setup deal.II
+#
FIND_PACKAGE(deal.II 9.4.0
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)
"or set an environment variable \"DEAL_II_DIR\" that contains this path."
)
ENDIF()
+DEAL_II_INITIALIZE_CACHED_VARIABLES()
+
+IF(NOT ${DEAL_II_WITH_MPI})
+ MESSAGE(FATAL_ERROR "parallel_in_time requires that deal.II be set up with MPI.")
+ENDIF()
-# Find braid details
-SET(BRAID_DIR "$ENV{BRAID_DIR}" CACHE INTERNAL "Copied BRAID_DIR from environment variable")
+#
+# setup braid
+#
+SET(BRAID_DIR "$ENV{BRAID_DIR}" CACHE INTERNAL
+ "Copied BRAID_DIR from environment variable")
FIND_PATH(BRAID_INCLUDE_DIR
NAMES braid.h
MESSAGE(STATUS "Braid include directory: ${BRAID_INCLUDE_DIR}")
MESSAGE(STATUS "Braid library: ${BRAID_LIBRARY}")
-# Include the braid paths and libraries
INCLUDE_DIRECTORIES(${BRAID_INCLUDE_DIR})
-# Build the library
-ADD_LIBRARY(${LIB_NAME} SHARED ${LIB_SRC})
-DEAL_II_SETUP_TARGET(${LIB_NAME})
-
-DEAL_II_INITIALIZE_CACHED_VARIABLES()
-PROJECT(${TARGET})
+#
+# setup parallel_in_time
+#
+SET(SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src")
+SET(LIB_NAME "parallel_in_time_lib")
-# Tell CMake to find MPI
-FIND_PACKAGE(MPI REQUIRED)
-ADD_DEFINITIONS(-DUSE_MPI)
-INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
+SET(LIB_SRC
+ ${SRC_PATH}/BraidFuncs.cc
+ ${SRC_PATH}/Utilities.cc
+ )
-DEAL_II_INVOKE_AUTOPILOT()
-TARGET_LINK_LIBRARIES(${TARGET} ${BRAID_LIBRARY}) # link braid
-TARGET_LINK_LIBRARIES(${TARGET} ${LIB_NAME})
-SET_TARGET_PROPERTIES(${TARGET} PROPERTIES
- LINK_FLAGS "${MPI_LINK_FLAGS}") # Link MPI
-SET_TARGET_PROPERTIES(${MAIN_NAME} PROPERTIES
- COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") # Use MPI compile flags
+OPTION(DO_MFG "Do the manufactured solution run" OFF)
-# Lastly build the tests
-ENABLE_TESTING()
-ADD_SUBDIRECTORY(test)
+IF(DO_MFG)
+ # If we are doing the manufactured solution, tell
+ # the C++ processor so it can enable MFG solutions
+ MESSAGE(STATUS "Manufactured solution enabled")
+ ADD_DEFINITIONS(-DDO_MFG)
+ENDIF(DO_MFG)
+ADD_LIBRARY(${LIB_NAME} SHARED ${LIB_SRC})
+DEAL_II_SETUP_TARGET(${LIB_NAME})
+TARGET_LINK_LIBRARIES(${LIB_NAME} ${BRAID_LIBRARY})
+ADD_EXECUTABLE(parallel_in_time)
+TARGET_SOURCES(parallel_in_time PRIVATE src/parallel_in_time.cc)
+TARGET_LINK_LIBRARIES(parallel_in_time ${LIB_NAME})
+DEAL_II_SETUP_TARGET(parallel_in_time)
+#
+# setup tests
+#
+ENABLE_TESTING()
+ADD_SUBDIRECTORY(test)
braid_TestInitAccess: Starting Test 1
braid_TestInitAccess: u = init(t=2.00e-01)
braid_TestInitAccess: access(u)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
braid_TestClone: u = init(t=2.00e-01)
braid_TestClone: v = clone(u)
braid_TestClone: access(u)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
braid_TestClone: access(v)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
braid_TestSum: v = clone(u)
braid_TestSum: v = u - v
braid_TestSum: access(v)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
braid_TestSum: Starting Test 2
braid_TestSum: v = 2*u + v
braid_TestSum: access(v)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00
0 12288 12545 3.225e-04 2.865e-03 3.723e-04
0 12288 12545 1.732e+00 1.539e+01 2.003e+00
braid_TestSum: access(u)
+Cycle 0:
+ Number of active cells: 12288
+ Number of degrees of freedom: 12545
cycle cells dofs L2 H1 Linfty
0 12288 12545 8.657e-01 7.696e+00 1.001e+00