diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml deleted file mode 100644 index 95a8999c5..000000000 --- a/.github/workflows/clang-format.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Clang-Format Check - -on: - push: - branches: - - master - pull_request: - merge_group: - paths-ignore: - - 'doc/**' - - 'contrib/**' - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request'}} - -permissions: - contents: read - -jobs: - clang-format-check: - - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 30 - - - name: Run Clang-Format - uses: jidicula/clang-format-action@v4.13.0 - with: - clang-format-version: '18' - exclude-regex: 'contrib/catch/.*' diff --git a/.github/workflows/compile_applications.yml b/.github/workflows/compile_applications.yml index 39980ce53..f48210602 100644 --- a/.github/workflows/compile_applications.yml +++ b/.github/workflows/compile_applications.yml @@ -1,13 +1,6 @@ name: compile-applications on: - push: - branches: - - master - paths-ignore: - - 'doc/**' - - 'contrib/**' - - '**/*.md' merge_group: paths-ignore: - 'doc/**' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 791e78d77..d7ce86eec 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,14 +1,6 @@ name: linux on: - push: - branches: - - master - paths-ignore: - - 'applications/**' - - 'doc/**' - - 'contrib/**' - - '**/*.md' pull_request: merge_group: branches: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..c5365755c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,23 @@ +name: pre-commit + +on: + push: + branches: + - master + pull_request: + +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request'}} + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 + - uses: pre-commit-ci/lite-action@v1.1.0 + if: always() diff --git a/.gitignore b/.gitignore index 4ae4e7845..8e57ff982 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,4 @@ output.txt error.txt # generated by operating system -.DS_Store \ No newline at end of file +.DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index f1e081393..0c5be9409 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,7 +281,8 @@ foreach(_build ${PRISMS_PF_BUILD_TYPES}) PUBLIC $ $ - PRIVATE ${CMAKE_SOURCE_DIR}/src + PRIVATE + ${CMAKE_SOURCE_DIR}/src ) target_compile_options( @@ -339,7 +340,8 @@ install( # Install the headers install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include FILES_MATCHING PATTERN "*.h" @@ -348,24 +350,28 @@ install( # Install the generated config.h install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/include/prismspf/config.h + FILES + ${CMAKE_CURRENT_BINARY_DIR}/include/prismspf/config.h DESTINATION include/prismspf ) # Install the cmake folder install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf FILES_MATCHING PATTERN "*.cmake" PATTERN "*.cc" PATTERN "CMakeLists.txt" - PATTERN "*.cmake.in" EXCLUDE + PATTERN "*.cmake.in" + EXCLUDE ) # Install the generated Config file install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/prisms_pf-config.cmake + FILES + ${CMAKE_CURRENT_BINARY_DIR}/cmake/prisms_pf-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf ) @@ -378,20 +384,15 @@ install( ) # Install the VERSION file -install( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/VERSION - DESTINATION . -) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/VERSION DESTINATION .) # Install the LICENSE file -install( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE - DESTINATION . -) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION .) # Install the cmake/template file install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/templates" + FILES + "${CMAKE_CURRENT_BINARY_DIR}/cmake/templates" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf ) diff --git a/README.md b/README.md index 2ec452621..a26690320 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ ![](logo_v2.png) [![GitHub Linux](https://github.com/prisms-center/phaseField/actions/workflows/linux.yml/badge.svg)](https://github.com/prisms-center/phaseField/actions/workflows/linux.yml) -[![Clang-Format](https://github.com/prisms-center/phaseField/actions/workflows/clang-format.yml/badge.svg)](https://github.com/prisms-center/phaseField/actions/workflows/clang-format.yml) -[![Clang-Tidy](https://github.com/prisms-center/phaseField/actions/workflows/clang-tidy.yml/badge.svg)](https://github.com/prisms-center/phaseField/actions/workflows/clang-tidy.yml) [![License: LGPL v2.1](https://img.shields.io/badge/License-lgpl-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1) [![DOI](https://zenodo.org/badge/22602327.svg)](https://zenodo.org/badge/latestdoi/22602327) diff --git a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt +++ b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/allen_cahn_explicit/CMakeLists.txt b/applications/allen_cahn_explicit/CMakeLists.txt index 9bef0eaab..e8236bd4f 100644 --- a/applications/allen_cahn_explicit/CMakeLists.txt +++ b/applications/allen_cahn_explicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( @@ -21,7 +25,6 @@ if(PRISMS_PF_FOUND) # Set up the application prisms_pf_autopilot(${PRISMS_PF_CMAKE_DIR}) - else() message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/alloy_solidification/CMakeLists.txt b/applications/alloy_solidification/CMakeLists.txt index 879e37e61..df9656265 100644 --- a/applications/alloy_solidification/CMakeLists.txt +++ b/applications/alloy_solidification/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( @@ -27,7 +31,8 @@ if(PRISMS_PF_FOUND) set_target_properties( main-debug PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR} + RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_SOURCE_DIR} ) endif() @@ -35,7 +40,8 @@ if(PRISMS_PF_FOUND) set_target_properties( main-release PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR} + RUNTIME_OUTPUT_DIRECTORY + ${CMAKE_SOURCE_DIR} ) endif() else() diff --git a/applications/blank/CMakeLists.txt b/applications/blank/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/blank/CMakeLists.txt +++ b/applications/blank/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/cahn_hilliard_explicit/CMakeLists.txt b/applications/cahn_hilliard_explicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/cahn_hilliard_explicit/CMakeLists.txt +++ b/applications/cahn_hilliard_explicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt b/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt +++ b/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/eshelby_inclusion/CMakeLists.txt b/applications/eshelby_inclusion/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/eshelby_inclusion/CMakeLists.txt +++ b/applications/eshelby_inclusion/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/nucleation/CMakeLists.txt b/applications/nucleation/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/nucleation/CMakeLists.txt +++ b/applications/nucleation/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/precipitate_evolution/CMakeLists.txt b/applications/precipitate_evolution/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/precipitate_evolution/CMakeLists.txt +++ b/applications/precipitate_evolution/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/applications/spinodal_decomposition/CMakeLists.txt b/applications/spinodal_decomposition/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/applications/spinodal_decomposition/CMakeLists.txt +++ b/applications/spinodal_decomposition/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/cmake/macros/macro_expand_template_instantiations.cmake b/cmake/macros/macro_expand_template_instantiations.cmake index 9b7c81f14..70f708b24 100644 --- a/cmake/macros/macro_expand_template_instantiations.cmake +++ b/cmake/macros/macro_expand_template_instantiations.cmake @@ -43,14 +43,12 @@ macro(expand_template_instantiations _target _inst_in_files) COMMAND ${_command} ARGS - ${_template_file} < - ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} > + ${_template_file} < ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} > "${_final_output}.tmp" COMMAND ${CMAKE_COMMAND} ARGS - -E rename "${_final_output}.tmp" - "${_final_output}" + -E rename "${_final_output}.tmp" "${_final_output}" ) # Append to a list of inst _inst_targets diff --git a/cmake/macros/macro_prisms_pf_autopilot.cmake b/cmake/macros/macro_prisms_pf_autopilot.cmake index d622f92c4..6a86a5875 100644 --- a/cmake/macros/macro_prisms_pf_autopilot.cmake +++ b/cmake/macros/macro_prisms_pf_autopilot.cmake @@ -44,7 +44,8 @@ macro(prisms_pf_autopilot PRISMS_PF_CMAKE_DIR) set_target_properties( ${_target} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RUNTIME_OUTPUT_DIRECTORY + "${CMAKE_CURRENT_SOURCE_DIR}" ) add_dependencies(${_target} dummy_inst) diff --git a/contrib/utilities/prm_remove_comments.sh b/contrib/utilities/prm_remove_comments.sh deleted file mode 100755 index cfdac86a8..000000000 --- a/contrib/utilities/prm_remove_comments.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan -# SPDX-License-Identifier: GNU Lesser General Public Version 2.1 -# -# This script removes all comments from all .prm files -# -# -# Usage: -# ./contrib/utilities/prm_remove_comments.sh -# - -if test ! -d src -o ! -d include -o ! -d applications; then - echo "This script must be run from the top-level directory of PRISMS-PF" - exit 1 -fi - -SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -MAIN_DIR="$SCRIPT_DIR/../../" - -find "$MAIN_DIR" -type f -name "*.prm" -exec sed -i -E 's/^\s*#.*//; s/\s+#.*//' {} + - -echo "Done" -exit 0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a7386d02..e178d1e74 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,9 +10,7 @@ endforeach() # Handles the install path foreach(_target ${PRISMS_PF_TARGETS}) - target_include_directories(${_target} PUBLIC - $ - ) + target_include_directories(${_target} PUBLIC $) endforeach() # Add the dummy.cc diff --git a/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt b/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt +++ b/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt b/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt +++ b/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt b/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt +++ b/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt b/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt +++ b/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/cavity_flow/CMakeLists.txt b/tests/regression_tests/cavity_flow/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/cavity_flow/CMakeLists.txt +++ b/tests/regression_tests/cavity_flow/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/fracture/CMakeLists.txt b/tests/regression_tests/fracture/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/fracture/CMakeLists.txt +++ b/tests/regression_tests/fracture/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt b/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt +++ b/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt b/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt +++ b/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/mechanics/CMakeLists.txt b/tests/regression_tests/mechanics/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/mechanics/CMakeLists.txt +++ b/tests/regression_tests/mechanics/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/precipitate_explicit/CMakeLists.txt b/tests/regression_tests/precipitate_explicit/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/precipitate_explicit/CMakeLists.txt +++ b/tests/regression_tests/precipitate_explicit/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package( diff --git a/tests/regression_tests/solution_blocks/CMakeLists.txt b/tests/regression_tests/solution_blocks/CMakeLists.txt index 1db24ddd3..e8236bd4f 100644 --- a/tests/regression_tests/solution_blocks/CMakeLists.txt +++ b/tests/regression_tests/solution_blocks/CMakeLists.txt @@ -5,7 +5,11 @@ cmake_minimum_required(VERSION 3.18) # Create a project for the application -project(myapp C CXX) +project( + myapp + C + CXX +) # Find the PRISMS-PF package find_package(