| 1 |
# Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced |
| 2 |
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files |
| 3 |
# LICENSE and NOTICE for details. LLNL-CODE-806117. |
| 4 |
# |
| 5 |
# This file is part of the MFEM library. For more information and source code |
| 6 |
# availability visit https://mfem.org. |
| 7 |
# |
| 8 |
# MFEM is free software; you can redistribute it and/or modify it under the |
| 9 |
# terms of the BSD-3 license. We welcome feedback and contributions, see file |
| 10 |
# CONTRIBUTING.md for details. |
| 11 |
|
| 12 |
if(MFEM_USE_MPI) |
| 13 |
add_custom_target(clean_common |
| 14 |
COMMAND ${CMAKE_COMMAND} -E echo "Cleaning common directory..." |
| 15 |
COMMAND make -C ${CMAKE_CURRENT_SOURCE_DIR}/../common clean |
| 16 |
COMMENT "Cleaning common directory..." |
| 17 |
) |
| 18 |
|
| 19 |
# Define miniapps |
| 20 |
set(MINIAPPS |
| 21 |
abs-l1-jacobi |
| 22 |
mg-abs-l1-jacobi |
| 23 |
) |
| 24 |
|
| 25 |
# Add miniapps |
| 26 |
foreach(APP ${MINIAPPS}) |
| 27 |
add_mfem_miniapp(${APP} |
| 28 |
MAIN ${APP}.cpp |
| 29 |
${MFEM_MINIAPPS_COMMON_HEADERS} |
| 30 |
EXTRA_SOURCES ds-common.cpp |
| 31 |
EXTRA_HEADERS ds-common.hpp |
| 32 |
LIBRARIES mfem-common mfem |
| 33 |
) |
| 34 |
endforeach() |
| 35 |
|
| 36 |
# Add the corresponding tests to the "test" target |
| 37 |
if (MFEM_ENABLE_TESTING) |
| 38 |
add_test(NAME abs-l1-jacobi_np${MFEM_MPI_NP} |
| 39 |
COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} |
| 40 |
${MPIEXEC_PREFLAGS} |
| 41 |
$<TARGET_FILE:abs-l1-jacobi> -m ../../data/ref-cube.mesh -rs 2 -rp 2 |
| 42 |
-s 1 -i 1 -a 3 -pc 1 -no-mon -no-vis |
| 43 |
${MPIEXEC_POSTFLAGS}) |
| 44 |
|
| 45 |
add_test(NAME mg-abs-l1-jacobi_np${MFEM_MPI_NP} |
| 46 |
COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} |
| 47 |
${MPIEXEC_PREFLAGS} |
| 48 |
$<TARGET_FILE:mg-abs-l1-jacobi> -m ../../data/ref-cube.mesh -rs 2 -rp 1 |
| 49 |
-ol 1 -gl 1 -s 1 -i 1 -a 3 -no-mon -no-vis |
| 50 |
${MPIEXEC_POSTFLAGS}) |
| 51 |
endif() |
| 52 |
|
| 53 |
# Add custom target for cleaning everything |
| 54 |
add_custom_target(clean_all |
| 55 |
COMMAND ${CMAKE_MAKE_PROGRAM} clean |
| 56 |
COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_CURRENT_SOURCE_DIR}/../common clean |
| 57 |
COMMENT "Cleaning all build artifacts..." |
| 58 |
) |
| 59 |
endif() |