From ba76b20792dc87050e3895e664a0eed212a3c44c Mon Sep 17 00:00:00 2001 From: Jason Landini <123970616+landinjm@users.noreply.github.com> Date: Fri, 2 Jan 2026 13:10:08 -0500 Subject: [PATCH 1/4] Python & CMake pre-commit (#758) * adding some comments, updating cmake minimum version, and gersemi formatting * python precommit * python precommit has to disable linting for now * gersemi precommit * delete this script because we have pre-commit --- .gersemirc | 4 + .pre-commit-config.yaml | 28 ++ CMakeLists.txt | 443 +++++++++--------- applications/CMakeLists.txt | 63 +-- .../CMakeLists.txt | 23 +- .../allen_cahn_explicit/CMakeLists.txt | 23 +- .../alloy_solidification/CMakeLists.txt | 23 +- applications/blank/CMakeLists.txt | 23 +- .../cahn_hilliard_explicit/CMakeLists.txt | 23 +- .../CMakeLists.txt | 23 +- applications/eshelby_inclusion/CMakeLists.txt | 23 +- applications/nucleation/CMakeLists.txt | 23 +- .../precipitate_evolution/CMakeLists.txt | 23 +- .../spinodal_decomposition/CMakeLists.txt | 23 +- cmake/macros/macro_append_flags.cmake | 14 +- .../macro_collect_header_and_src_files.cmake | 64 ++- cmake/macros/macro_define_library.cmake | 104 ++-- ...macro_expand_template_instantiations.cmake | 120 ++--- cmake/macros/macro_prisms_pf_autopilot.cmake | 123 +++-- .../macros/macro_prisms_pf_git_version.cmake | 155 +++--- cmake/macros/macro_set_cpp_standard.cmake | 6 +- cmake/macros/macro_set_if_empty.cmake | 6 +- cmake/modules/FindPRISMS_PF_CALIPER.cmake | 42 +- cmake/modules/FindPRISMS_PF_DEAL_II.cmake | 101 ++-- cmake/modules/FindPRISMS_PF_VTK.cmake | 70 ++- cmake/scripts/CMakeLists.txt | 10 +- cmake/setup_application.cmake | 86 ++-- cmake/setup_cached_variables.cmake | 87 ++-- cmake/setup_prisms_pf.cmake | 209 +++++---- cmake/write_config.cmake | 14 +- contrib/postprocessing/domain_stats.py | 95 ++-- contrib/postprocessing/interface_area.py | 33 +- contrib/postprocessing/phase_fraction.py | 25 +- contrib/postprocessing/plot_and_save.py | 25 +- contrib/postprocessing/splitvtufiles.py | 47 +- contrib/postprocessing/vtutopython.py | 182 ++++--- contrib/utilities/cmake_format.sh | 47 -- doc/doxygen/CMakeLists.txt | 63 ++- src/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 90 ++-- src/solvers/CMakeLists.txt | 72 +-- src/user_inputs/CMakeLists.txt | 21 +- src/utilities/CMakeLists.txt | 27 +- .../allen_cahn_explicit/CMakeLists.txt | 8 +- .../cahn_hilliard_explicit/CMakeLists.txt | 8 +- tests/performance_tests/plot_scaling.py | 3 +- tests/regression_tests/CMakeLists.txt | 81 ++-- .../allen_cahn_explicit/CMakeLists.txt | 23 +- .../allen_cahn_implicit/CMakeLists.txt | 23 +- .../cahn_hilliard_explicit/CMakeLists.txt | 23 +- .../cahn_hilliard_implicit/CMakeLists.txt | 23 +- .../cavity_flow/CMakeLists.txt | 23 +- .../regression_tests/fracture/CMakeLists.txt | 23 +- .../heat_equation_steady_state/CMakeLists.txt | 23 +- .../linear_solve_old_solution/CMakeLists.txt | 23 +- .../regression_tests/mechanics/CMakeLists.txt | 23 +- .../precipitate_explicit/CMakeLists.txt | 23 +- tests/regression_tests/run.py | 5 +- .../solution_blocks/CMakeLists.txt | 23 +- tests/unit_tests/core/CMakeLists.txt | 12 +- tests/unit_tests/field_input/CMakeLists.txt | 12 +- tests/unit_tests/user_inputs/CMakeLists.txt | 12 +- tests/unit_tests/utilities/CMakeLists.txt | 12 +- 63 files changed, 1646 insertions(+), 1468 deletions(-) create mode 100644 .gersemirc create mode 100644 .pre-commit-config.yaml delete mode 100755 contrib/utilities/cmake_format.sh diff --git a/.gersemirc b/.gersemirc new file mode 100644 index 000000000..dcd5df67a --- /dev/null +++ b/.gersemirc @@ -0,0 +1,4 @@ +definitions: [./cmake/macros,] +line_length: 90 +indent: 2 +list_expansion: favour-expansion \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..2d326edcc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +fail_fast: true + +repos: +# Python formatting and linting tools +- repo: https://github.com/psf/black + rev: 25.9.0 + hooks: + - id: black + language_version: python3 + exclude: contrib/utilities/prm_tools.py +- repo: https://github.com/pycqa/isort + rev: 6.0.1 + hooks: + - id: isort + args: ["--profile", "black"] + exclude: contrib/utilities/prm_tools.py +# TODO: Enable flake8 after addressing existing linting issues +# - repo: https://github.com/pycqa/flake8 +# rev: 7.3.0 +# hooks: +# - id: flake8 +# args: [--max-line-length=80] +# exclude: contrib/utilities/prm_tools.py +# CMake formatting +- repo: https://github.com/BlankSpruce/gersemi + rev: 0.25.0 + hooks: + - id: gersemi \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a09e74b0..f0baa12d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,8 @@ # cmake config message(STATUS "Using CMake ${CMAKE_VERSION}") message(STATUS "") -cmake_minimum_required(VERSION 3.13.4) -cmake_policy(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) +cmake_policy(VERSION 3.18) # Grab modules list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) @@ -14,8 +14,8 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) # Load macros file(GLOB macro_files "${CMAKE_SOURCE_DIR}/cmake/macros/*.cmake") foreach(file ${macro_files}) - message(STATUS "Include ${file}") - include(${file}) + message(STATUS "Include ${file}") + include(${file}) endforeach() # Grab the version of PRISMS-PF @@ -42,12 +42,13 @@ project(prisms_pf CXX) # Set the default install prefix if it was not set by the user if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX - "${CMAKE_BINARY_DIR}/install" - CACHE PATH - "Installation prefix" - FORCE - ) + set( + CMAKE_INSTALL_PREFIX + "${CMAKE_BINARY_DIR}/install" + CACHE PATH + "Installation prefix" + FORCE + ) endif() # Include the PRISMS-PF setup @@ -64,9 +65,14 @@ message(STATUS "=========================================================") message(STATUS "") # Process each of the modules -set(PRISMS_PF_MODULES DEAL_II VTK CALIPER) +set( + PRISMS_PF_MODULES + DEAL_II + VTK + CALIPER +) foreach(_module ${PRISMS_PF_MODULES}) - include(${CMAKE_SOURCE_DIR}/cmake/modules/FindPRISMS_PF_${_module}.cmake) + include(${CMAKE_SOURCE_DIR}/cmake/modules/FindPRISMS_PF_${_module}.cmake) endforeach() message(STATUS "Using PRISMS_PF_WITH_ZLIB = '${PRISMS_PF_WITH_ZLIB}'") @@ -87,19 +93,16 @@ message(STATUS "") set(PRISMS_PF_SOURCE_DIR ${CMAKE_SOURCE_DIR}) if(ADDITIONAL_DEGREES) - set(EXPAND_DEGREES "; 3; 4; 5; 6") + set(EXPAND_DEGREES "; 3; 4; 5; 6") endif() configure_file( - ${CMAKE_SOURCE_DIR}/include/prismspf/config.h.in - ${CMAKE_BINARY_DIR}/include/prismspf/config.h + ${CMAKE_SOURCE_DIR}/include/prismspf/config.h.in + ${CMAKE_BINARY_DIR}/include/prismspf/config.h ) # Configure the template arguments file -configure_file( - ${CMAKE_SOURCE_DIR}/cmake/templates.in - ${CMAKE_BINARY_DIR}/cmake/templates -) +configure_file(${CMAKE_SOURCE_DIR}/cmake/templates.in ${CMAKE_BINARY_DIR}/cmake/templates) # Add the script files add_subdirectory("${CMAKE_SOURCE_DIR}/cmake/scripts") @@ -113,70 +116,79 @@ get_property(PRISMS_PF_HEADER_FILES GLOBAL PROPERTY PRISMS_PF_HEADER_FILES) # Make and ninja build options if(CMAKE_GENERATOR MATCHES "Ninja") - set(_make_command "$ ninja") + set(_make_command "$ ninja") else() - set(_make_command "$ make") + set(_make_command "$ make") endif() # Debug and release targets if(${DEAL_II_BUILD_TYPE} MATCHES "DebugRelease") - add_custom_target( - release - COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Release . - COMMAND ${CMAKE_COMMAND} -E echo "***" - COMMAND - ${CMAKE_COMMAND} -E echo - "*** Switched to Release mode. Now recompile with: ${_make_command}" - COMMAND ${CMAKE_COMMAND} -E echo "***" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - VERBATIM - COMMENT "switching to RELEASE mode..." - ) - - add_custom_target( - debug - COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Debug . - COMMAND ${CMAKE_COMMAND} -E echo "***" - COMMAND - ${CMAKE_COMMAND} -E echo - "*** Switched to Debug mode. Now recompile with: ${_make_command}" - COMMAND ${CMAKE_COMMAND} -E echo "***" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - VERBATIM - COMMENT "switching to DEBUG mode..." - ) - - add_custom_target( - debugrelease - COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=DebugRelease . - COMMAND ${CMAKE_COMMAND} -E echo "***" - COMMAND - ${CMAKE_COMMAND} -E echo - "*** Switched to Debug and Release mode. Now recompile with: ${_make_command}" - COMMAND ${CMAKE_COMMAND} -E echo "***" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - VERBATIM - COMMENT "switching to DEBUG/RELEASE mode..." - ) + add_custom_target( + release + COMMAND + ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Release . + COMMAND + ${CMAKE_COMMAND} -E echo "***" + COMMAND + ${CMAKE_COMMAND} -E echo + "*** Switched to Release mode. Now recompile with: ${_make_command}" + COMMAND + ${CMAKE_COMMAND} -E echo "***" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMENT "switching to RELEASE mode..." + ) + + add_custom_target( + debug + COMMAND + ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Debug . + COMMAND + ${CMAKE_COMMAND} -E echo "***" + COMMAND + ${CMAKE_COMMAND} -E echo + "*** Switched to Debug mode. Now recompile with: ${_make_command}" + COMMAND + ${CMAKE_COMMAND} -E echo "***" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMENT "switching to DEBUG mode..." + ) + + add_custom_target( + debugrelease + COMMAND + ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=DebugRelease . + COMMAND + ${CMAKE_COMMAND} -E echo "***" + COMMAND + ${CMAKE_COMMAND} -E echo + "*** Switched to Debug and Release mode. Now recompile with: ${_make_command}" + COMMAND + ${CMAKE_COMMAND} -E echo "***" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + COMMENT "switching to DEBUG/RELEASE mode..." + ) endif() # Add distclean target to clean build add_custom_target( - distclean - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean - COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles - COMMAND - ${CMAKE_COMMAND} -E remove CMakeCache.txt cmake_install.cmake Makefile - build.ninja rules.ninja .ninja_deps .ninja_log clang-tidy.log - cppcheck.log cppcheck_unused.log output.txt error.txt summary.log - detailed.log - COMMENT "distclean invoked" + distclean + COMMAND + ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean + COMMAND + ${CMAKE_COMMAND} -E remove_directory CMakeFiles + COMMAND + ${CMAKE_COMMAND} -E remove CMakeCache.txt cmake_install.cmake Makefile build.ninja + rules.ninja .ninja_deps .ninja_log clang-tidy.log cppcheck.log cppcheck_unused.log + output.txt error.txt summary.log detailed.log + COMMENT "distclean invoked" ) file( - WRITE - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake - "message( + WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake + "message( \"### # # PRISMS-PF set up with ${DEAL_II_PACKAGE_NAME}-${DEAL_II_PACKAGE_VERSION} found at @@ -199,111 +211,109 @@ file( ) add_custom_target( - info - COMMAND - ${CMAKE_COMMAND} -P - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake + info + COMMAND + ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/print_usage.cmake ) # Set additional compiler flags -set(PRISMS_PF_ADDITIONAL_CXX_FLAGS - "" - CACHE STRING - "Additional CMAKE_CXX_FLAGS applied after the deal.II options." +set( + PRISMS_PF_ADDITIONAL_CXX_FLAGS + "" + CACHE STRING + "Additional CMAKE_CXX_FLAGS applied after the deal.II options." ) if(NOT PRISMS_PF_ADDITIONAL_CXX_FLAGS STREQUAL "") - message( - STATUS - "Appending PRISMS_PF_ADDITIONAL_CXX_FLAGS: '${PRISMS_PF_ADDITIONAL_CXX_FLAGS}':" - ) - append_flags(PRISMS_PF_ADDITIONAL_CXX_FLAGS PRISMS_PF_CXX_FLAGS) - message(STATUS " PRISMS_PF_WARNING_FLAGS: ${PRISMS_PF_WARNING_FLAGS}") - message(STATUS " PRISMS_PF_CXX_FLAGS: ${PRISMS_PF_CXX_FLAGS}") - message(STATUS " PRISMS_PF_CXX_FLAGS_DEBUG: ${PRISMS_PF_CXX_FLAGS_DEBUG}") - message( - STATUS - " PRISMS_PF_CXX_FLAGS_RELEASE: ${PRISMS_PF_CXX_FLAGS_RELEASE}" - ) + message( + STATUS + "Appending PRISMS_PF_ADDITIONAL_CXX_FLAGS: '${PRISMS_PF_ADDITIONAL_CXX_FLAGS}':" + ) + append_flags(PRISMS_PF_ADDITIONAL_CXX_FLAGS PRISMS_PF_CXX_FLAGS) + message(STATUS " PRISMS_PF_WARNING_FLAGS: ${PRISMS_PF_WARNING_FLAGS}") + message(STATUS " PRISMS_PF_CXX_FLAGS: ${PRISMS_PF_CXX_FLAGS}") + message(STATUS " PRISMS_PF_CXX_FLAGS_DEBUG: ${PRISMS_PF_CXX_FLAGS_DEBUG}") + message(STATUS " PRISMS_PF_CXX_FLAGS_RELEASE: ${PRISMS_PF_CXX_FLAGS_RELEASE}") endif() foreach(_build ${PRISMS_PF_BUILD_TYPES}) - # Create a target for each build type. Note that the build types are - # mixed case (e.g., Debug) so we need to convert them to lowercase and - # uppercase for various uses. - string(TOLOWER ${_build} _build_lowercase) - string(TOUPPER ${_build} _build_uppercase) - set(_library "prisms_pf_${_build_lowercase}") - list(APPEND PRISMS_PF_TARGETS ${_library}) - - # Add the library and set some properties - add_library(${_library} STATIC) - set_target_properties( - ${_target} - PROPERTIES - LINKER_LANGUAGE CXX - OUTPUT_NAME "prisms-pf-${_build_lowercase}" - ) - target_sources(${_library} PRIVATE ${PRISMS_PF_SOURCE_FILES}) - - # Collect the libraries to link against and the include directories - set(_library_dependencies - prisms_pf_core_${_build_lowercase} - prisms_pf_solvers_${_build_lowercase} - prisms_pf_user_inputs_${_build_lowercase} - prisms_pf_utilities_${_build_lowercase} - ) - list(APPEND PRISMS_PF_TARGETS ${_library_dependencies}) - - # Link the PRISMS-PF libraries - target_link_libraries(${_library} PUBLIC ${_library_dependencies}) - # Add explicit dependencies to ensure proper build order with Ninja - add_dependencies(${_library} ${_library_dependencies}) - - # Set the include directories - target_include_directories( - ${_library} - PUBLIC - $ - $ - PRIVATE ${CMAKE_BINARY_DIR}/src - ) - - target_compile_options( - ${_library} - PRIVATE - $<$: - ${PRISMS_PF_WARNING_FLAGS} - ${PRISMS_PF_CXX_FLAGS} - ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> - ) - target_link_options( - ${_library} - PRIVATE - $<$: - ${PRISMS_PF_LINKER_FLAGS} - ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> - ) - - # Add other dependencies, making sure they are public so that they - # propagate to targets that link against this library - - # VTK - if(${VTK_BUILT_SEPARATELY}) - target_include_directories(${_library} SYSTEM PUBLIC ${VTK_INCLUDE_DIR}) - target_link_libraries(${_library} PUBLIC ${VTK_NEW_LIBRARIES}) - endif() - - # caliper - if(${PRISMS_PF_WITH_CALIPER}) - target_link_libraries(${_library} PUBLIC caliper) - endif() - - # deal.II - target_link_libraries( - ${_library} - PUBLIC ${DEAL_II_TARGET_${_build_uppercase}} - ) + # Create a target for each build type. Note that the build types are + # mixed case (e.g., Debug) so we need to convert them to lowercase and + # uppercase for various uses. + string(TOLOWER ${_build} _build_lowercase) + string(TOUPPER ${_build} _build_uppercase) + set(_library "prisms_pf_${_build_lowercase}") + list(APPEND PRISMS_PF_TARGETS ${_library}) + + # Add the library and set some properties + add_library(${_library} STATIC) + set_target_properties( + ${_target} + PROPERTIES + LINKER_LANGUAGE + CXX + OUTPUT_NAME + "prisms-pf-${_build_lowercase}" + ) + target_sources(${_library} PRIVATE ${PRISMS_PF_SOURCE_FILES}) + + # Collect the libraries to link against and the include directories + set( + _library_dependencies + prisms_pf_core_${_build_lowercase} + prisms_pf_solvers_${_build_lowercase} + prisms_pf_user_inputs_${_build_lowercase} + prisms_pf_utilities_${_build_lowercase} + ) + list(APPEND PRISMS_PF_TARGETS ${_library_dependencies}) + + # Link the PRISMS-PF libraries + target_link_libraries(${_library} PUBLIC ${_library_dependencies}) + # Add explicit dependencies to ensure proper build order with Ninja + add_dependencies(${_library} ${_library_dependencies}) + + # Set the include directories + target_include_directories( + ${_library} + PUBLIC + $ + $ + PRIVATE + ${CMAKE_BINARY_DIR}/src + ) + + target_compile_options( + ${_library} + PRIVATE + $<$: + ${PRISMS_PF_WARNING_FLAGS} + ${PRISMS_PF_CXX_FLAGS} + ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> + ) + target_link_options( + ${_library} + PRIVATE + $<$: + ${PRISMS_PF_LINKER_FLAGS} + ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> + ) + + # Add other dependencies, making sure they are public so that they + # propagate to targets that link against this library + + # VTK + if(${VTK_BUILT_SEPARATELY}) + target_include_directories(${_library} SYSTEM PUBLIC ${VTK_INCLUDE_DIR}) + target_link_libraries(${_library} PUBLIC ${VTK_NEW_LIBRARIES}) + endif() + + # caliper + if(${PRISMS_PF_WITH_CALIPER}) + target_link_libraries(${_library} PUBLIC caliper) + endif() + + # deal.II + target_link_libraries(${_library} PUBLIC ${DEAL_II_TARGET_${_build_uppercase}}) endforeach() # ========================================================= @@ -313,34 +323,40 @@ include(GNUInstallDirs) # Install the libraries install( - TARGETS ${PRISMS_PF_TARGETS} - EXPORT prisms_pf-targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + TARGETS + ${PRISMS_PF_TARGETS} + EXPORT prisms_pf-targets + LIBRARY + DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME + DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) # Install the headers install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ - DESTINATION include/prisms_pf - FILES_MATCHING - PATTERN "*.h" - PATTERN "*.hpp" + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION include/prisms_pf + FILES_MATCHING + PATTERN "*.h" + PATTERN "*.hpp" ) # Install the CMake config files install( - EXPORT prisms_pf-targets - FILE prisms_pf-targets.cmake - NAMESPACE prisms_pf:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf + EXPORT prisms_pf-targets + FILE prisms_pf-targets.cmake + NAMESPACE prisms_pf:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf ) install( - FILES ${CMAKE_BINARY_DIR}/cmake/prisms_pf-config.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf + FILES + ${CMAKE_BINARY_DIR}/cmake/prisms_pf-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/prisms_pf ) # ========================================================= @@ -349,22 +365,27 @@ install( # Unit tests if(UNIT_TESTS) - enable_testing() - add_subdirectory(tests/unit_tests) - - add_custom_target( - run_tests - COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure - DEPENDS test_core test_field_input test_user_inputs test_utilities - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Run all tests" - ) + enable_testing() + add_subdirectory(tests/unit_tests) + + add_custom_target( + run_tests + COMMAND + ${CMAKE_CTEST_COMMAND} --output-on-failure + DEPENDS + test_core + test_field_input + test_user_inputs + test_utilities + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Run all tests" + ) endif() # Regression tests if(REGRESSION_TESTS) - # Compile each of the regression tests and run the python script - add_subdirectory(tests/regression_tests) + # Compile each of the regression tests and run the python script + add_subdirectory(tests/regression_tests) endif() # Applications @@ -383,30 +404,30 @@ include(${CMAKE_SOURCE_DIR}/cmake/write_config.cmake) # Generate configuration file for applications include(CMakePackageConfigHelpers) configure_package_config_file( - ${CMAKE_SOURCE_DIR}/cmake/prisms_pf-config.cmake.in - ${CMAKE_BINARY_DIR}/cmake/prisms_pf-config.cmake - INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/cmake + ${CMAKE_SOURCE_DIR}/cmake/prisms_pf-config.cmake.in + ${CMAKE_BINARY_DIR}/cmake/prisms_pf-config.cmake + INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/cmake ) # Unwrap the compiler compile_commands.json after the build if(${UNWRAP_COMPILER} STREQUAL "ON") - add_custom_command( - TARGET prisms_pf_debug - POST_BUILD - COMMAND - /bin/bash - ${CMAKE_SOURCE_DIR}/contrib/utilities/unwrap_compile_commands.sh - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Unwrapping compiler for compile_commands.json" - ) + add_custom_command( + TARGET prisms_pf_debug + POST_BUILD + COMMAND + /bin/bash ${CMAKE_SOURCE_DIR}/contrib/utilities/unwrap_compile_commands.sh + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Unwrapping compiler for compile_commands.json" + ) endif() # Export targets list(REMOVE_DUPLICATES PRISMS_PF_TARGETS) export( - TARGETS ${PRISMS_PF_TARGETS} - FILE "${CMAKE_BINARY_DIR}/cmake/prisms_pf-targets.cmake" - NAMESPACE prisms_pf:: + TARGETS + ${PRISMS_PF_TARGETS} + FILE "${CMAKE_BINARY_DIR}/cmake/prisms_pf-targets.cmake" + NAMESPACE prisms_pf:: ) # Print the config diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index 1c6973f73..c6247e9eb 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -5,39 +5,42 @@ message(STATUS "Setting up PRISMS-PF applications...") # A list of the applications -set(APPLICATIONS - allen_cahn_explicit - alloy_solidification - blank - cahn_hilliard_explicit - coupled_allen_cahn_cahn_hilliard - eshelby_inclusion - MgNd_precipitate_single_Bppp - nucleation - precipitate_evolution - spinodal_decomposition +set( + APPLICATIONS + allen_cahn_explicit + alloy_solidification + blank + cahn_hilliard_explicit + coupled_allen_cahn_cahn_hilliard + eshelby_inclusion + MgNd_precipitate_single_Bppp + nucleation + precipitate_evolution + spinodal_decomposition ) # For each regression application install the source files, configure, and compile foreach(app ${APPLICATIONS}) - # Install the source files - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${app}/ - DESTINATION ${CMAKE_INSTALL_PREFIX}/applications/${app} - FILES_MATCHING - PATTERN "CMakeFiles*" EXCLUDE - PATTERN "*.in" - PATTERN "*.cc" - PATTERN "*.h" - PATTERN "*.prm" - PATTERN "CMakeLists.txt" - PATTERN "*.md" - ) + # Install the source files + install( + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/${app}/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/applications/${app} + FILES_MATCHING + PATTERN "CMakeFiles*" + EXCLUDE + PATTERN "*.in" + PATTERN "*.cc" + PATTERN "*.h" + PATTERN "*.prm" + PATTERN "CMakeLists.txt" + PATTERN "*.md" + ) - # Compile during installation - install( - CODE - " + # Compile during installation + install( + CODE + " message(STATUS \"Building regression test: ${app}\") execute_process( COMMAND ${CMAKE_COMMAND} @@ -58,7 +61,7 @@ foreach(app ${APPLICATIONS}) endif() endif() " - ) + ) endforeach() -message(STATUS "PRISMS-PF applications setup complete.") \ No newline at end of file +message(STATUS "PRISMS-PF applications setup complete.") diff --git a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt +++ b/applications/MgNd_precipitate_single_Bppp/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/allen_cahn_explicit/CMakeLists.txt b/applications/allen_cahn_explicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/allen_cahn_explicit/CMakeLists.txt +++ b/applications/allen_cahn_explicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + 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 5f34be6c0..d4c518755 100644 --- a/applications/alloy_solidification/CMakeLists.txt +++ b/applications/alloy_solidification/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/blank/CMakeLists.txt b/applications/blank/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/blank/CMakeLists.txt +++ b/applications/blank/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/cahn_hilliard_explicit/CMakeLists.txt b/applications/cahn_hilliard_explicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/cahn_hilliard_explicit/CMakeLists.txt +++ b/applications/cahn_hilliard_explicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt b/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt +++ b/applications/coupled_allen_cahn_cahn_hilliard/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/eshelby_inclusion/CMakeLists.txt b/applications/eshelby_inclusion/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/eshelby_inclusion/CMakeLists.txt +++ b/applications/eshelby_inclusion/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/nucleation/CMakeLists.txt b/applications/nucleation/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/nucleation/CMakeLists.txt +++ b/applications/nucleation/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/precipitate_evolution/CMakeLists.txt b/applications/precipitate_evolution/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/precipitate_evolution/CMakeLists.txt +++ b/applications/precipitate_evolution/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/applications/spinodal_decomposition/CMakeLists.txt b/applications/spinodal_decomposition/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/applications/spinodal_decomposition/CMakeLists.txt +++ b/applications/spinodal_decomposition/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/cmake/macros/macro_append_flags.cmake b/cmake/macros/macro_append_flags.cmake index 71f99cf9f..0513b66da 100644 --- a/cmake/macros/macro_append_flags.cmake +++ b/cmake/macros/macro_append_flags.cmake @@ -4,10 +4,10 @@ # macro(append_flags SOURCE_FLAGS DEST_FLAGS) - if(${SOURCE_FLAGS}) - separate_arguments(_temp_flags NATIVE_COMMAND "${${SOURCE_FLAGS}}") - foreach(flag IN LISTS _temp_flags) - list(APPEND ${DEST_FLAGS} "${flag}") - endforeach() - endif() -endmacro() \ No newline at end of file + if(${SOURCE_FLAGS}) + separate_arguments(_temp_flags NATIVE_COMMAND "${${SOURCE_FLAGS}}") + foreach(flag IN LISTS _temp_flags) + list(APPEND ${DEST_FLAGS} "${flag}") + endforeach() + endif() +endmacro() diff --git a/cmake/macros/macro_collect_header_and_src_files.cmake b/cmake/macros/macro_collect_header_and_src_files.cmake index 2e795df12..2515584b5 100644 --- a/cmake/macros/macro_collect_header_and_src_files.cmake +++ b/cmake/macros/macro_collect_header_and_src_files.cmake @@ -3,40 +3,36 @@ # macro(collect_header_and_src_files _sources _headers) - set(_processed_sources "") - set(_processed_headers "") + set(_processed_sources "") + set(_processed_headers "") - foreach(_file ${_sources}) - if(NOT IS_ABSOLUTE "${_file}") - list( - APPEND - _processed_sources - "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" - ) - else() - list(APPEND _processed_sources "${_file}") - endif() - endforeach() - foreach(_file ${_headers}) - if(NOT IS_ABSOLUTE "${_file}") - list( - APPEND - _processed_headers - "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" - ) - else() - list(APPEND _processed_headers "${_file}") - endif() - endforeach() + foreach(_file ${_sources}) + if(NOT IS_ABSOLUTE "${_file}") + list(APPEND _processed_sources "${CMAKE_CURRENT_SOURCE_DIR}/${_file}") + else() + list(APPEND _processed_sources "${_file}") + endif() + endforeach() + foreach(_file ${_headers}) + if(NOT IS_ABSOLUTE "${_file}") + list(APPEND _processed_headers "${CMAKE_CURRENT_SOURCE_DIR}/${_file}") + else() + list(APPEND _processed_headers "${_file}") + endif() + endforeach() - set_property( - GLOBAL - APPEND - PROPERTY PRISMS_PF_SOURCE_FILES ${_processed_sources} - ) - set_property( - GLOBAL - APPEND - PROPERTY PRISMS_PF_HEADER_FILES ${_processed_headers} - ) + set_property( + GLOBAL + APPEND + PROPERTY + PRISMS_PF_SOURCE_FILES + ${_processed_sources} + ) + set_property( + GLOBAL + APPEND + PROPERTY + PRISMS_PF_HEADER_FILES + ${_processed_headers} + ) endmacro() diff --git a/cmake/macros/macro_define_library.cmake b/cmake/macros/macro_define_library.cmake index 04d6baaa6..5a18e43f7 100644 --- a/cmake/macros/macro_define_library.cmake +++ b/cmake/macros/macro_define_library.cmake @@ -3,63 +3,63 @@ # function(define_library _library) - foreach(_build ${PRISMS_PF_BUILD_TYPES}) - # Create a target for each build type. Note that the build types are - # mixed case (e.g., Debug) so we need to convert them to lowercase and - # uppercase for various uses. - string(TOLOWER ${_build} _build_lowercase) - string(TOUPPER ${_build} _build_uppercase) - set(_target "${_library}_${_build_lowercase}") + foreach(_build ${PRISMS_PF_BUILD_TYPES}) + # Create a target for each build type. Note that the build types are + # mixed case (e.g., Debug) so we need to convert them to lowercase and + # uppercase for various uses. + string(TOLOWER ${_build} _build_lowercase) + string(TOUPPER ${_build} _build_uppercase) + set(_target "${_library}_${_build_lowercase}") - # Add the library and set some properties - add_library(${_target} ${ARGN}) - set_target_properties(${_target} PROPERTIES LINKER_LANGUAGE CXX) + # Add the library and set some properties + add_library(${_target} ${ARGN}) + set_target_properties( + ${_target} + PROPERTIES + LINKER_LANGUAGE + CXX + ) - # Set the include directories - target_include_directories( - ${_target} - SYSTEM - PRIVATE ${CMAKE_BINARY_DIR}/include ${CMAKE_BINARY_DIR}/src - ) + # Set the include directories + target_include_directories( + ${_target} + SYSTEM + PRIVATE + ${CMAKE_BINARY_DIR}/include + ${CMAKE_BINARY_DIR}/src + ) - target_compile_options( - ${_target} - PRIVATE - $<$: - ${PRISMS_PF_WARNING_FLAGS} - ${PRISMS_PF_CXX_FLAGS} - ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> - ) - target_link_options( - ${_target} - PRIVATE - $<$: - ${PRISMS_PF_LINKER_FLAGS} - ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> - ) + target_compile_options( + ${_target} + PRIVATE + $<$: + ${PRISMS_PF_WARNING_FLAGS} + ${PRISMS_PF_CXX_FLAGS} + ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> + ) + target_link_options( + ${_target} + PRIVATE + $<$: + ${PRISMS_PF_LINKER_FLAGS} + ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> + ) - # Add other dependencies, making sure they are public so that they - # propagate to targets that link against this library + # Add other dependencies, making sure they are public so that they + # propagate to targets that link against this library - # VTK - if(${VTK_BUILT_SEPARATELY}) - target_include_directories( - ${_target} - SYSTEM - PRIVATE ${VTK_INCLUDE_DIR} - ) - target_link_libraries(${_target} PUBLIC ${VTK_NEW_LIBRARIES}) - endif() + # VTK + if(${VTK_BUILT_SEPARATELY}) + target_include_directories(${_target} SYSTEM PRIVATE ${VTK_INCLUDE_DIR}) + target_link_libraries(${_target} PUBLIC ${VTK_NEW_LIBRARIES}) + endif() - # caliper - if(${PRISMS_PF_WITH_CALIPER}) - target_link_libraries(${_target} PRIVATE caliper) - endif() + # caliper + if(${PRISMS_PF_WITH_CALIPER}) + target_link_libraries(${_target} PRIVATE caliper) + endif() - # deal.II - target_link_libraries( - ${_target} - PRIVATE ${DEAL_II_TARGET_${_build_uppercase}} - ) - endforeach() + # deal.II + target_link_libraries(${_target} PRIVATE ${DEAL_II_TARGET_${_build_uppercase}}) + endforeach() endfunction() diff --git a/cmake/macros/macro_expand_template_instantiations.cmake b/cmake/macros/macro_expand_template_instantiations.cmake index 286ed8220..83c10508e 100644 --- a/cmake/macros/macro_expand_template_instantiations.cmake +++ b/cmake/macros/macro_expand_template_instantiations.cmake @@ -4,71 +4,73 @@ # macro(expand_template_instantiations _target _inst_in_files) - # Loop over the provided inst.in files - foreach(_inst_in_file ${_inst_in_files}) - # Get the name for the output file. In other words, - # just drop the .in bit - string(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}") + # Loop over the provided inst.in files + foreach(_inst_in_file ${_inst_in_files}) + # Get the name for the output file. In other words, + # just drop the .in bit + string(REGEX REPLACE "\\.in$" "" _inst_file "${_inst_in_file}") - if(CMAKE_CROSSCOMPILING) - message(FATAL_ERROR "We don't support cross compiling") - endif() + if(CMAKE_CROSSCOMPILING) + message(FATAL_ERROR "We don't support cross compiling") + endif() - # Set the command we need to execute to run - # expand_template_instantiations.cc - set(_command expand_template_instantiations_exe) - set(_dependency expand_template_instantiations_exe) + # Set the command we need to execute to run + # expand_template_instantiations.cc + set(_command expand_template_instantiations_exe) + set(_dependency expand_template_instantiations_exe) - # Get the main build directory path - if(DEFINED PRISMS_PF_CORE_DIR) - # We're in an application context, use the main build directory - set(_main_build_dir ${PRISMS_PF_CORE_DIR}) - else() - # We're in the main project context, use current binary dir - set(_main_build_dir ${CMAKE_BINARY_DIR}) - endif() + # Get the main build directory path + if(DEFINED PRISMS_PF_CORE_DIR) + # We're in an application context, use the main build directory + set(_main_build_dir ${PRISMS_PF_CORE_DIR}) + else() + # We're in the main project context, use current binary dir + set(_main_build_dir ${CMAKE_BINARY_DIR}) + endif() - # Create a tmp inst file in case the command fails to - # execute. This two level thing is necessary so that - # we don't try and compile with incomplete instantiations - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} - DEPENDS - ${_dependency} - ${_main_build_dir}/cmake/templates - ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} - COMMAND ${_command} - ARGS - ${_main_build_dir}/cmake/templates < - ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} > - ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_file}.tmp - COMMAND ${CMAKE_COMMAND} - ARGS - -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}.tmp - ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} - ) + # Create a tmp inst file in case the command fails to + # execute. This two level thing is necessary so that + # we don't try and compile with incomplete instantiations + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} + DEPENDS + ${_dependency} + ${_main_build_dir}/cmake/templates + ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} + COMMAND + ${_command} + ARGS + ${_main_build_dir}/cmake/templates < ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file} + > ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_file}.tmp + COMMAND + ${CMAKE_COMMAND} + ARGS + -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}.tmp + ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file} + ) - # Append to a list of inst _inst_targets - list(APPEND _inst_targets ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}) - endforeach() + # Append to a list of inst _inst_targets + list(APPEND _inst_targets ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}) + endforeach() - # Create a target that depends on the generations - # of template files to ensure that things are done - # in the right order - add_custom_target(${_target}_inst ALL DEPENDS ${_inst_targets}) + # Create a target that depends on the generations + # of template files to ensure that things are done + # in the right order + add_custom_target(${_target}_inst ALL DEPENDS ${_inst_targets}) - # Add this target again to the different build types if the override is off. - if(NOT DEFINED BUILD_OVERRIDE) - foreach(_build ${PRISMS_PF_BUILD_TYPES}) - # The build types are uppercase so we need to - # convert them - string(TOLOWER ${_build} _build_lowercase) + # Add this target again to the different build types if the override is off. + if(NOT DEFINED BUILD_OVERRIDE) + foreach(_build ${PRISMS_PF_BUILD_TYPES}) + # The build types are uppercase so we need to + # convert them + string(TOLOWER ${_build} _build_lowercase) - # Add the target - add_dependencies(${_target}_${_build_lowercase} ${_target}_inst) - endforeach() - else() - # Add the target - add_dependencies(${_target} ${_target}_inst) - endif() + # Add the target + add_dependencies(${_target}_${_build_lowercase} ${_target}_inst) + endforeach() + else() + # Add the target + add_dependencies(${_target} ${_target}_inst) + endif() endmacro() diff --git a/cmake/macros/macro_prisms_pf_autopilot.cmake b/cmake/macros/macro_prisms_pf_autopilot.cmake index 08235e650..b0bed4ebb 100644 --- a/cmake/macros/macro_prisms_pf_autopilot.cmake +++ b/cmake/macros/macro_prisms_pf_autopilot.cmake @@ -3,76 +3,73 @@ # macro(prisms_pf_autopilot PRISMS_PF_CORE_DIR) - # Add the script files - add_subdirectory( - "${PRISMS_PF_CORE_DIR}/cmake/scripts" - "${CMAKE_BINARY_DIR}/scripts_build" - ) + # Add the script files + add_subdirectory( + "${PRISMS_PF_CORE_DIR}/cmake/scripts" + "${CMAKE_BINARY_DIR}/scripts_build" + ) - # Enable compile commands export - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # Enable compile commands export + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - # Set the location of application source files - # Check if an override is specified otherwise - # proceed with defaults - if(NOT DEFINED TARGET_SRC_OVERRIDE) - set(TARGET_SRC - "${CMAKE_CURRENT_SOURCE_DIR}/main.cc" - "${CMAKE_CURRENT_SOURCE_DIR}/equations.cc" - "${CMAKE_CURRENT_SOURCE_DIR}/ICs_and_BCs.cc" - ) - else() - set(TARGET_SRC ${TARGET_SRC_OVERRIDE}) - endif() + # Set the location of application source files + # Check if an override is specified otherwise + # proceed with defaults + if(NOT DEFINED TARGET_SRC_OVERRIDE) + set( + TARGET_SRC + "${CMAKE_CURRENT_SOURCE_DIR}/main.cc" + "${CMAKE_CURRENT_SOURCE_DIR}/equations.cc" + "${CMAKE_CURRENT_SOURCE_DIR}/ICs_and_BCs.cc" + ) + else() + set(TARGET_SRC ${TARGET_SRC_OVERRIDE}) + endif() - # Create the exectuables - foreach(_build ${APPLICATION_BUILD_TYPES}) - string(TOLOWER ${_build} _build_lowercase) - string(TOUPPER ${_build} _build_uppercase) + # Create the exectuables + foreach(_build ${APPLICATION_BUILD_TYPES}) + string(TOLOWER ${_build} _build_lowercase) + string(TOUPPER ${_build} _build_uppercase) - set(_target main-${_build_lowercase}) + set(_target main-${_build_lowercase}) - add_executable(${_target} ${TARGET_SRC}) + add_executable(${_target} ${TARGET_SRC}) - if(TARGET prisms_pf::prisms_pf_${_build_lowercase}) - target_link_libraries( - ${_target} - PRIVATE prisms_pf::prisms_pf_${_build_lowercase} - ) - message( - STATUS - "Successfully linked ${_target} to prisms_pf_${_build_lowercase}" - ) - else() - message( - FATAL_ERROR - "Target prisms_pf_${_build_lowercase} does not exist! " - "Available build types: ${PRISMS_PF_BUILD_TYPES}" - ) - endif() + if(TARGET prisms_pf::prisms_pf_${_build_lowercase}) + target_link_libraries(${_target} PRIVATE prisms_pf::prisms_pf_${_build_lowercase}) + message(STATUS "Successfully linked ${_target} to prisms_pf_${_build_lowercase}") + else() + message( + FATAL_ERROR + "Target prisms_pf_${_build_lowercase} does not exist! " + "Available build types: ${PRISMS_PF_BUILD_TYPES}" + ) + endif() - target_include_directories( - ${_target} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - ) + target_include_directories( + ${_target} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ) - target_compile_options( - ${_target} - PRIVATE - $<$: - ${PRISMS_PF_WARNING_FLAGS} - ${PRISMS_PF_CXX_FLAGS} - ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> - ) - target_link_options( - ${_target} - PRIVATE - $<$: - ${PRISMS_PF_LINKER_FLAGS} - ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> - ) + target_compile_options( + ${_target} + PRIVATE + $<$: + ${PRISMS_PF_WARNING_FLAGS} + ${PRISMS_PF_CXX_FLAGS} + ${PRISMS_PF_CXX_FLAGS_${_build_uppercase}}> + ) + target_link_options( + ${_target} + PRIVATE + $<$: + ${PRISMS_PF_LINKER_FLAGS} + ${PRISMS_PF_LINKER_FLAGS_${_build_uppercase}}> + ) - set(BUILD_OVERRIDE "") - expand_template_instantiations(${_target} "custom_pde.inst.in") - endforeach() + set(BUILD_OVERRIDE "") + expand_template_instantiations(${_target} "custom_pde.inst.in") + endforeach() endmacro() diff --git a/cmake/macros/macro_prisms_pf_git_version.cmake b/cmake/macros/macro_prisms_pf_git_version.cmake index 780f01784..4e2176aa3 100644 --- a/cmake/macros/macro_prisms_pf_git_version.cmake +++ b/cmake/macros/macro_prisms_pf_git_version.cmake @@ -3,95 +3,84 @@ # macro(prisms_pf_git_version) - message(STATUS "Querying git information") + message(STATUS "Querying git information") - find_package(Git QUIET) + find_package(Git QUIET) - set(PRISMS_PF_GIT_BRANCH "") - set(PRISMS_PF_GIT_REVISION "") - set(PRISMS_PF_GIT_SHORTREV "") - set(PRISMS_PF_GIT_TIMESTAMP "") + set(PRISMS_PF_GIT_BRANCH "") + set(PRISMS_PF_GIT_REVISION "") + set(PRISMS_PF_GIT_SHORTREV "") + set(PRISMS_PF_GIT_TIMESTAMP "") - set(tmp "") - set(tmp1 "") - set(tmp2 "") + set(tmp "") + set(tmp1 "") + set(tmp2 "") - if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD) - # Grab the nearest tag with some additional information - execute_process( - COMMAND git describe --abbrev=12 --dirty --always --tags - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE tmp - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD) + # Grab the nearest tag with some additional information + execute_process( + COMMAND + git describe --abbrev=12 --dirty --always --tags + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE tmp + OUTPUT_STRIP_TRAILING_WHITESPACE + ) - # Grab the branch - execute_process( - COMMAND git symbolic-ref HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE tmp1 - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT ${tmp1} STREQUAL "") - string( - REGEX REPLACE - "refs/heads/" - "" - PRISMS_PF_GIT_BRANCH - "${tmp1}" - ) - endif() + # Grab the branch + execute_process( + COMMAND + git symbolic-ref HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE tmp1 + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT ${tmp1} STREQUAL "") + string(REGEX REPLACE "refs/heads/" "" PRISMS_PF_GIT_BRANCH "${tmp1}") + endif() - # Grab the latest commit hash and date - set(date_formatting "") - if(NOT ${GIT_VERSION_STRING} VERSION_LESS 2.2) - set(date_formatting "--date=iso-strict") - endif() - execute_process( - COMMAND - git log -n 1 - --pretty=format:"revision=%H, shortrev=%h, date=%cd" - ${date_formatting} - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE tmp2 - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT ${tmp2} STREQUAL "") - string( - REGEX REPLACE - "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" - "\\1" - PRISMS_PF_GIT_REVISION - "${tmp2}" - ) - string( - REGEX REPLACE - "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" - "\\2" - PRISMS_PF_GIT_SHORTREV - "${tmp2}" - ) - string( - REGEX REPLACE - "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" - "\\3" - PRISMS_PF_GIT_TIMESTAMP - "${tmp2}" - ) - string( - REPLACE - "T" - " " - PRISMS_PF_GIT_TIMESTAMP - "${PRISMS_PF_GIT_TIMESTAMP}" - ) - endif() - else() - message(WARNING "git repo not found") + # Grab the latest commit hash and date + set(date_formatting "") + if(NOT ${GIT_VERSION_STRING} VERSION_LESS 2.2) + set(date_formatting "--date=iso-strict") + endif() + execute_process( + COMMAND + git log -n 1 --pretty=format:"revision=%H, shortrev=%h, date=%cd" + ${date_formatting} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE tmp2 + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT ${tmp2} STREQUAL "") + string( + REGEX REPLACE + "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + "\\1" + PRISMS_PF_GIT_REVISION + "${tmp2}" + ) + string( + REGEX REPLACE + "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + "\\2" + PRISMS_PF_GIT_SHORTREV + "${tmp2}" + ) + string( + REGEX REPLACE + "^\"revision=(.+), shortrev=(.+), date=(.+)\"$" + "\\3" + PRISMS_PF_GIT_TIMESTAMP + "${tmp2}" + ) + string(REPLACE "T" " " PRISMS_PF_GIT_TIMESTAMP "${PRISMS_PF_GIT_TIMESTAMP}") endif() + else() + message(WARNING "git repo not found") + endif() - set(PRISMS_PF_GIT_TAG "${tmp}" CACHE INTERNAL "") - unset(tmp) - unset(tmp1) - unset(tmp2) + set(PRISMS_PF_GIT_TAG "${tmp}" CACHE INTERNAL "") + unset(tmp) + unset(tmp1) + unset(tmp2) endmacro() diff --git a/cmake/macros/macro_set_cpp_standard.cmake b/cmake/macros/macro_set_cpp_standard.cmake index 37f76f1d7..40766053b 100644 --- a/cmake/macros/macro_set_cpp_standard.cmake +++ b/cmake/macros/macro_set_cpp_standard.cmake @@ -3,7 +3,7 @@ # macro(set_cpp_standard _number) - set(CMAKE_CXX_STANDARD ${_number}) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD ${_number}) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) endmacro() diff --git a/cmake/macros/macro_set_if_empty.cmake b/cmake/macros/macro_set_if_empty.cmake index 38621508b..b53a87557 100644 --- a/cmake/macros/macro_set_if_empty.cmake +++ b/cmake/macros/macro_set_if_empty.cmake @@ -3,7 +3,7 @@ # macro(set_if_empty _variable) - if("${${_variable}}" STREQUAL "") - set(${_variable} ${ARGN}) - endif() + if("${${_variable}}" STREQUAL "") + set(${_variable} ${ARGN}) + endif() endmacro() diff --git a/cmake/modules/FindPRISMS_PF_CALIPER.cmake b/cmake/modules/FindPRISMS_PF_CALIPER.cmake index ffd5359b6..0ee5f6d60 100644 --- a/cmake/modules/FindPRISMS_PF_CALIPER.cmake +++ b/cmake/modules/FindPRISMS_PF_CALIPER.cmake @@ -2,22 +2,34 @@ # Try and find the Caliper library # +set(CALIPER_DIR "" CACHE PATH "An optional hint to a Caliper directory") +set_if_empty(CALIPER_DIR "$ENV{CALIPER_DIR}") + +# As an optional feature, we must either let the user specify to use Caliper +# explicitly, or we can try and auto-detect it if(PRISMS_PF_AUTODETECTION) - find_package(Caliper QUIET HINTS ${CALIPER_DIR} $ENV{CALIPER_DIR}) - if(${CALIPER_FOUND}) - set(PRISMS_PF_WITH_CALIPER ON) - endif() + message(STATUS "Attempting to auto-detect Caliper installation...") + message(STATUS " CALIPER_DIR: ${CALIPER_DIR}") + find_package(Caliper QUIET HINTS ${CALIPER_DIR}) + if(${CALIPER_FOUND}) + set(PRISMS_PF_WITH_CALIPER ON) + message(STATUS " Caliper found at ${CALIPER_DIR}") + else() + set(PRISMS_PF_WITH_CALIPER OFF) + message(STATUS " Caliper not found") + endif() endif() if(PRISMS_PF_WITH_CALIPER) - find_package(Caliper QUIET HINTS ${CALIPER_DIR} $ENV{CALIPER_DIR}) - message(STATUS "CALIPER_DIR: ${CALIPER_DIR}") - if(${CALIPER_FOUND}) - include_directories(${CALIPER_INCLUDE_DIR}) - message(STATUS " Caliper found at ${CALIPER_DIR}") - else() - message( - FATAL_ERROR - "Caliper not found. Disable PRISMS_PF_WITH_CALIPER or specify a hint to your installation directory with CALIPER_DIR" - ) - endif() + message(STATUS "Looking for Caliper installation...") + message(STATUS " CALIPER_DIR: ${CALIPER_DIR}") + find_package(Caliper QUIET HINTS ${CALIPER_DIR}) + if(${CALIPER_FOUND}) + include_directories(${CALIPER_INCLUDE_DIR}) + message(STATUS " Caliper found at ${CALIPER_DIR}") + else() + message( + FATAL_ERROR + "Caliper not found. Disable PRISMS_PF_WITH_CALIPER or specify a hint to your installation directory with CALIPER_DIR" + ) + endif() endif() diff --git a/cmake/modules/FindPRISMS_PF_DEAL_II.cmake b/cmake/modules/FindPRISMS_PF_DEAL_II.cmake index 8e6f78031..b758e61aa 100644 --- a/cmake/modules/FindPRISMS_PF_DEAL_II.cmake +++ b/cmake/modules/FindPRISMS_PF_DEAL_II.cmake @@ -5,84 +5,93 @@ set(DEAL_II_DIR "" CACHE PATH "An optional hint to a deal.II directory") set_if_empty(DEAL_II_DIR "$ENV{DEAL_II_DIR}") +# Try to find deal.II +message(STATUS "Looking for deal.II installation...") +message(STATUS " DEAL_II_DIR: ${DEAL_II_DIR}") find_package(deal.II 9.6.0 QUIET HINTS ${DEAL_II_DIR}) if(NOT ${deal.II_FOUND}) - message( - FATAL_ERROR - "\n*** Could not find a recent version of deal.II. ***\n" - "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake " - "or set an environment variable \"DEAL_II_DIR\" that contains a path to a " - "recent version of deal.II." - ) + message( + FATAL_ERROR + "\n*** Could not find a recent version of deal.II. ***\n" + "You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake " + "or set an environment variable \"DEAL_II_DIR\" that contains a path to a " + "recent version of deal.II." + ) endif() -message( - STATUS - "Found deal.II version ${DEAL_II_PACKAGE_VERSION} at '${deal.II_DIR}'" -) +message(STATUS " deal.II version ${DEAL_II_PACKAGE_VERSION} at '${deal.II_DIR}'") # Check the deal.II build types match the ones we are requesting -string(FIND "${DEAL_II_BUILD_TYPE}" "${CMAKE_BUILD_TYPE}" _pos) +string( + FIND "${DEAL_II_BUILD_TYPE}" + "${CMAKE_BUILD_TYPE}" + _pos +) if(_pos EQUAL -1) - message( - FATAL_ERROR - "Mismatch between the build types that deal.II was built with and " - "the ones being requested. PRISMS-PF is tryng to build with ${CMAKE_BUILD_TYPE}, but " - "deal.II was built with ${DEAL_II_BUILD_TYPE}." - ) + message( + FATAL_ERROR + "Mismatch between the build types that deal.II was built with and " + "the ones being requested. PRISMS-PF is tryng to build with ${CMAKE_BUILD_TYPE}, but " + "deal.II was built with ${DEAL_II_BUILD_TYPE}." + ) endif() # Required deal.II features set(DEAL_II_INSTALL_VALID ON) if(NOT DEAL_II_WITH_LAPACK) - message(SEND_ERROR "\n**deal.II was built without support for lapack!\n") - set(DEAL_II_INSTALL_VALID OFF) + message(SEND_ERROR "\n**deal.II was built without support for lapack!\n") + set(DEAL_II_INSTALL_VALID OFF) endif() if(NOT DEAL_II_WITH_P4EST) - message(SEND_ERROR "\n**deal.II was built without support for p4est!\n") - set(DEAL_II_INSTALL_VALID OFF) + message(SEND_ERROR "\n**deal.II was built without support for p4est!\n") + set(DEAL_II_INSTALL_VALID OFF) endif() if(NOT DEAL_II_WITH_MPI) - message(SEND_ERROR "\n**deal.II was built without support for MPI!\n") - set(DEAL_II_INSTALL_VALID OFF) + message(SEND_ERROR "\n**deal.II was built without support for MPI!\n") + set(DEAL_II_INSTALL_VALID OFF) endif() if(NOT DEAL_II_INSTALL_VALID) - message( - FATAL_ERROR - "\nPRISMS-PF requires a deal.II installation with certain features enabled!\n" - ) + message( + FATAL_ERROR + "\nPRISMS-PF requires a deal.II installation with certain features enabled!\n" + ) endif() # Optional deal.II features -# zlib should be required by p4est in deal.II, so its on by default +# zlib should be required by p4est in deal.II, so it's on by default if(PRISMS_PF_WITH_ZLIB) - if(DEAL_II_WITH_ZLIB) - message(STATUS " Found deal.II installation with zlib") - else() - message( - FATAL_ERROR - "deal.II installation with zlib not found. Disable PRISMS_PF_WITH_ZLIB or recompile deal.II with zlib." - ) - endif() + if(DEAL_II_WITH_ZLIB) + message(STATUS " Found deal.II installation with zlib") + else() + message( + FATAL_ERROR + "deal.II installation with zlib not found. Disable PRISMS_PF_WITH_ZLIB or recompile deal.II with zlib." + ) + endif() +else() + message( + AUTHOR_WARNING + "PRISMS_PF_WITH_ZLIB is OFF; zlib support is supposed to be disabled, but likely isn't in the code" + ) endif() function(remove_std_flag variable_name) - # Get the current value - set(flags "${${variable_name}}") + # Get the current value + set(flags "${${variable_name}}") - # Remove any -std=c++XX or -std=gnu++XX flags - string(REGEX REPLACE "-std=[^ ]+" "" flags "${flags}") + # Remove any -std=c++XX or -std=gnu++XX flags + string(REGEX REPLACE "-std=[^ ]+" "" flags "${flags}") - # Clean up any extra spaces - string(REGEX REPLACE " +" " " flags "${flags}") - string(STRIP "${flags}" flags) + # Clean up any extra spaces + string(REGEX REPLACE " +" " " flags "${flags}") + string(STRIP "${flags}" flags) - # Set the modified value back to the parent scope - set(${variable_name} "${flags}" PARENT_SCOPE) + # Set the modified value back to the parent scope + set(${variable_name} "${flags}" PARENT_SCOPE) endfunction() # Grab relevant deal.II flags and put them into our own variables diff --git a/cmake/modules/FindPRISMS_PF_VTK.cmake b/cmake/modules/FindPRISMS_PF_VTK.cmake index 144b01044..c0490dd72 100644 --- a/cmake/modules/FindPRISMS_PF_VTK.cmake +++ b/cmake/modules/FindPRISMS_PF_VTK.cmake @@ -2,45 +2,39 @@ # Try and find the vtk library # +set(VTK_DIR "" CACHE PATH "An optional hint to a VTK directory") +set_if_empty(VTK_DIR "$ENV{VTK_DIR}") + # If deal.II wasn't built with VTK we have to check for the installation # elsewhere if(NOT DEAL_II_WITH_VTK AND PRISMS_PF_WITH_VTK) - message( - STATUS - "deal.II wasn't built with VTK, checking for separate installation" - ) - - find_package(VTK QUIET HINTS ${VTK_DIR} $ENV{VTK_DIR}) - set(VTK_VERSION "${VTK_VERSION}") - set(VTK_MAJOR_VERSION "${VTK_MAJOR_VERSION}") - set(VTK_MINOR_VERSION "${VTK_MINOR_VERSION}") - set(VTK_INCLUDE_DIR - ${VTK_PREFIX_PATH}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} - ) - # Filter the included libraries - set(_libraries) - foreach(_library ${VTK_LIBRARIES}) - if( - NOT ${_library} MATCHES "Python" - AND NOT ${_library} MATCHES "MPI4Py" - ) - get_target_property( - _configurations - ${_library} - IMPORTED_CONFIGURATIONS - ) - if(_configurations) - foreach(_configuration ${_configurations}) - get_target_property( - _imported_location - ${_library} - IMPORTED_LOCATION_${_configuration} - ) - list(APPEND _libraries ${_imported_location}) - endforeach() - endif() - endif() - endforeach() - set(VTK_NEW_LIBRARIES ${_libraries}) - set(VTK_BUILT_SEPARATELY ON) + message(STATUS "deal.II wasn't built with VTK, checking for separate installation...") + find_package(VTK QUIET HINTS ${VTK_DIR}) + # TODO: Clean this up and add minimum version support + set(VTK_VERSION "${VTK_VERSION}") + set(VTK_MAJOR_VERSION "${VTK_MAJOR_VERSION}") + set(VTK_MINOR_VERSION "${VTK_MINOR_VERSION}") + set( + VTK_INCLUDE_DIR + ${VTK_PREFIX_PATH}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} + ) + # Filter the included libraries + set(_libraries) + foreach(_library ${VTK_LIBRARIES}) + if(NOT ${_library} MATCHES "Python" AND NOT ${_library} MATCHES "MPI4Py") + get_target_property(_configurations ${_library} IMPORTED_CONFIGURATIONS) + if(_configurations) + foreach(_configuration ${_configurations}) + get_target_property( + _imported_location + ${_library} + IMPORTED_LOCATION_${_configuration} + ) + list(APPEND _libraries ${_imported_location}) + endforeach() + endif() + endif() + endforeach() + set(VTK_NEW_LIBRARIES ${_libraries}) + set(VTK_BUILT_SEPARATELY ON) endif() diff --git a/cmake/scripts/CMakeLists.txt b/cmake/scripts/CMakeLists.txt index e4d0ed596..41e3b560f 100644 --- a/cmake/scripts/CMakeLists.txt +++ b/cmake/scripts/CMakeLists.txt @@ -1,10 +1,12 @@ # Add the script to an executable add_executable( - expand_template_instantiations_exe - ${CMAKE_CURRENT_SOURCE_DIR}/expand_template_instantiations.cc + expand_template_instantiations_exe + ${CMAKE_CURRENT_SOURCE_DIR}/expand_template_instantiations.cc ) set_target_properties( - expand_template_instantiations_exe - PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/cmake/scripts" + expand_template_instantiations_exe + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY + "${CMAKE_BINARY_DIR}/cmake/scripts" ) diff --git a/cmake/setup_application.cmake b/cmake/setup_application.cmake index b02c019be..7f322af23 100644 --- a/cmake/setup_application.cmake +++ b/cmake/setup_application.cmake @@ -2,14 +2,14 @@ # Check that PRISMS_PF_CORE_DIR is set if(PRISMS_PF_CORE_DIR STREQUAL "") - message(FATAL_ERROR "PRISMS_PF_CORE_DIR is not set") + message(FATAL_ERROR "PRISMS_PF_CORE_DIR is not set") endif() # Load macros file(GLOB macro_files "${PRISMS_PF_CORE_DIR}/cmake/macros/*.cmake") foreach(file ${macro_files}) - message(STATUS "Include ${file}") - include(${file}) + message(STATUS "Include ${file}") + include(${file}) endforeach() # Grab the version of PRISMS-PF @@ -26,67 +26,69 @@ set_cpp_standard(20) # Make and ninja build options if(CMAKE_GENERATOR MATCHES "Ninja") - set(_make_command "$ ninja") + set(_make_command "$ ninja") else() - set(_make_command " $ make") + set(_make_command " $ make") endif() # Setup the build type (debug, release, debugrelease) if("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_BUILD_TYPE - "DebugRelease" - CACHE STRING - "Choose the type of build, options are: Debug, Release and DebugRelease." - FORCE - ) + set( + CMAKE_BUILD_TYPE + "DebugRelease" + CACHE STRING + "Choose the type of build, options are: Debug, Release and DebugRelease." + FORCE + ) endif() # List of build types for the application if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") - list(APPEND APPLICATION_BUILD_TYPES "Debug") + list(APPEND APPLICATION_BUILD_TYPES "Debug") endif() if("${CMAKE_BUILD_TYPE}" MATCHES "Release") - list(APPEND APPLICATION_BUILD_TYPES "Release") + list(APPEND APPLICATION_BUILD_TYPES "Release") endif() # Check that the core library was compiled with those build types foreach(BUILD_TYPE ${APPLICATION_BUILD_TYPES}) - if(NOT BUILD_TYPE IN_LIST PRISMS_PF_BUILD_TYPES) - message( - FATAL_ERROR - "Build type '${BUILD_TYPE}' not found in PRISMS_PF_BUILD_TYPES" - ) - endif() + if(NOT BUILD_TYPE IN_LIST PRISMS_PF_BUILD_TYPES) + message(FATAL_ERROR "Build type '${BUILD_TYPE}' not found in PRISMS_PF_BUILD_TYPES") + endif() endforeach() # For each of the build types as some targets that switch the type and compile if("Debug" IN_LIST APPLICATION_BUILD_TYPES) + add_custom_target( + debug + COMMAND + ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR} + COMMAND + ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Configuring and compiling in DEBUG mode..." + ) + if("Release" IN_LIST APPLICATION_BUILD_TYPES) add_custom_target( - debug - COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Configuring and compiling in DEBUG mode..." + debugrelease + COMMAND + ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR} + COMMAND + ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Configuring and compiling in DEBUG + RELEASE mode..." ) - if("Release" IN_LIST APPLICATION_BUILD_TYPES) - add_custom_target( - debugrelease - COMMAND - ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Configuring and compiling in DEBUG + RELEASE mode..." - ) - endif() + endif() endif() if("Release" IN_LIST APPLICATION_BUILD_TYPES) - add_custom_target( - release - COMMAND - ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=DebugRelease ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Configuring and compiling in RELEASE mode..." - ) + add_custom_target( + release + COMMAND + ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=DebugRelease ${CMAKE_SOURCE_DIR} + COMMAND + ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Configuring and compiling in RELEASE mode..." + ) endif() diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index 69b2fb7a8..f7d0390c2 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -17,72 +17,91 @@ option(BUILD_APPLICATIONS "Whether to build all the pre-built applications or no message(STATUS "BUILD_APPLICATIONS = ${BUILD_APPLICATIONS}") option( - 64BIT_INDICES - "Whether to compile PRISMS-PF with 64-bit numbers for large simulations" - OFF + 64BIT_INDICES + "Whether to compile PRISMS-PF with 64-bit numbers for large simulations" + OFF ) message(STATUS "64BIT_INDICES = ${64BIT_INDICES}") option( - ADDITIONAL_OPTIMIZATIONS - "Whether the user wants to enable additional optimizations, or not." - OFF + ADDITIONAL_OPTIMIZATIONS + "Whether the user wants to enable additional optimizations, or not." + OFF ) message(STATUS "ADDITIONAL_OPTIMIZATIONS = ${ADDITIONAL_OPTIMIZATIONS}") option( - ADDITIONAL_DEGREES - "Wether the user wants to enable the compilation of additional element degrees or not." - OFF + ADDITIONAL_DEGREES + "Wether the user wants to enable the compilation of additional element degrees or not." + OFF ) message(STATUS "ADDITIONAL_DEGREES = ${ADDITIONAL_DEGREES}") option( - UNWRAP_COMPILER - "Whether the user wants to unwrap the compiler in compile_commands.json, or not." - OFF + UNWRAP_COMPILER + "Whether the user wants to unwrap the compiler in compile_commands.json, or not." + OFF ) mark_as_advanced(UNWRAP_COMPILER) # Setup the build type (debug, release, debugrelease) if("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_BUILD_TYPE - "DebugRelease" - CACHE STRING - "Choose the type of build, options are: Debug, Release and DebugRelease." - FORCE - ) + set( + CMAKE_BUILD_TYPE + "DebugRelease" + CACHE STRING + "Choose the type of build, options are: Debug, Release and DebugRelease." + FORCE + ) endif() # Convert build type into the debug and release builds, which may or may # not be built. if( - "${CMAKE_BUILD_TYPE}" STREQUAL "Release" - OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" - OR "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease" + "${CMAKE_BUILD_TYPE}" + STREQUAL + "Release" + OR + "${CMAKE_BUILD_TYPE}" + STREQUAL + "Debug" + OR + "${CMAKE_BUILD_TYPE}" + STREQUAL + "DebugRelease" ) - message(STATUS "Setting up PRISMS-PF for ${CMAKE_BUILD_TYPE} mode.") + message(STATUS "Setting up PRISMS-PF for ${CMAKE_BUILD_TYPE} mode.") else() - message( - FATAL_ERROR - "CMAKE_BUILD_TYPE must either be 'Release', 'Debug', or 'DebugRelease', but is set to '${CMAKE_BUILD_TYPE}'." - ) + message( + FATAL_ERROR + "CMAKE_BUILD_TYPE must either be 'Release', 'Debug', or 'DebugRelease', but is set to '${CMAKE_BUILD_TYPE}'." + ) endif() if( - "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" - OR "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease" + "${CMAKE_BUILD_TYPE}" + STREQUAL + "Debug" + OR + "${CMAKE_BUILD_TYPE}" + STREQUAL + "DebugRelease" ) - set(PRISMS_PF_BUILD_DEBUG "ON") + set(PRISMS_PF_BUILD_DEBUG "ON") else() - set(PRISMS_PF_BUILD_DEBUG "OFF") + set(PRISMS_PF_BUILD_DEBUG "OFF") endif() if( - "${CMAKE_BUILD_TYPE}" STREQUAL "Release" - OR "${CMAKE_BUILD_TYPE}" STREQUAL "DebugRelease" + "${CMAKE_BUILD_TYPE}" + STREQUAL + "Release" + OR + "${CMAKE_BUILD_TYPE}" + STREQUAL + "DebugRelease" ) - set(PRISMS_PF_BUILD_RELEASE "ON") + set(PRISMS_PF_BUILD_RELEASE "ON") else() - set(PRISMS_PF_BUILD_RELEASE "OFF") + set(PRISMS_PF_BUILD_RELEASE "OFF") endif() diff --git a/cmake/setup_prisms_pf.cmake b/cmake/setup_prisms_pf.cmake index 876b66784..015bf017e 100644 --- a/cmake/setup_prisms_pf.cmake +++ b/cmake/setup_prisms_pf.cmake @@ -11,34 +11,34 @@ set_if_empty(PRISMS_PF_VERSION "${_version}") # Decompose the version string( - REGEX REPLACE - "^([0-9]+)\\..*" - "\\1" - PRISMS_PF_VERSION_MAJOR - "${PRISMS_PF_VERSION}" + REGEX REPLACE + "^([0-9]+)\\..*" + "\\1" + PRISMS_PF_VERSION_MAJOR + "${PRISMS_PF_VERSION}" ) string( - REGEX REPLACE - "^[0-9]+\\.([0-9]+).*" - "\\1" - PRISMS_PF_VERSION_MINOR - "${PRISMS_PF_VERSION}" + REGEX REPLACE + "^[0-9]+\\.([0-9]+).*" + "\\1" + PRISMS_PF_VERSION_MINOR + "${PRISMS_PF_VERSION}" ) string( - REGEX REPLACE - "^[0-9]+\\.[0-9]+\\.([0-9]+).*" - "\\1" - PRISMS_PF_VERSION_SUBMINOR - "${PRISMS_PF_VERSION}" + REGEX REPLACE + "^[0-9]+\\.[0-9]+\\.([0-9]+).*" + "\\1" + PRISMS_PF_VERSION_SUBMINOR + "${PRISMS_PF_VERSION}" ) # List of build types if("${CMAKE_BUILD_TYPE}" MATCHES "Debug") - list(APPEND PRISMS_PF_BUILD_TYPES "Debug") + list(APPEND PRISMS_PF_BUILD_TYPES "Debug") endif() if("${CMAKE_BUILD_TYPE}" MATCHES "Release") - list(APPEND PRISMS_PF_BUILD_TYPES "Release") + list(APPEND PRISMS_PF_BUILD_TYPES "Release") endif() # Set the standard to C++20 @@ -46,109 +46,114 @@ set_cpp_standard(20) # Create compile_commands.json set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(FORCE_COLORED_OUTPUT - ON - CACHE BOOL - "Forces colored output when compiling with gcc and clang." +set( + FORCE_COLORED_OUTPUT + ON + CACHE BOOL + "Forces colored output when compiling with gcc and clang." ) # Features option( - PRISMS_PF_WITH_ZLIB - "Whether the user wants to compile PRISMS-PF with deal.II's zlib dependency, or not." - ON + PRISMS_PF_WITH_ZLIB + "Whether the user wants to compile PRISMS-PF with deal.II's zlib dependency, or not." + ON ) option( - PRISMS_PF_WITH_VTK - "Whether the user wants to compiler PRISMS-PF with vtk, or not" - OFF + PRISMS_PF_WITH_VTK + "Whether the user wants to compiler PRISMS-PF with vtk, or not" + OFF ) option( - PRISMS_PF_WITH_CALIPER - "Whether the user wants to compile PRISMS-PF with the profiling code Caliper, or not." - OFF + PRISMS_PF_WITH_CALIPER + "Whether the user wants to compile PRISMS-PF with the profiling code Caliper, or not." + OFF ) # Set the compiler and linker flags set(PRISMS_PF_WARNING_FLAGS "") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC - set(PRISMS_PF_WARNING_FLAGS - -Wall - -Wextra - -Wpedantic - # -Wconversion # TODO: Renable this - # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility - -Wshadow - -Wnon-virtual-dtor - -Wold-style-cast - -Wcast-align - -Wunused - -Woverloaded-virtual - -Wnull-dereference - -Wdouble-promotion - -Wformat=2 - -Wimplicit-fallthrough - -Wmisleading-indentation - -Wduplicated-cond - -Wduplicated-branches - -Wlogical-op - -Wuseless-cast - ) + set( + PRISMS_PF_WARNING_FLAGS + -Wall + -Wextra + -Wpedantic + # -Wconversion # TODO: Renable this + # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility + -Wshadow + -Wnon-virtual-dtor + -Wold-style-cast + -Wcast-align + -Wunused + -Woverloaded-virtual + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wimplicit-fallthrough + -Wmisleading-indentation + -Wduplicated-cond + -Wduplicated-branches + -Wlogical-op + -Wuseless-cast + ) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Clang/AppleClang - set(PRISMS_PF_WARNING_FLAGS - -Wall - -Wextra - -Wpedantic - -Wconversion - # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility - -Wshadow - -Wnon-virtual-dtor - -Wold-style-cast - -Wcast-align - -Wunused - -Woverloaded-virtual - -Wnull-dereference - -Wdouble-promotion - -Wformat=2 - -Wimplicit-fallthrough - -Wdocumentation - -Winconsistent-missing-destructor-override-attribute - -Wunreachable-code - -Wmove - -Wloop-analysis - -Wcomma - -Wrange-loop-analysis - ) + set( + PRISMS_PF_WARNING_FLAGS + -Wall + -Wextra + -Wpedantic + -Wconversion + # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility + -Wshadow + -Wnon-virtual-dtor + -Wold-style-cast + -Wcast-align + -Wunused + -Woverloaded-virtual + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wimplicit-fallthrough + -Wdocumentation + -Winconsistent-missing-destructor-override-attribute + -Wunreachable-code + -Wmove + -Wloop-analysis + -Wcomma + -Wrange-loop-analysis + ) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # Intel classic (icc/icpc) - set(PRISMS_PF_WARNING_FLAGS - -Wall - -Wextra - -Wcheck - -Wshadow - -Wunused-variable - -Wuninitialized - -Wremarks - ) + set( + PRISMS_PF_WARNING_FLAGS + -Wall + -Wextra + -Wcheck + -Wshadow + -Wunused-variable + -Wuninitialized + -Wremarks + ) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") # Newer Intel oneAPI compilers (icx/icpx) - set(PRISMS_PF_WARNING_FLAGS - -Wall - -Wextra - -Wpedantic - -Wconversion - # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility - -Wshadow - -Wnon-virtual-dtor - -Wold-style-cast - -Wcast-align - -Wunused - -Woverloaded-virtual - -Wnull-dereference - -Wdouble-promotion - -Wformat=2 - -Wimplicit-fallthrough - ) + set( + PRISMS_PF_WARNING_FLAGS + -Wall + -Wextra + -Wpedantic + -Wconversion + # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility + -Wshadow + -Wnon-virtual-dtor + -Wold-style-cast + -Wcast-align + -Wunused + -Woverloaded-virtual + -Wnull-dereference + -Wdouble-promotion + -Wformat=2 + -Wimplicit-fallthrough + ) endif() set(PRISMS_PF_CXX_FLAGS "") diff --git a/cmake/write_config.cmake b/cmake/write_config.cmake index 540006ab0..8a437b7ce 100644 --- a/cmake/write_config.cmake +++ b/cmake/write_config.cmake @@ -5,19 +5,23 @@ # Set the file pathes and remove any log files that may already exist set(detailed_log "${CMAKE_SOURCE_DIR}/detailed.log") set(summary_log "${CMAKE_SOURCE_DIR}/summary.log") -file(REMOVE ${detailed_log} ${summary_log}) +file( + REMOVE + ${detailed_log} + ${summary_log} +) function(write_to_both) - file(APPEND "${detailed_log}" "${ARGN}") - file(APPEND "${summary_log}" "${ARGN}") + file(APPEND "${detailed_log}" "${ARGN}") + file(APPEND "${summary_log}" "${ARGN}") endfunction() function(write_to_summary) - file(APPEND "${summary_log}" "${ARGN}") + file(APPEND "${summary_log}" "${ARGN}") endfunction() function(write_to_detailed) - file(APPEND "${detailed_log}" "${ARGN}") + file(APPEND "${detailed_log}" "${ARGN}") endfunction() write_to_both( diff --git a/contrib/postprocessing/domain_stats.py b/contrib/postprocessing/domain_stats.py index c0f941b4c..38b90f00b 100644 --- a/contrib/postprocessing/domain_stats.py +++ b/contrib/postprocessing/domain_stats.py @@ -1,29 +1,30 @@ #!/usr/bin/env python3 import sys -from visit import * + from numpy import * +from visit import * -#DeleteAllPlots() +# DeleteAllPlots() # Step 1: Open a database (the whole .vtu time series) -dbname="solution-*.vtu database" +dbname = "solution-*.vtu database" OpenDatabase(dbname) -#Defining number of samples in each direction (for resampling operator) -#The number of samples in the direction in which the system is the largest -#gets assigned nmax samples. The remaining directions get assigned -#a propostional number according to their length -#Thus number can be increased if domains are underresolved or -#decreased if domains are sufficiently resolved and calculations -#take too long -nmax=256; - -#Step 2: Add contour plot to obtain grid information and dimensionality -#Add Contour plot +# Defining number of samples in each direction (for resampling operator) +# The number of samples in the direction in which the system is the largest +# gets assigned nmax samples. The remaining directions get assigned +# a propostional number according to their length +# Thus number can be increased if domains are underresolved or +# decreased if domains are sufficiently resolved and calculations +# take too long +nmax = 256 + +# Step 2: Add contour plot to obtain grid information and dimensionality +# Add Contour plot AddPlot("Contour", "n") ContourAtts = ContourAttributes() -ContourAtts.contourValue = (0.5) +ContourAtts.contourValue = 0.5 ContourAtts.contourMethod = ContourAtts.Value SetPlotOptions(ContourAtts) # Step 3: Draw the plots @@ -33,18 +34,18 @@ Query("SpatialExtents") gpq = GetQueryOutputValue() # Extracting number of coordinate limits -#(i.e. min x, max x, min y, max y, min z, max z -dimslength=len(gpq); +# (i.e. min x, max x, min y, max y, min z, max z +dimslength = len(gpq) # Step 5 Determine if system is 2D or 3D (2D - dimslength=4; 3D - dimslength=6) if dimslength >= 5: - is3D = True + is3D = True else: - is3D = False + is3D = False DeleteActivePlots() -#Preparing system for resampling +# Preparing system for resampling AddPlot("Pseudocolor", "n") DrawPlots() @@ -54,29 +55,29 @@ # Extracting number of grid points in the z- direction num_z_coords = int(gpq[4]) -#Step 3: Get the system length in each direction +# Step 3: Get the system length in each direction Query("SpatialExtents") -sq=GetQueryOutputValue() -lx=sq[1]-sq[0] -ly=sq[3]-sq[2] +sq = GetQueryOutputValue() +lx = sq[1] - sq[0] +ly = sq[3] - sq[2] if is3D == True: - lz=sq[5]-sq[4] + lz = sq[5] - sq[4] else: lz = 0.0 -lv=[lx,ly,lz] +lv = [lx, ly, lz] -#Step 4: Calculate the numbers of points in each direction for the -#resample operators -nsx=int(nmax*lv[0]/max(lv)) -nsy=int(nmax*lv[1]/max(lv)) -nsz=int(nmax*lv[2]/max(lv)) +# Step 4: Calculate the numbers of points in each direction for the +# resample operators +nsx = int(nmax * lv[0] / max(lv)) +nsy = int(nmax * lv[1] / max(lv)) +nsz = int(nmax * lv[2] / max(lv)) # Step 5: Resample the data to create a strucutured mesh # Adding the Resample Operator AddOperator("Resample") -#The object r contains the Resample Operator Attributes -r=ResampleAttributes() +# The object r contains the Resample Operator Attributes +r = ResampleAttributes() # Setting the number of samples in x and y # (this may need to be adjusted for different system sizes # and refine factors) @@ -87,7 +88,7 @@ r.is3D = 1 r.samplesZ = nsz else: - r.is3D=0 + r.is3D = 0 # Setting the operator options SetOperatorOptions(r) @@ -96,21 +97,21 @@ # based on value # Adding operator Isovolume AddOperator("Isovolume") -#The object iv contains the Isovolume Operator Attributes -iv=IsovolumeAttributes() +# The object iv contains the Isovolume Operator Attributes +iv = IsovolumeAttributes() # Setting the lower bound to 0.5 # This will select all the regions for which n>0.5 -iv.lbound=0.5 +iv.lbound = 0.5 # Setting the operator options SetOperatorOptions(iv) DrawPlots() -#Step 7: Initializing the number of domains for each time state +# Step 7: Initializing the number of domains for each time state # And opening output file -nodoms=[0.0]*TimeSliderGetNStates() -#Setting the output file name -ofnm="domain_stats_vs_t.txt" -#opening file to output +nodoms = [0.0] * TimeSliderGetNStates() +# Setting the output file name +ofnm = "domain_stats_vs_t.txt" +# opening file to output outF = open(ofnm, "w") print >> outF, "# frame no. / time / no. domains / avg. domain vol. (area) / std. dev." @@ -119,7 +120,7 @@ # Step 8: Animate through time and save results # Count number of domains and save output for states in range(TimeSliderGetNStates()): - #Set slider to state + # Set slider to state SetTimeSliderState(states) # Get the time corresponding to the state Query("Time") @@ -139,9 +140,9 @@ # calculate the volume (or area) of each connected component if r.is3D: # calculate the area of each connected component - size_vec = res['comp_volume'] + size_vec = res["comp_volume"] else: - size_vec = res['comp_area'] + size_vec = res["comp_area"] # Convert tuple to numpy array size_vec_np = asarray(size_vec) # Average domains size @@ -153,8 +154,8 @@ std_dev = 0.0 # Print the state number, time and no. of domains to # screen and to files - print("% d, %.7f, % d, %.7f, %.7f" %(states, t, nodoms, avg_size, std_dev)) - print >> outF, "% d, %.7f, % d, %.7f, %.7f" %(states, t, nodoms, avg_size, std_dev) + print("% d, %.7f, % d, %.7f, %.7f" % (states, t, nodoms, avg_size, std_dev)) + print >> outF, "% d, %.7f, % d, %.7f, %.7f" % (states, t, nodoms, avg_size, std_dev) # Close output file outF.close() # Delete all plots diff --git a/contrib/postprocessing/interface_area.py b/contrib/postprocessing/interface_area.py index 5700924c2..75725a6a5 100644 --- a/contrib/postprocessing/interface_area.py +++ b/contrib/postprocessing/interface_area.py @@ -5,10 +5,11 @@ # For 2D systems, it calculates the total intertface length import sys + from visit import * # Step 1: Open a database (all time steps) -db="solution-*.vtu database" +db = "solution-*.vtu database" OpenDatabase(db) # Step 2: Add Contour plot (using variable "n") @@ -17,35 +18,35 @@ # and n=0.5 representing the midpoint accross the interface AddPlot("Contour", "n", 1, 1) ContourAtts = ContourAttributes() -ContourAtts.contourValue = (0.5) +ContourAtts.contourValue = 0.5 ContourAtts.contourMethod = ContourAtts.Value SetPlotOptions(ContourAtts) -#Step 3: Draw the plot +# Step 3: Draw the plot DrawPlots() # Step 5: Animate through time and save images -intarea=[0.0]*TimeSliderGetNStates() -ofnm="iarea_vs_t.txt" +intarea = [0.0] * TimeSliderGetNStates() +ofnm = "iarea_vs_t.txt" outF = open(ofnm, "w") for states in range(TimeSliderGetNStates()): SetTimeSliderState(states) Query("Time") t = GetQueryOutputValue() - qresp=Query("Weighted Variable Sum") - wvs=GetQueryOutputValue() - #Weighted Variable Sum integrates the value of the order - #parameter along the area (length) of the contour - #surface (curve). - #Since the countour is taken at value n=0.5, - #We multiply by 2 to obtain the area (or length) + qresp = Query("Weighted Variable Sum") + wvs = GetQueryOutputValue() + # Weighted Variable Sum integrates the value of the order + # parameter along the area (length) of the contour + # surface (curve). + # Since the countour is taken at value n=0.5, + # We multiply by 2 to obtain the area (or length) if wvs == (): - intarea[states]=0.0 + intarea[states] = 0.0 else: - intarea[states]=2.0*wvs - print("% d, %.1f, %.5f" %(states, t, intarea[states])) - print >> outF, "% d %.1f %.5f" %(states, t, intarea[states]) + intarea[states] = 2.0 * wvs + print("% d, %.1f, %.5f" % (states, t, intarea[states])) + print >> outF, "% d %.1f %.5f" % (states, t, intarea[states]) outF.close() DeleteAllPlots() CloseDatabase(db) diff --git a/contrib/postprocessing/phase_fraction.py b/contrib/postprocessing/phase_fraction.py index b53d9fef3..328d7dca2 100644 --- a/contrib/postprocessing/phase_fraction.py +++ b/contrib/postprocessing/phase_fraction.py @@ -1,12 +1,13 @@ #!/usr/bin/env python3 import sys + from visit import * -#DeleteAllPlots() +# DeleteAllPlots() # Step 1: Open a database (the whole .vtu time series) -dbname="solution-*.vtu database" +dbname = "solution-*.vtu database" OpenDatabase(dbname) # Step 2: Add plots (using variable "n") @@ -27,26 +28,26 @@ num_z_coords = int(gpq[4]) # Step 5 Get the area (or volume) of the whole domain -av=0.0 +av = 0.0 if num_z_coords >= 1: Query("Volume") # Assign result to variable a - av=GetQueryOutputValue() + av = GetQueryOutputValue() else: Query("2D area") # Assign result to variable a - av=GetQueryOutputValue() + av = GetQueryOutputValue() # Step 6: Initialize phase fraction and open output file -phasefrac=[0.0]*TimeSliderGetNStates() +phasefrac = [0.0] * TimeSliderGetNStates() # Set the output file name -ofnm="phi_vs_t.txt" +ofnm = "phi_vs_t.txt" # Open output file outF = open(ofnm, "w") # Step 7: Animate through time and save results for states in range(TimeSliderGetNStates()): - #Set slider to state + # Set slider to state SetTimeSliderState(states) # Get the time corresponding to the state Query("Time") @@ -55,13 +56,13 @@ # Get the average of domains where n=1 by integration Query("Average Value") # Set this to the variable wvs - avv=GetQueryOutputValue() + avv = GetQueryOutputValue() # Calculate phase fraction as - phasefrac[states]=avv + phasefrac[states] = avv # Print the state number, time and phase fraction to # screen and to files - print("% d, %.1f, %.5f" %(states, t, phasefrac[states])) - print >> outF, "% d %.1f %.5f" %(states, t, phasefrac[states]) + print("% d, %.1f, %.5f" % (states, t, phasefrac[states])) + print >> outF, "% d %.1f %.5f" % (states, t, phasefrac[states]) outF.close() DeleteAllPlots() diff --git a/contrib/postprocessing/plot_and_save.py b/contrib/postprocessing/plot_and_save.py index a6f5f4676..572f8ddbb 100644 --- a/contrib/postprocessing/plot_and_save.py +++ b/contrib/postprocessing/plot_and_save.py @@ -1,37 +1,38 @@ #!/usr/bin/env python3 import sys + from visit import * -#DeleteAllPlots() +# DeleteAllPlots() # Step 1: Open a database (the whole .vtu time series) -dbname="solution-*.vtu database" +dbname = "solution-*.vtu database" OpenDatabase(dbname) -#Step 2: Add contour plot to obtain grid information and dimensionality -#Add Contour plot +# Step 2: Add contour plot to obtain grid information and dimensionality +# Add Contour plot AddPlot("Contour", "n") ContourAtts = ContourAttributes() -ContourAtts.contourValue = (0.5) +ContourAtts.contourValue = 0.5 ContourAtts.contourMethod = ContourAtts.Value SetPlotOptions(ContourAtts) # Step 3: Draw the plots DrawPlots() - + # Step 4: Get the spacial extents Query("SpatialExtents") gpq = GetQueryOutputValue() # Extracting number of coordinate limits -#(i.e. min x, max x, min y, max y, min z, max z -dimslength=len(gpq); - +# (i.e. min x, max x, min y, max y, min z, max z +dimslength = len(gpq) + # Step 5 Determine if system is 2D or 3D (2D - dimslength=4; 3D - dimslength=6) if dimslength >= 5: is2D = False else: is2D = True - + if is2D: DeleteActivePlots() AddPlot("Pseudocolor", "n") @@ -39,7 +40,7 @@ # Step 7: Animate through time and save results for states in range(TimeSliderGetNStates()): - #Set slider to state + # Set slider to state SetTimeSliderState(states) # Get the time corresponding to the state Query("Time") @@ -47,7 +48,7 @@ t = GetQueryOutputValue() # Print the state number, time and phase fraction to # screen and to files - print("Saving frame % d, time %.1f" %(states, t)) + print("Saving frame % d, time %.1f" % (states, t)) SaveWindowAtts = SaveWindowAttributes() SaveWindowAtts.fileName = "frame_" SetSaveWindowAttributes(SaveWindowAtts) diff --git a/contrib/postprocessing/splitvtufiles.py b/contrib/postprocessing/splitvtufiles.py index 58f6012da..a98cbf261 100644 --- a/contrib/postprocessing/splitvtufiles.py +++ b/contrib/postprocessing/splitvtufiles.py @@ -1,9 +1,11 @@ -import pyvista as pv -import numpy as np -import os import glob +import os import sys +import numpy as np +import pyvista as pv + + def split_mesh(input_file, output_prefix, number_of_splits): # Read the .vtu file mesh = pv.read(input_file) @@ -30,29 +32,39 @@ def split_mesh(input_file, output_prefix, number_of_splits): # Create the .pvtu file create_pvtu_file(output_prefix, split_filenames, mesh) + def create_pvtu_file(base_name, split_filenames, reference_mesh): - with open(f"{base_name}.pvtu", 'w') as file: + with open(f"{base_name}.pvtu", "w") as file: file.write('\n') - file.write('\n') + file.write( + '\n' + ) file.write(' \n') - + # Write point data arrays for array in reference_mesh.point_data.keys(): - num_components = reference_mesh.point_data[array].shape[1] if len(reference_mesh.point_data[array].shape) > 1 else 1 + num_components = ( + reference_mesh.point_data[array].shape[1] + if len(reference_mesh.point_data[array].shape) > 1 + else 1 + ) data_type = pv.get_array_association(reference_mesh, array) - file.write(f' \n') + file.write( + f' \n' + ) # Write piece references for filename in split_filenames: file.write(f' \n') - file.write(' \n') - file.write('\n') + file.write(" \n") + file.write("\n") + def process_vtu_files(no_parts): # Construct the search pattern for .vtu files - search_pattern = os.path.join('solution-*.vtu') - + search_pattern = os.path.join("solution-*.vtu") + # Find all .vtu files in the specified directory vtu_files = glob.glob(search_pattern) @@ -61,17 +73,16 @@ def process_vtu_files(no_parts): print(f"Splitting {file}") # Add your code here to process each file # For example, reading the file, performing some analysis, etc. - filenm_noext=file[:-4] + filenm_noext = file[:-4] split_mesh(file, filenm_noext, int(no_parts)) + # Main # Call the function try: process_vtu_files(sys.argv[1]) except Exception as e: print(f"An error occurred: {e}") - print("Error: A single integer argument must be provided specifying the number files in which the system will be split") - - - - + print( + "Error: A single integer argument must be provided specifying the number files in which the system will be split" + ) diff --git a/contrib/postprocessing/vtutopython.py b/contrib/postprocessing/vtutopython.py index 095e3f322..c834be8fc 100644 --- a/contrib/postprocessing/vtutopython.py +++ b/contrib/postprocessing/vtutopython.py @@ -1,33 +1,39 @@ try: - import sys,getopt,os,meshio,pickle + import getopt + import os + import pickle + import sys + + import meshio import numpy as np import pandas as pd except: - print('meshio, pandas, pickle, and numpy packages are required.') + print("meshio, pandas, pickle, and numpy packages are required.") argumentList = sys.argv # Options options = "i:o:hs:v:d:" - + # Long options -long_options = ["input","output","help","scalars", "vectors", "dimension"] +long_options = ["input", "output", "help", "scalars", "vectors", "dimension"] vectors = [] scalars = [] ndim = 2 grid = False -infile = '' -outfile = '' +infile = "" +outfile = "" try: # Parsing argument arguments, values = getopt.getopt(argumentList[1:], options, long_options) # checking each argument for currentArgument, currentValue in arguments: - + if currentArgument in ("-h", "--help"): - print ("\ + print( + "\ \nUsage: vtutopython.py -i -o -s -v -d -g -h \n\n\ \ -i or --input: specify input file in vtu or vtk format\n\ @@ -43,50 +49,52 @@ \ To extract file, use:\n\ with open('name_of_file.pkl', 'rb') as f:\n\ - loaded_file = pickle.load(f)\n") + loaded_file = pickle.load(f)\n" + ) sys.exit(0) elif currentArgument in ("-i", "--input"): infile = currentValue - if infile.split(sep='.')[1] not in ['vtu','vtk']: - print('Input file should be in vtu or vtk format') + if infile.split(sep=".")[1] not in ["vtu", "vtk"]: + print("Input file should be in vtu or vtk format") sys.exit(1) elif currentArgument in ("-o", "--output"): outfile = currentValue - if outfile.split(sep='.')[1] != 'pkl': - print('Output file should be in pkl format') + if outfile.split(sep=".")[1] != "pkl": + print("Output file should be in pkl format") sys.exit(1) elif currentArgument in ("-v", "--vectors"): - vectors = currentValue.replace(' ','').split(',') + vectors = currentValue.replace(" ", "").split(",") elif currentArgument in ("-s", "--scalars"): - scalars = currentValue.replace(' ','').split(',') + scalars = currentValue.replace(" ", "").split(",") elif currentArgument in ("-d", "--dimension"): ndim = currentValue - + except getopt.error as err: # output error, and return with an error code - print (str(err)) + print(str(err)) -if infile == '': - print('Specify an input file.') +if infile == "": + print("Specify an input file.") sys.exit(1) -if outfile == '': - print('Specify an output file.') +if outfile == "": + print("Specify an output file.") sys.exit(1) if scalars == [] and vectors == []: - print('Specify some fields to output.') + print("Specify some fields to output.") sys.exit(1) + def vtutopython(filename, scalars=[], vectors=[], dim=2): # for this version, the input should be an evenly spaced rectilnear grid (no AMR, same spacing in every direction) - # filename is the name of the input vtu file (vtk probably works too) in the current directory + # filename is the name of the input vtu file (vtk probably works too) in the current directory # scalars is a list of strings containing the names of scalar fields # vectors is a list of strings containing the names of vector fields # dim is the dimension of the problem (2 or 3) - + # returns a dictionary containing numpy arrays of the requested fields # required libraries @@ -95,41 +103,56 @@ def vtutopython(filename, scalars=[], vectors=[], dim=2): indices = [] outputs = {} - mesh = meshio.read(os.path.join(os.getcwd(),filename)) # load the mesh + mesh = meshio.read(os.path.join(os.getcwd(), filename)) # load the mesh if dim == 2: indexcount = 2 # put the data into a pandas dataframe to process it (which requires it be loaded into a dictionary first) - data = {'x': mesh.points[:,0], 'y': mesh.points[:,1]} + data = {"x": mesh.points[:, 0], "y": mesh.points[:, 1]} for field in vectors: - data[field + 'x'] = mesh.point_data[field][:,0] - data[field + 'y'] = mesh.point_data[field][:,1] - vecindices.append((indexcount,field)) # we will put the fields in a numpy array, so need to know what the indices will be + data[field + "x"] = mesh.point_data[field][:, 0] + data[field + "y"] = mesh.point_data[field][:, 1] + vecindices.append( + (indexcount, field) + ) # we will put the fields in a numpy array, so need to know what the indices will be indexcount += 2 for field in scalars: data[field] = mesh.point_data[field] - indices.append((indexcount,field)) + indices.append((indexcount, field)) indexcount += 1 - df = pd.DataFrame(data=data) # initialize dataframe - df = df.drop_duplicates() # all values are repeated for each cell node, need to get rid of them - df = df.sort_values(['x', 'y'], ascending=[True, True]) # sort by position so that we can easily reshape the array - cleandata = df.to_numpy() # we need to put things in a numpy array so they can be reshaped - - dh = cleandata[1,1]-cleandata[0,1] # find spacing between cells - xsize = cleandata[-1,0] # domain size - ysize = cleandata[-1,1] - xdiv = round(xsize/dh)+1 # number of points in each direction (number of cells + 1) - ydiv = round(ysize/dh)+1 + df = pd.DataFrame(data=data) # initialize dataframe + df = ( + df.drop_duplicates() + ) # all values are repeated for each cell node, need to get rid of them + df = df.sort_values( + ["x", "y"], ascending=[True, True] + ) # sort by position so that we can easily reshape the array + cleandata = ( + df.to_numpy() + ) # we need to put things in a numpy array so they can be reshaped + + dh = cleandata[1, 1] - cleandata[0, 1] # find spacing between cells + xsize = cleandata[-1, 0] # domain size + ysize = cleandata[-1, 1] + xdiv = ( + round(xsize / dh) + 1 + ) # number of points in each direction (number of cells + 1) + ydiv = round(ysize / dh) + 1 # reshape the arrays and load them into a dictionary to be returned - outputs['x'] = cleandata[:,0].reshape(xdiv,ydiv) - outputs['y'] = cleandata[:,1].reshape(xdiv,ydiv) + outputs["x"] = cleandata[:, 0].reshape(xdiv, ydiv) + outputs["y"] = cleandata[:, 1].reshape(xdiv, ydiv) for i in indices: - outputs[i[1]] = cleandata[:,i[0]].reshape(xdiv,ydiv) + outputs[i[1]] = cleandata[:, i[0]].reshape(xdiv, ydiv) for i in vecindices: - outputs[i[1]] = np.array([cleandata[:,i[0]].reshape(xdiv,ydiv),cleandata[:,i[0]+1].reshape(xdiv,ydiv)]) + outputs[i[1]] = np.array( + [ + cleandata[:, i[0]].reshape(xdiv, ydiv), + cleandata[:, i[0] + 1].reshape(xdiv, ydiv), + ] + ) return outputs @@ -137,41 +160,60 @@ def vtutopython(filename, scalars=[], vectors=[], dim=2): indexcount = 3 # put the data into a pandas dataframe to process it (which requires it be loaded into a dictionary first) - data = {'x': mesh.points[:,0], 'y': mesh.points[:,1], 'z': mesh.points[:,2]} + data = {"x": mesh.points[:, 0], "y": mesh.points[:, 1], "z": mesh.points[:, 2]} for field in vectors: - data[field + 'x'] = mesh.point_data[field][:,0] - data[field + 'y'] = mesh.point_data[field][:,1] - data[field + 'z'] = mesh.point_data[field][:,2] - vecindices.append((indexcount,field)) # we will put the fields in a numpy array, so need to know what the indices will be + data[field + "x"] = mesh.point_data[field][:, 0] + data[field + "y"] = mesh.point_data[field][:, 1] + data[field + "z"] = mesh.point_data[field][:, 2] + vecindices.append( + (indexcount, field) + ) # we will put the fields in a numpy array, so need to know what the indices will be indexcount += 3 for field in scalars: data[field] = mesh.point_data[field] - indices.append((indexcount,field)) + indices.append((indexcount, field)) indexcount += 1 - df = pd.DataFrame(data=data) # initialize dataframe - df = df.drop_duplicates() # all values are repeated for each cell node, need to get rid of them - df = df.sort_values(['x', 'y', 'z'], ascending=[True, True, True]) # sort by position so that we can easily reshape the array - cleandata = df.to_numpy() # we need to put things in a numpy array so they can be reshaped - - dh = cleandata[1,2]-cleandata[0,2] # find spacing between cells - xsize = cleandata[-1,0] # domain size - ysize = cleandata[-1,1] - zsize = cleandata[-1,2] - xdiv = round(xsize/dh)+1 # number of points in each direction (number of cells + 1) - ydiv = round(ysize/dh)+1 - zdiv = round(zsize/dh)+1 + df = pd.DataFrame(data=data) # initialize dataframe + df = ( + df.drop_duplicates() + ) # all values are repeated for each cell node, need to get rid of them + df = df.sort_values( + ["x", "y", "z"], ascending=[True, True, True] + ) # sort by position so that we can easily reshape the array + cleandata = ( + df.to_numpy() + ) # we need to put things in a numpy array so they can be reshaped + + dh = cleandata[1, 2] - cleandata[0, 2] # find spacing between cells + xsize = cleandata[-1, 0] # domain size + ysize = cleandata[-1, 1] + zsize = cleandata[-1, 2] + xdiv = ( + round(xsize / dh) + 1 + ) # number of points in each direction (number of cells + 1) + ydiv = round(ysize / dh) + 1 + zdiv = round(zsize / dh) + 1 # reshape the arrays and load them into a dictionary to be returned - outputs['x'] = cleandata[:,0].reshape(xdiv,ydiv,zdiv) - outputs['y'] = cleandata[:,1].reshape(xdiv,ydiv,zdiv) - outputs['z'] = cleandata[:,2].reshape(xdiv,ydiv,zdiv) + outputs["x"] = cleandata[:, 0].reshape(xdiv, ydiv, zdiv) + outputs["y"] = cleandata[:, 1].reshape(xdiv, ydiv, zdiv) + outputs["z"] = cleandata[:, 2].reshape(xdiv, ydiv, zdiv) for i in indices: - outputs[i[1]] = cleandata[:,i[0]].reshape(xdiv,ydiv,zdiv) + outputs[i[1]] = cleandata[:, i[0]].reshape(xdiv, ydiv, zdiv) for i in vecindices: - outputs[i[1]] = np.array([cleandata[:,i[0]].reshape(xdiv,ydiv,zdiv),cleandata[:,i[0]+1].reshape(xdiv,ydiv,zdiv),cleandata[:,i[0]+2].reshape(xdiv,ydiv,zdiv)]) + outputs[i[1]] = np.array( + [ + cleandata[:, i[0]].reshape(xdiv, ydiv, zdiv), + cleandata[:, i[0] + 1].reshape(xdiv, ydiv, zdiv), + cleandata[:, i[0] + 2].reshape(xdiv, ydiv, zdiv), + ] + ) return outputs - -with open(outfile, 'wb') as f: - pickle.dump(vtutopython(filename=infile,scalars=scalars,vectors=vectors,dim=ndim), f) + + +with open(outfile, "wb") as f: + pickle.dump( + vtutopython(filename=infile, scalars=scalars, vectors=vectors, dim=ndim), f + ) diff --git a/contrib/utilities/cmake_format.sh b/contrib/utilities/cmake_format.sh deleted file mode 100755 index 2f4eecc59..000000000 --- a/contrib/utilities/cmake_format.sh +++ /dev/null @@ -1,47 +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 formats all the cmake files -# -# -# Usage: -# ./contrib/utilities/cmake_format.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 - -if ! [ -x "$(command -v gersemi)" ]; then - echo "make sure gersemi is in the path" - exit 1 -fi - -# Format the root cmake file -gersemi "CMakeLists.txt" -i -echo "Formatted CMakeLists.txt" - -# Directories containing the cmake files -TARGET_DIRS=("cmake" "src" "doc" "applications" "tests") - -for TARGET_DIR in "${TARGET_DIRS[@]}"; do - # Check if the directory exists - if [ ! -d "$TARGET_DIR" ]; then - echo "Directory $TARGET_DIR does not exist" - exit 2 - fi - - # Find all cmake files and format excluding the ones - # generated in CMakeFiles - find "$TARGET_DIR" \ - -type d -name CMakeFiles -prune -o \ - -type f \( -name "*.cmake" -o -name "CMakeLists.txt" \) -print | while read -r file; do - gersemi --in-place "$file" - echo "Formatted $file" - done -done - -echo "Done" -exit 0 diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt index c366a5ea2..6e670e4f5 100644 --- a/doc/doxygen/CMakeLists.txt +++ b/doc/doxygen/CMakeLists.txt @@ -9,12 +9,7 @@ cmake_minimum_required(VERSION 3.27) cmake_policy(VERSION 3.27) # Grab the version of PRISMS-PF -file( - STRINGS - "${CMAKE_SOURCE_DIR}/../../VERSION" - PRISMS_PF_VERSION - LIMIT_COUNT 1 -) +file(STRINGS "${CMAKE_SOURCE_DIR}/../../VERSION" PRISMS_PF_VERSION LIMIT_COUNT 1) message(STATUS "") message(STATUS "=========================================================") @@ -28,32 +23,32 @@ project(PRISMS-PF) find_package(Doxygen REQUIRED) if(DOXYGEN_FOUND) - # Path of Doxyfile - set(DOXYGEN_INPUT ${CMAKE_SOURCE_DIR}/Doxyfile) - - # Path of output file - set(DOXYGEN_OUTPUT ${CMAKE_SOURCE_DIR}/Doxyfile.out) - - # The directory where the documentation will be generated - set(DOXYGEN_HTML_OUTPUT "${PRISMS_PF_VERSION}") - set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/docs") - - # Copy input to output - configure_file(${DOXYGEN_INPUT} ${DOXYGEN_OUTPUT} @ONLY) - - # Add target to generate documentation - doxygen_add_docs( - doc - ${CMAKE_SOURCE_DIR}/../../src - ${CMAKE_SOURCE_DIR}/../../include - COMMENT "Generating Doxygen documentation" - CONFIG_FILE ${DOXYGEN_OUTPUT} - ALL - ) - - message( - STATUS - "Doxygen documentation will be generated using: ${DOXYGEN_INPUT}" - "and output to: ${DOXYGEN_OUTPUT_DIRECTORY}/${DOXYGEN_HTML_OUTPUT}" - ) + # Path of Doxyfile + set(DOXYGEN_INPUT ${CMAKE_SOURCE_DIR}/Doxyfile) + + # Path of output file + set(DOXYGEN_OUTPUT ${CMAKE_SOURCE_DIR}/Doxyfile.out) + + # The directory where the documentation will be generated + set(DOXYGEN_HTML_OUTPUT "${PRISMS_PF_VERSION}") + set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/docs") + + # Copy input to output + configure_file(${DOXYGEN_INPUT} ${DOXYGEN_OUTPUT} @ONLY) + + # Add target to generate documentation + doxygen_add_docs( + doc + ${CMAKE_SOURCE_DIR}/../../src + ${CMAKE_SOURCE_DIR}/../../include + COMMENT "Generating Doxygen documentation" + CONFIG_FILE ${DOXYGEN_OUTPUT} + ALL + ) + + message( + STATUS + "Doxygen documentation will be generated using: ${DOXYGEN_INPUT}" + "and output to: ${DOXYGEN_OUTPUT_DIRECTORY}/${DOXYGEN_HTML_OUTPUT}" + ) endif(DOXYGEN_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3db258b85..b91cfabec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ # This file collects the source files for PRISMS-PF foreach(TARGET IN ITEMS core solvers user_inputs utilities) - add_subdirectory(${TARGET}) + add_subdirectory(${TARGET}) endforeach() # Add the dummy.cc diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5befc67d8..f723764f9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,52 +1,56 @@ # Manually specify files to be included -set(_src - ${CMAKE_CURRENT_SOURCE_DIR}/conditional_ostreams.cc - ${CMAKE_CURRENT_SOURCE_DIR}/constraint_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/dof_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/initial_conditions.cc - ${CMAKE_CURRENT_SOURCE_DIR}/invm_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/matrix_free_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/matrix_free_operator.cc - ${CMAKE_CURRENT_SOURCE_DIR}/nonuniform_dirichlet.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pde_operator.cc - ${CMAKE_CURRENT_SOURCE_DIR}/pde_problem.cc - ${CMAKE_CURRENT_SOURCE_DIR}/phase_field_tools.cc - ${CMAKE_CURRENT_SOURCE_DIR}/solution_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/solution_output.cc - ${CMAKE_CURRENT_SOURCE_DIR}/solver_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/timer.cc - ${CMAKE_CURRENT_SOURCE_DIR}/triangulation_handler.cc - ${CMAKE_CURRENT_SOURCE_DIR}/variable_attribute_loader.cc - ${CMAKE_CURRENT_SOURCE_DIR}/variable_attributes.cc - ${CMAKE_CURRENT_SOURCE_DIR}/variable_container.cc +set( + _src + ${CMAKE_CURRENT_SOURCE_DIR}/conditional_ostreams.cc + ${CMAKE_CURRENT_SOURCE_DIR}/constraint_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/dof_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/initial_conditions.cc + ${CMAKE_CURRENT_SOURCE_DIR}/invm_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/matrix_free_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/matrix_free_operator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/nonuniform_dirichlet.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pde_operator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/pde_problem.cc + ${CMAKE_CURRENT_SOURCE_DIR}/phase_field_tools.cc + ${CMAKE_CURRENT_SOURCE_DIR}/solution_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/solution_output.cc + ${CMAKE_CURRENT_SOURCE_DIR}/solver_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/timer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/triangulation_handler.cc + ${CMAKE_CURRENT_SOURCE_DIR}/variable_attribute_loader.cc + ${CMAKE_CURRENT_SOURCE_DIR}/variable_attributes.cc + ${CMAKE_CURRENT_SOURCE_DIR}/variable_container.cc ) -set(_inst - constraint_handler.inst.in - dof_handler.inst.in - initial_conditions.inst.in - invm_handler.inst.in - matrix_free_handler.inst.in - matrix_free_operator.inst.in - nonuniform_dirichlet.inst.in - pde_operator.inst.in - pde_problem.inst.in - phase_field_tools.inst.in - solution_handler.inst.in - solution_output.inst.in - solver_handler.inst.in - triangulation_handler.inst.in - variable_attribute_loader.inst.in - variable_container.inst.in +set( + _inst + constraint_handler.inst.in + dof_handler.inst.in + initial_conditions.inst.in + invm_handler.inst.in + matrix_free_handler.inst.in + matrix_free_operator.inst.in + nonuniform_dirichlet.inst.in + pde_operator.inst.in + pde_problem.inst.in + phase_field_tools.inst.in + solution_handler.inst.in + solution_output.inst.in + solver_handler.inst.in + triangulation_handler.inst.in + variable_attribute_loader.inst.in + variable_container.inst.in ) -file( - GLOB _header - CONFIGURE_DEPENDS - ${CMAKE_SOURCE_DIR}/include/prismspf/core/*.h -) +file(GLOB _header CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/include/prismspf/core/*.h) -define_library(prisms_pf_core OBJECT ${_src} ${_header} ${_inst}) +define_library( + prisms_pf_core + OBJECT + ${_src} + ${_header} + ${_inst} +) expand_template_instantiations(prisms_pf_core "${_inst}") diff --git a/src/solvers/CMakeLists.txt b/src/solvers/CMakeLists.txt index bad693876..392961e08 100644 --- a/src/solvers/CMakeLists.txt +++ b/src/solvers/CMakeLists.txt @@ -1,43 +1,47 @@ # Manually specify files to be included -set(_src - ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_constant_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_explicit_postprocess_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_explicit_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_base.cc - ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_gmg.cc - ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_identity.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sequential_auxiliary_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sequential_co_nonlinear_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sequential_linear_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sequential_self_nonlinear_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sequential_solver.cc - ${CMAKE_CURRENT_SOURCE_DIR}/solver_base.cc +set( + _src + ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_constant_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_explicit_postprocess_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_explicit_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_base.cc + ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_gmg.cc + ${CMAKE_CURRENT_SOURCE_DIR}/linear_solver_identity.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sequential_auxiliary_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sequential_co_nonlinear_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sequential_linear_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sequential_self_nonlinear_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sequential_solver.cc + ${CMAKE_CURRENT_SOURCE_DIR}/solver_base.cc ) -set(_inst - concurrent_constant_solver.inst.in - concurrent_explicit_postprocess_solver.inst.in - concurrent_explicit_solver.inst.in - concurrent_solver.inst.in - linear_solver_base.inst.in - linear_solver_gmg.inst.in - linear_solver_identity.inst.in - sequential_auxiliary_solver.inst.in - sequential_co_nonlinear_solver.inst.in - sequential_linear_solver.inst.in - sequential_self_nonlinear_solver.inst.in - sequential_solver.inst.in - solver_base.inst.in +set( + _inst + concurrent_constant_solver.inst.in + concurrent_explicit_postprocess_solver.inst.in + concurrent_explicit_solver.inst.in + concurrent_solver.inst.in + linear_solver_base.inst.in + linear_solver_gmg.inst.in + linear_solver_identity.inst.in + sequential_auxiliary_solver.inst.in + sequential_co_nonlinear_solver.inst.in + sequential_linear_solver.inst.in + sequential_self_nonlinear_solver.inst.in + sequential_solver.inst.in + solver_base.inst.in ) -file( - GLOB _header - CONFIGURE_DEPENDS - ${CMAKE_SOURCE_DIR}/include/prismspf/solvers/*.h -) +file(GLOB _header CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/include/prismspf/solvers/*.h) -define_library(prisms_pf_solvers OBJECT ${_src} ${_header} ${_inst}) +define_library( + prisms_pf_solvers + OBJECT + ${_src} + ${_header} + ${_inst} +) expand_template_instantiations(prisms_pf_solvers "${_inst}") diff --git a/src/user_inputs/CMakeLists.txt b/src/user_inputs/CMakeLists.txt index 59bafa5ce..0be498a50 100644 --- a/src/user_inputs/CMakeLists.txt +++ b/src/user_inputs/CMakeLists.txt @@ -1,18 +1,21 @@ # Manually specify files to be included -set(_src - ${CMAKE_CURRENT_SOURCE_DIR}/input_file_reader.cc - ${CMAKE_CURRENT_SOURCE_DIR}/user_input_parameters.cc +set( + _src + ${CMAKE_CURRENT_SOURCE_DIR}/input_file_reader.cc + ${CMAKE_CURRENT_SOURCE_DIR}/user_input_parameters.cc ) set(_inst user_input_parameters.inst.in) -file( - GLOB _header - CONFIGURE_DEPENDS - ${CMAKE_SOURCE_DIR}/include/prismspf/user_inputs/*.h -) +file(GLOB _header CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/include/prismspf/user_inputs/*.h) -define_library(prisms_pf_user_inputs OBJECT ${_src} ${_header} ${_inst}) +define_library( + prisms_pf_user_inputs + OBJECT + ${_src} + ${_header} + ${_inst} +) expand_template_instantiations(prisms_pf_user_inputs "${_inst}") diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 950e57b14..15f6eb969 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -1,18 +1,25 @@ # Manually specify files to be included -set(_src - ${CMAKE_CURRENT_SOURCE_DIR}/integrator.cc - ${CMAKE_CURRENT_SOURCE_DIR}/element_volume.cc +set( + _src + ${CMAKE_CURRENT_SOURCE_DIR}/integrator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/element_volume.cc ) -set(_inst integrator.inst.in element_volume.inst.in) - -file( - GLOB _header - CONFIGURE_DEPENDS - ${CMAKE_SOURCE_DIR}/include/prismspf/utilities/*.h +set( + _inst + integrator.inst.in + element_volume.inst.in ) -define_library(prisms_pf_utilities OBJECT ${_src} ${_header} ${_inst}) +file(GLOB _header CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/include/prismspf/utilities/*.h) + +define_library( + prisms_pf_utilities + OBJECT + ${_src} + ${_header} + ${_inst} +) expand_template_instantiations(prisms_pf_utilities "${_inst}") diff --git a/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt b/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt index 9a386d1d3..b374b109e 100644 --- a/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt +++ b/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt @@ -3,14 +3,10 @@ # Adapted from the ASPECT CMake file ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Get the core library's directory (3 levels up from the macro file) -get_filename_component( - PRISMS_PF_CORE_DIR - ${CMAKE_CURRENT_LIST_DIR}/../../.. - ABSOLUTE -) +get_filename_component(PRISMS_PF_CORE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE) # Include core library's configuration include(${PRISMS_PF_CORE_DIR}/cmake/prisms_pf_config.cmake) diff --git a/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt b/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt index 9a386d1d3..b374b109e 100644 --- a/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt +++ b/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt @@ -3,14 +3,10 @@ # Adapted from the ASPECT CMake file ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Get the core library's directory (3 levels up from the macro file) -get_filename_component( - PRISMS_PF_CORE_DIR - ${CMAKE_CURRENT_LIST_DIR}/../../.. - ABSOLUTE -) +get_filename_component(PRISMS_PF_CORE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE) # Include core library's configuration include(${PRISMS_PF_CORE_DIR}/cmake/prisms_pf_config.cmake) diff --git a/tests/performance_tests/plot_scaling.py b/tests/performance_tests/plot_scaling.py index 6b469df1a..4028f4899 100644 --- a/tests/performance_tests/plot_scaling.py +++ b/tests/performance_tests/plot_scaling.py @@ -1,5 +1,6 @@ -import re import glob +import re + import matplotlib.pyplot as plt diff --git a/tests/regression_tests/CMakeLists.txt b/tests/regression_tests/CMakeLists.txt index cbad1521f..63873f2cf 100644 --- a/tests/regression_tests/CMakeLists.txt +++ b/tests/regression_tests/CMakeLists.txt @@ -5,40 +5,43 @@ message(STATUS "Setting up PRISMS-PF regression tests...") # A list of the regression applications -set(REGRESSION_TEST_APPS - allen_cahn_explicit - allen_cahn_implicit - cahn_hilliard_explicit - cahn_hilliard_implicit - cavity_flow - fracture - heat_equation_steady_state - linear_solve_old_solution - mechanics - precipitate_explicit - solution_blocks +set( + REGRESSION_TEST_APPS + allen_cahn_explicit + allen_cahn_implicit + cahn_hilliard_explicit + cahn_hilliard_implicit + cavity_flow + fracture + heat_equation_steady_state + linear_solve_old_solution + mechanics + precipitate_explicit + solution_blocks ) # For each regression application install the source files, configure, and compile foreach(test_app ${REGRESSION_TEST_APPS}) - # Install the source files - install( - DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${test_app}/ - DESTINATION ${CMAKE_INSTALL_PREFIX}/tests/regression_tests/${test_app} - FILES_MATCHING - PATTERN "CMakeFiles*" EXCLUDE - PATTERN "*.in" - PATTERN "*.cc" - PATTERN "*.h" - PATTERN "*.prm" - PATTERN "CMakeLists.txt" - PATTERN "gold_output.txt" - ) + # Install the source files + install( + DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/${test_app}/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/tests/regression_tests/${test_app} + FILES_MATCHING + PATTERN "CMakeFiles*" + EXCLUDE + PATTERN "*.in" + PATTERN "*.cc" + PATTERN "*.h" + PATTERN "*.prm" + PATTERN "CMakeLists.txt" + PATTERN "gold_output.txt" + ) - # Compile during installation - install( - CODE - " + # Compile during installation + install( + CODE + " message(STATUS \"Building regression test: ${test_app}\") execute_process( COMMAND ${CMAKE_COMMAND} @@ -60,17 +63,25 @@ foreach(test_app ${REGRESSION_TEST_APPS}) endif() endif() " - ) + ) endforeach() # Run the regressions apps -find_package(Python COMPONENTS Interpreter Development REQUIRED) +find_package( + Python + COMPONENTS + Interpreter + Development + REQUIRED +) if(NOT DEFINED N_THREADS) - set(N_THREADS 1) + set(N_THREADS 1) endif() -install(CODE " +install( + CODE + " execute_process( COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run.py -j ${N_THREADS} @@ -82,7 +93,7 @@ execute_process( if(run_result) message(FATAL_ERROR \"Regression tests failed\") endif() -") - +" +) message(STATUS "PRISMS-PF regression tests setup complete.") diff --git a/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt b/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt +++ b/tests/regression_tests/allen_cahn_explicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt b/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt +++ b/tests/regression_tests/allen_cahn_implicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt b/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt +++ b/tests/regression_tests/cahn_hilliard_explicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt b/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt +++ b/tests/regression_tests/cahn_hilliard_implicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/cavity_flow/CMakeLists.txt b/tests/regression_tests/cavity_flow/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/cavity_flow/CMakeLists.txt +++ b/tests/regression_tests/cavity_flow/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/fracture/CMakeLists.txt b/tests/regression_tests/fracture/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/fracture/CMakeLists.txt +++ b/tests/regression_tests/fracture/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt b/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt +++ b/tests/regression_tests/heat_equation_steady_state/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt b/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt +++ b/tests/regression_tests/linear_solve_old_solution/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/mechanics/CMakeLists.txt b/tests/regression_tests/mechanics/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/mechanics/CMakeLists.txt +++ b/tests/regression_tests/mechanics/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/precipitate_explicit/CMakeLists.txt b/tests/regression_tests/precipitate_explicit/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/precipitate_explicit/CMakeLists.txt +++ b/tests/regression_tests/precipitate_explicit/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/regression_tests/run.py b/tests/regression_tests/run.py index b98ce9ec6..cf1f0b670 100644 --- a/tests/regression_tests/run.py +++ b/tests/regression_tests/run.py @@ -1,13 +1,14 @@ import argparse -import subprocess import datetime import os +import re +import subprocess import sys import time from dataclasses import dataclass, field from typing import Dict + import numpy as np -import re # Executable name. For now we will use release mode executable_name = "main-release" diff --git a/tests/regression_tests/solution_blocks/CMakeLists.txt b/tests/regression_tests/solution_blocks/CMakeLists.txt index 5f34be6c0..d4c518755 100644 --- a/tests/regression_tests/solution_blocks/CMakeLists.txt +++ b/tests/regression_tests/solution_blocks/CMakeLists.txt @@ -2,22 +2,25 @@ # CMake script for the PRISMS-PF applications ## -cmake_minimum_required(VERSION 3.13.4) +cmake_minimum_required(VERSION 3.18) # Create a project for the application project(myapp CXX) # Find the PRISMS-PF package -find_package(prisms_pf QUIET HINTS ${PRISMS_PF_DIR} $ENV{PRISMS_PF_DIR}) +find_package( + prisms_pf + QUIET + HINTS + ${PRISMS_PF_DIR} + $ENV{PRISMS_PF_DIR} +) if(PRISMS_PF_FOUND) - # Include setup script - include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) + # Include setup script + include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) - # Set up the application - prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) + # Set up the application + prisms_pf_autopilot(${PRISMS_PF_CORE_DIR}) else() - message( - FATAL_ERROR - "PRISMS-PF package not found. Please make sure it is in path." - ) + message(FATAL_ERROR "PRISMS-PF package not found. Please make sure it is in path.") endif() diff --git a/tests/unit_tests/core/CMakeLists.txt b/tests/unit_tests/core/CMakeLists.txt index fdf1014b5..1877a5479 100644 --- a/tests/unit_tests/core/CMakeLists.txt +++ b/tests/unit_tests/core/CMakeLists.txt @@ -5,12 +5,12 @@ add_executable(test_core ${TEST_SOURCES}) target_link_libraries(test_core PRIVATE prisms_pf_debug) target_include_directories( - test_core - PRIVATE - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/contrib/catch - ${CMAKE_CURRENT_SOURCE_DIR} + test_core + PRIVATE + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/include + ${CMAKE_SOURCE_DIR}/contrib/catch + ${CMAKE_CURRENT_SOURCE_DIR} ) add_test(NAME core COMMAND test_core) diff --git a/tests/unit_tests/field_input/CMakeLists.txt b/tests/unit_tests/field_input/CMakeLists.txt index 3e02c7261..f5beaa9b0 100644 --- a/tests/unit_tests/field_input/CMakeLists.txt +++ b/tests/unit_tests/field_input/CMakeLists.txt @@ -5,12 +5,12 @@ add_executable(test_field_input ${TEST_SOURCES}) target_link_libraries(test_field_input PRIVATE prisms_pf_debug) target_include_directories( - test_field_input - PRIVATE - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/contrib/catch - ${CMAKE_CURRENT_SOURCE_DIR} + test_field_input + PRIVATE + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/include + ${CMAKE_SOURCE_DIR}/contrib/catch + ${CMAKE_CURRENT_SOURCE_DIR} ) add_test(NAME field_input COMMAND test_field_input) diff --git a/tests/unit_tests/user_inputs/CMakeLists.txt b/tests/unit_tests/user_inputs/CMakeLists.txt index af3c05ec2..683e0b136 100644 --- a/tests/unit_tests/user_inputs/CMakeLists.txt +++ b/tests/unit_tests/user_inputs/CMakeLists.txt @@ -5,12 +5,12 @@ add_executable(test_user_inputs ${TEST_SOURCES}) target_link_libraries(test_user_inputs PRIVATE prisms_pf_debug) target_include_directories( - test_user_inputs - PRIVATE - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/contrib/catch - ${CMAKE_CURRENT_SOURCE_DIR} + test_user_inputs + PRIVATE + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/include + ${CMAKE_SOURCE_DIR}/contrib/catch + ${CMAKE_CURRENT_SOURCE_DIR} ) add_test(NAME user_inputs COMMAND test_user_inputs) diff --git a/tests/unit_tests/utilities/CMakeLists.txt b/tests/unit_tests/utilities/CMakeLists.txt index 856483ff8..85a9a3ef3 100644 --- a/tests/unit_tests/utilities/CMakeLists.txt +++ b/tests/unit_tests/utilities/CMakeLists.txt @@ -5,12 +5,12 @@ add_executable(test_utilities ${TEST_SOURCES}) target_link_libraries(test_utilities PRIVATE prisms_pf_debug) target_include_directories( - test_utilities - PRIVATE - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/contrib/catch - ${CMAKE_CURRENT_SOURCE_DIR} + test_utilities + PRIVATE + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/include + ${CMAKE_SOURCE_DIR}/contrib/catch + ${CMAKE_CURRENT_SOURCE_DIR} ) add_test(NAME utilities COMMAND test_utilities) From 2af3d2f4c7e016cd95be81121c9db4190ef2dfe0 Mon Sep 17 00:00:00 2001 From: Jason Landini <123970616+landinjm@users.noreply.github.com> Date: Fri, 2 Jan 2026 17:34:08 -0500 Subject: [PATCH 2/4] More pre-commit (#759) * more precommit but all mashed together since my stuff got corrupted * codespell ignores --- .clang-format | 4 +- .codespellrc | 2 + .gersemirc | 2 +- .github/workflows/clang-format.yml | 2 +- .github/workflows/compile_applications.yml | 3 +- .github/workflows/cppcheck.yml | 1 - .github/workflows/github-pages.yml | 5 +- .github/workflows/linux.yml | 2 +- .pre-commit-config.yaml | 25 +++++- LICENSE | 2 +- README.md | 2 +- applications/CMakeLists.txt | 2 +- .../ICs_and_BCs.cc | 2 +- .../MgNd_precipitate_single_Bppp/main.cc | 2 +- .../parameters.prm | 16 ++-- .../postprocess.cc | 2 +- .../precipitateEvolution_KKS.md | 62 +++++++------- .../_CHAC_anisotropy/CHAC_anisotropy.md | 18 ++-- applications/_CHAC_anisotropy/ICs_and_BCs.cc | 2 +- applications/_CHAC_anisotropy/custom_pde.h | 2 +- applications/_CHAC_anisotropy/equations.cc | 4 +- applications/_CHAC_anisotropy/main.cc | 2 +- applications/_CHAC_anisotropy/postprocess.cc | 2 +- .../CHAC_anisotropyRegularized.md | 20 ++--- .../ICs_and_BCs.cc | 2 +- .../_CHAC_anisotropy_regularized/custom_pde.h | 2 +- .../_CHAC_anisotropy_regularized/equations.cc | 4 +- .../_CHAC_anisotropy_regularized/main.cc | 2 +- .../postprocess.cc | 2 +- .../_CHAC_performance_test/ICs_and_BCs.cc | 2 +- .../_CHAC_performance_test/custom_pde.h | 2 +- .../_CHAC_performance_test/equations.cc | 4 +- applications/_CHAC_performance_test/main.cc | 2 +- .../_CHAC_performance_test/postprocess.cc | 4 +- .../CHiMaD_benchmark1a/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark1a/custom_pde.h | 2 +- .../CHiMaD_benchmark1a/equations.cc | 4 +- .../CHiMaD_benchmark1a/postprocess.cc | 4 +- .../CHiMaD_benchmark1b/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark1b/custom_pde.h | 2 +- .../CHiMaD_benchmark1b/equations.cc | 4 +- .../CHiMaD_benchmark1b/postprocess.cc | 4 +- .../CHiMaD_benchmark1c/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark1c/custom_pde.h | 2 +- .../CHiMaD_benchmark1c/equations.cc | 4 +- .../CHiMaD_benchmark1c/postprocess.cc | 4 +- .../CHiMaD_benchmark2a/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark2a/custom_pde.h | 2 +- .../CHiMaD_benchmark2a/equations.cc | 4 +- .../CHiMaD_benchmark2a/postprocess.cc | 4 +- .../CHiMaD_benchmark3a/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark3a/custom_pde.h | 2 +- .../CHiMaD_benchmark3a/equations.cc | 4 +- .../CHiMaD_benchmark3a/postprocess.cc | 4 +- .../CHiMaD_benchmark6a/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark6a/custom_pde.h | 2 +- .../CHiMaD_benchmark6a/equations.cc | 4 +- .../CHiMaD_benchmark6a/postprocess.cc | 6 +- .../CHiMaD_benchmark6b/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark6b/custom_pde.h | 2 +- .../CHiMaD_benchmark6b/equations.cc | 4 +- .../CHiMaD_benchmark6b/postprocess.cc | 6 +- .../CHiMaD_benchmark7a/ICs_and_BCs.cc | 2 +- .../CHiMaD_benchmark7a/custom_pde.h | 2 +- .../CHiMaD_benchmark7a/equations.cc | 4 +- .../CHiMaD_benchmark7a/postprocess.cc | 4 +- .../_allen_cahn_conserved/ICs_and_BCs.cc | 2 +- .../allen_cahn_conserved.md | 18 ++-- .../_allen_cahn_conserved/custom_pde.h | 4 +- .../_allen_cahn_conserved/equations.cc | 4 +- applications/_allen_cahn_conserved/main.cc | 2 +- .../_allen_cahn_conserved/postprocess.cc | 4 +- .../ICs_and_BCs.cc | 2 +- .../alloy_solidification_uniform.md | 22 ++--- .../custom_pde.h | 2 +- .../equations.cc | 4 +- .../_alloy_solidification_uniform/main.cc | 2 +- applications/_anisotropy_facet/ICs_and_BCs.cc | 2 +- .../_anisotropy_facet/anisotropy_facet.h | 2 +- .../_anisotropy_facet/anisotropy_facet.md | 22 ++--- applications/_anisotropy_facet/custom_pde.h | 2 +- applications/_anisotropy_facet/equations.cc | 4 +- applications/_anisotropy_facet/main.cc | 2 +- applications/_anisotropy_facet/postprocess.cc | 2 +- applications/_corrosion/ICs_and_BCs.cc | 2 +- applications/_corrosion/corrosion.md | 18 ++-- applications/_corrosion/custom_pde.h | 2 +- applications/_corrosion/equations.cc | 32 +++---- applications/_corrosion/main.cc | 2 +- .../_corrosion_microgalvanic/ICs_and_BCs.cc | 2 +- .../corrosion_microgalvanic.md | 85 +++++++++---------- .../_corrosion_microgalvanic/custom_pde.h | 2 +- .../_corrosion_microgalvanic/equations.cc | 16 ++-- applications/_corrosion_microgalvanic/main.cc | 2 +- .../_dendritic_solidification/ICs_and_BCs.cc | 2 +- .../_dendritic_solidification/custom_pde.h | 2 +- .../dendriticSolidification.md | 20 ++--- .../_dendritic_solidification/equations.cc | 4 +- .../_dendritic_solidification/main.cc | 2 +- .../_fickian_diffusion/ICs_and_BCs.cc | 2 +- applications/_fickian_diffusion/custom_pde.h | 2 +- applications/_fickian_diffusion/equations.cc | 4 +- .../formulation_fickianFlux.md | 10 +-- applications/_fickian_diffusion/main.cc | 2 +- applications/_grainGrowth/ICs_and_BCs.cc | 2 +- applications/_grainGrowth/custom_pde.h | 2 +- applications/_grainGrowth/equations.cc | 4 +- applications/_grainGrowth/grainGrowth.md | 10 +-- applications/_grainGrowth/main.cc | 2 +- applications/_grainGrowth/postprocess.cc | 2 +- .../_grainGrowth_dream3d/ICs_and_BCs.cc | 2 +- .../_grainGrowth_dream3d/custom_pde.h | 2 +- .../_grainGrowth_dream3d/equations.cc | 4 +- .../_grainGrowth_dream3d/grainGrowth.md | 10 +-- applications/_grainGrowth_dream3d/main.cc | 2 +- .../_grainGrowth_dream3d/postprocess.cc | 2 +- applications/_mechanics/ICs_and_BCs.cc | 2 +- applications/_mechanics/custom_pde.h | 2 +- applications/_mechanics/equations.cc | 4 +- applications/_mechanics/main.cc | 2 +- applications/_mechanics/mechanics.md | 10 +-- .../_nucleation_preferential/ICs_and_BCs.cc | 2 +- .../KKS_nucleation.md | 36 ++++---- .../_nucleation_preferential/custom_pde.h | 2 +- .../_nucleation_preferential/equations.cc | 4 +- applications/_nucleation_preferential/main.cc | 2 +- .../_nucleation_preferential/nucleation.cc | 2 +- .../allen_cahn_explicit/ICs_and_BCs.cc | 2 +- .../allen_cahn_explicit/allen_cahn.md | 6 +- applications/allen_cahn_explicit/custom_pde.h | 2 +- applications/allen_cahn_explicit/equations.cc | 2 +- applications/allen_cahn_explicit/main.cc | 2 +- .../allen_cahn_explicit/parameters.prm | 16 ++-- .../alloy_solidification/ICs_and_BCs.cc | 2 +- .../alloy_solidification.md | 38 ++++----- .../alloy_solidification/custom_pde.h | 6 +- .../alloy_solidification/equations.cc | 8 +- applications/alloy_solidification/main.cc | 2 +- .../alloy_solidification/parameters.prm | 18 ++-- applications/blank/ICs_and_BCs.cc | 2 +- applications/blank/custom_pde.h | 2 +- applications/blank/main.cc | 2 +- .../cahn_hilliard_explicit/ICs_and_BCs.cc | 2 +- .../cahn_hilliard_explicit/cahn_hilliard.md | 24 +++--- .../cahn_hilliard_explicit/custom_pde.h | 2 +- applications/cahn_hilliard_explicit/main.cc | 2 +- .../cahn_hilliard_explicit/parameters.prm | 16 ++-- .../ICs_and_BCs.cc | 2 +- .../coupled_allen_cahn_cahn_hilliard.md | 18 ++-- .../custom_pde.h | 2 +- .../coupled_allen_cahn_cahn_hilliard/main.cc | 2 +- .../parameters.prm | 17 ++-- .../postprocess.cc | 4 +- applications/eshelby_inclusion/ICs_and_BCs.cc | 2 +- applications/eshelby_inclusion/custom_pde.h | 2 +- applications/eshelby_inclusion/equations.cc | 2 +- .../eshelby_inclusion/eshelby_inclusion.md | 14 +-- applications/eshelby_inclusion/main.cc | 2 +- applications/eshelby_inclusion/parameters.prm | 14 +-- applications/nucleation/ICs_and_BCs.cc | 2 +- applications/nucleation/KKS_nucleation.md | 36 ++++---- applications/nucleation/custom_pde.h | 2 +- applications/nucleation/equations.cc | 2 +- applications/nucleation/main.cc | 2 +- applications/precipitate_evolution/main.cc | 2 +- .../precipitate_evolution/parameters.prm | 18 ++-- .../precipitate_evolution.md | 56 ++++++------ .../spinodal_decomposition/ICs_and_BCs.cc | 2 +- .../spinodal_decomposition/cahn_hilliard.md | 24 +++--- .../spinodal_decomposition/custom_pde.h | 2 +- .../spinodal_decomposition/equations.cc | 2 +- applications/spinodal_decomposition/main.cc | 2 +- cmake/macros/macro_prisms_pf_autopilot.cmake | 2 +- cmake/prisms_pf-config.cmake.in | 2 +- .../scripts/expand_template_instantiations.cc | 24 +++--- cmake/setup_cached_variables.cmake | 2 +- cmake/setup_prisms_pf.cmake | 2 +- cmake/templates.in | 2 +- cmake/write_config.cmake | 2 +- contrib/postprocessing/README.md | 24 +++--- contrib/postprocessing/domain_stats.py | 4 +- contrib/postprocessing/interface_area.py | 4 +- contrib/postprocessing/phase_fraction.py | 2 +- contrib/postprocessing/plot_and_save.py | 2 +- .../copy_file_to_all_applications.sh | 4 +- doc/README.md | 2 +- doc/doxygen/.gitignore | 2 +- doc/doxygen/custom.css | 2 +- doc/doxygen/delete_me.css | 2 +- doc/doxygen/delete_me.html | 2 +- doc/doxygen/header.html | 2 +- doc/doxygen/main/contact.h | 2 +- doc/doxygen/main/main.h | 2 +- doc/doxygen/version_selector_handler.js | 2 +- include/prismspf/core/cell_marker_base.h | 2 +- include/prismspf/core/conditional_ostreams.h | 2 +- include/prismspf/core/exceptions.h | 4 +- include/prismspf/core/grid_refiner.h | 2 +- include/prismspf/core/grid_refiner_context.h | 2 +- include/prismspf/core/invm_handler.h | 8 +- include/prismspf/core/pde_operator.h | 2 +- include/prismspf/core/solution_handler.h | 2 +- include/prismspf/core/solver_handler.h | 6 +- include/prismspf/core/tee_stream.h | 2 +- include/prismspf/core/timer.h | 2 +- include/prismspf/core/triangulation_handler.h | 2 +- include/prismspf/core/type_enums.h | 2 +- include/prismspf/core/variable_container.h | 6 +- include/prismspf/core/vector_mapping.h | 4 +- include/prismspf/field_input/read_binary.h | 2 +- include/prismspf/field_input/read_vtk.h | 4 +- include/prismspf/nucleation/nucleus.h | 2 +- .../nucleation/nucleus_refinement_function.h | 2 +- .../prismspf/solvers/linear_solver_identity.h | 2 +- .../user_inputs/boundary_parameters.h | 4 +- .../user_inputs/checkpoint_parameters.h | 2 +- .../load_initial_condition_parameters.h | 2 +- .../user_inputs/miscellaneous_parameters.h | 2 +- .../user_inputs/nonlinear_solve_parameters.h | 2 +- include/prismspf/user_inputs/parameter_base.h | 2 +- .../user_inputs/spatial_discretization.h | 2 +- .../user_inputs/temporal_discretization.h | 2 +- .../user_inputs/user_input_parameters.h | 2 +- include/prismspf/utilities/utilities.h | 4 +- .../utilities/vectorized_operations.h | 2 +- src/core/constraint_handler.cc | 2 +- src/core/matrix_free_handler.inst.in | 1 - src/core/timer.cc | 4 +- src/core/triangulation_handler.cc | 4 +- src/core/variable_attribute_loader.cc | 4 +- src/core/variable_attribute_loader.inst.in | 2 +- src/core/variable_attributes.cc | 2 +- src/core/variable_container.cc | 6 +- src/dummy.cc | 2 +- src/solvers/concurrent_constant_solver.cc | 2 +- .../concurrent_explicit_postprocess_solver.cc | 2 +- src/solvers/concurrent_explicit_solver.cc | 2 +- src/solvers/linear_solver_gmg.cc | 6 +- src/solvers/sequential_co_nonlinear_solver.cc | 2 +- src/solvers/sequential_linear_solver.cc | 2 +- .../sequential_self_nonlinear_solver.cc | 2 +- src/solvers/sequential_solver.cc | 2 +- src/solvers/solver_base.cc | 6 +- src/user_inputs/input_file_reader.cc | 6 +- .../allen_cahn_explicit/CMakeLists.txt | 2 +- .../allen_cahn_explicit/custom_pde.h | 2 +- .../allen_cahn_explicit/main.cc | 2 +- .../cahn_hilliard_explicit/CMakeLists.txt | 2 +- .../cahn_hilliard_explicit/custom_pde.h | 2 +- .../cahn_hilliard_explicit/main.cc | 2 +- tests/performance_tests/scale_problem.sh | 4 +- tests/regression_tests/CMakeLists.txt | 2 +- .../allen_cahn_explicit/ICs_and_BCs.cc | 2 +- .../allen_cahn_explicit/custom_pde.h | 2 +- .../allen_cahn_explicit/gold_output.txt | 3 +- .../allen_cahn_explicit/main.cc | 2 +- .../allen_cahn_implicit/ICs_and_BCs.cc | 2 +- .../allen_cahn_implicit/custom_pde.h | 2 +- .../allen_cahn_implicit/gold_output.txt | 3 +- .../allen_cahn_implicit/main.cc | 2 +- .../cahn_hilliard_explicit/ICs_and_BCs.cc | 2 +- .../cahn_hilliard_explicit/custom_pde.h | 2 +- .../cahn_hilliard_explicit/gold_output.txt | 3 +- .../cahn_hilliard_explicit/main.cc | 2 +- .../cahn_hilliard_implicit/ICs_and_BCs.cc | 2 +- .../cahn_hilliard_implicit/custom_pde.h | 2 +- .../cahn_hilliard_implicit/gold_output.txt | 3 +- .../cahn_hilliard_implicit/main.cc | 2 +- .../regression_tests/cavity_flow/custom_pde.h | 2 +- .../cavity_flow/gold_output.txt | 46 +++++----- tests/regression_tests/cavity_flow/main.cc | 2 +- .../cavity_flow/parameters.prm | 2 +- .../regression_tests/fracture/gold_output.txt | 14 +-- tests/regression_tests/fracture/main.cc | 2 +- .../heat_equation_steady_state/ICs_and_BCs.cc | 2 +- .../heat_equation_steady_state/custom_pde.h | 2 +- .../heat_equation_steady_state/equations.cc | 2 +- .../gold_output.txt | 2 +- .../heat_equation_steady_state/main.cc | 2 +- .../linear_solve_old_solution/ICs_and_BCs.cc | 2 +- .../linear_solve_old_solution/custom_pde.h | 2 +- .../linear_solve_old_solution/gold_output.txt | 2 +- .../linear_solve_old_solution/main.cc | 2 +- .../linear_solve_old_solution/parameters.prm | 2 +- .../regression_tests/mechanics/ICs_and_BCs.cc | 2 +- .../mechanics/gold_output.txt | 4 +- tests/regression_tests/mechanics/main.cc | 2 +- .../precipitate_explicit/gold_output.txt | 14 +-- .../precipitate_explicit/main.cc | 2 +- .../solution_blocks/ICs_and_BCs.cc | 2 +- .../solution_blocks/custom_pde.h | 2 +- .../solution_blocks/gold_output.txt | 2 +- .../regression_tests/solution_blocks/main.cc | 2 +- tests/unit_tests/.gitignore | 2 +- tests/unit_tests/core/field_solve_type.cc | 2 +- tests/unit_tests/core/main.cc | 2 +- .../core/variable_attribute_loader.cc | 2 +- tests/unit_tests/field_input/.gitignore | 2 +- tests/unit_tests/field_input/main.cc | 2 +- tests/unit_tests/field_input/read_binary.cc | 2 +- tests/unit_tests/field_input/read_vtk.cc | 2 +- .../field_input/test_2D_1degree.vtk | 4 +- .../field_input/test_2D_2degree.vtk | 4 +- .../field_input/test_3D_1degree.vtk | 4 +- .../user_inputs/initial_condition_read_in.cc | 2 +- tests/unit_tests/user_inputs/main.cc | 2 +- .../user_inputs/nonlinear_solve_parameters.cc | 2 +- tests/unit_tests/utilities/main.cc | 2 +- tests/unit_tests/utilities/utilities.cc | 2 +- version_changes.md | 16 ++-- 310 files changed, 805 insertions(+), 790 deletions(-) create mode 100644 .codespellrc diff --git a/.clang-format b/.clang-format index 5420e2b55..c856c64c2 100644 --- a/.clang-format +++ b/.clang-format @@ -102,7 +102,7 @@ IncludeCategories: Priority: 14 # all standard <...> headers - Regex: '<[-\w\/-_]+[\.\/]*[-\w\/-_]+>>' - Priority: 99 + Priority: 99 # all local "..." headers - Regex: '"[-\w\/-_]+[\.\/]*[-\w\/-_]+"' Priority: 999 @@ -164,4 +164,4 @@ Standard: c++20 TabWidth: 2 -UseTab: Never \ No newline at end of file +UseTab: Never diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..2dad8f74d --- /dev/null +++ b/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +ignore-words-list = Mater,nd,multline diff --git a/.gersemirc b/.gersemirc index dcd5df67a..d559a6c98 100644 --- a/.gersemirc +++ b/.gersemirc @@ -1,4 +1,4 @@ definitions: [./cmake/macros,] line_length: 90 indent: 2 -list_expansion: favour-expansion \ No newline at end of file +list_expansion: favour-expansion diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index ca3ad2fa6..b6bf57bc1 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -1,6 +1,6 @@ name: Clang-Format Check -on: +on: push: branches: - master diff --git a/.github/workflows/compile_applications.yml b/.github/workflows/compile_applications.yml index 24711d0a4..e2a1d7ef7 100644 --- a/.github/workflows/compile_applications.yml +++ b/.github/workflows/compile_applications.yml @@ -1,6 +1,6 @@ name: compile-applications -on: +on: push: branches: - master @@ -52,4 +52,3 @@ jobs: export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 ninja -j $(nproc) install - diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml index 1380e3b05..400c814ec 100644 --- a/.github/workflows/cppcheck.yml +++ b/.github/workflows/cppcheck.yml @@ -50,4 +50,3 @@ jobs: - name: Run cppcheck run: | ./contrib/utilities/cppcheck.sh -j$(nproc) - diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index c7eaa0bc1..c58b0dbcf 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -4,7 +4,7 @@ on: push: branches: - master - + permissions: contents: write @@ -33,7 +33,7 @@ jobs: cd doc/doxygen cmake . make - + - name: Update version selector run: | ./contrib/utilities/update_doc_version_selector.sh doc/doxygen/docs/ @@ -56,4 +56,3 @@ jobs: folder: doc/doxygen/docs/ target-folder: doxygen/ clean: false # This must be false to keep prior versions of the docs - diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3e3bdc8c1..b97204d2c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,6 +1,6 @@ name: linux -on: +on: push: branches: - master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d326edcc..45dc87b4e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,29 @@ fail_fast: true repos: +# General purpose hooks +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + args: [--maxkb=8192] + - id: check-merge-conflict + - id: end-of-file-fixer + exclude: ^contrib/catch/ + - id: no-commit-to-branch + args: [--branch,master] + - id: trailing-whitespace + exclude: ^contrib/catch/ +- repo: https://github.com/gitleaks/gitleaks + rev: v8.24.2 + hooks: + - id: gitleaks +- repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + args: [--config=.codespellrc] + exclude: ^contrib/catch/ # Python formatting and linting tools - repo: https://github.com/psf/black rev: 25.9.0 @@ -25,4 +48,4 @@ repos: - repo: https://github.com/BlankSpruce/gersemi rev: 0.25.0 hooks: - - id: gersemi \ No newline at end of file + - id: gersemi diff --git a/LICENSE b/LICENSE index d49bfd04c..4efad2a19 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ This directory contains the PhaseField Code developed by the PRISMS Center at the University of Michigan, Ann Arbor, USA. (c) 2014 The Regents of the University of Michigan -PRISMS Center http://prisms.engin.umich.edu +PRISMS Center http://prisms.engin.umich.edu This code is a free software; you can use it, redistribute it, and/or modify it under the terms of the GNU Lesser General Public diff --git a/README.md b/README.md index cc444f854..2ec452621 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ cd applications/cahnHilliard cmake . make -j ``` -This will generate two executable files: `main` and `main-debug`. Debug and release are compiler configurations. Debug mode is slower, but contains less optimiziations and more meaningful error messages. This makes it ideal for application/model code development. Release mode has less "safety features" and meaningful error messages, with more optimizations (faster runtime). +This will generate two executable files: `main` and `main-debug`. Debug and release are compiler configurations. Debug mode is slower, but contains less optimizations and more meaningful error messages. This makes it ideal for application/model code development. Release mode has less "safety features" and meaningful error messages, with more optimizations (faster runtime). Debug execution (serial runs): ```bash diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index c6247e9eb..7b6c286a7 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -43,7 +43,7 @@ foreach(app ${APPLICATIONS}) " message(STATUS \"Building regression test: ${app}\") execute_process( - COMMAND ${CMAKE_COMMAND} + COMMAND ${CMAKE_COMMAND} -S ${CMAKE_INSTALL_PREFIX}/applications/${app}/ WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/applications/${app} RESULT_VARIABLE configure_result diff --git a/applications/MgNd_precipitate_single_Bppp/ICs_and_BCs.cc b/applications/MgNd_precipitate_single_Bppp/ICs_and_BCs.cc index 89c0c5fe7..8187599a0 100644 --- a/applications/MgNd_precipitate_single_Bppp/ICs_and_BCs.cc +++ b/applications/MgNd_precipitate_single_Bppp/ICs_and_BCs.cc @@ -84,4 +84,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/MgNd_precipitate_single_Bppp/main.cc b/applications/MgNd_precipitate_single_Bppp/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/MgNd_precipitate_single_Bppp/main.cc +++ b/applications/MgNd_precipitate_single_Bppp/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/MgNd_precipitate_single_Bppp/parameters.prm b/applications/MgNd_precipitate_single_Bppp/parameters.prm index ed18350ba..faca6b178 100644 --- a/applications/MgNd_precipitate_single_Bppp/parameters.prm +++ b/applications/MgNd_precipitate_single_Bppp/parameters.prm @@ -38,19 +38,19 @@ set time step = 1.0e-5 # The total number of timesteps to take set number steps = 5000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 10 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for c = Natural set boundary condition for mu = Natural @@ -59,7 +59,7 @@ set boundary condition for u, x component = DIRICHLET: 0.0, DIRICHLET: 0.0, NATU set boundary condition for u, y component = NATURAL, DIRICHLET: 0.0, DIRICHLET: 0.0, DIRICHLET: 0.0, NATURAL, DIRICHLET: 0.0 set boundary condition for u, z component = NATURAL, DIRICHLET: 0.0, NATURAL, DIRICHLET: 0.0, DIRICHLET: 0.0, DIRICHLET: 0.0 -# The linear solve parameters. The type of residual can either be AbsoluteResidual or +# The linear solve parameters. The type of residual can either be AbsoluteResidual or # RelativeResidual. The preconditioner type can either be none or geometric multigrid # (GMG). The parameters smoothing range, degree, eigenvalue cg iterations, and min # multigrid level are specific to GMG and can be changed to suite your problem. diff --git a/applications/MgNd_precipitate_single_Bppp/postprocess.cc b/applications/MgNd_precipitate_single_Bppp/postprocess.cc index 581128f6a..b70ad81e2 100644 --- a/applications/MgNd_precipitate_single_Bppp/postprocess.cc +++ b/applications/MgNd_precipitate_single_Bppp/postprocess.cc @@ -272,4 +272,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(0, total_energy_density); pp_variable_list.set_scalar_value_term_rhs(1, vm_stress); -} \ No newline at end of file +} diff --git a/applications/MgNd_precipitate_single_Bppp/precipitateEvolution_KKS.md b/applications/MgNd_precipitate_single_Bppp/precipitateEvolution_KKS.md index b357f360e..a8b2781d5 100644 --- a/applications/MgNd_precipitate_single_Bppp/precipitateEvolution_KKS.md +++ b/applications/MgNd_precipitate_single_Bppp/precipitateEvolution_KKS.md @@ -1,16 +1,16 @@ # KKS Phase Field Model of Precipitate Evolution (September 14th, 2023) - + The model employed in this application is described in detail in the article: DeWitt et al., Misfit-driven $\beta'''$ precipitate composition and morphology in Mg-Nd alloys, Acta Materialia **137**, 378-389 (2017). - + ## Variational formulation The total free energy of the system (neglecting boundary terms) is of the form, $$ \begin{equation} -\Pi(c, \eta_1, \eta_2, \eta_3, \epsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \epsilon) ~dV +\Pi(c, \eta_1, \eta_2, \eta_3, \epsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \epsilon) ~dV \end{equation} $$ @@ -32,30 +32,30 @@ $$ $$ \begin{equation} -f_{grad}(\eta_1, \eta_2, \eta_3) = \frac{1}{2} \sum_{p=1}^3 \kappa_{ij}^{\eta_p} \eta_{p,i} \eta_{p,j} +f_{grad}(\eta_1, \eta_2, \eta_3) = \frac{1}{2} \sum_{p=1}^3 \kappa_{ij}^{\eta_p} \eta_{p,i} \eta_{p,j} \end{equation} $$ $$ \begin{gather} -f_{elastic}(c,\eta_1, \eta_2, \eta_3,\epsilon) = \frac{1}{2} C_{ijkl}(\eta_1, \eta_2, \eta_3) \left( \varepsilon_{ij} - \varepsilon ^0_{ij}(c, \eta_1, \eta_2, \eta_3) \right)\left( \varepsilon_{kl} - \varepsilon^0_{kl}(c, \eta_1, \eta_2, \eta_3)\right) +f_{elastic}(c,\eta_1, \eta_2, \eta_3,\epsilon) = \frac{1}{2} C_{ijkl}(\eta_1, \eta_2, \eta_3) \left( \varepsilon_{ij} - \varepsilon ^0_{ij}(c, \eta_1, \eta_2, \eta_3) \right)\left( \varepsilon_{kl} - \varepsilon^0_{kl}(c, \eta_1, \eta_2, \eta_3)\right) \end{gather} $$ $$ \begin{gather} -\varepsilon^0(c, \eta_1, \eta_2, \eta_3) = H(\eta_1) \varepsilon^0_{\eta_1} (c_{\beta})+ H(\eta_2) \varepsilon^0_{\eta_2} (c_{\beta}) + H(\eta_3) \varepsilon^0_{\eta_3} (c_{\beta}) +\varepsilon^0(c, \eta_1, \eta_2, \eta_3) = H(\eta_1) \varepsilon^0_{\eta_1} (c_{\beta})+ H(\eta_2) \varepsilon^0_{\eta_2} (c_{\beta}) + H(\eta_3) \varepsilon^0_{\eta_3} (c_{\beta}) C(\eta_1, \eta_2, \eta_3) = H(\eta_1) C_{\eta_1}+ H(\eta_2) C_{\eta_2} + H(\eta_3) C_{\eta_3} + \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) C_{\alpha} \end{gather} $$ Here $\varepsilon^0_{\eta_p}$ are the composition dependent stress free strain transformation tensor corresponding to each structural order parameter, which is a function of the $\beta$ phase concentration, $c_{\beta}$, defined below. -In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{alpha}$ and $c_{beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta_1, \eta_2, \eta_3)$ can be rewritten as +In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{alpha}$ and $c_{beta}$, respectively. The homogeneous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta_1, \eta_2, \eta_3)$ can be rewritten as $$ \begin{equation} -f_{chem}(c, \eta_1, \eta_2, \eta_3) = f_{\alpha}(c_{\alpha}) \left( 1- \sum_{p=1}^3 H(\eta_p)\right) + f_{\beta}(c_{\beta}) \sum_{p=1}^3 H(\eta_p)+ W f_{Landau}(\eta_1, \eta_2, \eta_3) +f_{chem}(c, \eta_1, \eta_2, \eta_3) = f_{\alpha}(c_{\alpha}) \left( 1- \sum_{p=1}^3 H(\eta_p)\right) + f_{\beta}(c_{\beta}) \sum_{p=1}^3 H(\eta_p)+ W f_{Landau}(\eta_1, \eta_2, \eta_3) \end{equation} $$ @@ -68,7 +68,7 @@ c = c_{\alpha} \left( 1- \sum_{p=1}^3 H(\eta_p)\right) + c_{\beta} \sum_{p=1}^3 \end{gather} $$ -Given the following parabolic functions for the single-phase homogenous free energies: +Given the following parabolic functions for the single-phase homogeneous free energies: $$ \begin{gather} @@ -82,15 +82,15 @@ the single-phase concentrations are: $$ \begin{gather} c_{\alpha} = \frac{ B_2 c + \frac{1}{2} (B_1 - A_1) \sum_{p=1}^3 H(\eta_p) }{A_2 \sum_{p=1}^3 H(\eta_p) + B_2 \left( 1- \sum_{p=1}^3 H(\eta_p)\right) } \\ -c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-\sum_{p=1}^3 H(\eta_p)\right] }{A_2 \sum_{p=1}^3 H(\eta_p) + B_2 \left[ 1- \sum_{p=1}^3 H(\eta_p)\right] } +c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-\sum_{p=1}^3 H(\eta_p)\right] }{A_2 \sum_{p=1}^3 H(\eta_p) + B_2 \left[ 1- \sum_{p=1}^3 H(\eta_p)\right] } \end{gather} $$ ## Required inputs - $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above -- $f_{Landau}(\eta_1, \eta_2, \eta_3)$ - Landau free energy term that controls the interfacial energy and prevents precipitates with different orientation varients from overlapping, example form given in Appendix I -- \$W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface +- $f_{Landau}(\eta_1, \eta_2, \eta_3)$ - Landau free energy term that controls the interfacial energy and prevents precipitates with different orientation variants from overlapping, example form given in Appendix I +- \$W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface - $H(\eta_p)$ - Interpolation function for connecting the $\alpha$ phase and the $p^{th}$ orientation variant of the $\beta$ phase, example form given in Appendix I - $\kappa^{\eta_p}$ - gradient penalty tensor for the $p^{th}$ orientation variant of the $\beta$ phase - $C_{\eta_p}$ - fourth order elasticity tensor (or its equivalent second order Voigt representation) for the $p^{th}$ orientation variant of the $\beta$ phase @@ -108,7 +108,7 @@ We obtain chemical potentials for the chemical potentials for the concentration $$ \begin{align} - \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + C_{ijkl} (- \varepsilon^0_{ij,c}) \left( \varepsilon_{kl} - \varepsilon^0_{kl}\right) + \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + C_{ijkl} (- \varepsilon^0_{ij,c}) \left( \varepsilon_{kl} - \varepsilon^0_{kl}\right) \end{align} $$ @@ -127,30 +127,30 @@ $$ \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) \end{align} $$ - -where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: + +where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarantee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: $$ \begin{align} -\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} +\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} \end{align} $$ -where $L$ is a constant mobility. +where $L$ is a constant mobility. ## Mechanics Considering variations on the displacement $u$ of the from $u+\epsilon w$, we have $$ \begin{align} -\delta_u \Pi &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \varepsilon - \varepsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 +\delta_u \Pi &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \varepsilon - \varepsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 \end{align} $$ where $\sigma = C(\eta_1, \eta_2, \eta_3) : \left( \varepsilon - \varepsilon^0(c,\eta_1, \eta_2, \eta_3)\right)$ is the stress tensor. ## Time discretization -Using forward Euler explicit time stepping, equations +Using forward Euler explicit time stepping, equations $$ \begin{align} @@ -158,11 +158,11 @@ $$ \end{align} $$ -and +and $$ \begin{align} -\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} +\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} \end{align} $$ @@ -181,7 +181,7 @@ $$ $$ ## Weak formulation -Writing equations +Writing equations $$ \begin{align} @@ -189,15 +189,15 @@ $$ \end{align} $$ -and +and $$ \begin{align} -\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} +\frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} \end{align} $$ -in the weak form, with the arbirary variation given by $w$ yields: +in the weak form, with the arbitrary variation given by $w$ yields: $$ \begin{align} @@ -207,7 +207,7 @@ $$ $$ \begin{align} -%&= \int_\Omega wc^{n}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +%&= \int_\Omega wc^{n}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV \end{align} $$ @@ -221,7 +221,7 @@ The expression of $\frac{1}{f_{,cc}} \nabla \mu_c$ can be written as: $$ \begin{align} -\frac{1}{f_{,cc}} \nabla \mu_c = & \nabla c + (c_{\alpha}-c_{\beta}) \sum_{p=1}^3 H(\eta_p)_{,\eta_p} \nabla \eta_p +\frac{1}{f_{,cc}} \nabla \mu_c = & \nabla c + (c_{\alpha}-c_{\beta}) \sum_{p=1}^3 H(\eta_p)_{,\eta_p} \nabla \eta_p \end{align} $$ @@ -271,7 +271,7 @@ r_{cx} &= -\Delta t M \frac{1}{f_{,cc}} \nabla \mu_c \end{align} $$ -Expanding $\mu_{\eta_p}$ in equation +Expanding $\mu_{\eta_p}$ in equation $$ \begin{align} @@ -290,11 +290,11 @@ $$ $$ \begin{align} &\int_\Omega w \left(\eta_p^{n}-\Delta t L \left( (f_{\beta}-f_{\alpha})H_{,\eta_p}(\eta_p^n) -(c_{\beta}-c_{\alpha}) f_{\beta,c_{\beta}}H_{,\eta_p}(\eta_p^n) + W f_{Landau,\eta_p} --C_{ijkl} (H_{,\eta_p}(\eta_p) \epsilon_{ij}^{0 \eta_p}) (\epsilon_{kl} - \epsilon_{kl}^{0}) + \frac{1}{2} \left((C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha}) H_{,\eta_p}(\eta_p) \right) (\epsilon_{ij} - \epsilon_{ij}^{0}) (\epsilon_{kl} - \epsilon_{kl}^{0}) \right) \right) &+ \nabla w \cdot \left(-\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n \right) dV +-C_{ijkl} (H_{,\eta_p}(\eta_p) \epsilon_{ij}^{0 \eta_p}) (\epsilon_{kl} - \epsilon_{kl}^{0}) + \frac{1}{2} \left((C_{ijkl}^{\eta_p} - C_{ijkl}^{\alpha}) H_{,\eta_p}(\eta_p) \right) (\epsilon_{ij} - \epsilon_{ij}^{0}) (\epsilon_{kl} - \epsilon_{kl}^{0}) \right) \right) &+ \nabla w \cdot \left(-\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n \right) dV \end{align} $$ -where +where $$ \begin{align} @@ -309,7 +309,7 @@ r_{\eta_p x} &= -\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n \end{align} $$ -## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta_p)$ +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta_p)$ $$ \begin{gather} diff --git a/applications/_CHAC_anisotropy/CHAC_anisotropy.md b/applications/_CHAC_anisotropy/CHAC_anisotropy.md index c1919424a..569c222be 100644 --- a/applications/_CHAC_anisotropy/CHAC_anisotropy.md +++ b/applications/_CHAC_anisotropy/CHAC_anisotropy.md @@ -3,11 +3,11 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 ~dV + \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 ~dV \end{equation} $$ -where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. The interface normal vector $\mathbf{n}$ is given by +where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. The interface normal vector $\mathbf{n}$ is given by $$ \begin{equation} @@ -45,7 +45,7 @@ Now the PDE for Cahn-Hilliard dynamics is given by: $$ \begin{align} \frac{\partial c}{\partial t} &= -~\nabla \cdot (-M_c\nabla \mu_c)\\ - &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) + &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) \end{align} $$ @@ -54,11 +54,11 @@ and the PDE for Allen-Cahn dynamics is given by: $$ \begin{align} \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta \\ - &=-M_\eta ~ ((f_{\beta,c}-f_{\alpha,c})H_{,\eta} - \nabla \cdot \mathbf{m}) + &=-M_\eta ~ ((f_{\beta,c}-f_{\alpha,c})H_{,\eta} - \nabla \cdot \mathbf{m}) \end{align} $$ -where $M_c$ and $M_\eta$ are the constant mobilities. +where $M_c$ and $M_\eta$ are the constant mobilities. ## Time discretization @@ -82,7 +82,7 @@ $$ $$ \begin{align} -&= \int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) \mathbf{m}^n ~dV +&= \int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) \mathbf{m}^n ~dV \end{align} $$ @@ -98,7 +98,7 @@ r_{\eta x} &= (- \Delta t M_{\eta}) \mathbf{m}^n \end{align} $$ -and +and $$ \begin{align} @@ -115,9 +115,9 @@ $$ $$ \begin{align} -r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] +r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] \end{align} $$ -The above values of $r_{\eta}$, $r_{\eta x}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following equations file: +The above values of $r_{\eta}$, $r_{\eta x}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following equations file: `applications/CHAC\_anisotropy/equations.h` diff --git a/applications/_CHAC_anisotropy/ICs_and_BCs.cc b/applications/_CHAC_anisotropy/ICs_and_BCs.cc index c0390575b..d8c57453e 100644 --- a/applications/_CHAC_anisotropy/ICs_and_BCs.cc +++ b/applications/_CHAC_anisotropy/ICs_and_BCs.cc @@ -76,4 +76,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHAC_anisotropy/custom_pde.h b/applications/_CHAC_anisotropy/custom_pde.h index 55793cf95..42a8dfd7d 100644 --- a/applications/_CHAC_anisotropy/custom_pde.h +++ b/applications/_CHAC_anisotropy/custom_pde.h @@ -94,4 +94,4 @@ class CustomPDE : public MatrixFreePDE double epsilonM = userInputs.get_model_constant_double("epsilonM"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHAC_anisotropy/equations.cc b/applications/_CHAC_anisotropy/equations.cc index 2e39e6a81..b09bc4477 100644 --- a/applications/_CHAC_anisotropy/equations.cc +++ b/applications/_CHAC_anisotropy/equations.cc @@ -37,7 +37,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -179,4 +179,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHAC_anisotropy/main.cc b/applications/_CHAC_anisotropy/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_CHAC_anisotropy/main.cc +++ b/applications/_CHAC_anisotropy/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_CHAC_anisotropy/postprocess.cc b/applications/_CHAC_anisotropy/postprocess.cc index c8f2c96b7..6f8951f64 100644 --- a/applications/_CHAC_anisotropy/postprocess.cc +++ b/applications/_CHAC_anisotropy/postprocess.cc @@ -92,4 +92,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHAC_anisotropy_regularized/CHAC_anisotropyRegularized.md b/applications/_CHAC_anisotropy_regularized/CHAC_anisotropyRegularized.md index 8be17c483..c126e6b2b 100644 --- a/applications/_CHAC_anisotropy_regularized/CHAC_anisotropyRegularized.md +++ b/applications/_CHAC_anisotropy_regularized/CHAC_anisotropyRegularized.md @@ -4,11 +4,11 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 + \frac{\delta^2}{2} (\Delta \eta)^2 ~dV + \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 + \frac{\delta^2}{2} (\Delta \eta)^2 ~dV \end{equation} $$ -where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. $\delta$ is a scalar regularization parameter. The interface normal vector $\mathbf{n}$ is given by +where $f_{\alpha}$ and $f_{\beta}$ are the free energy densities corresponding to $\alpha$ and $\beta$ phases, respectively, and are functions of composition $c$. $H$ is a function of the structural order parameter $\eta$. $\delta$ is a scalar regularization parameter. The interface normal vector $\mathbf{n}$ is given by $$ \begin{equation} @@ -44,7 +44,7 @@ Now the PDE for Cahn-Hilliard dynamics is given by: $$ \begin{align} \frac{\partial c}{\partial t} &= -~\nabla \cdot (-M_c\nabla \mu_c)\\ -&=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) +&=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) \end{align} $$ @@ -65,7 +65,7 @@ $$ \end{align} $$ -and the PDE for Allen-Cahn dynamics becomes +and the PDE for Allen-Cahn dynamics becomes $$ \begin{align} @@ -89,8 +89,8 @@ In the weak formulation, considering an arbitrary variation $w$, the above equat $$ \begin{align} - \int_{\Omega} w \phi^{n+1} ~dV &=\int_{\Omega} \nabla w \cdot \nabla \eta^n ~dV -\end{align} + \int_{\Omega} w \phi^{n+1} ~dV &=\int_{\Omega} \nabla w \cdot \nabla \eta^n ~dV +\end{align} $$ $$ @@ -107,8 +107,8 @@ $$ $$ \begin{align} - &=\int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 - \phi^n) ~dV + &=\int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 + \phi^n) ~dV \end{align} $$ @@ -125,7 +125,7 @@ r_{\eta x} &= (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 \phi^n) \end{align} $$ -and +and $$ \begin{align} @@ -147,7 +147,7 @@ $$ $$ \begin{align} -r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta^n) ] +r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta^n) ] \end{align} $$ diff --git a/applications/_CHAC_anisotropy_regularized/ICs_and_BCs.cc b/applications/_CHAC_anisotropy_regularized/ICs_and_BCs.cc index 97d57d38e..c34768095 100644 --- a/applications/_CHAC_anisotropy_regularized/ICs_and_BCs.cc +++ b/applications/_CHAC_anisotropy_regularized/ICs_and_BCs.cc @@ -80,4 +80,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHAC_anisotropy_regularized/custom_pde.h b/applications/_CHAC_anisotropy_regularized/custom_pde.h index 6e1e01cf8..0f28c89fb 100644 --- a/applications/_CHAC_anisotropy_regularized/custom_pde.h +++ b/applications/_CHAC_anisotropy_regularized/custom_pde.h @@ -95,4 +95,4 @@ class CustomPDE : public MatrixFreePDE double delta2 = userInputs.get_model_constant_double("delta2"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHAC_anisotropy_regularized/equations.cc b/applications/_CHAC_anisotropy_regularized/equations.cc index 8477db8d7..a5386894e 100644 --- a/applications/_CHAC_anisotropy_regularized/equations.cc +++ b/applications/_CHAC_anisotropy_regularized/equations.cc @@ -45,7 +45,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -201,4 +201,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHAC_anisotropy_regularized/main.cc b/applications/_CHAC_anisotropy_regularized/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_CHAC_anisotropy_regularized/main.cc +++ b/applications/_CHAC_anisotropy_regularized/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_CHAC_anisotropy_regularized/postprocess.cc b/applications/_CHAC_anisotropy_regularized/postprocess.cc index 2cdb6bb29..01ec3bfff 100644 --- a/applications/_CHAC_anisotropy_regularized/postprocess.cc +++ b/applications/_CHAC_anisotropy_regularized/postprocess.cc @@ -102,4 +102,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHAC_performance_test/ICs_and_BCs.cc b/applications/_CHAC_performance_test/ICs_and_BCs.cc index fce6b2996..cc8476946 100644 --- a/applications/_CHAC_performance_test/ICs_and_BCs.cc +++ b/applications/_CHAC_performance_test/ICs_and_BCs.cc @@ -91,4 +91,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHAC_performance_test/custom_pde.h b/applications/_CHAC_performance_test/custom_pde.h index 41e5882a4..2c8a6c985 100644 --- a/applications/_CHAC_performance_test/custom_pde.h +++ b/applications/_CHAC_performance_test/custom_pde.h @@ -103,4 +103,4 @@ class CustomPDE : public MatrixFreePDE userInputs.get_model_constant_double("matrix_concentration"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHAC_performance_test/equations.cc b/applications/_CHAC_performance_test/equations.cc index 4b6950384..161269439 100644 --- a/applications/_CHAC_performance_test/equations.cc +++ b/applications/_CHAC_performance_test/equations.cc @@ -37,7 +37,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -140,4 +140,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHAC_performance_test/main.cc b/applications/_CHAC_performance_test/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_CHAC_performance_test/main.cc +++ b/applications/_CHAC_performance_test/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_CHAC_performance_test/postprocess.cc b/applications/_CHAC_performance_test/postprocess.cc index 9ab9d97d1..a896926fe 100644 --- a/applications/_CHAC_performance_test/postprocess.cc +++ b/applications/_CHAC_performance_test/postprocess.cc @@ -65,7 +65,7 @@ CustomPDE::postProcessedFields( // Interpolation function scalarvalueType h = (3.0 * n * n - 2.0 * n * n * n); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = (constV(1.0) - h) * fa + h * fb; // The gradient free energy @@ -78,4 +78,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/ICs_and_BCs.cc index 72ebc1268..7348cb192 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/ICs_and_BCs.cc @@ -69,4 +69,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/custom_pde.h index b77c1cf9e..7706bc0b4 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/custom_pde.h @@ -96,4 +96,4 @@ class CustomPDE : public MatrixFreePDE scalarvalueType M = constV(5.0); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc index b181007b9..e2d2e6902 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc @@ -37,7 +37,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -139,4 +139,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc index 73a90721c..e1741bd16 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc @@ -57,7 +57,7 @@ CustomPDE::postProcessedFields( // --- Setting the expressions for the terms in the postprocessing expressions // --- - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = rho_s * dealii::Utilities::fixed_power<2>(c - c_alpha) * dealii::Utilities::fixed_power<2>(c - c_beta); @@ -74,4 +74,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/ICs_and_BCs.cc index 72ebc1268..7348cb192 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/ICs_and_BCs.cc @@ -69,4 +69,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/custom_pde.h index b77c1cf9e..7706bc0b4 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/custom_pde.h @@ -96,4 +96,4 @@ class CustomPDE : public MatrixFreePDE scalarvalueType M = constV(5.0); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc index b181007b9..e2d2e6902 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc @@ -37,7 +37,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -139,4 +139,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc index 73a90721c..e1741bd16 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc @@ -57,7 +57,7 @@ CustomPDE::postProcessedFields( // --- Setting the expressions for the terms in the postprocessing expressions // --- - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = rho_s * dealii::Utilities::fixed_power<2>(c - c_alpha) * dealii::Utilities::fixed_power<2>(c - c_beta); @@ -74,4 +74,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/ICs_and_BCs.cc index 72ebc1268..7348cb192 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/ICs_and_BCs.cc @@ -69,4 +69,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/custom_pde.h index 6e68aebd9..a367489b1 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/custom_pde.h @@ -184,4 +184,4 @@ CustomPDE::create_triangulation( } } } -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc index b181007b9..e2d2e6902 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc @@ -37,7 +37,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -139,4 +139,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc index 73a90721c..e1741bd16 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc @@ -57,7 +57,7 @@ CustomPDE::postProcessedFields( // --- Setting the expressions for the terms in the postprocessing expressions // --- - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = rho_s * dealii::Utilities::fixed_power<2>(c - c_alpha) * dealii::Utilities::fixed_power<2>(c - c_beta); @@ -74,4 +74,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/ICs_and_BCs.cc index 594168776..8ee9987a9 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/ICs_and_BCs.cc @@ -105,4 +105,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/custom_pde.h index fea9ef55b..21dcef63a 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/custom_pde.h @@ -97,4 +97,4 @@ class CustomPDE : public MatrixFreePDE double alpha = userInputs.get_model_constant_double("alpha"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc index 5ba8d0272..f778306f5 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc @@ -69,7 +69,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -245,4 +245,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc index 2ec337dad..e0bcf3a51 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc @@ -93,7 +93,7 @@ CustomPDE::postProcessedFields( // Combined function (g) scalarvalueType gV = (gdwV + gintV); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = (constV(1.0) - hV) * faV + hV * fbV + wV * gV; // The gradient free energy @@ -108,4 +108,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/ICs_and_BCs.cc index 22ad73b39..a09a16f59 100755 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/ICs_and_BCs.cc @@ -83,4 +83,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/custom_pde.h index 131642c24..3354baa86 100755 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/custom_pde.h @@ -97,4 +97,4 @@ class CustomPDE : public MatrixFreePDE double mult = userInputs.get_model_constant_double("mult"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc index b5e0b80be..e8c4489a1 100755 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc @@ -45,7 +45,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -194,4 +194,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc index 1cd2733ca..f4c803cd2 100755 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc @@ -64,7 +64,7 @@ CustomPDE::postProcessedFields( scalarvalueType f_tot = constV(0.0); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = -0.5 * phi * phi + 0.25 * phi * phi * phi * phi + lambda * u * phi * (1.0 - 2.0 / 3.0 * phi * phi + 1.0 / 5.0 / phi * phi * phi * phi); @@ -88,4 +88,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/ICs_and_BCs.cc index 92ad4f713..ef90e265e 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/ICs_and_BCs.cc @@ -81,4 +81,4 @@ CustomPDE::setNonUniformDirichletBCs( } // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/custom_pde.h index 5e6a85793..3ba9b9349 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/custom_pde.h @@ -98,4 +98,4 @@ class CustomPDE : public MatrixFreePDE double epsilon = userInputs.get_model_constant_double("epsilon"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc index dadaef4c4..71a1c5324 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc @@ -47,7 +47,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -172,4 +172,4 @@ CustomPDE::equationLHS( // --- Submitting the terms for the governing equations --- variable_list.set_scalar_gradient_term_lhs(2, eqx_Dphi); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc index 44aa66a93..ccafa1447 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc @@ -60,11 +60,11 @@ CustomPDE::postProcessedFields( scalarvalueType f_tot = constV(0.0); - // The homogenous chemical free energy + // The homogeneous chemical free energy scalarvalueType f_chem = rho * (c - c_alpha) * (c - c_alpha) * (c_beta - c) * (c_beta - c); - // The homogenous electrostaric free energy + // The homogeneous electrostaric free energy scalarvalueType f_elec = 0.5 * k * c * phi; // The gradient free energy @@ -80,4 +80,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/ICs_and_BCs.cc index 92ad4f713..ef90e265e 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/ICs_and_BCs.cc @@ -81,4 +81,4 @@ CustomPDE::setNonUniformDirichletBCs( } // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/custom_pde.h index 5c6cc35af..5ab803bda 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/custom_pde.h @@ -251,4 +251,4 @@ CustomPDE::create_triangulation( } } } -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc index 3f8394eac..5af1ad5e7 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc @@ -47,7 +47,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -167,4 +167,4 @@ CustomPDE::equationLHS( scalargradType eqx_Dphi = Dphix; variable_list.set_scalar_gradient_term_lhs(2, eqx_Dphi); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc index 44aa66a93..ccafa1447 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc @@ -60,11 +60,11 @@ CustomPDE::postProcessedFields( scalarvalueType f_tot = constV(0.0); - // The homogenous chemical free energy + // The homogeneous chemical free energy scalarvalueType f_chem = rho * (c - c_alpha) * (c - c_alpha) * (c_beta - c) * (c_beta - c); - // The homogenous electrostaric free energy + // The homogeneous electrostaric free energy scalarvalueType f_elec = 0.5 * k * c * phi; // The gradient free energy @@ -80,4 +80,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/ICs_and_BCs.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/ICs_and_BCs.cc index 91b76dc88..72ff26126 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/ICs_and_BCs.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/ICs_and_BCs.cc @@ -58,4 +58,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/custom_pde.h b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/custom_pde.h index 5bf77b1a9..763e19148 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/custom_pde.h +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/custom_pde.h @@ -100,4 +100,4 @@ class CustomPDE : public MatrixFreePDE double C2 = pi * userInputs.get_model_constant_double("C2"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc index b7fe97a21..9f8b4e985 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc @@ -29,7 +29,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -134,4 +134,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc index d29199f1e..394b98537 100644 --- a/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc +++ b/applications/_CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc @@ -86,7 +86,7 @@ CustomPDE::postProcessedFields( scalarvalueType f_tot = constV(0.0); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = (n * n * n * n - 2.0 * n * n * n + n * n); // The gradient free energy @@ -138,4 +138,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(1, f_tot); pp_variable_list.set_scalar_value_term_rhs(2, source_term); pp_variable_list.set_scalar_value_term_rhs(3, n_sol); -} \ No newline at end of file +} diff --git a/applications/_allen_cahn_conserved/ICs_and_BCs.cc b/applications/_allen_cahn_conserved/ICs_and_BCs.cc index 29d080ffb..86f84df2d 100644 --- a/applications/_allen_cahn_conserved/ICs_and_BCs.cc +++ b/applications/_allen_cahn_conserved/ICs_and_BCs.cc @@ -91,4 +91,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_allen_cahn_conserved/allen_cahn_conserved.md b/applications/_allen_cahn_conserved/allen_cahn_conserved.md index 22ea5b640..bd69be27b 100644 --- a/applications/_allen_cahn_conserved/allen_cahn_conserved.md +++ b/applications/_allen_cahn_conserved/allen_cahn_conserved.md @@ -8,12 +8,12 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(\eta, \nabla \eta) = \int_{\Omega} f( \eta ) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV, + \Pi(\eta, \nabla \eta) = \int_{\Omega} f( \eta ) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV, \end{equation} $$ where $\eta$ is the structural order parameter, and $\kappa$ is the gradient length scale parameter. - + ## Variational treatment Considering variations on the primal field $\eta$ of the from $\eta+\epsilon w$, we have @@ -79,7 +79,7 @@ A &= \frac{M}{V}\int_\Omega \mu \,dV. \end{align} $$ -Subsituting $A$ from +Substituting $A$ from $$ \begin{align} @@ -87,7 +87,7 @@ A &= \frac{M}{V}\int_\Omega \mu \,dV. \end{align} $$ -into +into $$ \begin{align} @@ -127,7 +127,7 @@ In the weak formulation, considering an arbitrary variation $w$, the above equat $$ \begin{align} -\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV +\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV \end{align} $$ @@ -141,13 +141,13 @@ and $$ \begin{align} -\int_{\Omega} w \mu^{n+1} ~dV&= \int_{\Omega} [w f_{,\eta}^n - w \kappa \Delta \eta^{n}]~dV +\int_{\Omega} w \mu^{n+1} ~dV&= \int_{\Omega} [w f_{,\eta}^n - w \kappa \Delta \eta^{n}]~dV \end{align} $$ $$ \begin{align} -&= \int_{\Omega} w ( f_{,\eta}^{n} ) + \nabla w \cdot (\kappa \nabla \eta^{n}) ~dV, +&= \int_{\Omega} w ( f_{,\eta}^{n} ) + \nabla w \cdot (\kappa \nabla \eta^{n}) ~dV, \end{align} $$ @@ -159,7 +159,7 @@ $$ $$ \begin{align} -r_{\mu} &= f_{,\eta}^{n} +r_{\mu} &= f_{,\eta}^{n} \end{align} $$ @@ -167,7 +167,7 @@ where the reference chemical potential $\bar{\mu}^n$ for time step $n$ in $$ \begin{align} -\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV +\int_{\Omega} w \eta^{n+1} ~dV&= \int_{\Omega} w [ \eta^{n} - \Delta t M(\mu^n-\bar{\mu}^n) ]~dV \end{align} $$ diff --git a/applications/_allen_cahn_conserved/custom_pde.h b/applications/_allen_cahn_conserved/custom_pde.h index d6a5a0dcc..b2835956a 100644 --- a/applications/_allen_cahn_conserved/custom_pde.h +++ b/applications/_allen_cahn_conserved/custom_pde.h @@ -179,7 +179,7 @@ CustomPDE::solveIncrement(bool skip_time_dependent) // Now, update the non-explicit variables // For the time being, this is just the elliptic equations, but implicit - // parabolic and auxilary equations should also be here + // parabolic and auxiliary equations should also be here if (this->hasNonExplicitEquation) { bool nonlinear_iteration_converged = false; @@ -334,4 +334,4 @@ CustomPDE::solveIncrement(bool skip_time_dependent) } // log time this->computing_timer.leave_subsection("matrixFreePDE: solveIncrements"); -} \ No newline at end of file +} diff --git a/applications/_allen_cahn_conserved/equations.cc b/applications/_allen_cahn_conserved/equations.cc index 9029591b1..e93cff006 100644 --- a/applications/_allen_cahn_conserved/equations.cc +++ b/applications/_allen_cahn_conserved/equations.cc @@ -36,7 +36,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -135,4 +135,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_allen_cahn_conserved/main.cc b/applications/_allen_cahn_conserved/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_allen_cahn_conserved/main.cc +++ b/applications/_allen_cahn_conserved/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_allen_cahn_conserved/postprocess.cc b/applications/_allen_cahn_conserved/postprocess.cc index 3a3c944c6..443e50714 100644 --- a/applications/_allen_cahn_conserved/postprocess.cc +++ b/applications/_allen_cahn_conserved/postprocess.cc @@ -66,7 +66,7 @@ CustomPDE::postProcessedFields( scalarvalueType f_tot = constV(0.0); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = (n * n * n * n - 2.0 * n * n * n + n * n); // The gradient free energy @@ -85,4 +85,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(0, std::sqrt(nx[0] * nx[0] + nx[1] * nx[1])); pp_variable_list.set_scalar_value_term_rhs(1, f_tot); -} \ No newline at end of file +} diff --git a/applications/_alloy_solidification_uniform/ICs_and_BCs.cc b/applications/_alloy_solidification_uniform/ICs_and_BCs.cc index dca87a3af..86aeb1186 100644 --- a/applications/_alloy_solidification_uniform/ICs_and_BCs.cc +++ b/applications/_alloy_solidification_uniform/ICs_and_BCs.cc @@ -84,4 +84,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_alloy_solidification_uniform/alloy_solidification_uniform.md b/applications/_alloy_solidification_uniform/alloy_solidification_uniform.md index a7fa311ae..8c03995fa 100644 --- a/applications/_alloy_solidification_uniform/alloy_solidification_uniform.md +++ b/applications/_alloy_solidification_uniform/alloy_solidification_uniform.md @@ -1,6 +1,6 @@ # PRISMS-PF Application Formulation: alloySolidification_uniform -This example application implements a simple model to simulate solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. The implemented model was introduced by Karma [1] in 2001. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered to be fixed by external conditions. In contrast to *alloySolidification*, this application considers solidification under uniform temperature and no diffusion in the solid. In the default settings of the application, the simulation starts with a circular solid in the corner of a square system. The evolution of the system is calculated for an initial scaled supersaturation value, $\Omega$. As this seed grows, three variables are tracked, an order parameter, $\phi$, that denotes whether the material a liquid ($\phi=-1$) or solid ($\phi=1$), the solute concentration, $c$, and an auxiliary term, $\xi$. +This example application implements a simple model to simulate solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. The implemented model was introduced by Karma [1] in 2001. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered to be fixed by external conditions. In contrast to *alloySolidification*, this application considers solidification under uniform temperature and no diffusion in the solid. In the default settings of the application, the simulation starts with a circular solid in the corner of a square system. The evolution of the system is calculated for an initial scaled supersaturation value, $\Omega$. As this seed grows, three variables are tracked, an order parameter, $\phi$, that denotes whether the material a liquid ($\phi=-1$) or solid ($\phi=1$), the solute concentration, $c$, and an auxiliary term, $\xi$. ## Model The free energy of the system can be written as the functional [2] @@ -40,7 +40,7 @@ and $$ \begin{equation} -\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{j}_{at} \right), +\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{j}_{at} \right), \end{equation} $$ @@ -74,7 +74,7 @@ where $$ \begin{equation} -\xi(\phi,c) = -\frac{\partial f}{\partial \phi} - \frac{\lambda}{1-k} g'(\phi)(e^u - 1) + W^2\nabla^2 \phi +\xi(\phi,c) = -\frac{\partial f}{\partial \phi} - \frac{\lambda}{1-k} g'(\phi)(e^u - 1) + W^2\nabla^2 \phi \end{equation} $$ @@ -106,7 +106,7 @@ The constant $\lambda$ is defined as $\lambda=a_1W/d_0$, where $d_0$ is the mic $$ \begin{equation} -g'(\phi)=(1-\phi^2)^2, +g'(\phi)=(1-\phi^2)^2, \end{equation} $$ @@ -132,11 +132,11 @@ $$ \end{equation} $$ -and +and $$ \begin{equation} -\xi(\phi,c) = -\frac{\partial f}{\partial \phi} - \frac{\lambda}{1-k} g'(\phi)(e^u - 1) + W^2\nabla^2 \phi +\xi(\phi,c) = -\frac{\partial f}{\partial \phi} - \frac{\lambda}{1-k} g'(\phi)(e^u - 1) + W^2\nabla^2 \phi \end{equation} $$ @@ -170,7 +170,7 @@ The initial condition is set by placing a solid seed in an undercooled system wi | $\tau$ | 1 | Unit time | | $d_0/W$| 0.277 |Microscopic capillary length (with respect to W) | | $a$ | $1/(2\sqrt{2})$ |Antitraping term constant| -|$a_1$| 0.8839 | Coefficient $a_1$ | +|$a_1$| 0.8839 | Coefficient $a_1$ | | $a_2$ | 0.6267 | Coefficient $a_2$ | | $\lambda$ | $a_1W/d_0$ | Parameter $\lambda$ | | $D$ | $a_2\lambda W^2/\tau$ | Solute diffusivity in the liquid | @@ -189,7 +189,7 @@ $$ $$ \begin{equation} -c^{n+1}=c^{n}+\Delta t \left \( D c^n q(\phi^n)\nabla(u^n) + aWc_l^0(1-k)(e^u)^n \left(\frac{\partial \phi}{\partial t}\right)^n\frac{\nabla \phi^n}{|\nabla \phi^n|} \right \) +c^{n+1}=c^{n}+\Delta t \left \( D c^n q(\phi^n)\nabla(u^n) + aWc_l^0(1-k)(e^u)^n \left(\frac{\partial \phi}{\partial t}\right)^n\frac{\nabla \phi^n}{|\nabla \phi^n|} \right \) \end{equation} $$ @@ -215,7 +215,7 @@ $$ $$ \begin{align} -\int_{\Omega} \omega c^{n+1} ~dV =& +\int_{\Omega} \omega c^{n+1} ~dV =& \int_{\Omega} \omega c^{n} ~dV \end{align} $$ @@ -228,7 +228,7 @@ $$ $$ \begin{align} -r_c &= c^{n} +r_c &= c^{n} \end{align} $$ @@ -260,7 +260,7 @@ r_\xi= -f'(\phi^n) - \frac{\lambda}{1-k} g'(\phi^n)[(e^u)^n - 1] \end{equation} $$ -and +and $$ \begin{align} diff --git a/applications/_alloy_solidification_uniform/custom_pde.h b/applications/_alloy_solidification_uniform/custom_pde.h index 918f7ca49..1735fbc2f 100644 --- a/applications/_alloy_solidification_uniform/custom_pde.h +++ b/applications/_alloy_solidification_uniform/custom_pde.h @@ -106,4 +106,4 @@ class CustomPDE : public MatrixFreePDE double D = a2 * lambda * W * W / tau; // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_alloy_solidification_uniform/equations.cc b/applications/_alloy_solidification_uniform/equations.cc index d612af79b..8e20e2475 100644 --- a/applications/_alloy_solidification_uniform/equations.cc +++ b/applications/_alloy_solidification_uniform/equations.cc @@ -45,7 +45,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -245,4 +245,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_alloy_solidification_uniform/main.cc b/applications/_alloy_solidification_uniform/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_alloy_solidification_uniform/main.cc +++ b/applications/_alloy_solidification_uniform/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_anisotropy_facet/ICs_and_BCs.cc b/applications/_anisotropy_facet/ICs_and_BCs.cc index 97d57d38e..c34768095 100644 --- a/applications/_anisotropy_facet/ICs_and_BCs.cc +++ b/applications/_anisotropy_facet/ICs_and_BCs.cc @@ -80,4 +80,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_anisotropy_facet/anisotropy_facet.h b/applications/_anisotropy_facet/anisotropy_facet.h index ef84aea19..a0f28eea6 100644 --- a/applications/_anisotropy_facet/anisotropy_facet.h +++ b/applications/_anisotropy_facet/anisotropy_facet.h @@ -48,4 +48,4 @@ CustomPDE::anisotropy( dgammadnormal[j] -= alpha[i] * w[i] * orient[i][j] * std::pow(mn, w[i] - 1.0); } } -} \ No newline at end of file +} diff --git a/applications/_anisotropy_facet/anisotropy_facet.md b/applications/_anisotropy_facet/anisotropy_facet.md index 7e463bfa4..4df0898e1 100644 --- a/applications/_anisotropy_facet/anisotropy_facet.md +++ b/applications/_anisotropy_facet/anisotropy_facet.md @@ -4,7 +4,7 @@ This application is essentially a specialization of the CHAC\_anisotropyRegarize $$ \begin{equation} - \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 + \frac{\delta^2}{2} (\Delta \eta)^2 ~dV + \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{1}{2} | \gamma( \mathbf{n} ) \nabla \eta |^2 + \frac{\delta^2}{2} (\Delta \eta)^2 ~dV \end{equation} $$ @@ -23,7 +23,7 @@ Following standard variational arguments (see Cahn-Hilliard formulation), we obt $$ \begin{align} - \mu_{c} &= (f_{\alpha,c}(1-H)+f_{\beta,c}H) + \mu_{c} &= (f_{\alpha,c}(1-H)+f_{\beta,c}H) \end{align} $$ @@ -54,7 +54,7 @@ $$ $$ \begin{align} - &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) + &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) \end{align} $$ @@ -62,7 +62,7 @@ and the PDE for Allen-Cahn dynamics is given by: $$ \begin{align} - \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta + \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta \end{align} $$ @@ -80,7 +80,7 @@ $$ \end{align} $$ -and the PDE for Allen-Cahn dynamics becomes +and the PDE for Allen-Cahn dynamics becomes $$ \begin{align} @@ -93,7 +93,7 @@ Considering forward Euler explicit time stepping, we have the time discretized k $$ \begin{align} - \phi^{n+1} &= \Delta \eta^n + \phi^{n+1} &= \Delta \eta^n \end{align} $$ @@ -114,13 +114,13 @@ In the weak formulation, considering an arbitrary variation $w$, the above equat $$ \begin{align} - \int_{\Omega} w \phi^{n+1} ~dV &=\int_{\Omega} \nabla w \cdot \nabla \eta^n ~dV + \int_{\Omega} w \phi^{n+1} ~dV &=\int_{\Omega} \nabla w \cdot \nabla \eta^n ~dV \end{align} $$ $$ \begin{align} -r_{\phi x} &= \nabla \eta^n +r_{\phi x} &= \nabla \eta^n \end{align} $$ @@ -132,7 +132,7 @@ $$ $$ \begin{align} - &=\int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 \phi^n) ~dV + &=\int_{\Omega} w \left( \eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 \phi^n) ~dV \end{align} $$ @@ -148,7 +148,7 @@ r_{\eta x} &= (- \Delta t M_{\eta}) ( \mathbf{m}^n - \delta^2 \phi^n) \end{align} $$ -and +and $$ \begin{align} @@ -170,7 +170,7 @@ $$ $$ \begin{align} -r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta^n) ] +r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta^n) ] \end{align} $$ diff --git a/applications/_anisotropy_facet/custom_pde.h b/applications/_anisotropy_facet/custom_pde.h index d26194af4..bf072a3fa 100644 --- a/applications/_anisotropy_facet/custom_pde.h +++ b/applications/_anisotropy_facet/custom_pde.h @@ -100,4 +100,4 @@ class CustomPDE : public MatrixFreePDE double delta2 = userInputs.get_model_constant_double("delta2"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_anisotropy_facet/equations.cc b/applications/_anisotropy_facet/equations.cc index 1b12c3c7f..842d8b26f 100644 --- a/applications/_anisotropy_facet/equations.cc +++ b/applications/_anisotropy_facet/equations.cc @@ -47,7 +47,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -181,4 +181,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_anisotropy_facet/main.cc b/applications/_anisotropy_facet/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_anisotropy_facet/main.cc +++ b/applications/_anisotropy_facet/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_anisotropy_facet/postprocess.cc b/applications/_anisotropy_facet/postprocess.cc index a2134c7e0..51157b607 100644 --- a/applications/_anisotropy_facet/postprocess.cc +++ b/applications/_anisotropy_facet/postprocess.cc @@ -90,4 +90,4 @@ CustomPDE::postProcessedFields( // --- Submitting the terms for the postprocessing expressions --- pp_variable_list.set_scalar_value_term_rhs(0, f_tot); -} \ No newline at end of file +} diff --git a/applications/_corrosion/ICs_and_BCs.cc b/applications/_corrosion/ICs_and_BCs.cc index ca0f3e9a9..890a1a90f 100644 --- a/applications/_corrosion/ICs_and_BCs.cc +++ b/applications/_corrosion/ICs_and_BCs.cc @@ -94,4 +94,4 @@ if (index == 2){ } */ // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_corrosion/corrosion.md b/applications/_corrosion/corrosion.md index ee7a22fe5..77ba3a141 100644 --- a/applications/_corrosion/corrosion.md +++ b/applications/_corrosion/corrosion.md @@ -63,7 +63,7 @@ z_M c_M + z_+ c_+ + z_-c_- = 0. \end{equation} $$ -Thus, the concentrations are not independent of each other only two additional equations are required to describe the concentration evolution for all three species. The concentrations of the effective metal cation and the supporting electrolyte cation are directly solved and the supporting anion concentration is eliminated via +Thus, the concentrations are not independent of each other only two additional equations are required to describe the concentration evolution for all three species. The concentrations of the effective metal cation and the supporting electrolyte cation are directly solved and the supporting anion concentration is eliminated via $$ \begin{equation} @@ -79,7 +79,7 @@ $$ \end{align} $$ -where $c_i =c_M, c_+$ and $\Phi$ is the electrostatic potential. The last term of the right hand side of +where $c_i =c_M, c_+$ and $\Phi$ is the electrostatic potential. The last term of the right hand side of $$ \begin{align} @@ -95,7 +95,7 @@ $$ \end{equation} $$ -where +where $$ \begin{equation} @@ -115,7 +115,7 @@ where $i_{max,c}$ is the maximum reaction current density, $\beta$ is the the ch $$ \begin{equation} -i_{max,c}=\left( \frac{z_M F}{1-c_M V_M} \right) \left[ \frac{2\delta}{\tau}(c_{M,sat} - c_M ) + \left( D_M\nabla c_M +z_M\frac{F}{RT}D_M c_M \nabla \Phi \right) \cdot \mathbf{n} \right], +i_{max,c}=\left( \frac{z_M F}{1-c_M V_M} \right) \left[ \frac{2\delta}{\tau}(c_{M,sat} - c_M ) + \left( D_M\nabla c_M +z_M\frac{F}{RT}D_M c_M \nabla \Phi \right) \cdot \mathbf{n} \right], \end{equation} $$ @@ -128,7 +128,7 @@ $$ $$ ## Time Discretization -The fields $\eta$, $\psi$, $c_M$ and $c_+$ are solved using an explicit Euler method for time integration. For $\eta$ and $\psi$ we employ a splitting strategy to transform Eqs. +The fields $\eta$, $\psi$, $c_M$ and $c_+$ are solved using an explicit Euler method for time integration. For $\eta$ and $\psi$ we employ a splitting strategy to transform Eqs. $$ \begin{equation} @@ -136,7 +136,7 @@ $$ \end{equation} $$ -and +and $$ \begin{equation} @@ -160,7 +160,7 @@ $$ \end{equation} $$ -where +where $$ \begin{equation} @@ -293,7 +293,7 @@ $$ $$ \begin{align} -\int_{\Omega} \omega c_i^{n+1} dV &=\int_{\Omega} \omega \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n +\int_{\Omega} \omega c_i^{n+1} dV &=\int_{\Omega} \omega \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n +\frac{\Delta t D_i z_i F}{RT\psi^n}\nabla\psi^n\cdot(c_i^n\nabla \Phi^n) +\frac{\Delta t}{z_i F\psi^n} |\nabla\psi^n| i_{rxn}\right) dV \end{align} $$ @@ -306,7 +306,7 @@ $$ $$ \begin{align} -r_{ci} &= \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n +r_{ci} &= \left( c_i^n+\frac{\Delta t D_i}{\psi^n}\nabla\psi^n\cdot\nabla c_i^n +\frac{\Delta t D_i z_i F}{RT\psi^n}\nabla\psi^n\cdot(c_i^n\nabla \Phi^n) +\frac{\Delta t}{z_i F\psi^n} |\nabla\psi^n| i_{rxn}\right) \end{align} $$ diff --git a/applications/_corrosion/custom_pde.h b/applications/_corrosion/custom_pde.h index 753e6b10c..df9c9a847 100644 --- a/applications/_corrosion/custom_pde.h +++ b/applications/_corrosion/custom_pde.h @@ -124,4 +124,4 @@ class CustomPDE : public MatrixFreePDE double deltaV = std::sqrt(2.0 * epssqV / WV); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_corrosion/equations.cc b/applications/_corrosion/equations.cc index b80025b5e..0648c14cc 100644 --- a/applications/_corrosion/equations.cc +++ b/applications/_corrosion/equations.cc @@ -89,7 +89,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -111,7 +111,7 @@ CustomPDE::explicitEquationRHS( // --- Parameters in the explicit equations can be set here --- // Timestep - scalarvalueType delt = constV(userInputs.dtValue); + scalarvalueType dt = constV(userInputs.dtValue); // The order parameter and its derivatives scalarvalueType n = variable_list.template get_value(0); @@ -123,7 +123,7 @@ CustomPDE::explicitEquationRHS( scalarvalueType psi = variable_list.template get_value(2); scalargradType psix = variable_list.template get_gradient(2); - // The chemical potential of the domain patameter + // The chemical potential of the domain parameter scalargradType mupsix = variable_list.template get_gradient(3); // The concentration of metal ion and its derivatives @@ -160,7 +160,7 @@ CustomPDE::explicitEquationRHS( scalarvalueType v = -constV(VMV / (zMV * FarC)) * irxn; // The mobility (including dependence of psi scalarvalueType MnV = MconstV * psi * std::abs(irxn); - // Products needed to calculate the concentraion residual terms + // Products needed to calculate the concentration residual terms // Miscellaneous dot products scalarvalueType psixcMx = constV(0.0); scalarvalueType psixcPx = constV(0.0); @@ -176,27 +176,27 @@ CustomPDE::explicitEquationRHS( } // --- Calculation of residual terms for n --- - scalarvalueType rnV = n + v * delt * magpsix; - scalargradType rnxV = -MnV * delt * mux; + scalarvalueType rnV = n + v * dt * magpsix; + scalargradType rnxV = -MnV * dt * mux; // --- Calculation of residual terms for psi --- - scalarvalueType rpsiV = psi - v * delt * magpsix; - scalargradType rpsixV = -MnV * delt * mupsix; + scalarvalueType rpsiV = psi - v * dt * magpsix; + scalargradType rpsixV = -MnV * dt * mupsix; // --- Calculation of residual terms for cM --- scalarvalueType rcMV = - cM + delt * (constV(DMV) * invpsi * psixcMx + - constV(DMV * zMV * FarC / (RV * TV)) * psixcMPhix * invpsi + - constV(1.0 / (zMV * FarC)) * invpsi * magpsix * irxn); + cM + dt * (constV(DMV) * invpsi * psixcMx + + constV(DMV * zMV * FarC / (RV * TV)) * psixcMPhix * invpsi + + constV(1.0 / (zMV * FarC)) * invpsi * magpsix * irxn); scalargradType rcMxV = - -delt * (DMV * cMx + constV(DMV * zMV * FarC / (RV * TV)) * cM * Phix); + -dt * (DMV * cMx + constV(DMV * zMV * FarC / (RV * TV)) * cM * Phix); // --- Calculation of residual terms for cP --- scalarvalueType rcPV = - cP + delt * (constV(DPV) * invpsi * psixcPx + - constV(DPV * zPV * FarC / (RV * TV)) * psixcPPhix * invpsi); + cP + dt * (constV(DPV) * invpsi * psixcPx + + constV(DPV * zPV * FarC / (RV * TV)) * psixcPPhix * invpsi); scalargradType rcPxV = - -delt * (DPV * cPx + constV(DPV * zPV * FarC / (RV * TV)) * cP * Phix); + -dt * (DPV * cPx + constV(DPV * zPV * FarC / (RV * TV)) * cP * Phix); // --- Submitting the terms for the governing equations --- // Residuals terms for the equation to evolve the order parameter @@ -504,4 +504,4 @@ CustomPDE::capFields(VectorizedArray &ncp, if (psi[j] > 1.0) psicp[j] = 1.0; } -} \ No newline at end of file +} diff --git a/applications/_corrosion/main.cc b/applications/_corrosion/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_corrosion/main.cc +++ b/applications/_corrosion/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_corrosion_microgalvanic/ICs_and_BCs.cc b/applications/_corrosion_microgalvanic/ICs_and_BCs.cc index f9ab6c5fc..09126ff59 100644 --- a/applications/_corrosion_microgalvanic/ICs_and_BCs.cc +++ b/applications/_corrosion_microgalvanic/ICs_and_BCs.cc @@ -124,4 +124,4 @@ if (index == 2){ } */ // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_corrosion_microgalvanic/corrosion_microgalvanic.md b/applications/_corrosion_microgalvanic/corrosion_microgalvanic.md index 3c62411fc..14b1160d4 100644 --- a/applications/_corrosion_microgalvanic/corrosion_microgalvanic.md +++ b/applications/_corrosion_microgalvanic/corrosion_microgalvanic.md @@ -7,7 +7,7 @@ This application simulates the evolution of the metal-electrolyte interface due Consider the free energy functional of the form $$ -\begin{equation} +\begin{equation} \widetilde {\mathcal F} = \int_\Omega \left(f_0\left(\{\varphi_j\},\psi\right)+\frac{\widetilde\epsilon^2}{2}\left(\sum^2_{j=1}|\nabla\varphi_j|^2+|\nabla\psi|^2\right)\right)d\Omega, \end{equation} $$ @@ -15,7 +15,7 @@ $$ where $\widetilde {\mathcal F}$ represents the total free energy of the system scaled by the bulk free energy density coefficient, $W$, and $\tilde{\epsilon}^2=\epsilon/W$ is the rescaled gradient energy coefficient. Here $\psi$ and $\varphi_j$ represent the order parameter for the electrolyte phase and for the $j^{th}$ metal phase respectively. The dimensionless bulk free energy density, $f_0$, is given by $$ -\begin{equation} +\begin{equation} f_0\left(\{\varphi_j\},\psi\right)= \sum^N_{j=1}\left(\frac{\varphi_j^4}{4}-\frac{\varphi_j^2}{2}\right)+\left(\frac{\psi^4}{4}-\frac{\psi^2}{2}\right)+\frac{3}{2}\sum^N_{j=1}\sum^N_{k>j}\varphi_j^2\varphi_k^2+\frac{3}{2}\sum^N_{j=1} \varphi_j^2\psi^2. \end{equation} $$ @@ -27,7 +27,7 @@ In this application, we only consider two phases in the metal: the anodic phase, The evolution of the anodic metal/electrolyte interface is governed by Cahn-Hilliard equations with a source term for $\varphi_1$ and $\psi$, $$ -\begin{equation} +\begin{equation} \frac{\partial \varphi_1}{\partial t} = \nabla \cdot \left(M\nabla\frac{\delta \widetilde F}{\delta \varphi_1} \right)+v\big|\nabla \psi \big| \end{equation} $$ @@ -40,10 +40,10 @@ $$ \end{equation} $$ -Since we do not consider any deposition on the cathodic phase, the evolution of $\varphi_2$ is given by the Cahn-Hilliard equation, +Since we do not consider any deposition on the cathodic phase, the evolution of $\varphi_2$ is given by the Cahn-Hilliard equation, $$ -\begin{equation} +\begin{equation} \frac{\partial\varphi_2}{\partial t}=\nabla \cdot \left(M\nabla\frac{\delta \widetilde F}{\delta \varphi_2} \right) \end{equation} $$ @@ -51,7 +51,7 @@ $$ In the previous Eqs., $M$ is the Cahn-Hilliard mobility coefficient, assumed to be equal for all phases, and $v$ is the velocity of the interface normal to the surface, which is related to the reaction current at the interface via Faraday’s law of electrolysis: $$ -\begin{equation} +\begin{equation} v = -\frac{V_m \xi_1 i_{rxn,1}}{z_mF}. \end{equation} $$ @@ -59,7 +59,7 @@ $$ Here $V_m$ is the molar volume of the metal, $i_{rxn,1}$, is the anodic current density, $z_m$ is the dissolved metal cation charge number, and $F$ is Faraday’s constant. The variable $\xi_1$ is used as a weighing factor for the contribution of the anodic current density over the total current density. This factor is defined in the following section. The interfacial mobility, $M$, is set as a function of the local current density, $$ -\begin{equation} +\begin{equation} M = 2\delta\frac{V_m|\xi_1 i_{rxn,1}|\psi}{z_mF}, \end{equation} $$ @@ -71,7 +71,7 @@ where $2\delta=2\sqrt{2\widetilde{\epsilon}^2}$ gives the equilibrium interfacia In general, the transport of the ionic species in the electrolyte is controlled by migration, diffusion, and convection. Though PRISMS-PF is capable of including diffusion, in this application, the electrolyte is considered to be well-stirred. The current density ${i_e}$ in the electrolyte is given by $$ -\begin{equation} +\begin{equation} {i_e} = -\kappa_e\nabla\Phi_e \end{equation} $$ @@ -87,16 +87,16 @@ $$ At the metal/electrolyte interface, the normal component of ${i_e}$ is equal to $i_{rxn}$ $$ -\begin{equation} +\begin{equation} {i_e}\cdot{\hat n_{m/e}}=i_{rxn}. \end{equation} $$ where ${\hat n_{m/e}}$ is the unit normal vector of the metal/electrolyte interface pointing out of the metal. The previous Eqs. can combined using the Smoothed Boundary Method (SBM) [H.-C. Yu, H.-Y. Chen, and K. Thornton, Model. Simul. Mater. Sci. Eng. **20**, 075008 -(2012)] to obtain an expression for $\Phi_e$ within the electrolyte that includes the appropriate boundary condition at the metal/electrolyte interface. For this system, the SBM is applied with $\psi$ as the domain parameter. The resulting equation for $\Phi_e$ is given by +(2012)] to obtain an expression for $\Phi_e$ within the electrolyte that includes the appropriate boundary condition at the metal/electrolyte interface. For this system, the SBM is applied with $\psi$ as the domain parameter. The resulting equation for $\Phi_e$ is given by $$ -\begin{equation} +\begin{equation} \nabla\cdot\left(\psi\kappa_e\nabla\Phi_e\right) =-|\nabla\psi|i_{rxn}. \end{equation} $$ @@ -128,7 +128,7 @@ $$ where $i_{corr,2}$ is the corrosion current density of the cathodic phase, $\eta_2$ is the cathodic overpotential which is given in the same form as its anodic counterpart: $$ -\begin{equation} +\begin{equation} \eta_2 = \Phi_m - \Phi_e - E_{corr,2}, \end{equation} $$ @@ -152,7 +152,7 @@ $$ and $$ -\begin{equation} +\begin{equation} \xi_{1} = 1- \varphi_2, \end{equation} $$ @@ -183,7 +183,7 @@ $$ \end{equation} $$ -where +where $$ \begin{equation} @@ -294,7 +294,7 @@ r_{1 x} &= \left(-\Delta t M\nabla\mu_1^{n}\right) $$ $$ -\begin{align} +\begin{align} \int_\Omega \omega \varphi_2^{n+1}dV = \int_\Omega \omega \varphi_2^n dV + \int_\Omega \nabla\omega\cdot \left(-\Delta t M\nabla\mu_2^{n}\right) dV \end{align} $$ @@ -348,7 +348,7 @@ r_{\mu 1 x} &= \left(\widetilde{\epsilon}^2\nabla\varphi^n_1\right) $$ $$ -\begin{align} +\begin{align} \int_\Omega \omega\mu_2^{n+1} dV = \int_\Omega \omega f^n_2 dV +\int_\Omega \nabla\omega\cdot \left(\widetilde{\epsilon}^2\nabla\varphi^n_2\right) dV \end{align} $$ @@ -389,7 +389,7 @@ $$ \begin{align} \int_\Omega \omega \left(\left(\frac{\partial i_{rxn}}{\partial\Phi_e}\right)_{\Phi_e = \Phi_e^0}|\nabla\psi|\Delta\Phi_e\right)dV \end{align} -$$ +$$ $$ \begin{align} @@ -438,32 +438,31 @@ The above values of are used to define the equation terms in the input file: |Name in the model equations | Variable/parameter name in the code | |----------------------------|-------------------------------------| -| $\varphi_1$ | nAnodic | -| $\varphi_2$ | nCathodic | -| $\psi$ | psi | -| $v$ | v | -| $M$ | MnV | -| $V_m$ | VMV | -| $z_m$ | zMV | -| $\delta$ | delta | -| $\widetilde{{\epsilon}}^2$ | epssqV | -| $\kappa_e$ | kappa | -| $\Phi_e$ | Phi | -| $i_{corr,1}$ | i0Anodic | -| $i_{corr,2}$ | i0Cathodic | -| $i_{rxn,1}$ | iAnodic | -| $i_{rxn,2}$ | iCathodic | -| $i_{max}$ | iMax | -| $\eta_1$ | etaAnodic | -| $\eta_2$ | etaCathodic | -| \xi_1$ | xiAnodic | -| $\xi_2$ | xiCathodic | -| $A_1$ | AAnodic | -| $A_2$ | ACathodic | -| $E_{corr,1}$ | EcorrAnodic | -| $E_{corr,2}$ | EcorrCathodic | -| $\zeta$ | lthresh | +| $\varphi_1$ | nAnodic | +| $\varphi_2$ | nCathodic | +| $\psi$ | psi | +| $v$ | v | +| $M$ | MnV | +| $V_m$ | VMV | +| $z_m$ | zMV | +| $\delta$ | delta | +| $\widetilde{{\epsilon}}^2$ | epssqV | +| $\kappa_e$ | kappa | +| $\Phi_e$ | Phi | +| $i_{corr,1}$ | i0Anodic | +| $i_{corr,2}$ | i0Cathodic | +| $i_{rxn,1}$ | iAnodic | +| $i_{rxn,2}$ | iCathodic | +| $i_{max}$ | iMax | +| $\eta_1$ | etaAnodic | +| $\eta_2$ | etaCathodic | +| \xi_1$ | xiAnodic | +| $\xi_2$ | xiCathodic | +| $A_1$ | AAnodic | +| $A_2$ | ACathodic | +| $E_{corr,1}$ | EcorrAnodic | +| $E_{corr,2}$ | EcorrCathodic | +| $\zeta$ | lthresh | Table 1: Variables/parameters names used in the model equations and the corresponding names used in the code - diff --git a/applications/_corrosion_microgalvanic/custom_pde.h b/applications/_corrosion_microgalvanic/custom_pde.h index 5a0ceb7a9..5240f1da6 100644 --- a/applications/_corrosion_microgalvanic/custom_pde.h +++ b/applications/_corrosion_microgalvanic/custom_pde.h @@ -112,4 +112,4 @@ class CustomPDE : public MatrixFreePDE double MconstV = 2.0 * (VMV / (zMV * FarC)) * deltaV; // Constant prefactor for mobility // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_corrosion_microgalvanic/equations.cc b/applications/_corrosion_microgalvanic/equations.cc index 5e80860be..ece68a55c 100644 --- a/applications/_corrosion_microgalvanic/equations.cc +++ b/applications/_corrosion_microgalvanic/equations.cc @@ -110,7 +110,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -132,7 +132,7 @@ CustomPDE::explicitEquationRHS( // --- Parameters in the explicit equations can be set here --- // Timestep - scalarvalueType delt = constV(userInputs.dtValue); + scalarvalueType dt = constV(userInputs.dtValue); // The order parameter of the anodic phase scalarvalueType nAnodic = variable_list.template get_value(0); @@ -217,16 +217,16 @@ CustomPDE::explicitEquationRHS( scalarvalueType MnV = MconstV * psi * abs(xiAnodic * iAnodic); // --- Calculation of residual terms for nAnodic --- - scalarvalueType rnAnodic = nAnodic + v * delt * magpsix; - scalargradType rnAnodicx = -MnV * delt * muAnodicx; + scalarvalueType rnAnodic = nAnodic + v * dt * magpsix; + scalargradType rnAnodicx = -MnV * dt * muAnodicx; // --- Calculation of residual terms for nCathodic --- scalarvalueType rnCathodic = nCathodic; - scalargradType rnCathodicx = -MnV * delt * muCathodicx; + scalargradType rnCathodicx = -MnV * dt * muCathodicx; // --- Calculation of residual terms for psi --- - scalarvalueType rpsi = psi - v * delt * magpsix; - scalargradType rpsix = -MnV * delt * mupsix; + scalarvalueType rpsi = psi - v * dt * magpsix; + scalargradType rpsix = -MnV * dt * mupsix; // --- Submitting the terms for the governing equations --- // Residuals terms for the equation to evolve the order parameter @@ -470,4 +470,4 @@ CustomPDE::equationLHS( // Residuals for the equation to evolve the potential(Phi) variable_list.set_scalar_value_term_lhs(6, rDPhi); variable_list.set_scalar_gradient_term_lhs(6, rDPhix); -} \ No newline at end of file +} diff --git a/applications/_corrosion_microgalvanic/main.cc b/applications/_corrosion_microgalvanic/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_corrosion_microgalvanic/main.cc +++ b/applications/_corrosion_microgalvanic/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_dendritic_solidification/ICs_and_BCs.cc b/applications/_dendritic_solidification/ICs_and_BCs.cc index a2a79d920..f682b3706 100644 --- a/applications/_dendritic_solidification/ICs_and_BCs.cc +++ b/applications/_dendritic_solidification/ICs_and_BCs.cc @@ -83,4 +83,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_dendritic_solidification/custom_pde.h b/applications/_dendritic_solidification/custom_pde.h index 131642c24..3354baa86 100644 --- a/applications/_dendritic_solidification/custom_pde.h +++ b/applications/_dendritic_solidification/custom_pde.h @@ -97,4 +97,4 @@ class CustomPDE : public MatrixFreePDE double mult = userInputs.get_model_constant_double("mult"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_dendritic_solidification/dendriticSolidification.md b/applications/_dendritic_solidification/dendriticSolidification.md index 2f8d0db99..cd2e76523 100644 --- a/applications/_dendritic_solidification/dendriticSolidification.md +++ b/applications/_dendritic_solidification/dendriticSolidification.md @@ -11,7 +11,7 @@ Consider a free energy density given by: $$ \begin{equation} - \Pi = \int_{\Omega} \left[ \frac{1}{2} W^2(\hat{n})|\nabla \phi|^2+f(\phi,u) \right] ~dV + \Pi = \int_{\Omega} \left[ \frac{1}{2} W^2(\hat{n})|\nabla \phi|^2+f(\phi,u) \right] ~dV \end{equation} $$ @@ -31,7 +31,7 @@ f(\phi,u) = -\frac{1}{2}\phi^2 + \frac{1}{4}\phi^4 + \lambda u \phi \left(1-\fra \end{equation} $$ -where $\lambda$ is a dimensionless coupling constant. The gradient energy coefficient, $W$, is given by +where $\lambda$ is a dimensionless coupling constant. The gradient energy coefficient, $W$, is given by $$ \begin{equation} @@ -46,7 +46,7 @@ The evolution equations are: $$ \begin{gather} \frac{\partial u}{\partial t} = D \nabla^2 u + \frac{1}{2} \frac{\partial \phi}{\partial t} \\ -\tau(\hat{n}) \frac{\partial \phi}{\partial t} = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\tau(\hat{n}) \frac{\partial \phi}{\partial t} = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] \end{gather} $$ @@ -65,7 +65,7 @@ $$ \begin{gather} \frac{\partial u}{\partial t} = D \nabla^2 u + \frac{\mu}{2 \tau} \\ \tau(\hat{n}) \frac{\partial \phi}{\partial t} = \mu \\ -\mu = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] +\mu = -\frac{\partial f}{\partial \phi} + \nabla \cdot \left[W^2(\theta) \nabla \phi \right]+ \frac{\partial}{\partial x} \left[ |\nabla \phi|^2 W(\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial x} \right)} \right] + \frac{\partial}{\partial y} \left[ |\nabla \phi|^2 W\theta) \frac{\partial W(\theta)}{\partial \left( \frac{\partial \phi}{\partial y} \right)} \right] \end{gather} $$ @@ -90,9 +90,9 @@ $\tau_0$: Controls the phase transformation kinetics, default value of 1.0. $\epsilon_m$: T the strength of the anisotropy, default value of 0.05. -$D$: The thermal diffusion constant, default value of 1.0. +$D$: The thermal diffusion constant, default value of 1.0. -$\Delta: \frac{T_m-T_0}{L/c_p}$: The level of undercooling, default value of 0.75. +$\Delta: \frac{T_m-T_0}{L/c_p}$: The level of undercooling, default value of 0.75. $\theta_0$: The rotation angle of the anisotropy with respect to the simulation frame, default value of 0.125 ($\sim$7.2$^\circ$). @@ -108,7 +108,7 @@ $$ $$ \begin{align} -\mu^{n+1} = \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} +\mu^{n+1} = \left[ \phi^n - \lambda u \left(1 - (\phi^n)^2 \right) \right] \left(1-(\phi^n)^2\right) + \nabla \cdot \bigg[\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} \end{align} $$ @@ -122,13 +122,13 @@ $$ $$ \begin{align} -\int_{\Omega} w u^{n+1} ~dV = \int_{\Omega} w \left(u^{n} + \frac{\mu^n \Delta t}{2 \tau}\right) + \nabla w \cdot (-D \Delta t \nabla u^n) ~dV +\int_{\Omega} w u^{n+1} ~dV = \int_{\Omega} w \left(u^{n} + \frac{\mu^n \Delta t}{2 \tau}\right) + \nabla w \cdot (-D \Delta t \nabla u^n) ~dV \end{align} $$ $$ \begin{align} -\int_{\Omega} w \phi^{n+1} ~dV = \int_{\Omega} w \left(\phi^n + \frac{\Delta t \mu^n}{\tau}\right) ~dV +\int_{\Omega} w \phi^{n+1} ~dV = \int_{\Omega} w \left(\phi^n + \frac{\Delta t \mu^n}{\tau}\right) ~dV \end{align} $$ @@ -159,7 +159,7 @@ $$ $$ \begin{align} &+ \nabla w \cdot \bigg[-\left(W^2 \frac{\partial \phi^n}{\partial x} + W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial y}\right)\hat{x} -&- \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] ~dV +&- \left(W^2 \frac{\partial \phi^n}{\partial y} -W_0 \epsilon_m m W(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right) \hat{y} \bigg] ~dV \end{align} $$ diff --git a/applications/_dendritic_solidification/equations.cc b/applications/_dendritic_solidification/equations.cc index 2d6d95555..651473283 100644 --- a/applications/_dendritic_solidification/equations.cc +++ b/applications/_dendritic_solidification/equations.cc @@ -45,7 +45,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -196,4 +196,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_dendritic_solidification/main.cc b/applications/_dendritic_solidification/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_dendritic_solidification/main.cc +++ b/applications/_dendritic_solidification/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_fickian_diffusion/ICs_and_BCs.cc b/applications/_fickian_diffusion/ICs_and_BCs.cc index 245d57239..4dd7373ea 100644 --- a/applications/_fickian_diffusion/ICs_and_BCs.cc +++ b/applications/_fickian_diffusion/ICs_and_BCs.cc @@ -51,4 +51,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_fickian_diffusion/custom_pde.h b/applications/_fickian_diffusion/custom_pde.h index 7df6a3816..3ed561c36 100644 --- a/applications/_fickian_diffusion/custom_pde.h +++ b/applications/_fickian_diffusion/custom_pde.h @@ -92,4 +92,4 @@ class CustomPDE : public MatrixFreePDE double DcV = userInputs.get_model_constant_double("DcV"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_fickian_diffusion/equations.cc b/applications/_fickian_diffusion/equations.cc index e759d5124..54dc53d33 100644 --- a/applications/_fickian_diffusion/equations.cc +++ b/applications/_fickian_diffusion/equations.cc @@ -29,7 +29,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -132,4 +132,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_fickian_diffusion/formulation_fickianFlux.md b/applications/_fickian_diffusion/formulation_fickianFlux.md index 58bf390e4..c626749bc 100644 --- a/applications/_fickian_diffusion/formulation_fickianFlux.md +++ b/applications/_fickian_diffusion/formulation_fickianFlux.md @@ -29,13 +29,13 @@ $$ c^{n+1} &= c^{n} + (\Delta t D)~\Delta c^n + \Delta t f^n \end{align} $$ - + ## Weak formulation In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: $$ \begin{align} -\int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w (\Delta t D) \Delta c^n + w \Delta t f^n ~dV +\int_{\Omega} w c^{n+1} ~dV &= \int_{\Omega} w c^{n} + w (\Delta t D) \Delta c^n + w \Delta t f^n ~dV \end{align} $$ @@ -54,19 +54,19 @@ $$ $$ \begin{align} &= \int_{\Omega} w (c^{n}+\Delta t f^n) + \nabla w \cdot (-\Delta t D) \nabla c^n ~dV \quad [\text {assuming flux}~j=0 ] -\end{align} +\end{align} $$ $$ \begin{align} r_c &= c^{n}+\Delta t f^n -\end{align} +\end{align} $$ $$ \begin{align} r_{cx} &= (-\Delta t D) \nabla c^n -\end{align} +\end{align} $$ The above values of $r_{c}$ and $r_{c x}$ are used to define the residuals in the following parameters file: diff --git a/applications/_fickian_diffusion/main.cc b/applications/_fickian_diffusion/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_fickian_diffusion/main.cc +++ b/applications/_fickian_diffusion/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_grainGrowth/ICs_and_BCs.cc b/applications/_grainGrowth/ICs_and_BCs.cc index c2fb579f3..70651adcd 100644 --- a/applications/_grainGrowth/ICs_and_BCs.cc +++ b/applications/_grainGrowth/ICs_and_BCs.cc @@ -179,4 +179,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_grainGrowth/custom_pde.h b/applications/_grainGrowth/custom_pde.h index 2e8d19130..cf327a00c 100644 --- a/applications/_grainGrowth/custom_pde.h +++ b/applications/_grainGrowth/custom_pde.h @@ -94,4 +94,4 @@ class CustomPDE : public MatrixFreePDE double alpha = userInputs.get_model_constant_double("alpha"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_grainGrowth/equations.cc b/applications/_grainGrowth/equations.cc index e38e931f0..5c2aa4868 100644 --- a/applications/_grainGrowth/equations.cc +++ b/applications/_grainGrowth/equations.cc @@ -36,7 +36,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -141,4 +141,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_grainGrowth/grainGrowth.md b/applications/_grainGrowth/grainGrowth.md index e1342cd47..3107bc034 100644 --- a/applications/_grainGrowth/grainGrowth.md +++ b/applications/_grainGrowth/grainGrowth.md @@ -8,12 +8,12 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV + \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV \end{equation} $$ where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. - + ## Variational treatment The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: @@ -32,7 +32,7 @@ $$ \end{equation} $$ -where $L$ is the constant mobility. +where $L$ is the constant mobility. ## Time discretization Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: @@ -42,7 +42,7 @@ $$ \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) \end{align} $$ - + ## Weak formulation In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: @@ -70,5 +70,5 @@ r_{\eta_i x} &= (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) \end{align} $$ -The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: +The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: `applications/grainGrowth/equations.h` diff --git a/applications/_grainGrowth/main.cc b/applications/_grainGrowth/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_grainGrowth/main.cc +++ b/applications/_grainGrowth/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_grainGrowth/postprocess.cc b/applications/_grainGrowth/postprocess.cc index fd6ae79a3..bb36b8101 100644 --- a/applications/_grainGrowth/postprocess.cc +++ b/applications/_grainGrowth/postprocess.cc @@ -130,4 +130,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(0, feature_ids); pp_variable_list.set_scalar_value_term_rhs(1, max_op); -} \ No newline at end of file +} diff --git a/applications/_grainGrowth_dream3d/ICs_and_BCs.cc b/applications/_grainGrowth_dream3d/ICs_and_BCs.cc index 4d9b814be..5dcb9dddb 100644 --- a/applications/_grainGrowth_dream3d/ICs_and_BCs.cc +++ b/applications/_grainGrowth_dream3d/ICs_and_BCs.cc @@ -49,4 +49,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_grainGrowth_dream3d/custom_pde.h b/applications/_grainGrowth_dream3d/custom_pde.h index 2e8d19130..cf327a00c 100644 --- a/applications/_grainGrowth_dream3d/custom_pde.h +++ b/applications/_grainGrowth_dream3d/custom_pde.h @@ -94,4 +94,4 @@ class CustomPDE : public MatrixFreePDE double alpha = userInputs.get_model_constant_double("alpha"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_grainGrowth_dream3d/equations.cc b/applications/_grainGrowth_dream3d/equations.cc index fea799a50..73c33acbb 100644 --- a/applications/_grainGrowth_dream3d/equations.cc +++ b/applications/_grainGrowth_dream3d/equations.cc @@ -47,7 +47,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -152,4 +152,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_grainGrowth_dream3d/grainGrowth.md b/applications/_grainGrowth_dream3d/grainGrowth.md index e1342cd47..3107bc034 100644 --- a/applications/_grainGrowth_dream3d/grainGrowth.md +++ b/applications/_grainGrowth_dream3d/grainGrowth.md @@ -8,12 +8,12 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV + \Pi(\eta_i, \nabla \eta_i) = \int_{\Omega} \left[\sum_{i=1}^N \left(-\frac{1}{2}\eta_i^2+ \frac{1}{4}\eta_i^4 \right) + \alpha \sum_{i=1}^N \sum_{j>i}^N \eta_i^2 \eta_j^2 +\frac{1}{4} \right] + \frac{\kappa}{2} \sum_{i=1}^N |\nabla \eta_i|^2 ~dV \end{equation} $$ where $\eta_i$ is one of $N$ structural order parameters, $\alpha$ is the grain interaction coefficient, and $\kappa$ is the gradient energy coefficient. - + ## Variational treatment The driving force for grain evolution is determined by the variational derivative of the total energy with respect to each order parameter: @@ -32,7 +32,7 @@ $$ \end{equation} $$ -where $L$ is the constant mobility. +where $L$ is the constant mobility. ## Time discretization Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: @@ -42,7 +42,7 @@ $$ \eta_i^{n+1} &= \eta_i^{n} - \Delta t L~\left( -\eta_i^n + (\eta_i^n)^3 + 2 \alpha \eta_i^n \sum_{j \ne i}^N (\eta^n_j)^2 - \kappa \nabla^2 \eta^n_i \right) \end{align} $$ - + ## Weak formulation In the weak formulation, considering an arbitrary variation $w$, the above equation can be expressed as a residual equation: @@ -70,5 +70,5 @@ r_{\eta_i x} &= (-\Delta t L \kappa)~ \cdot (\nabla \eta_i^{n}) \end{align} $$ -The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: +The above values of $r_{\eta_i}$ and $r_{\eta_i x}$ are used to define the residuals in the following parameters file: `applications/grainGrowth/equations.h` diff --git a/applications/_grainGrowth_dream3d/main.cc b/applications/_grainGrowth_dream3d/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_grainGrowth_dream3d/main.cc +++ b/applications/_grainGrowth_dream3d/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_grainGrowth_dream3d/postprocess.cc b/applications/_grainGrowth_dream3d/postprocess.cc index 4b66cdb37..e9b6eb76f 100644 --- a/applications/_grainGrowth_dream3d/postprocess.cc +++ b/applications/_grainGrowth_dream3d/postprocess.cc @@ -142,4 +142,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(0, feature_ids); pp_variable_list.set_scalar_value_term_rhs(1, max_op); -} \ No newline at end of file +} diff --git a/applications/_mechanics/ICs_and_BCs.cc b/applications/_mechanics/ICs_and_BCs.cc index ae2e0e3ce..da244ed82 100644 --- a/applications/_mechanics/ICs_and_BCs.cc +++ b/applications/_mechanics/ICs_and_BCs.cc @@ -53,4 +53,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_mechanics/custom_pde.h b/applications/_mechanics/custom_pde.h index 4786352c1..4603dcefd 100644 --- a/applications/_mechanics/custom_pde.h +++ b/applications/_mechanics/custom_pde.h @@ -94,4 +94,4 @@ class CustomPDE : public MatrixFreePDE userInputs.get_model_constant_elasticity_tensor("compliance"); // ================================================================ -}; \ No newline at end of file +}; diff --git a/applications/_mechanics/equations.cc b/applications/_mechanics/equations.cc index 01073ece9..edf3448fb 100644 --- a/applications/_mechanics/equations.cc +++ b/applications/_mechanics/equations.cc @@ -22,7 +22,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -154,4 +154,4 @@ CustomPDE::equationLHS( // --- Submitting the terms for the governing equations --- variable_list.set_vector_gradient_term_lhs(0, eqx_Du); -} \ No newline at end of file +} diff --git a/applications/_mechanics/main.cc b/applications/_mechanics/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_mechanics/main.cc +++ b/applications/_mechanics/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_mechanics/mechanics.md b/applications/_mechanics/mechanics.md index d3f8d7344..3d5570583 100644 --- a/applications/_mechanics/mechanics.md +++ b/applications/_mechanics/mechanics.md @@ -41,11 +41,11 @@ $$ \end{align} $$ -If surface tractions are zero: +If surface tractions are zero: $$ \begin{align} -R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 +R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 \end{align} $$ @@ -70,7 +70,7 @@ The discretized form of this equation can be written as a matrix inversion probl $$ \begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \epsilon (u+\alpha w) ~dV \bigg{|}_{\alpha=0} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \epsilon (u+\alpha w) ~dV \bigg{|}_{\alpha=0} \end{align} $$ @@ -82,13 +82,13 @@ $$ $$ \begin{align} -&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha}\nabla(u+\alpha w) ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) +&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha}\nabla(u+\alpha w) ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) \end{align} $$ $$ \begin{align} -&= \int_{\Omega} \nabla w :C: \nabla w ~dV +&= \int_{\Omega} \nabla w :C: \nabla w ~dV \end{align} $$ diff --git a/applications/_nucleation_preferential/ICs_and_BCs.cc b/applications/_nucleation_preferential/ICs_and_BCs.cc index 2f01829f3..e066c7fd7 100644 --- a/applications/_nucleation_preferential/ICs_and_BCs.cc +++ b/applications/_nucleation_preferential/ICs_and_BCs.cc @@ -60,4 +60,4 @@ CustomPDE::setNonUniformDirichletBCs( // (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5). // ------------------------------------------------------------------------- -} \ No newline at end of file +} diff --git a/applications/_nucleation_preferential/KKS_nucleation.md b/applications/_nucleation_preferential/KKS_nucleation.md index dcffff64b..789e60de0 100644 --- a/applications/_nucleation_preferential/KKS_nucleation.md +++ b/applications/_nucleation_preferential/KKS_nucleation.md @@ -1,6 +1,6 @@ # KKS Phase Field Model of Precipitate Evolution coupled with nucleation (October 2, 2024) -The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. +The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. ## Precipitate Evolution ### Variational formulation @@ -8,7 +8,7 @@ In the absence of elastic effects total free energy of the 2-component system (n $$ \begin{equation} -\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV +\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV \end{equation} $$ @@ -36,7 +36,7 @@ f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ \end{equation} $$ -In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as +In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogeneous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as $$ \begin{equation} @@ -58,11 +58,11 @@ $$ \end{align} $$ -Given the following parabolic functions for the single-phase homogenous free energies: +Given the following parabolic functions for the single-phase homogeneous free energies: $$ \begin{align} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \end{align} $$ @@ -82,7 +82,7 @@ $$ $$ \begin{align} -c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } +c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } \end{align} $$ @@ -90,7 +90,7 @@ $$ - $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above - $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I -- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface +- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface - $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I - $\kappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface @@ -120,11 +120,11 @@ Now the PDE for Cahn-Hilliard dynamics is given by: $$ \begin{align} - \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) + \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) \end{align} $$ - where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: + where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarantee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: $$ \begin{align} @@ -132,7 +132,7 @@ $$ \end{align} $$ -where $L$ is a constant mobility. +where $L$ is a constant mobility. ### Time discretization Using forward Euler explicit time stepping, the equations from the Kinetics section become: @@ -150,7 +150,7 @@ $$ $$ ### Weak formulation -Writing the equations from the Kinetics section in the weak form, with the arbirary variation given by $w$ yields: +Writing the equations from the Kinetics section in the weak form, with the arbitrary variation given by $w$ yields: $$ \begin{align} @@ -184,7 +184,7 @@ $$ $$ \begin{align} -%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV \end{align} $$ @@ -204,7 +204,7 @@ The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: $$ \begin{equation} -\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta +\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta \end{equation} $$ @@ -238,7 +238,7 @@ $$ $$ \begin{align} -&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV +&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV \end{align} $$ @@ -256,7 +256,7 @@ $$ ## Nucleation method -We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. +We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. ### Nucleation rate @@ -290,7 +290,7 @@ $$ ### Hold time -After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. +After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistence composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. ### Required nucleation inputs @@ -306,11 +306,11 @@ Dimensions (ellipsoidal semiaxes) of precipitate seeds - c - semiaxis in the x-direction -## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ $$ \begin{align} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \end{align} $$ diff --git a/applications/_nucleation_preferential/custom_pde.h b/applications/_nucleation_preferential/custom_pde.h index f181ca2f9..85a0aa70e 100644 --- a/applications/_nucleation_preferential/custom_pde.h +++ b/applications/_nucleation_preferential/custom_pde.h @@ -215,4 +215,4 @@ CustomPDE::adaptive_refinement_criterion() } ++t_cell; } -} \ No newline at end of file +} diff --git a/applications/_nucleation_preferential/equations.cc b/applications/_nucleation_preferential/equations.cc index 2bc5f0fbf..bcb0523cd 100644 --- a/applications/_nucleation_preferential/equations.cc +++ b/applications/_nucleation_preferential/equations.cc @@ -43,7 +43,7 @@ CustomAttributeLoader::load_variable_attributes() } // ============================================================================================= -// explicitEquationRHS (needed only if one or more equation is explict time +// explicitEquationRHS (needed only if one or more equation is explicit time // dependent) // ============================================================================================= // This function calculates the right-hand-side of the explicit time-dependent @@ -229,4 +229,4 @@ CustomPDE::equationLHS( [[maybe_unused]] VariableContainer> &variable_list, [[maybe_unused]] const Point> q_point_loc, [[maybe_unused]] const VectorizedArray element_volume) const -{} \ No newline at end of file +{} diff --git a/applications/_nucleation_preferential/main.cc b/applications/_nucleation_preferential/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/_nucleation_preferential/main.cc +++ b/applications/_nucleation_preferential/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/_nucleation_preferential/nucleation.cc b/applications/_nucleation_preferential/nucleation.cc index 60a3c38fe..08d6e9e32 100644 --- a/applications/_nucleation_preferential/nucleation.cc +++ b/applications/_nucleation_preferential/nucleation.cc @@ -41,4 +41,4 @@ CustomPDE::getNucleationProbability( 1.0 - exp(-J * userInputs.dtValue * ((double) userInputs.steps_between_nucleation_attempts) * dV); return retProb; -} \ No newline at end of file +} diff --git a/applications/allen_cahn_explicit/ICs_and_BCs.cc b/applications/allen_cahn_explicit/ICs_and_BCs.cc index 3c7383e47..23e8f24bd 100644 --- a/applications/allen_cahn_explicit/ICs_and_BCs.cc +++ b/applications/allen_cahn_explicit/ICs_and_BCs.cc @@ -71,4 +71,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/allen_cahn_explicit/allen_cahn.md b/applications/allen_cahn_explicit/allen_cahn.md index 620c1ad0a..bd5083550 100644 --- a/applications/allen_cahn_explicit/allen_cahn.md +++ b/applications/allen_cahn_explicit/allen_cahn.md @@ -3,7 +3,7 @@ Consider a free energy expression of the form: $$ \begin{align} -\Pi(\eta, \nabla \eta) = \int_{\Omega} f(\eta) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV +\Pi(\eta, \nabla \eta) = \int_{\Omega} f(\eta) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV \end{align} $$ @@ -62,7 +62,7 @@ $$ $$ \begin{align} -r_{\eta}= \eta^{n} - \Delta t M f_{,\eta}^{n} +r_{\eta}= \eta^{n} - \Delta t M f_{,\eta}^{n} \end{align} $$ @@ -72,4 +72,4 @@ r_{\eta x} = -\Delta t M \kappa\nabla \eta^{n} \end{align} $$ -The above values of $r_{\eta}$ and $r_{\eta x}$ are used to define the residuals in `applications/allen_cahn/equations.cc`. \ No newline at end of file +The above values of $r_{\eta}$ and $r_{\eta x}$ are used to define the residuals in `applications/allen_cahn/equations.cc`. diff --git a/applications/allen_cahn_explicit/custom_pde.h b/applications/allen_cahn_explicit/custom_pde.h index 2ef191b39..836e17d71 100644 --- a/applications/allen_cahn_explicit/custom_pde.h +++ b/applications/allen_cahn_explicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KnV = get_user_inputs().get_user_constants().get_model_constant_double("KnV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/allen_cahn_explicit/equations.cc b/applications/allen_cahn_explicit/equations.cc index e34df43b9..179389b85 100644 --- a/applications/allen_cahn_explicit/equations.cc +++ b/applications/allen_cahn_explicit/equations.cc @@ -100,4 +100,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/allen_cahn_explicit/main.cc b/applications/allen_cahn_explicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/allen_cahn_explicit/main.cc +++ b/applications/allen_cahn_explicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/allen_cahn_explicit/parameters.prm b/applications/allen_cahn_explicit/parameters.prm index eba301b59..b0617d2d5 100644 --- a/applications/allen_cahn_explicit/parameters.prm +++ b/applications/allen_cahn_explicit/parameters.prm @@ -26,23 +26,23 @@ set time step = 1.0e-2 # The total number of timesteps to take set number steps = 5000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 5 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for n = Natural -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant MnV = 1.0, DOUBLE set Model constant KnV = 2.0, DOUBLE diff --git a/applications/alloy_solidification/ICs_and_BCs.cc b/applications/alloy_solidification/ICs_and_BCs.cc index de7278163..241a30411 100644 --- a/applications/alloy_solidification/ICs_and_BCs.cc +++ b/applications/alloy_solidification/ICs_and_BCs.cc @@ -38,7 +38,7 @@ CustomPDE::set_initial_condition( else if (index == 1) { // For the order parameter, we just place a small seed. Note that - // the order parameter ranges from -1 to 1 in thi model. + // the order parameter ranges from -1 to 1 in this model. for (unsigned int dir = 0; dir < dim; dir++) { dist += (point[dir] - diff --git a/applications/alloy_solidification/alloy_solidification.md b/applications/alloy_solidification/alloy_solidification.md index ce23a9b02..e454f4520 100644 --- a/applications/alloy_solidification/alloy_solidification.md +++ b/applications/alloy_solidification/alloy_solidification.md @@ -1,6 +1,6 @@ # PRISMS-PF Application Formulation: alloySolidification -This example application [1] implements a simple model to simulate the directional solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. +This example application [1] implements a simple model to simulate the directional solidification of a binary alloy A-B in the dilute limit with component B acting as a solute in a matrix of A. The implemented model was introduced by Echebarria et al. [2] in 2004. In this model, latent heat is assumed to diffuse much faster than impurities and, therefore, the temperature field is considered to be fixed by external conditions. In the default settings of the application, the simulation starts with a circular solid in the corner of an elongated system which evolves as a system is cooled under a uniform thermal gradient and constant cooling rate. As this seed grows, three variables are tracked: an order parameter, $\phi$, that denotes whether the material is a liquid ($\phi=-1$) or solid ($\phi=1$), @@ -43,7 +43,7 @@ and $$ \begin{equation} -\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{\jmath}_{at} \right), +\frac{\partial c}{\partial t} = \nabla \cdot \left(\ M(\phi,c) \frac{\delta \mathcal{F}}{\delta c} - \vec{\jmath}_{at} \right), \end{equation} $$ @@ -92,7 +92,7 @@ $$ \end{equation} $$ -and +and $$ \begin{equation} @@ -135,8 +135,8 @@ $$ \end{equation} $$ -The function $a_s$ is the anisotropy factor for the solid-liquid interfacial energy, which depends on the outward normal (with respect to the solid) of the interface, -$\hat{n}=-\nabla \phi / |\nabla \phi|$. For a solid phase with $m$-fold symmetry this factor is given by +The function $a_s$ is the anisotropy factor for the solid-liquid interfacial energy, which depends on the outward normal (with respect to the solid) of the interface, +$\hat{n}=-\nabla \phi / |\nabla \phi|$. For a solid phase with $m$-fold symmetry this factor is given by $$ \begin{equation} @@ -146,15 +146,15 @@ $$ (In the implementation of the current model, $m$ is set to 4 and $\theta_0=0$. For the purpose of computational efficiency, explicit calculation of trigonometric functions (and their inverse) is avoided. Thus, all sine and cosine terms with argument $m\theta$ are evaluated as $\sin(m\theta)=4\cos^3\theta\sin\theta-4\cos\theta\sin^3\theta$ and $\cos(m\theta)=\cos^4\theta -6\cos^2\theta\sin^2\theta-\sin^4\theta$, where $\sin\theta=\partial_y\phi / |\nabla \phi|$ and $\cos\theta=\partial_x\phi / |\nabla \phi|$.) -where $\epsilon_m$ determines the strength of the anisotropy, $\theta$ is the in-plane azimuthal angle of the normal vector with respect to the positive $x$-direction and $\theta_0$ is the reference orientation of the solid grains. The angle $\theta$ is related to the normal derivatives of $\phi$ at the interface via +where $\epsilon_m$ determines the strength of the anisotropy, $\theta$ is the in-plane azimuthal angle of the normal vector with respect to the positive $x$-direction and $\theta_0$ is the reference orientation of the solid grains. The angle $\theta$ is related to the normal derivatives of $\phi$ at the interface via $$ \begin{equation} -\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. +\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. \end{equation} $$ -In +In $$ \begin{align} @@ -177,9 +177,9 @@ d_0=\frac{\gamma T_m}{L |m| (1-k) c_l^0}. \end{equation} $$ -In the previous equation, $\gamma$ is the equilibrium surface tension and $L$ is the latent heat of fusion per volume. -Finally, $\tilde{y}$, $\tilde{V}_p$, $\tilde{l}_T$ and $\tilde{D}$ are all dimensionless parameters, calculated by taking the unit length as $W$ and the unit time as $\tau_0=0.6267\lambda W^2/D$, -where $D$ is the solute diffusivity in the liquid. The coordinate, $\tilde{y}$, represents the position along the direction of the thermal gradient, $\tilde{V}_p$ is the steady-state solidification speed, +In the previous equation, $\gamma$ is the equilibrium surface tension and $L$ is the latent heat of fusion per volume. +Finally, $\tilde{y}$, $\tilde{V}_p$, $\tilde{l}_T$ and $\tilde{D}$ are all dimensionless parameters, calculated by taking the unit length as $W$ and the unit time as $\tau_0=0.6267\lambda W^2/D$, +where $D$ is the solute diffusivity in the liquid. The coordinate, $\tilde{y}$, represents the position along the direction of the thermal gradient, $\tilde{V}_p$ is the steady-state solidification speed, $\tilde{l}_T$ is the thermal length, calculated as $$ @@ -189,8 +189,8 @@ $$ $$ -where $\tilde{G}$ is the dimensionless thermal gradient, and $\tilde{D}$ is the dimensionless solute diffusivity in the liquid. Note that Eqs. 10 through 15 -are equivalent to Eqs. (132) and (133) from Ref. [2], except for the expression for the phase-field relaxation time $\tau_\phi$ which, for this application, was chosen to be $U$-dependent, +where $\tilde{G}$ is the dimensionless thermal gradient, and $\tilde{D}$ is the dimensionless solute diffusivity in the liquid. Note that Eqs. 10 through 15 +are equivalent to Eqs. (132) and (133) from Ref. [2], except for the expression for the phase-field relaxation time $\tau_\phi$ which, for this application, was chosen to be $U$-dependent, as defined by Eq. (123) from Ref. [2]. @@ -217,11 +217,11 @@ $$ \end{align} $$ -along with +along with $$ \begin{equation} -\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. +\tan(\theta) = \frac{\partial \phi / \partial y}{\partial \phi / \partial x}. \end{equation} $$ @@ -284,7 +284,7 @@ $$ $$ \begin{align} -& \left . + \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right)\hat{y}\right] +& \left . + \left(a_s^2(\theta^n) \frac{\partial \phi^n}{\partial y} - \epsilon_m m a_s(\theta^n) \sin \left[ m \left(\theta^n - \theta_0 \right) \right] \frac{\partial \phi^n}{\partial x}\right)\hat{y}\right] \end{align} $$ @@ -310,7 +310,7 @@ r_{\phi} &= \left(\phi^n + \frac{ \xi^n}{\tau_\phi}\Delta t\right) $$ -For the weak form of +For the weak form of $$ \begin{align} @@ -330,7 +330,7 @@ into the gradient of $1/\tau_U$: $$ \begin{align} -\int_{\Omega} \omega U^{n+1} ~dV =& +\int_{\Omega} \omega U^{n+1} ~dV =& \int_{\Omega} \omega \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) ~dV \end{align} $$ @@ -343,7 +343,7 @@ $$ $$ \begin{align} -r_U &= \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) +r_U &= \left( U^{n} + \frac{\Delta t}{2\tau_U\tau_\phi}[1+(1-k)U^n]\xi^n - \frac{\Delta t (1-k)}{2\tau_U^2} \nabla \phi \cdot \left[\tilde{D}\frac{1-\phi^n}{2}\nabla U^n-\vec{\jmath}_{at}^{\,U}\right] \right) \end{align} $$ diff --git a/applications/alloy_solidification/custom_pde.h b/applications/alloy_solidification/custom_pde.h index 782dc5ec8..394f29e40 100644 --- a/applications/alloy_solidification/custom_pde.h +++ b/applications/alloy_solidification/custom_pde.h @@ -138,8 +138,8 @@ class CustomPDE : public PDEOperator number epsilon = get_user_inputs().get_user_constants().get_model_constant_double("epsilon"); number k = get_user_inputs().get_user_constants().get_model_constant_double("k"); - number lamda = - get_user_inputs().get_user_constants().get_model_constant_double("lamda"); + number lambda = + get_user_inputs().get_user_constants().get_model_constant_double("lambda"); number Dtilde = get_user_inputs().get_user_constants().get_model_constant_double("Dtilde"); @@ -152,4 +152,4 @@ class CustomPDE : public PDEOperator get_user_inputs().get_user_constants().get_model_constant_double("regval"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/alloy_solidification/equations.cc b/applications/alloy_solidification/equations.cc index ba1b37a1f..5e0890146 100644 --- a/applications/alloy_solidification/equations.cc +++ b/applications/alloy_solidification/equations.cc @@ -78,10 +78,10 @@ CustomPDE::compute_explicit_rhs( // Anisotropic term ScalarValue a_n = 1.0 + (epsilon * c4th); - // coeffcient before phi + // coefficient before phi ScalarValue tau_phi = (1.0 + (1.0 - k) * U) * a_n * a_n; - // coeffcient before U + // coefficient before U ScalarValue tau_U = (((1.0 + k) / 2.0) - ((1.0 - k) * phi / 2.0)); // Antitrapping term @@ -167,7 +167,7 @@ CustomPDE::compute_nonexplicit_rhs( // Define the terms in the equations ScalarValue eq_xi = phi - (phi * phi * phi) - - (lamda * (1.0 - phi * phi) * (1.0 - phi * phi) * (U + tep + U_off)); + (lambda * (1.0 - phi * phi) * (1.0 - phi * phi) * (U + tep + U_off)); ScalarGrad eqx_xi = -aniso; @@ -207,4 +207,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/alloy_solidification/main.cc b/applications/alloy_solidification/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/alloy_solidification/main.cc +++ b/applications/alloy_solidification/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/alloy_solidification/parameters.prm b/applications/alloy_solidification/parameters.prm index 5567058e2..9e2f87d16 100644 --- a/applications/alloy_solidification/parameters.prm +++ b/applications/alloy_solidification/parameters.prm @@ -38,30 +38,30 @@ set time step = 0.002 # The total number of timesteps to take set number steps = 200000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 50 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for U = Natural set boundary condition for phi = Natural set boundary condition for xi = Natural -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant epsilon = 0.01, DOUBLE set Model constant k = 0.14, DOUBLE set Model constant c0 = 3.0, DOUBLE -set Model constant lamda = 20.0, DOUBLE +set Model constant lambda = 20.0, DOUBLE set Model constant Dtilde = 12.534, DOUBLE set Model constant Vtilde = 9.4536, DOUBLE set Model constant ltilde = 21175.7186, DOUBLE diff --git a/applications/blank/ICs_and_BCs.cc b/applications/blank/ICs_and_BCs.cc index 8a71b9787..e2ca59543 100644 --- a/applications/blank/ICs_and_BCs.cc +++ b/applications/blank/ICs_and_BCs.cc @@ -39,4 +39,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/blank/custom_pde.h b/applications/blank/custom_pde.h index 4a1be6579..671dba12e 100644 --- a/applications/blank/custom_pde.h +++ b/applications/blank/custom_pde.h @@ -130,4 +130,4 @@ class CustomPDE : public PDEOperator Types::Index solve_block) const override; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/blank/main.cc b/applications/blank/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/blank/main.cc +++ b/applications/blank/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/cahn_hilliard_explicit/ICs_and_BCs.cc b/applications/cahn_hilliard_explicit/ICs_and_BCs.cc index 18eef38a1..77ed6b52d 100644 --- a/applications/cahn_hilliard_explicit/ICs_and_BCs.cc +++ b/applications/cahn_hilliard_explicit/ICs_and_BCs.cc @@ -77,4 +77,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/cahn_hilliard_explicit/cahn_hilliard.md b/applications/cahn_hilliard_explicit/cahn_hilliard.md index 9e6fc0ce5..4b77a6939 100644 --- a/applications/cahn_hilliard_explicit/cahn_hilliard.md +++ b/applications/cahn_hilliard_explicit/cahn_hilliard.md @@ -3,24 +3,24 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(c, \nabla c) = \int_{\Omega} f( c ) + \frac{\kappa}{2} \nabla c \cdot \nabla c ~dV + \Pi(c, \nabla c) = \int_{\Omega} f( c ) + \frac{\kappa}{2} \nabla c \cdot \nabla c ~dV \end{equation} $$ where $c$ is the composition, and $\kappa$ is the gradient length scale parameter. - + ## Variational treatment Considering variations on the primal field $c$ of the from $c+\epsilon w$, we have $$ \begin{align} -\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(c+\epsilon w) + \frac{\kappa}{2} \nabla (c+\epsilon w) \cdot ~\nabla (c+\epsilon w) ~dV \right\vert_{\epsilon=0} +\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(c+\epsilon w) + \frac{\kappa}{2} \nabla (c+\epsilon w) \cdot ~\nabla (c+\epsilon w) ~dV \right\vert_{\epsilon=0} \end{align} -$$ +$$ $$ \begin{align} -&= \int_{\Omega} w f_{,c} + \kappa \nabla w \nabla c ~dV +&= \int_{\Omega} w f_{,c} + \kappa \nabla w \nabla c ~dV \end{align} $$ @@ -49,7 +49,7 @@ $$ $$ \begin{align} - &=-M~\nabla \cdot (-\nabla (f_{,c} - \kappa \Delta c)) + &=-M~\nabla \cdot (-\nabla (f_{,c} - \kappa \Delta c)) \end{align} $$ @@ -73,7 +73,7 @@ Considering forward Euler explicit time stepping, we have the time discretized k $$ \begin{align} - \mu^{n+1} &= f_{,c}^{n} - \kappa \Delta c^{n} + \mu^{n+1} &= f_{,c}^{n} - \kappa \Delta c^{n} \end{align} $$ @@ -94,7 +94,7 @@ $$ $$ \begin{align} - &=\int_{\Omega} w f_{,c}^{n} + \nabla w \cdot \kappa \nabla c^{n} ~dV + &=\int_{\Omega} w f_{,c}^{n} + \nabla w \cdot \kappa \nabla c^{n} ~dV \end{align} $$ @@ -110,17 +110,17 @@ r_{mux} &= \kappa \nabla c^{n} \end{align} $$ -and +and $$ \begin{align} -\int_{\Omega} w c^{n+1} ~dV&= \int_{\Omega} w c^{n} + w \Delta t M~\nabla \cdot (\nabla \mu^{n}) ~dV +\int_{\Omega} w c^{n+1} ~dV&= \int_{\Omega} w c^{n} + w \Delta t M~\nabla \cdot (\nabla \mu^{n}) ~dV \end{align} $$ $$ \begin{align} -&= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M)~ \cdot (\nabla \mu^{n}) ~dV \quad \text{[neglecting boundary flux]} +&= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M)~ \cdot (\nabla \mu^{n}) ~dV \quad \text{[neglecting boundary flux]} \end{align} $$ @@ -136,5 +136,5 @@ r_{c x} &= (-\Delta t M)~ \cdot (\nabla \mu^{n}) \end{align} $$ -The above values of $r_{mu}$, $r_{mux}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: +The above values of $r_{mu}$, $r_{mux}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: `applications/cahn_hilliard/equations.cc` diff --git a/applications/cahn_hilliard_explicit/custom_pde.h b/applications/cahn_hilliard_explicit/custom_pde.h index 57d24c40b..84a12d931 100644 --- a/applications/cahn_hilliard_explicit/custom_pde.h +++ b/applications/cahn_hilliard_explicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KcV = get_user_inputs().get_user_constants().get_model_constant_double("KcV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/cahn_hilliard_explicit/main.cc b/applications/cahn_hilliard_explicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/cahn_hilliard_explicit/main.cc +++ b/applications/cahn_hilliard_explicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/cahn_hilliard_explicit/parameters.prm b/applications/cahn_hilliard_explicit/parameters.prm index 8d913d891..05e8d2ca4 100644 --- a/applications/cahn_hilliard_explicit/parameters.prm +++ b/applications/cahn_hilliard_explicit/parameters.prm @@ -38,24 +38,24 @@ set time step = 1.0e-3 # The total number of timesteps to take set number steps = 100000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 10 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for c = Natural set boundary condition for mu = Natural -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant McV = 1.0, DOUBLE set Model constant KcV = 1.5, DOUBLE diff --git a/applications/coupled_allen_cahn_cahn_hilliard/ICs_and_BCs.cc b/applications/coupled_allen_cahn_cahn_hilliard/ICs_and_BCs.cc index 1b94b44e9..9f6c3ca1b 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/ICs_and_BCs.cc +++ b/applications/coupled_allen_cahn_cahn_hilliard/ICs_and_BCs.cc @@ -81,4 +81,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/coupled_allen_cahn_cahn_hilliard/coupled_allen_cahn_cahn_hilliard.md b/applications/coupled_allen_cahn_cahn_hilliard/coupled_allen_cahn_cahn_hilliard.md index 95e12e66c..80ea0ef37 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/coupled_allen_cahn_cahn_hilliard.md +++ b/applications/coupled_allen_cahn_cahn_hilliard/coupled_allen_cahn_cahn_hilliard.md @@ -4,7 +4,7 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV + \Pi(c, \eta, \nabla \eta) = \int_{\Omega} \left( f_{\alpha}(1-H) + f_{\beta}H \right) + \frac{\kappa}{2} \nabla \eta \cdot \nabla \eta ~dV \end{equation} $$ @@ -21,7 +21,7 @@ $$ $$ \begin{align} - \mu_{\eta} &= (f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta + \mu_{\eta} &= (f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta \end{align} $$ @@ -36,7 +36,7 @@ $$ $$ \begin{align} - &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) + &=M_c~\nabla \cdot (\nabla (f_{\alpha,c}(1-H)+f_{\beta,c}H)) \end{align} $$ @@ -44,17 +44,17 @@ and the PDE for Allen-Cahn dynamics is given by: $$ \begin{align} - \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta + \frac{\partial \eta}{\partial t} &= -M_\eta \mu_\eta \end{align} $$ $$ \begin{align} - &=-M_\eta ~ ((f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta) + &=-M_\eta ~ ((f_{\beta}-f_{\alpha})H_{,\eta} - \kappa \Delta \eta) \end{align} $$ -where $M_c$ and $M_\eta$ are the constant mobilities. +where $M_c$ and $M_\eta$ are the constant mobilities. ## Time discretization Considering forward Euler explicit time stepping, we have the time discretized kinetics equation: @@ -82,7 +82,7 @@ $$ $$ \begin{align} - &=\int_{\Omega} w \left(\eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}\kappa) \nabla \eta^{n} ~dV + &=\int_{\Omega} w \left(\eta^{n} - \Delta t M_{\eta}~ ((f_{\beta,c}^n-f_{\alpha,c}^n)H_{,\eta}^n) \right)+ \nabla w \cdot (- \Delta t M_{\eta}\kappa) \nabla \eta^{n} ~dV \end{align} $$ @@ -98,7 +98,7 @@ r_{\eta x} &= (- \Delta t M_{\eta}\kappa) \nabla \eta^{n} \end{align} $$ -and +and $$ \begin{align} @@ -120,7 +120,7 @@ $$ $$ \begin{align} -r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] +r_{cx} &= (-\Delta t M_{c})~ [~(f_{\alpha,cc}^n(1-H^{n})+f_{\beta,cc}^n H^{n}) \nabla c + ~((f_{\beta,c}^n-f_{\alpha,c}^n)H^{n}_{,\eta} \nabla \eta) ] \end{align} $$ diff --git a/applications/coupled_allen_cahn_cahn_hilliard/custom_pde.h b/applications/coupled_allen_cahn_cahn_hilliard/custom_pde.h index 042127230..74b28ab8c 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/custom_pde.h +++ b/applications/coupled_allen_cahn_cahn_hilliard/custom_pde.h @@ -148,4 +148,4 @@ class CustomPDE : public PDEOperator "matrix_concentration"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/coupled_allen_cahn_cahn_hilliard/main.cc b/applications/coupled_allen_cahn_cahn_hilliard/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/main.cc +++ b/applications/coupled_allen_cahn_cahn_hilliard/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/coupled_allen_cahn_cahn_hilliard/parameters.prm b/applications/coupled_allen_cahn_cahn_hilliard/parameters.prm index 6305b76f9..e902aecbd 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/parameters.prm +++ b/applications/coupled_allen_cahn_cahn_hilliard/parameters.prm @@ -43,24 +43,24 @@ set time step = 8.0e-4 # The total number of timesteps to take set number steps = 150000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 10 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for c = Natural set boundary condition for n = Natural -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant Mc = 1.0, DOUBLE set Model constant Mn = 150.0, DOUBLE @@ -70,4 +70,3 @@ set Model constant center2 = (75,75,75), TENSOR set Model constant radius1 = 20.0, DOUBLE set Model constant radius2 = 8.33333333333, DOUBLE set Model constant matrix_concentration = 0.009, DOUBLE - diff --git a/applications/coupled_allen_cahn_cahn_hilliard/postprocess.cc b/applications/coupled_allen_cahn_cahn_hilliard/postprocess.cc index 0c65ec351..592e23fb3 100644 --- a/applications/coupled_allen_cahn_cahn_hilliard/postprocess.cc +++ b/applications/coupled_allen_cahn_cahn_hilliard/postprocess.cc @@ -76,7 +76,7 @@ CustomPDE::postProcessedFields( // Interpolation function and its derivative scalarvalueType h = (10.0 * n * n * n - 15.0 * n * n * n * n + 6.0 * n * n * n * n * n); - // The homogenous free energy + // The homogeneous free energy scalarvalueType f_chem = (constV(1.0) - h) * fa + h * fb; // The gradient free energy @@ -101,4 +101,4 @@ CustomPDE::postProcessedFields( pp_variable_list.set_scalar_value_term_rhs(0, f_tot); pp_variable_list.set_scalar_value_term_rhs(1, mag_grad_c); -} \ No newline at end of file +} diff --git a/applications/eshelby_inclusion/ICs_and_BCs.cc b/applications/eshelby_inclusion/ICs_and_BCs.cc index 666923113..e6dbdc978 100644 --- a/applications/eshelby_inclusion/ICs_and_BCs.cc +++ b/applications/eshelby_inclusion/ICs_and_BCs.cc @@ -37,4 +37,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/eshelby_inclusion/custom_pde.h b/applications/eshelby_inclusion/custom_pde.h index 0ae46b36c..b6d27fb7d 100644 --- a/applications/eshelby_inclusion/custom_pde.h +++ b/applications/eshelby_inclusion/custom_pde.h @@ -135,4 +135,4 @@ class CustomPDE : public PDEOperator "compliance"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/eshelby_inclusion/equations.cc b/applications/eshelby_inclusion/equations.cc index e78afd9da..054943557 100644 --- a/applications/eshelby_inclusion/equations.cc +++ b/applications/eshelby_inclusion/equations.cc @@ -107,4 +107,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/eshelby_inclusion/eshelby_inclusion.md b/applications/eshelby_inclusion/eshelby_inclusion.md index 913a72bb6..2694e5446 100644 --- a/applications/eshelby_inclusion/eshelby_inclusion.md +++ b/applications/eshelby_inclusion/eshelby_inclusion.md @@ -1,6 +1,6 @@ # PRISMS-PF Application Formulation: eshelbyInclusion -This example application implements a simple 3D calculation of the displacement field near a homogenous inclusion. +This example application implements a simple 3D calculation of the displacement field near a homogeneous inclusion. Consider a strain energy expression of the form: @@ -41,11 +41,11 @@ $$ \end{align} $$ -If surface tractions are zero: +If surface tractions are zero: $$ \begin{align} -R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 +R &= \int_{\Omega} \nabla w : \sigma ~dV = 0 \end{align} $$ @@ -62,7 +62,7 @@ where $\Delta u = u - u_0$. Then, applying the discretization that $u = \sum_i w $$ \begin{equation} -\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) +\frac{\delta R(u)}{\delta u} \Delta U = -R(u_0) \end{equation} $$ @@ -70,7 +70,7 @@ The discretized form of this equation can be written as a matrix inversion probl $$ \begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \end{align} $$ @@ -82,13 +82,13 @@ $$ $$ \begin{align} -&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) +&= \int_{\Omega} \nabla w :C: \frac{d}{d\alpha} \left[ \nabla(u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \quad (due ~to ~the ~symmetry ~of ~C) \end{align} $$ $$ \begin{align} -&= \int_{\Omega} \nabla w :C: \nabla w ~dV +&= \int_{\Omega} \nabla w :C: \nabla w ~dV \end{align} $$ diff --git a/applications/eshelby_inclusion/main.cc b/applications/eshelby_inclusion/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/eshelby_inclusion/main.cc +++ b/applications/eshelby_inclusion/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/eshelby_inclusion/parameters.prm b/applications/eshelby_inclusion/parameters.prm index d6e48aa5e..7bcba3ce6 100644 --- a/applications/eshelby_inclusion/parameters.prm +++ b/applications/eshelby_inclusion/parameters.prm @@ -20,7 +20,7 @@ subsection Rectangular mesh set z subdivisions = 1 end -# The linear solve parameters. The type of residual can either be AbsoluteResidual or +# The linear solve parameters. The type of residual can either be AbsoluteResidual or # RelativeResidual. The preconditioner type can either be none or geometric multigrid # (GMG). The parameters smoothing range, degree, eigenvalue cg iterations, and min # multigrid level are specific to GMG and can be changed to suite your problem. @@ -36,16 +36,16 @@ subsection linear solver parameters: u end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for u, x component = Dirichlet: 0.0, Dirichlet: 0.0, Natural, Dirichlet: 0.0, Natural, Dirichlet: 0.0 set boundary condition for u, y component = Natural, Dirichlet: 0.0, Dirichlet: 0.0, Dirichlet: 0.0, Natural, Dirichlet: 0.0 set boundary condition for u, z component = Natural, Dirichlet: 0.0, Natural, Dirichlet: 0.0, Dirichlet: 0.0, Dirichlet: 0.0 -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant compliance = (22.5,0.3), isotropic elastic constants diff --git a/applications/nucleation/ICs_and_BCs.cc b/applications/nucleation/ICs_and_BCs.cc index 42ccbe110..ff008e7c8 100644 --- a/applications/nucleation/ICs_and_BCs.cc +++ b/applications/nucleation/ICs_and_BCs.cc @@ -48,4 +48,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/nucleation/KKS_nucleation.md b/applications/nucleation/KKS_nucleation.md index dcffff64b..789e60de0 100644 --- a/applications/nucleation/KKS_nucleation.md +++ b/applications/nucleation/KKS_nucleation.md @@ -1,6 +1,6 @@ # KKS Phase Field Model of Precipitate Evolution coupled with nucleation (October 2, 2024) -The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. +The Nucleation Model application for PRISMS-PF incorporates a stochastic method to add nuclei to the KKS phase field model for precipitate growth. Nuclei are seeded throughout the time evolution of the system based on a probability that depends on the local solute supersaturation. This document is divided in two sections. In the first section, the phase field model formulation for precipitate evolution in a binary alloy (without elastic effects) is presented. In the second section the nucleation method is presented. ## Precipitate Evolution ### Variational formulation @@ -8,7 +8,7 @@ In the absence of elastic effects total free energy of the 2-component system (n $$ \begin{equation} -\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV +\Pi(c, \eta) = \int_{\Omega} f(c, \eta) ~dV \end{equation} $$ @@ -36,7 +36,7 @@ f_{grad}(\eta) = \frac{1}{2} \kappa | \nabla \eta |^2 \\ \end{equation} $$ -In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogenous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as +In the KKS model (Kim 1999), the interfacial region is modeled as a mixture of the $\alpha$ and $\beta$ phases with concentrations $c_{\alpha}$ and $c_{\beta}$, respectively. The homogeneous free energies for each phase, $f_{\alpha}$ and $f_{\beta}$ in this case, are typically given as functions of $c_{\alpha}$ and $c_{\beta}$, rather than directly as functions of $c$ and $\eta_p$. Thus, $f_{chem}(c, \eta)$ can be rewritten as $$ \begin{equation} @@ -58,11 +58,11 @@ $$ \end{align} $$ -Given the following parabolic functions for the single-phase homogenous free energies: +Given the following parabolic functions for the single-phase homogeneous free energies: $$ \begin{align} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \end{align} $$ @@ -82,7 +82,7 @@ $$ $$ \begin{align} -c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } +c_{\beta} = \frac{ A_2 c + \frac{1}{2} (A_1 - B_1) \left[1-H(\eta)\right] }{A_2 H(\eta) + B_2 \left[ 1- H(\eta)\right] } \end{align} $$ @@ -90,7 +90,7 @@ $$ - $f_{\alpha}(c_{\alpha}), f_{\beta}(c_{\beta})$ - Homogeneous chemical free energy of the components of the binary system, example form given above - $f_{Landau}(\eta)$ - Landau free energy term that controls the interfacial energy. Example form given in Appendix I -- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface +- $W$ - Barrier height for the Landau free energy term, used to control the thickness of the interface - $H(\eta)$ - Interpolation function for connecting the $\alpha$ phase and the $\beta$ phase. Example form given in Appendix I - $\kappa^{\eta_p}$ - gradient penalty coefficient for the $\alpha - \beta$ interface @@ -120,11 +120,11 @@ Now the PDE for Cahn-Hilliard dynamics is given by: $$ \begin{align} - \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) + \frac{\partial c}{\partial t} &= ~\nabla \cdot \left( \frac{1}{f_{,cc}}M \nabla \mu_c \right) \end{align} $$ - where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarentee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: + where $M$ is a constant mobility and the factor of $\frac{1}{f_{,cc}}$ is added to guarantee constant diffusivity in the two phases. The PDE for Allen-Cahn dynamics is given by: $$ \begin{align} @@ -132,7 +132,7 @@ $$ \end{align} $$ -where $L$ is a constant mobility. +where $L$ is a constant mobility. ### Time discretization Using forward Euler explicit time stepping, the equations from the Kinetics section become: @@ -150,7 +150,7 @@ $$ $$ ### Weak formulation -Writing the equations from the Kinetics section in the weak form, with the arbirary variation given by $w$ yields: +Writing the equations from the Kinetics section in the weak form, with the arbitrary variation given by $w$ yields: $$ \begin{align} @@ -184,7 +184,7 @@ $$ $$ \begin{align} -%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +%&= \int_\Omega wc^{n} +\nabla w \cdot (\Delta t M \nabla \mu_c ) dV \end{align} $$ @@ -204,7 +204,7 @@ The expression of $\frac{1}{f_{,cc}} \mu_c$ can be written as: $$ \begin{equation} -\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta +\frac{1}{f_{,cc}} \nabla \mu_c = \nabla c + (c_{\alpha}-c_{\beta}) H(\eta)_{,\eta} \nabla \eta \end{equation} $$ @@ -238,7 +238,7 @@ $$ $$ \begin{align} -&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV +&+ \nabla w \cdot (-\Delta t L \kappa \nabla \eta^n ) dV \end{align} $$ @@ -256,7 +256,7 @@ $$ ## Nucleation method -We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. +We follow the same approach as Jokisaari and Thornton [Comput. Mater. Sci. **112**, 128-138 (2016)] which consists of adding nuclei throughout a phase field simulation based on a probability that depends on the local supersaturation. This probability is calculated every fixed number of time steps and for every element of the computational domain. In each nucleation event, nucleation is triggered at a point within the $\alpha$ phase. Each nucleus is then added to the system by modifying the order parameter to it's $\beta$ phase value within a small domain around the selected nucleation center. This domain can be spherical/circular or ellipsoidal/elliptical. ### Nucleation rate @@ -290,7 +290,7 @@ $$ ### Hold time -After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistance composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. +After each nucleus is added, there is a `hold' time interval, $\Delta t_h$, during which the order parameter value is fixed within a small window that encompasses the new nucleus. The purpose of this hold time is to allow the concentration to evolve within the nucleus to a value close to the coexistence composition for $\beta$ phase, and therefore, to create small a solute depleted zone around the nucleus. After the hold time, the nucleus is allowed to evolve into a precipitate. ### Required nucleation inputs @@ -306,11 +306,11 @@ Dimensions (ellipsoidal semiaxes) of precipitate seeds - c - semiaxis in the x-direction -## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $f_{Landau}$, $H(\eta)$ $$ \begin{align} -f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} +f_{\alpha}(c_{\alpha}) = A_{2} c_{\alpha}^2 + A_{1} c_{\alpha} + A_{0} \end{align} $$ diff --git a/applications/nucleation/custom_pde.h b/applications/nucleation/custom_pde.h index 069f38b9f..b04e968b8 100644 --- a/applications/nucleation/custom_pde.h +++ b/applications/nucleation/custom_pde.h @@ -166,4 +166,4 @@ class CustomPDE : public PDEOperator double interface_coeff = std::sqrt(2.0 * KnV / W_barrier); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/nucleation/equations.cc b/applications/nucleation/equations.cc index a11d17c4e..d686508a0 100644 --- a/applications/nucleation/equations.cc +++ b/applications/nucleation/equations.cc @@ -221,4 +221,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/nucleation/main.cc b/applications/nucleation/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/nucleation/main.cc +++ b/applications/nucleation/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/precipitate_evolution/main.cc b/applications/precipitate_evolution/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/precipitate_evolution/main.cc +++ b/applications/precipitate_evolution/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/applications/precipitate_evolution/parameters.prm b/applications/precipitate_evolution/parameters.prm index dfd1f6d01..0eb48eba2 100644 --- a/applications/precipitate_evolution/parameters.prm +++ b/applications/precipitate_evolution/parameters.prm @@ -48,19 +48,19 @@ set time step = 6.0e-4 # The total number of timesteps to take set number steps = 20000 -# The number of ouputs and the frequency at which they output. The potential options -# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. +# The number of outputs and the frequency at which they output. The potential options +# for the type of output are: EQUAL_SPACING, LOG_SPACING, and N_PER_DECADE. subsection output set condition = EQUAL_SPACING set number = 10 end # The boundary conditions for the variables. The available boundary conditions are -# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and -# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann -# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is -# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and -# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc +# Natural, Dirichlet: value, Periodic, NonuniformDirichlet, and +# TimeDependentNonuniformDirichlet. Natural boundary conditions are zero-neumann +# boundary conditions. For homogeneous Dirichlet boundary conditions, the value is +# specified following the colon in Dirichet: 1.0. NonuniformDirichlet and +# TimeDependentNonuniformDirichlet boundary conditions are specified in the ICs_and_BCs.cc # files. set boundary condition for c = Natural set boundary condition for n1 = Natural @@ -70,7 +70,7 @@ set boundary condition for u, x component = Dirichlet: 0.0 set boundary condition for u, y component = Dirichlet: 0.0 set boundary condition for u, z component = Dirichlet: 0.0 -# The linear solve parameters. The type of residual can either be AbsoluteResidual or +# The linear solve parameters. The type of residual can either be AbsoluteResidual or # RelativeResidual. The preconditioner type can either be none or geometric multigrid # (GMG). The parameters smoothing range, degree, eigenvalue cg iterations, and min # multigrid level are specific to GMG and can be changed to suite your problem. @@ -84,7 +84,7 @@ subsection linear solver parameters: u set eigenvalue cg iterations = 20 end -# Model constants that are defined and accessed through CustomPDE. These constants +# Model constants that are defined and accessed through CustomPDE. These constants # are particular useful when defining system parameters that you may sweep over. set Model constant McV = 1.0, double set Model constant Mn1V = 100.0, double diff --git a/applications/precipitate_evolution/precipitate_evolution.md b/applications/precipitate_evolution/precipitate_evolution.md index 04d18a51a..cc0cafd73 100644 --- a/applications/precipitate_evolution/precipitate_evolution.md +++ b/applications/precipitate_evolution/precipitate_evolution.md @@ -5,7 +5,7 @@ The total free energy of the system (neglecting boundary terms) is of the form, $$ \begin{equation} -\Pi(c, \eta_1, \eta_2, \eta_3, \epsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \epsilon) ~dV +\Pi(c, \eta_1, \eta_2, \eta_3, \epsilon) = \int_{\Omega} f(c, \eta_1, \eta_2, \eta_3, \epsilon) ~dV \end{equation} $$ @@ -71,7 +71,7 @@ From the variational derivatives given in Appendix II, we obtain the chemical po $$ \begin{align} - \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + C_{ijkl} (- \epsilon^0_{ij,c}) \left( \epsilon_{kl} - \epsilon^0_{kl}\right) + \mu_{c} &= f_{\alpha,c} \left( 1- H(\eta_1)-H(\eta_2)-H(\eta_3)\right) +f_{\beta,c} \left( H(\eta_1) + H(\eta_2) + H(\eta_3) \right) + C_{ijkl} (- \epsilon^0_{ij,c}) \left( \epsilon_{kl} - \epsilon^0_{kl}\right) \end{align} $$ @@ -94,28 +94,28 @@ $$ $$ \begin{align} - \frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} + \frac{\partial \eta_p}{\partial t} &= - L \mu_{\eta_p} \end{align} $$ -where $M$ and $L$ are the constant mobilities. +where $M$ and $L$ are the constant mobilities. ## Mechanics Considering variations on the displacement $u$ of the from $u+\epsilon w$, we have $$ \begin{align} -\delta_u \Pi &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 +\delta_u \Pi &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 \end{align} $$ -where $\sigma = C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right)$ is the stress tensor. +where $\sigma = C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right)$ is the stress tensor. Now consider $$ \begin{align} -R &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 +R &= \int_{\Omega} \nabla w : C(\eta_1, \eta_2, \eta_3) : \left( \epsilon - \epsilon^0(c,\eta_1, \eta_2, \eta_3)\right) ~dV = 0 \end{align} $$ @@ -123,7 +123,7 @@ We solve for $R=0$ using a gradient scheme which involves the following lineariz $$ \begin{align} -R_{u}~| + \frac{\delta R}{\delta u} \Delta u &= 0 +R_{u}~| + \frac{\delta R}{\delta u} \Delta u &= 0 \end{align} $$ @@ -153,11 +153,11 @@ $$ ## Weak formulation and residual expressions ### The Cahn-Hillard and Allen-Cahn equations -Writing the Cahn-Hillard and Allen-Cahn equations in the weak form, with the arbirary variation given by $w$ yields: +Writing the Cahn-Hillard and Allen-Cahn equations in the weak form, with the arbitrary variation given by $w$ yields: $$ \begin{align} -\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t [\nabla \cdot (M \nabla \mu_c) ] dV +\int_\Omega w c^{n+1} dV &= \int_\Omega wc^{n}+w \Delta t [\nabla \cdot (M \nabla \mu_c) ] dV \end{align} $$ @@ -181,8 +181,8 @@ $$ $$ \begin{align} -\int_\Omega w \eta_p^{n+1} dV &= \int_\Omega w \eta_p^{n}-w \Delta t L \mu_{\eta_p} dV -%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV +\int_\Omega w \eta_p^{n+1} dV &= \int_\Omega w \eta_p^{n}-w \Delta t L \mu_{\eta_p} dV +%&= \int_\Omega w\underbrace{c^{n}}_{r_c}+\nabla w \cdot (\Delta t M \nabla \mu_c ) dV \end{align} $$ @@ -242,7 +242,7 @@ Expanding $\mu_{\eta_p}$ in the weak AC equation and applying the divergence the $$ \begin{align} -\int_\Omega w \eta_p^{n+1} dV &= +\int_\Omega w \eta_p^{n+1} dV &= \end{align} $$ @@ -260,7 +260,7 @@ $$ $$ \begin{align} -&+ \nabla w \cdot (-\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n ) dV +&+ \nabla w \cdot (-\Delta t L \kappa_{ij}^{\eta_p} \eta_{p,i}^n ) dV \end{align} $$ @@ -300,7 +300,7 @@ The discretized form of this equation can be written as a matrix inversion probl $$ \begin{align} -\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} +\frac{\delta R(u)}{\delta u} &= \frac{d}{d\alpha} \int_{\Omega} \nabla w :C: \left[ \epsilon (u+\alpha w) - \epsilon^0 \right] ~dV \bigg{|}_{\alpha=0} \end{align} $$ @@ -318,7 +318,7 @@ $$ $$ \begin{align} -&= \int_{\Omega} \nabla w :C: \nabla w ~dV +&= \int_{\Omega} \nabla w :C: \nabla w ~dV \end{align} $$ @@ -358,10 +358,10 @@ r_{ux} &= \sigma \end{align} $$ -The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: +The above values of $r_{ux}^{LHS}$ and $r_{ux}$ are used to define the residuals in the following input file: `applications/precipitate_evolution/equations.cc` -## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $H(\eta_p)$ +## Appendix I: Example functions for $f_{\alpha}$, $f_{\beta}$, $H(\eta_p)$ $$ \begin{align} @@ -371,7 +371,7 @@ $$ $$ \begin{align} -f_{\beta}(c) = A_{2, \beta} c^2 + A_{1, \beta} c + A_{0, \beta} +f_{\beta}(c) = A_{2, \beta} c^2 + A_{1, \beta} c + A_{0, \beta} \end{align} $$ @@ -394,20 +394,20 @@ Breaking up each of these terms yields: $$ \begin{align} -\frac{d}{d\alpha} \left[ f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r)\right]\_{\alpha=0}\ &= f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} +\frac{d}{d\alpha} \left[ f_{chem}(c,\eta_p+\alpha w,\eta_q,\eta_r)\right]\_{\alpha=0}\ &= f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} \end{align} $$ $$ \begin{align} -&+f_{\beta}(c) \left[ \frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} +&+f_{\beta}(c) \left[ \frac{\partial H(\eta_p+\alpha w)}{\partial (\eta_p + \alpha w)} \frac{\partial(\eta_p + \alpha w)}{\partial \alpha} \right]_{\alpha=0} \end{align} $$ $$ \begin{align} -&=f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] -+f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] +&=f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] ++f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] \end{align} $$ @@ -470,13 +470,13 @@ Putting the terms back together yields: $$ \begin{align} -\delta_{\eta_p} \Pi &= \int_{\Omega} f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] +f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] +\delta_{\eta_p} \Pi &= \int_{\Omega} f_{\alpha}(c) \left[ -\frac{\partial H(\eta_p)}{\partial \eta_p} w \right] +f_{\beta}(c) \left[ \frac{\partial H(\eta_p)}{\partial \eta_p } w \right] \end{align} $$ $$ \begin{align} -&+ \kappa_{ij} w_{,i} \eta_{p,j} +&+ \kappa_{ij} w_{,i} \eta_{p,j} \end{align} $$ @@ -488,7 +488,7 @@ $$ $$ \begin{align} -&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) ~dV +&+ C_{ijkl}(\eta_p,\eta_q,\eta_r) \bigg (-\frac{\partial\epsilon_{ij}^0 (c,\eta_p,\eta_q,\eta_r)}{\partial \eta_p} w \bigg) \big(\epsilon_{kl}-\epsilon_{kl}^0 (c,\eta_p,\eta_q,\eta_r)\big) ~dV \end{align} $$ @@ -504,7 +504,7 @@ Breaking up each of these terms yields: $$ \begin{align} -\frac{d}{d\alpha} \left[ f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r)\right]\_{\alpha=0} &= \bigg[ \frac{\partial f_{\alpha}(c + \alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(1-\sum_{p=1}^3 H(\eta_p)\right) +\frac{d}{d\alpha} \left[ f_{chem}(c+\alpha w,\eta_p,\eta_q,\eta_r)\right]\_{\alpha=0} &= \bigg[ \frac{\partial f_{\alpha}(c + \alpha w)}{\partial(c+\alpha w)} \frac{\partial(c+\alpha w)}{\partial \alpha} \left(1-\sum_{p=1}^3 H(\eta_p)\right) \end{align} $$ @@ -534,7 +534,7 @@ $$ $$ \begin{align} -&- \big(\epsilon_{ij}-\epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) \frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \bigg]_{\alpha=0} +&- \big(\epsilon_{ij}-\epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)\big) \frac{\partial \epsilon_{ij}^0 (c+\alpha w,\eta_p,\eta_q,\eta_r)}{\partial (c + \alpha w)} \frac{\partial(c + \alpha w)}{\partial \alpha} \bigg]_{\alpha=0} \end{align} $$ diff --git a/applications/spinodal_decomposition/ICs_and_BCs.cc b/applications/spinodal_decomposition/ICs_and_BCs.cc index bef61f37b..619b37e13 100644 --- a/applications/spinodal_decomposition/ICs_and_BCs.cc +++ b/applications/spinodal_decomposition/ICs_and_BCs.cc @@ -55,4 +55,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/spinodal_decomposition/cahn_hilliard.md b/applications/spinodal_decomposition/cahn_hilliard.md index 53bac1a3c..f0b300c66 100644 --- a/applications/spinodal_decomposition/cahn_hilliard.md +++ b/applications/spinodal_decomposition/cahn_hilliard.md @@ -3,24 +3,24 @@ Consider a free energy expression of the form: $$ \begin{equation} - \Pi(c, \nabla c) = \int_{\Omega} f( c ) + \frac{\kappa}{2} \nabla c \cdot \nabla c ~dV + \Pi(c, \nabla c) = \int_{\Omega} f( c ) + \frac{\kappa}{2} \nabla c \cdot \nabla c ~dV \end{equation} $$ where $c$ is the composition, and $\kappa$ is the gradient length scale parameter. - + ## Variational treatment Considering variations on the primal field $c$ of the from $c+\epsilon w$, we have $$ \begin{align} -\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(c+\epsilon w) + \frac{\kappa}{2} \nabla (c+\epsilon w) \cdot ~\nabla (c+\epsilon w) ~dV \right\vert_{\epsilon=0} +\delta \Pi &= \left. \frac{d}{d\epsilon} \int_{\Omega} f(c+\epsilon w) + \frac{\kappa}{2} \nabla (c+\epsilon w) \cdot ~\nabla (c+\epsilon w) ~dV \right\vert_{\epsilon=0} \end{align} -$$ +$$ $$ \begin{align} -&= \int_{\Omega} w f_{,c} + \kappa \nabla w \nabla c ~dV +&= \int_{\Omega} w f_{,c} + \kappa \nabla w \nabla c ~dV \end{align} $$ @@ -49,7 +49,7 @@ $$ $$ \begin{align} - &=-M~\nabla \cdot (-\nabla (f_{,c} - \kappa \Delta c)) + &=-M~\nabla \cdot (-\nabla (f_{,c} - \kappa \Delta c)) \end{align} $$ @@ -73,7 +73,7 @@ Considering forward Euler explicit time stepping, we have the time discretized k $$ \begin{align} - \mu^{n+1} &= f_{,c}^{n} - \kappa \Delta c^{n} + \mu^{n+1} &= f_{,c}^{n} - \kappa \Delta c^{n} \end{align} $$ @@ -94,7 +94,7 @@ $$ $$ \begin{align} - &=\int_{\Omega} w f_{,c}^{n} + \nabla w \cdot \kappa \nabla c^{n} ~dV + &=\int_{\Omega} w f_{,c}^{n} + \nabla w \cdot \kappa \nabla c^{n} ~dV \end{align} $$ @@ -110,17 +110,17 @@ r_{mux} &= \kappa \nabla c^{n} \end{align} $$ -and +and $$ \begin{align} -\int_{\Omega} w c^{n+1} ~dV&= \int_{\Omega} w c^{n} + w \Delta t M~\nabla \cdot (\nabla \mu^{n}) ~dV +\int_{\Omega} w c^{n+1} ~dV&= \int_{\Omega} w c^{n} + w \Delta t M~\nabla \cdot (\nabla \mu^{n}) ~dV \end{align} $$ $$ \begin{align} -&= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M)~ \cdot (\nabla \mu^{n}) ~dV \quad \text{[neglecting boundary flux]} +&= \int_{\Omega} w c^{n} + \nabla w (-\Delta t M)~ \cdot (\nabla \mu^{n}) ~dV \quad \text{[neglecting boundary flux]} \end{align} $$ @@ -136,5 +136,5 @@ r_{c x} &= (-\Delta t M)~ \cdot (\nabla \mu^{n}) \end{align} $$ -The above values of $r_{mu}$, $r_{mux}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: +The above values of $r_{mu}$, $r_{mux}$, $r_{c}$ and $r_{cx}$ are used to define the residuals in the following parameters file: `applications/cahnHilliard/parameters.h` diff --git a/applications/spinodal_decomposition/custom_pde.h b/applications/spinodal_decomposition/custom_pde.h index 109e82910..8a4656593 100644 --- a/applications/spinodal_decomposition/custom_pde.h +++ b/applications/spinodal_decomposition/custom_pde.h @@ -142,4 +142,4 @@ class CustomPDE : public PDEOperator get_user_inputs().get_user_constants().get_model_constant_double("icamplitude"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/spinodal_decomposition/equations.cc b/applications/spinodal_decomposition/equations.cc index 720295bc9..b04823add 100644 --- a/applications/spinodal_decomposition/equations.cc +++ b/applications/spinodal_decomposition/equations.cc @@ -110,4 +110,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/applications/spinodal_decomposition/main.cc b/applications/spinodal_decomposition/main.cc index 9cd0b22fa..a376b9106 100644 --- a/applications/spinodal_decomposition/main.cc +++ b/applications/spinodal_decomposition/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/cmake/macros/macro_prisms_pf_autopilot.cmake b/cmake/macros/macro_prisms_pf_autopilot.cmake index b0bed4ebb..8e5b04ab0 100644 --- a/cmake/macros/macro_prisms_pf_autopilot.cmake +++ b/cmake/macros/macro_prisms_pf_autopilot.cmake @@ -26,7 +26,7 @@ macro(prisms_pf_autopilot PRISMS_PF_CORE_DIR) set(TARGET_SRC ${TARGET_SRC_OVERRIDE}) endif() - # Create the exectuables + # Create the executables foreach(_build ${APPLICATION_BUILD_TYPES}) string(TOLOWER ${_build} _build_lowercase) string(TOUPPER ${_build} _build_uppercase) diff --git a/cmake/prisms_pf-config.cmake.in b/cmake/prisms_pf-config.cmake.in index 12902ae66..11b448380 100644 --- a/cmake/prisms_pf-config.cmake.in +++ b/cmake/prisms_pf-config.cmake.in @@ -4,7 +4,7 @@ # Provide the location of the build tree set(PRISMS_PF_CORE_DIR "@CMAKE_SOURCE_DIR@") -set(PRISMS_PF_BINARY_DIR "@CMAKE_BINARY_DIR@") +set(PRISMS_PF_BINARY_DIR "@CMAKE_BINARY_DIR@") # Build types set(PRISMS_PF_BUILD_TYPES @PRISMS_PF_BUILD_TYPES@ CACHE STRING "List of PRISMS-PF build types") diff --git a/cmake/scripts/expand_template_instantiations.cc b/cmake/scripts/expand_template_instantiations.cc index f7c62968e..c7f6ae7db 100644 --- a/cmake/scripts/expand_template_instantiations.cc +++ b/cmake/scripts/expand_template_instantiations.cc @@ -261,8 +261,8 @@ do_substitutions( const std::string &str, const std::vector> &substitution_list) { - // We have to do this recurively to get all possible combinations. If the list is empty, - // dump the text. Other perform the substitutions one at a time + // We have to do this recursively to get all possible combinations. If the list is + // empty, dump the text. Other perform the substitutions one at a time if (substitution_list.size() == 0) { std::cout << str << "\n" << std::flush; @@ -427,7 +427,7 @@ process_templates() // Check that we have a for loop if (!has_prefix(class_template_in, "for")) { - std::cerr << "Invalid template instantation list. Missing `for`\n" + std::cerr << "Invalid template instantiation list. Missing `for`\n" << std::flush; std::exit(1); } @@ -441,7 +441,7 @@ process_templates() // Check that we have a for loop if (!has_prefix(class_template_in, "(")) { - std::cerr << "Invalid template instantation list. Missing `(`\n" << std::flush; + std::cerr << "Invalid template instantiation list. Missing `(`\n" << std::flush; std::exit(1); } @@ -459,7 +459,7 @@ process_templates() // Check that we have a for loop if (!has_prefix(class_template_in, ")")) { - std::cerr << "Invalid template instantation list. Missing `)`\n" << std::flush; + std::cerr << "Invalid template instantiation list. Missing `)`\n" << std::flush; std::exit(1); } @@ -478,7 +478,7 @@ process_templates() split_string_to_vector(expansion_key, " :"); if (value_key.size() != 2) { - std::cerr << "Invalid template instantation list. Expansions should be " + std::cerr << "Invalid template instantiation list. Expansions should be " "paired key : value. You have `" << expansion_key << "`\n" << std::flush; @@ -504,7 +504,7 @@ process_templates() // Check that we have a for loop if (!has_prefix(class_template_in, "{")) { - std::cerr << "Invalid template instantation list. Missing `{`\n" << std::flush; + std::cerr << "Invalid template instantiation list. Missing `{`\n" << std::flush; std::exit(1); } @@ -514,7 +514,7 @@ process_templates() // Remove the preceding spaces delete_preceding_whitespace(class_template_in); - // Grab the explicit template instantations we have to substite + // Grab the explicit template instantiations we have to substite const std::string substitution_templates = get_substring_with_delimiter(class_template_in, "}"); @@ -539,9 +539,9 @@ main(int argc, char **argv) // Throw an error for the wrong script input if (argc < 2) { - std::cerr - << "Usage: \n expand_template_instantations list_of_in_files < inst.in > inst \n" - << std::flush; + std::cerr << "Usage: \n expand_template_instantiations list_of_in_files < inst.in " + "> inst \n" + << std::flush; std::exit(1); } @@ -554,7 +554,7 @@ main(int argc, char **argv) // Write a brief message for the .inst file std::cout << "// This file is automatically generated by PRISMS-PF\n\n" << std::flush; - // Process the template instantations + // Process the template instantiations process_templates(); } diff --git a/cmake/setup_cached_variables.cmake b/cmake/setup_cached_variables.cmake index f7d0390c2..402313fe7 100644 --- a/cmake/setup_cached_variables.cmake +++ b/cmake/setup_cached_variables.cmake @@ -32,7 +32,7 @@ message(STATUS "ADDITIONAL_OPTIMIZATIONS = ${ADDITIONAL_OPTIMIZATIONS}") option( ADDITIONAL_DEGREES - "Wether the user wants to enable the compilation of additional element degrees or not." + "Whether the user wants to enable the compilation of additional element degrees or not." OFF ) message(STATUS "ADDITIONAL_DEGREES = ${ADDITIONAL_DEGREES}") diff --git a/cmake/setup_prisms_pf.cmake b/cmake/setup_prisms_pf.cmake index 015bf017e..0ea416cb8 100644 --- a/cmake/setup_prisms_pf.cmake +++ b/cmake/setup_prisms_pf.cmake @@ -80,7 +80,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC -Wall -Wextra -Wpedantic - # -Wconversion # TODO: Renable this + # -Wconversion # TODO: Re-enable this # -Wsign-conversion # This is disabled because deal.II uses int when it should be uint so it just produces a lot of noise for limited utility -Wshadow -Wnon-virtual-dtor diff --git a/cmake/templates.in b/cmake/templates.in index e9aff89da..5809446d2 100644 --- a/cmake/templates.in +++ b/cmake/templates.in @@ -1,4 +1,4 @@ -// Input file that is used with expand_template_instantations.cc +// Input file that is used with expand_template_instantiations.cc // to process .inst.in files into .in files // Scalar types diff --git a/cmake/write_config.cmake b/cmake/write_config.cmake index 8a437b7ce..0e333aaa8 100644 --- a/cmake/write_config.cmake +++ b/cmake/write_config.cmake @@ -2,7 +2,7 @@ # Write the cmake config to a file # -# Set the file pathes and remove any log files that may already exist +# Set the file paths and remove any log files that may already exist set(detailed_log "${CMAKE_SOURCE_DIR}/detailed.log") set(summary_log "${CMAKE_SOURCE_DIR}/summary.log") file( diff --git a/contrib/postprocessing/README.md b/contrib/postprocessing/README.md index 711f94321..600520f3d 100644 --- a/contrib/postprocessing/README.md +++ b/contrib/postprocessing/README.md @@ -10,7 +10,7 @@ You can test if the cli works by typing (in a terminal window) \$ visit -cli -This should open the cli environment and a VisIt window. +This should open the cli environment and a VisIt window. 2) [Sourcing scripts](https://www.visitusers.org/index.php?title=Using_CLI#Starting_the_CLI) @@ -18,7 +18,7 @@ To run in batch mode, type: \$ visit -cli -s -Or to run entirely in batch mode (with no window apperaring) +Or to run entirely in batch mode (with no window appearing) \$ visit -cli -nowin -s @@ -35,9 +35,9 @@ This script creates a pseudocolor (in 2D) or contour (in 3D) plot for each time #### phase_fraction.py -This script calculates the phase fraction (volume fraction for 2D, area fraction for 3D) based on the field variable "n". +This script calculates the phase fraction (volume fraction for 2D, area fraction for 3D) based on the field variable "n". -The phase fraction is calculated as the numerical integrals ![formula](https://render.githubusercontent.com/render/math?math=\phi=\frac{1}{V}\int_Vnd^3r) for +The phase fraction is calculated as the numerical integrals ![formula](https://render.githubusercontent.com/render/math?math=\phi=\frac{1}{V}\int_Vnd^3r) for a 3D system and ![formula](https://render.githubusercontent.com/render/math?math=\phi=\frac{1}{A}\int_An\,d^2r) for a 2D system, where *V* (*A*) is the total volume (area) of the system. The results for all time states are outputted in the file **phi_vs_t.txt**. @@ -46,23 +46,23 @@ For each row, the first column corresponds to the frame number, the second to th #### interface_area.py -This script calculates the total area (or length, in a 2D system) of the interface between two phases defined by the field variable "n". +This script calculates the total area (or length, in a 2D system) of the interface between two phases defined by the field variable "n". -The numerical integral $A_{int}=2\int_{\delta\Omega}nd^2r$ ![formula](https://render.githubusercontent.com/render/math?math=A_{int}=2\int_{\delta\Omega}nd^2r) is used to calculate the *area* of a 2D interface +The numerical integral $A_{int}=2\int_{\delta\Omega}nd^2r$ ![formula](https://render.githubusercontent.com/render/math?math=A_{int}=2\int_{\delta\Omega}nd^2r) is used to calculate the *area* of a 2D interface in a 3D system, where ![formula](https://render.githubusercontent.com/render/math?math=\delta\Omega) is the contour surface at *n=0.5*. -The numerical integral ![formula](https://render.githubusercontent.com/render/math?math=L_{int}=2\int_{\delta%20l}ndr) is used to the *length* of the 1D +The numerical integral ![formula](https://render.githubusercontent.com/render/math?math=L_{int}=2\int_{\delta%20l}ndr) is used to the *length* of the 1D interface in a 2D system, where ![formula](https://render.githubusercontent.com/render/math?math=\delta%20l) is the contour line at *n=0.5*. -The results for all time states are outputted in the file **iarea_vs_t.txt**. +The results for all time states are outputted in the file **iarea_vs_t.txt**. For each row, the first column corresponds to the frame number, the second to the time and the third one to the total interface area (or length). #### domain_stats.py -This script calculates the following quantities for each of the time states: -1) Number of domains, defined as the number or separate regions based on the values of field variable, "n". Each interconnected region for which n>0.5 is counted as a separate domain. +This script calculates the following quantities for each of the time states: +1) Number of domains, defined as the number or separate regions based on the values of field variable, "n". Each interconnected region for which n>0.5 is counted as a separate domain. 2) Average domain size (area in 2D and volume in 3D) -3) Standard deviation of the domain sizes. +3) Standard deviation of the domain sizes. Results for all time states are outputted in the file **domain_stats_vs_t.txt**. @@ -70,7 +70,7 @@ For each row, the first column corresponds to the frame number, the second to th #### splitvtufiles.py -This script splits the output .vtu files into several files, allowing for parallel visualization in VisIt or ParaView. To run it simply +This script splits the output .vtu files into several files, allowing for parallel visualization in VisIt or ParaView. To run it simply 1. Open a terminal 2. Go to the directory where the series of output files from a single simulation are located (these files must be generated using the single file per process option, see the **Output** section from [this page](https://prisms-center.github.io/phaseField/doxygen_files/input_file.html)) diff --git a/contrib/postprocessing/domain_stats.py b/contrib/postprocessing/domain_stats.py index 38b90f00b..4400a86dc 100644 --- a/contrib/postprocessing/domain_stats.py +++ b/contrib/postprocessing/domain_stats.py @@ -30,7 +30,7 @@ # Step 3: Draw the plots DrawPlots() -# Step 4: Get the spacial extents +# Step 4: Get the spatial extents Query("SpatialExtents") gpq = GetQueryOutputValue() # Extracting number of coordinate limits @@ -73,7 +73,7 @@ nsy = int(nmax * lv[1] / max(lv)) nsz = int(nmax * lv[2] / max(lv)) -# Step 5: Resample the data to create a strucutured mesh +# Step 5: Resample the data to create a structured mesh # Adding the Resample Operator AddOperator("Resample") # The object r contains the Resample Operator Attributes diff --git a/contrib/postprocessing/interface_area.py b/contrib/postprocessing/interface_area.py index 75725a6a5..875b6673f 100644 --- a/contrib/postprocessing/interface_area.py +++ b/contrib/postprocessing/interface_area.py @@ -15,7 +15,7 @@ # Step 2: Add Contour plot (using variable "n") # This variable must be in the range [0,1] # with 0 representing one phase, 1 representing another phase -# and n=0.5 representing the midpoint accross the interface +# and n=0.5 representing the midpoint across the interface AddPlot("Contour", "n", 1, 1) ContourAtts = ContourAttributes() ContourAtts.contourValue = 0.5 @@ -39,7 +39,7 @@ # Weighted Variable Sum integrates the value of the order # parameter along the area (length) of the contour # surface (curve). - # Since the countour is taken at value n=0.5, + # Since the contour is taken at value n=0.5, # We multiply by 2 to obtain the area (or length) if wvs == (): intarea[states] = 0.0 diff --git a/contrib/postprocessing/phase_fraction.py b/contrib/postprocessing/phase_fraction.py index 328d7dca2..2a5065317 100644 --- a/contrib/postprocessing/phase_fraction.py +++ b/contrib/postprocessing/phase_fraction.py @@ -13,7 +13,7 @@ # Step 2: Add plots (using variable "n") # This variable must be in the range [0,1] # with 0 representing one phase, 1 representing another phase -# and n=0.5 representing the midpoint accross the interface +# and n=0.5 representing the midpoint across the interface AddPlot("Pseudocolor", "n") # Step 3: Draw the plots diff --git a/contrib/postprocessing/plot_and_save.py b/contrib/postprocessing/plot_and_save.py index 572f8ddbb..63fa9554a 100644 --- a/contrib/postprocessing/plot_and_save.py +++ b/contrib/postprocessing/plot_and_save.py @@ -20,7 +20,7 @@ # Step 3: Draw the plots DrawPlots() -# Step 4: Get the spacial extents +# Step 4: Get the spatial extents Query("SpatialExtents") gpq = GetQueryOutputValue() # Extracting number of coordinate limits diff --git a/contrib/utilities/copy_file_to_all_applications.sh b/contrib/utilities/copy_file_to_all_applications.sh index ad6b15852..2f2ff87fe 100755 --- a/contrib/utilities/copy_file_to_all_applications.sh +++ b/contrib/utilities/copy_file_to_all_applications.sh @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: © 2025 PRISMS Center at the University of Michigan # SPDX-License-Identifier: GNU Lesser General Public Version 2.1 # -# This script copies a file to all the applications in the tests/automatic_tests +# This script copies a file to all the applications in the tests/automatic_tests # directory and all the applications in the applications directory. # # @@ -58,4 +58,4 @@ copy_to_valid_apps_in_dir "applications" copy_to_valid_apps_in_dir "tests/automatic_tests" echo "Done" -exit 0 \ No newline at end of file +exit 0 diff --git a/doc/README.md b/doc/README.md index a4a2c110b..37e799057 100644 --- a/doc/README.md +++ b/doc/README.md @@ -16,4 +16,4 @@ make ``` ## Licensing -The documentation is covered with the same license as the PRISMS-PF library. \ No newline at end of file +The documentation is covered with the same license as the PRISMS-PF library. diff --git a/doc/doxygen/.gitignore b/doc/doxygen/.gitignore index 19ee9d596..47017a21c 100644 --- a/doc/doxygen/.gitignore +++ b/doc/doxygen/.gitignore @@ -5,4 +5,4 @@ DoxygenWarningLog.txt !main !docs/index.html -!docs/version_selector.html \ No newline at end of file +!docs/version_selector.html diff --git a/doc/doxygen/custom.css b/doc/doxygen/custom.css index 8b0b07310..9faf21ef1 100644 --- a/doc/doxygen/custom.css +++ b/doc/doxygen/custom.css @@ -23,4 +23,4 @@ html.dark-mode { font-weight: bold; cursor: pointer; transition: all 0.2s ease; -} \ No newline at end of file +} diff --git a/doc/doxygen/delete_me.css b/doc/doxygen/delete_me.css index 65059b6ab..438accd8f 100644 --- a/doc/doxygen/delete_me.css +++ b/doc/doxygen/delete_me.css @@ -2212,4 +2212,4 @@ details[open]>summary::before { content: "\25bc"; padding-right: 4px; font-size: 80%; -} \ No newline at end of file +} diff --git a/doc/doxygen/delete_me.html b/doc/doxygen/delete_me.html index 78913d356..3ccee83c7 100644 --- a/doc/doxygen/delete_me.html +++ b/doc/doxygen/delete_me.html @@ -18,4 +18,4 @@ - \ No newline at end of file + diff --git a/doc/doxygen/header.html b/doc/doxygen/header.html index bbce1129e..39a59fec0 100644 --- a/doc/doxygen/header.html +++ b/doc/doxygen/header.html @@ -92,4 +92,4 @@ - \ No newline at end of file + diff --git a/doc/doxygen/main/contact.h b/doc/doxygen/main/contact.h index e7b32e1ba..411769ee9 100644 --- a/doc/doxygen/main/contact.h +++ b/doc/doxygen/main/contact.h @@ -21,4 +21,4 @@ information as possible when asking for help. This includes: \li The version of PRISMS-PF you are using \li Your operating system and environment details \li Any other relevant information that might help us understand the issue -*/ \ No newline at end of file +*/ diff --git a/doc/doxygen/main/main.h b/doc/doxygen/main/main.h index d8bbcdba9..757789c39 100644 --- a/doc/doxygen/main/main.h +++ b/doc/doxygen/main/main.h @@ -44,4 +44,4 @@ External phase field links:\n [PF Best Practices](https://pages.nist.gov/pf-recommended-practices/intro.html)\n\n Contact us at prisms-pf@umich.edu - */ \ No newline at end of file + */ diff --git a/doc/doxygen/version_selector_handler.js b/doc/doxygen/version_selector_handler.js index 761800e37..1ddd42b36 100644 --- a/doc/doxygen/version_selector_handler.js +++ b/doc/doxygen/version_selector_handler.js @@ -18,4 +18,4 @@ $(function () { var currentVersion = window.location.pathname.split('/')[3]; $('#versionSelector').val(currentVersion); }); -}); \ No newline at end of file +}); diff --git a/include/prismspf/core/cell_marker_base.h b/include/prismspf/core/cell_marker_base.h index dae98f98f..1f48200a8 100644 --- a/include/prismspf/core/cell_marker_base.h +++ b/include/prismspf/core/cell_marker_base.h @@ -46,4 +46,4 @@ class CellMarkerBase } }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/conditional_ostreams.h b/include/prismspf/core/conditional_ostreams.h index 7b509551a..21636c2ec 100644 --- a/include/prismspf/core/conditional_ostreams.h +++ b/include/prismspf/core/conditional_ostreams.h @@ -77,4 +77,4 @@ class ConditionalOStreams pout_summary(); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/exceptions.h b/include/prismspf/core/exceptions.h index e2c1b2136..b62b8d5f5 100644 --- a/include/prismspf/core/exceptions.h +++ b/include/prismspf/core/exceptions.h @@ -62,10 +62,10 @@ DeclExceptionMsg(UnreachableCode, "This code should not have been reached."); DeclException2(DependencyNotFound, Types::Index, std::string, - << "Attemped access of the variable with index " << arg1 + << "Attempted access of the variable with index " << arg1 << " and dependency type " << arg2 << " that was not marked as needed. Please check CustomAttributeLoader."); // NOLINTEND -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/grid_refiner.h b/include/prismspf/core/grid_refiner.h index 3158196ec..d70eeb198 100644 --- a/include/prismspf/core/grid_refiner.h +++ b/include/prismspf/core/grid_refiner.h @@ -101,7 +101,7 @@ class GridRefiner .get_spatial_discretization() .get_has_adaptivity()) { - ConditionalOStreams::pout_base() << " grid refinment disabled...\n" + ConditionalOStreams::pout_base() << " grid refinement disabled...\n" << std::flush; return; } diff --git a/include/prismspf/core/grid_refiner_context.h b/include/prismspf/core/grid_refiner_context.h index d7b55caa8..5814bdc3b 100644 --- a/include/prismspf/core/grid_refiner_context.h +++ b/include/prismspf/core/grid_refiner_context.h @@ -252,4 +252,4 @@ class GridRefinementContext const MGInfo *mg_info; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/invm_handler.h b/include/prismspf/core/invm_handler.h index f9297574a..b4a999dca 100644 --- a/include/prismspf/core/invm_handler.h +++ b/include/prismspf/core/invm_handler.h @@ -111,14 +111,14 @@ class InvmHandler bool vector_needed = false; /** - * @brief Field index of the first occuring scalar field. This is the index for which we - * attached the FEEvaluation objects to evaluate and initialize the invm vector. + * @brief Field index of the first occurring scalar field. This is the index for which + * we attached the FEEvaluation objects to evaluate and initialize the invm vector. */ unsigned int scalar_index = Numbers::invalid_index; /** - * @brief Field index of the first occuring vector field. This is the index for which we - * attached the FEEvaluation objects to evaluate and initialize the invm vector. + * @brief Field index of the first occurring vector field. This is the index for which + * we attached the FEEvaluation objects to evaluate and initialize the invm vector. */ unsigned int vector_index = Numbers::invalid_index; diff --git a/include/prismspf/core/pde_operator.h b/include/prismspf/core/pde_operator.h index a3ea90dee..6815811c2 100644 --- a/include/prismspf/core/pde_operator.h +++ b/include/prismspf/core/pde_operator.h @@ -129,4 +129,4 @@ class PDEOperator const PhaseFieldTools *pf_tools; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/solution_handler.h b/include/prismspf/core/solution_handler.h index 2009b10bd..e6c50fd9a 100644 --- a/include/prismspf/core/solution_handler.h +++ b/include/prismspf/core/solution_handler.h @@ -125,7 +125,7 @@ class SolutionHandler const dealii::AffineConstraints &constraints); /** - * @brief Apply intial condition to the old fields. For now, this simply copies the + * @brief Apply initial condition to the old fields. For now, this simply copies the * values in the normal field to the old. * * TODO (landinjm): What should we do for the initial condition of old fields. diff --git a/include/prismspf/core/solver_handler.h b/include/prismspf/core/solver_handler.h index d6db9e370..e10a2e9b6 100644 --- a/include/prismspf/core/solver_handler.h +++ b/include/prismspf/core/solver_handler.h @@ -81,7 +81,7 @@ class SolveBlock reinit(); /** - * @brief Solve a single incremenet for all of the solvers. + * @brief Solve a single increment for all of the solvers. * * TODO (landinjm): Fix the logic here with the passed variables */ @@ -187,7 +187,7 @@ class SolverHandler reinit(); /** - * @brief Solve a single incremenet for all of the solvers. + * @brief Solve a single increment for all of the solvers. * * TODO (landinjm): Fix the logic here with the passed variables */ @@ -201,4 +201,4 @@ class SolverHandler std::map> solve_blocks; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/tee_stream.h b/include/prismspf/core/tee_stream.h index 5e9c628df..66dec6dbb 100644 --- a/include/prismspf/core/tee_stream.h +++ b/include/prismspf/core/tee_stream.h @@ -60,4 +60,4 @@ class TeeStream : public std::ostream TeeBuffer tee_buffer; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/timer.h b/include/prismspf/core/timer.h index f1e32ba7b..5b20bd0a8 100644 --- a/include/prismspf/core/timer.h +++ b/include/prismspf/core/timer.h @@ -51,4 +51,4 @@ class Timer print_summary(); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/core/triangulation_handler.h b/include/prismspf/core/triangulation_handler.h index 566b55bac..0a2e297a1 100644 --- a/include/prismspf/core/triangulation_handler.h +++ b/include/prismspf/core/triangulation_handler.h @@ -64,7 +64,7 @@ class TriangulationHandler user_inputs->get_spatial_discretization().get_max_refinement(), dealii::ExcMessage( "Currently, we don't allow the initial refinement to be lower than the " - "maximum adpative refinement level when using multigrid. This is because we " + "maximum adaptive refinement level when using multigrid. This is because we " "have to create a sequence of coarser meshes.")); coarsened_triangulations = diff --git a/include/prismspf/core/type_enums.h b/include/prismspf/core/type_enums.h index eb5f52979..660b38e85 100644 --- a/include/prismspf/core/type_enums.h +++ b/include/prismspf/core/type_enums.h @@ -49,7 +49,7 @@ enum ElasticityModel : std::uint8_t * different types of solve that are possible. For Explicit solves, all fields of that * type can be solved concurrently. For NonexplicitLinear, NonexplicitSelfnonlinear, * and NonexplicitAuxiliary, these must be solved sequentially and wrapped in - * conditionals in the user implmentation. For NonexplicitCononlinear, there are at + * conditionals in the user implementation. For NonexplicitCononlinear, there are at * least 2 fields that are nonlinear together, as opposed to NonexplicitSelfnonlinear, * which must be solved at the same time. A simply case for this is the steady-state * Cahn-Hilliard equation. Finally, for ExplicitPostprocess and ExplicitConstant, they diff --git a/include/prismspf/core/variable_container.h b/include/prismspf/core/variable_container.h index f072c5bdd..1ae154507 100644 --- a/include/prismspf/core/variable_container.h +++ b/include/prismspf/core/variable_container.h @@ -991,13 +991,13 @@ class VariableContainer get_q_point_location() const; /** - * @brief Initialize, read DOFs, and set evaulation flags for each variable. + * @brief Initialize, read DOFs, and set evaluation flags for each variable. */ void reinit_and_eval(const std::vector &src, unsigned int cell); /** - * @brief Initialize, read DOFs, and set evaulation flags for each variable. + * @brief Initialize, read DOFs, and set evaluation flags for each variable. */ void reinit_and_eval(const VectorType &src, unsigned int cell); @@ -1074,7 +1074,7 @@ class VariableContainer Types::Index max_fields = Numbers::invalid_index; /** - * @brief Nax number of dependency types. + * @brief Max number of dependency types. */ Types::Index max_dependency_types = Numbers::invalid_index; diff --git a/include/prismspf/core/vector_mapping.h b/include/prismspf/core/vector_mapping.h index bcc157e6e..21bf96a8a 100644 --- a/include/prismspf/core/vector_mapping.h +++ b/include/prismspf/core/vector_mapping.h @@ -11,7 +11,7 @@ PRISMS_PF_BEGIN_NAMESPACE /** * Due the generalized nature of PRISMS-PF and how we handle the solving of PDEs on the * backend, we end up with a slew of vectors that have to be managed and updated as we - * solve fields. While we can stored these in hierarchical data structure to perserve the + * solve fields. While we can stored these in hierarchical data structure to preserve the * logic and intuition this becomes unwieldy on the backend and is less performant than * storing them in a flat structure or vector blocks. * @@ -37,7 +37,7 @@ class VectorMappings unsigned int n_blocks = 0; /** - * @brief Block vector of all neccessary vectors for the PDE problem. + * @brief Block vector of all necessary vectors for the PDE problem. */ dealii::BlockVector block_vector; diff --git a/include/prismspf/field_input/read_binary.h b/include/prismspf/field_input/read_binary.h index 0034b4ba9..4beb32316 100644 --- a/include/prismspf/field_input/read_binary.h +++ b/include/prismspf/field_input/read_binary.h @@ -166,7 +166,7 @@ ReadBinary::check_file_size() auto file_size = std::filesystem::file_size(this->ic_file.filename); // Compute the expected size of the binary file. This is simply the number of points - // mutliplied by the size of each point in bytes. + // multiplied by the size of each point in bytes. auto expected_size_scalar = static_cast(n_points * sizeof(number)); auto expected_size_vector = static_cast(dim * expected_size_scalar); diff --git a/include/prismspf/field_input/read_vtk.h b/include/prismspf/field_input/read_vtk.h index ca8e40375..f51db4a47 100644 --- a/include/prismspf/field_input/read_vtk.h +++ b/include/prismspf/field_input/read_vtk.h @@ -248,7 +248,7 @@ ReadUnstructuredVTK::get_scalar_value(const dealii::Point &poi "The provided vtk dataset does not contain a field named " + scalar_name)); - // Convet the dealii point to a vector + // Convert the dealii point to a vector std::vector point_vector = dealii_point_to_vector(point); // Set the active scalar and update the reader @@ -341,7 +341,7 @@ ReadUnstructuredVTK::get_vector_value(const dealii::Point &poi "The provided vtk dataset does not contain a field named " + vector_name)); - // Convet the dealii point to a vector + // Convert the dealii point to a vector std::vector point_vector = dealii_point_to_vector(point); // Set the active vector and update the reader diff --git a/include/prismspf/nucleation/nucleus.h b/include/prismspf/nucleation/nucleus.h index 66788b50a..6edae7df4 100644 --- a/include/prismspf/nucleation/nucleus.h +++ b/include/prismspf/nucleation/nucleus.h @@ -106,4 +106,4 @@ Nucleus::mpi_datatype() return MPI_NUCLEUS; } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/nucleation/nucleus_refinement_function.h b/include/prismspf/nucleation/nucleus_refinement_function.h index 3a55bce7f..b767eceea 100644 --- a/include/prismspf/nucleation/nucleus_refinement_function.h +++ b/include/prismspf/nucleation/nucleus_refinement_function.h @@ -76,4 +76,4 @@ class NucleusRefinementFunction : public CellMarkerBase const std::vector> *nuclei_list; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/solvers/linear_solver_identity.h b/include/prismspf/solvers/linear_solver_identity.h index 6bc8db6aa..040b1ae00 100644 --- a/include/prismspf/solvers/linear_solver_identity.h +++ b/include/prismspf/solvers/linear_solver_identity.h @@ -87,4 +87,4 @@ class IdentitySolver : public LinearSolverBase solve(const number &step_length = 1.0) override; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/boundary_parameters.h b/include/prismspf/user_inputs/boundary_parameters.h index 1fbbefb4d..469b9bc74 100644 --- a/include/prismspf/user_inputs/boundary_parameters.h +++ b/include/prismspf/user_inputs/boundary_parameters.h @@ -77,7 +77,7 @@ struct BoundaryCondition } /** - * @brief Get the value for a homogenous dirichlet boundary condition. + * @brief Get the value for a homogeneous dirichlet boundary condition. */ [[nodiscard]] double get_dirichlet_value(dealii::types::boundary_id boundary_id) const @@ -90,7 +90,7 @@ struct BoundaryCondition } /** - * @brief Add the value for a homogenous dirichlet boundary condition. + * @brief Add the value for a homogeneous dirichlet boundary condition. */ void add_boundary_condition(dealii::types::boundary_id boundary_id, double boundary_value) diff --git a/include/prismspf/user_inputs/checkpoint_parameters.h b/include/prismspf/user_inputs/checkpoint_parameters.h index dec9c4ab0..608d2bbf6 100644 --- a/include/prismspf/user_inputs/checkpoint_parameters.h +++ b/include/prismspf/user_inputs/checkpoint_parameters.h @@ -198,4 +198,4 @@ CheckpointParameters::print_parameter_summary() const ConditionalOStreams::pout_summary() << "\n\n" << std::flush; } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/load_initial_condition_parameters.h b/include/prismspf/user_inputs/load_initial_condition_parameters.h index fda98e40b..1175ac0f6 100644 --- a/include/prismspf/user_inputs/load_initial_condition_parameters.h +++ b/include/prismspf/user_inputs/load_initial_condition_parameters.h @@ -186,4 +186,4 @@ LoadInitialConditionParameters::print_parameter_summary() const } } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/miscellaneous_parameters.h b/include/prismspf/user_inputs/miscellaneous_parameters.h index 04c4636cc..d9258e060 100644 --- a/include/prismspf/user_inputs/miscellaneous_parameters.h +++ b/include/prismspf/user_inputs/miscellaneous_parameters.h @@ -66,4 +66,4 @@ MiscellaneousParameters::print_parameter_summary() const << std::flush; } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/nonlinear_solve_parameters.h b/include/prismspf/user_inputs/nonlinear_solve_parameters.h index be5dd7fb2..2e088b06d 100644 --- a/include/prismspf/user_inputs/nonlinear_solve_parameters.h +++ b/include/prismspf/user_inputs/nonlinear_solve_parameters.h @@ -116,4 +116,4 @@ NonlinearSolveParameterSet::print_parameter_summary() const } } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/parameter_base.h b/include/prismspf/user_inputs/parameter_base.h index 5e0f5cb9e..75316dc77 100644 --- a/include/prismspf/user_inputs/parameter_base.h +++ b/include/prismspf/user_inputs/parameter_base.h @@ -48,4 +48,4 @@ class ParameterBase }; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/spatial_discretization.h b/include/prismspf/user_inputs/spatial_discretization.h index 3f7940b83..33abc2100 100644 --- a/include/prismspf/user_inputs/spatial_discretization.h +++ b/include/prismspf/user_inputs/spatial_discretization.h @@ -243,7 +243,7 @@ class RectangularMesh : public Mesh } // Create a vector of matched pairs that we fill and enforce upon the - // constaints + // constraints std::vector::Triangulation::cell_iterator>> periodicity_vector; diff --git a/include/prismspf/user_inputs/temporal_discretization.h b/include/prismspf/user_inputs/temporal_discretization.h index 8463ec6a8..ce8dda7f3 100644 --- a/include/prismspf/user_inputs/temporal_discretization.h +++ b/include/prismspf/user_inputs/temporal_discretization.h @@ -189,4 +189,4 @@ TemporalDiscretization::print_parameter_summary() const << std::flush; } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/include/prismspf/user_inputs/user_input_parameters.h b/include/prismspf/user_inputs/user_input_parameters.h index 53ce65eed..accc99acc 100644 --- a/include/prismspf/user_inputs/user_input_parameters.h +++ b/include/prismspf/user_inputs/user_input_parameters.h @@ -238,7 +238,7 @@ class UserInputParameters // Temporal discretization parameters TemporalDiscretization temporal_discretization; - // Linear solve paramters + // Linear solve parameters LinearSolveParameters linear_solve_parameters; // Nonlinear solve parameters diff --git a/include/prismspf/utilities/utilities.h b/include/prismspf/utilities/utilities.h index e2cd8a333..f001ca385 100644 --- a/include/prismspf/utilities/utilities.h +++ b/include/prismspf/utilities/utilities.h @@ -122,7 +122,7 @@ compute_stress(const dealii::Tensor<2, voigt_tensor_size, T> &elasticity_te } /** - * @brief Remove whitepace from strings + * @brief Remove whitespace from strings */ inline std::string strip_whitespace(const std::string &_text) @@ -200,4 +200,4 @@ dealii_point_to_vector(const dealii::Point &point) PRISMS_PF_END_NAMESPACE -#include \ No newline at end of file +#include diff --git a/include/prismspf/utilities/vectorized_operations.h b/include/prismspf/utilities/vectorized_operations.h index da8afb5fc..999d3da9e 100644 --- a/include/prismspf/utilities/vectorized_operations.h +++ b/include/prismspf/utilities/vectorized_operations.h @@ -40,4 +40,4 @@ namespace dealii } return out; } -} // namespace dealii \ No newline at end of file +} // namespace dealii diff --git a/src/core/constraint_handler.cc b/src/core/constraint_handler.cc index 453ddf5e1..cf5eebbad 100644 --- a/src/core/constraint_handler.cc +++ b/src/core/constraint_handler.cc @@ -269,7 +269,7 @@ ConstraintHandler::apply_periodic_constraints( const dealii::ComponentMask &mask) const { // Create a vector of matched pairs that we fill and enforce upon the - // constaints + // constraints std::vector< dealii::GridTools::PeriodicFacePair::cell_iterator>> periodicity_vector; diff --git a/src/core/matrix_free_handler.inst.in b/src/core/matrix_free_handler.inst.in index 423ce6857..253e66fde 100644 --- a/src/core/matrix_free_handler.inst.in +++ b/src/core/matrix_free_handler.inst.in @@ -12,4 +12,3 @@ for ( dimension : SPACE_DIMENSIONS; degree : ELEMENT_DEGREE; number : REAL_SCALA const ConstraintHandler &, const dealii::Quadrature<1> &); } - diff --git a/src/core/timer.cc b/src/core/timer.cc index 7aa98eb86..4d21ad963 100644 --- a/src/core/timer.cc +++ b/src/core/timer.cc @@ -69,8 +69,8 @@ Timer::print_summary() return; #endif - // TODO: Revist the deal.II TimerOutput class and reorganize sections so they are tiered - // accordingly + // TODO: Revisit the deal.II TimerOutput class and reorganize sections so they are + // tiered accordingly } PRISMS_PF_END_NAMESPACE diff --git a/src/core/triangulation_handler.cc b/src/core/triangulation_handler.cc index 9c2610864..9edaea8c6 100644 --- a/src/core/triangulation_handler.cc +++ b/src/core/triangulation_handler.cc @@ -169,7 +169,7 @@ TriangulationHandler::generate_mesh() !user_inputs->get_spatial_discretization().get_has_adaptivity(), dealii::ExcMessage( "Currently, we don't allow the initial refinement to be lower than the " - "maximum adpative refinement level when using multigrid. This is because we " + "maximum adaptive refinement level when using multigrid. This is because we " "have to create a sequence of coarser meshes.")); coarsened_triangulations = @@ -259,7 +259,7 @@ TriangulationHandler::mark_periodic() periodic_ids.insert(boundary_id); // Create a vector of matched pairs that we fill and enforce upon the - // constaints + // constraints std::vector> periodicity_vector; diff --git a/src/core/variable_attribute_loader.cc b/src/core/variable_attribute_loader.cc index dbe83413e..ae373811a 100644 --- a/src/core/variable_attribute_loader.cc +++ b/src/core/variable_attribute_loader.cc @@ -34,7 +34,7 @@ VariableAttributeLoader::init_variable_attributes() // the length of the vector for the eval flag set at runtime. const auto max_fields = static_cast(var_attributes.size()); - // Determine the max numer of dependency types. This is used to determine the length of + // Determine the max number of dependency types. This is used to determine the length of // the vector for the eval flag set at runtime. const auto max_dependency_types = static_cast(DependencyType::OldFour); @@ -564,7 +564,7 @@ VariableAttributeLoader::compute_shared_dependencies( const Types::Index max_fields = first_variable->max_fields; const Types::Index max_dependencies = first_variable->max_dependency_types; - // If the field_solve_type is not something we would expect thow an assertion. We could + // If the field_solve_type is not something we would expect throw an assertion. We could // return early, but I slightly favor an assertion and choosing the appropriate // FieldSolveType's upstream. Assert(field_solve_type == FieldSolveType::Explicit || diff --git a/src/core/variable_attribute_loader.inst.in b/src/core/variable_attribute_loader.inst.in index d5a65ee37..5042f1985 100644 --- a/src/core/variable_attribute_loader.inst.in +++ b/src/core/variable_attribute_loader.inst.in @@ -16,4 +16,4 @@ template void VariableAttributeLoader::set_is_nucleation_rate &dependencies); - } \ No newline at end of file + } diff --git a/src/core/variable_attributes.cc b/src/core/variable_attributes.cc index 07b9f7a47..16ea89ef7 100644 --- a/src/core/variable_attributes.cc +++ b/src/core/variable_attributes.cc @@ -464,7 +464,7 @@ VariableAttributes::compute_simplified_dependency_set( // Compute dependencies for a given eval_flag_set. Change and old flags are irrelevant, // so ignore those. If we have EvalFlags::nothing ignore it. If the dependency is // explicit or constant ignore it. If the dependency is itself ignore it so it doesn't - // interfere with the map and flag circularity. If the dependencys have different solve + // interfere with the map and flag circularity. If the dependencies have different solve // blocks ignore those as well. auto compute_dependencies = [&](const auto &eval_flag_set) { diff --git a/src/core/variable_container.cc b/src/core/variable_container.cc index d64a19956..9dafdb94b 100644 --- a/src/core/variable_container.cc +++ b/src/core/variable_container.cc @@ -148,7 +148,7 @@ VariableContainer::eval_local_operator( // Grab the element volume const SizeType element_volume = element_volume_handler->get_element_volume(cell); - // Initialize, read DOFs, and set evaulation flags for each variable + // Initialize, read DOFs, and set evaluation flags for each variable reinit_and_eval(src, cell); // Evaluate at each quadrature point @@ -178,7 +178,7 @@ VariableContainer::eval_local_operator( // Grab the element volume const SizeType element_volume = element_volume_handler->get_element_volume(cell); - // Initialize, read DOFs, and set evaulation flags for each variable + // Initialize, read DOFs, and set evaluation flags for each variable reinit_and_eval(src, cell); // Evaluate at each quadrature point @@ -209,7 +209,7 @@ VariableContainer::eval_local_operator( // Grab the element volume const SizeType element_volume = element_volume_handler->get_element_volume(cell); - // Initialize, read DOFs, and set evaulation flags for each variable + // Initialize, read DOFs, and set evaluation flags for each variable reinit_and_eval(src, cell); reinit_and_eval(src_subset, cell); diff --git a/src/dummy.cc b/src/dummy.cc index e62ee31a1..ee8dbee08 100644 --- a/src/dummy.cc +++ b/src/dummy.cc @@ -3,4 +3,4 @@ #ifdef CLANG_TIDY # include -#endif \ No newline at end of file +#endif diff --git a/src/solvers/concurrent_constant_solver.cc b/src/solvers/concurrent_constant_solver.cc index c5cfee40b..6acd2ff49 100644 --- a/src/solvers/concurrent_constant_solver.cc +++ b/src/solvers/concurrent_constant_solver.cc @@ -62,4 +62,4 @@ ConcurrentConstantSolver::print() #include "solvers/concurrent_constant_solver.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/src/solvers/concurrent_explicit_postprocess_solver.cc b/src/solvers/concurrent_explicit_postprocess_solver.cc index b771780ab..8d3ed0f33 100644 --- a/src/solvers/concurrent_explicit_postprocess_solver.cc +++ b/src/solvers/concurrent_explicit_postprocess_solver.cc @@ -78,4 +78,4 @@ ConcurrentExplicitPostprocessSolver::print() #include "solvers/concurrent_explicit_postprocess_solver.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/src/solvers/concurrent_explicit_solver.cc b/src/solvers/concurrent_explicit_solver.cc index 761be2b85..c6d65e9aa 100644 --- a/src/solvers/concurrent_explicit_solver.cc +++ b/src/solvers/concurrent_explicit_solver.cc @@ -77,4 +77,4 @@ ConcurrentExplicitSolver::print() #include "solvers/concurrent_explicit_solver.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/src/solvers/linear_solver_gmg.cc b/src/solvers/linear_solver_gmg.cc index 221ee9280..3b34b48b6 100644 --- a/src/solvers/linear_solver_gmg.cc +++ b/src/solvers/linear_solver_gmg.cc @@ -57,7 +57,7 @@ GMGSolver::init() // Call the base class init this->LinearSolverBase::init(); - // Basic intialization that is the same as the identity solve. + // Basic initialization that is the same as the identity solve. this->clear_system_matrices(); this->initialize_system_matrices(); this->finalize_system_matrices(); @@ -195,7 +195,7 @@ GMGSolver::reinit() // Call the base class reinit this->LinearSolverBase::reinit(); - // Basic intialization that is the same as the identity solve. + // Basic initialization that is the same as the identity solve. this->clear_system_matrices(); this->initialize_system_matrices(); this->finalize_system_matrices(); @@ -345,7 +345,7 @@ GMGSolver::solve(const number &step_length) .get_matrix_free() ->get_vector_partitioner(local_index) ->is_compatible(*mg_src_subset[level].get_partitioner()), - dealii::ExcMessage("Incompatabile vector partitioners")); + dealii::ExcMessage("Incompatible vector partitioners")); } // Interpolate diff --git a/src/solvers/sequential_co_nonlinear_solver.cc b/src/solvers/sequential_co_nonlinear_solver.cc index 24c523b8a..ff15ac48a 100644 --- a/src/solvers/sequential_co_nonlinear_solver.cc +++ b/src/solvers/sequential_co_nonlinear_solver.cc @@ -205,7 +205,7 @@ SequentialCoNonlinearSolver::solve() { // The solve will have updated the "old solution" vector with the newton update // so it's technically the new solution. In order to update the solutions and - // perserve the old states we copy the old solution from above and swap. + // preserve the old states we copy the old solution from above and swap. *(this->get_solution_handler().get_new_solution_vector(index)) = old_solutions[index]; this->get_solution_handler() diff --git a/src/solvers/sequential_linear_solver.cc b/src/solvers/sequential_linear_solver.cc index 5ee551a58..604c41ba8 100644 --- a/src/solvers/sequential_linear_solver.cc +++ b/src/solvers/sequential_linear_solver.cc @@ -92,4 +92,4 @@ SequentialLinearSolver::print() #include "solvers/sequential_linear_solver.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/src/solvers/sequential_self_nonlinear_solver.cc b/src/solvers/sequential_self_nonlinear_solver.cc index 8a0f491a3..d4009ac5c 100644 --- a/src/solvers/sequential_self_nonlinear_solver.cc +++ b/src/solvers/sequential_self_nonlinear_solver.cc @@ -151,7 +151,7 @@ SequentialSelfNonlinearSolver::solve() } // The solve will have updated the "old solution" vector with the newton update so - // it's technically the new solution. In order to update the solutions and perserve + // it's technically the new solution. In order to update the solutions and preserve // the old states we copy the old solution from above and swap. *(this->get_solution_handler().get_new_solution_vector(index)) = old_solution; this->get_solution_handler() diff --git a/src/solvers/sequential_solver.cc b/src/solvers/sequential_solver.cc index 200e72bb9..a5f796dd8 100644 --- a/src/solvers/sequential_solver.cc +++ b/src/solvers/sequential_solver.cc @@ -364,7 +364,7 @@ SequentialSolver::solve_linear_solver( } // The solve will have updated the "old solution" vector with the newton update so it's - // technically the new solution. In order to update the solutions and perserve the old + // technically the new solution. In order to update the solutions and preserve the old // states we copy the old solution from above and swap. *(this->get_solution_handler().get_new_solution_vector(variable.get_field_index())) = old_solution; diff --git a/src/solvers/solver_base.cc b/src/solvers/solver_base.cc index 3fc683837..e761744d7 100644 --- a/src/solvers/solver_base.cc +++ b/src/solvers/solver_base.cc @@ -47,7 +47,7 @@ SolverBase::init() // Set the initial condition set_initial_condition(); - // Apply constraints. This part is neccessary so they are taken into account for + // Apply constraints. This part is necessary so they are taken into account for // adaptive meshing for (const auto &[index, variable] : subset_attributes) { @@ -66,7 +66,7 @@ SolverBase::reinit() return; } - // Apply constraints. This part is neccessary so they are taken into account for + // Apply constraints. This part is necessary so they are taken into account for // adaptive meshing for (const auto &[index, variable] : subset_attributes) { @@ -198,4 +198,4 @@ SolverBase::set_initial_condition() #include "solvers/solver_base.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/src/user_inputs/input_file_reader.cc b/src/user_inputs/input_file_reader.cc index ee2477871..eba6b2fd4 100644 --- a/src/user_inputs/input_file_reader.cc +++ b/src/user_inputs/input_file_reader.cc @@ -494,7 +494,7 @@ InputFileReader::declare_output_parameters() "condition", "EQUAL_SPACING", dealii::Patterns::Selection("EQUAL_SPACING|LOG_SPACING|N_PER_DECADE|LIST"), - "The spacing type for outputing the solution fields (either EQUAL_SPACING, " + "The spacing type for outputting the solution fields (either EQUAL_SPACING, " "LOG_SPACING, N_PER_DECADE, or LIST)."); parameter_handler.declare_entry( "list", @@ -516,7 +516,7 @@ InputFileReader::declare_output_parameters() "false", dealii::Patterns::Bool(), "Whether to print the summary table of the wall time and wall time for " - "indiviual subroutines every time the code outputs."); + "individual subroutines every time the code outputs."); } parameter_handler.leave_subsection(); } @@ -830,7 +830,7 @@ InputFileReader::declare_grain_loading_parameters() // input // // parameters.prm // file, - // // deafault setting + // // default setting // is // // unstructured // mesh diff --git a/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt b/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt index b374b109e..50d2fc559 100644 --- a/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt +++ b/tests/performance_tests/allen_cahn_explicit/CMakeLists.txt @@ -17,7 +17,7 @@ include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) # Create a project for the application project(myapp CXX) -# Set the overide for the src files +# Set the override for the src files set(TARGET_SRC_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/main.cc") # Include the autopilot macro diff --git a/tests/performance_tests/allen_cahn_explicit/custom_pde.h b/tests/performance_tests/allen_cahn_explicit/custom_pde.h index 04c1071ed..9a0c00dfd 100644 --- a/tests/performance_tests/allen_cahn_explicit/custom_pde.h +++ b/tests/performance_tests/allen_cahn_explicit/custom_pde.h @@ -257,4 +257,4 @@ CustomPDE::compute_postprocess_explicit_rhs( INSTANTIATE_TRI_TEMPLATE(CustomPDE) -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/performance_tests/allen_cahn_explicit/main.cc b/tests/performance_tests/allen_cahn_explicit/main.cc index 15c7b293a..6f9ba45db 100644 --- a/tests/performance_tests/allen_cahn_explicit/main.cc +++ b/tests/performance_tests/allen_cahn_explicit/main.cc @@ -265,4 +265,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt b/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt index b374b109e..50d2fc559 100644 --- a/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt +++ b/tests/performance_tests/cahn_hilliard_explicit/CMakeLists.txt @@ -17,7 +17,7 @@ include(${PRISMS_PF_CORE_DIR}/cmake/setup_application.cmake) # Create a project for the application project(myapp CXX) -# Set the overide for the src files +# Set the override for the src files set(TARGET_SRC_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/main.cc") # Include the autopilot macro diff --git a/tests/performance_tests/cahn_hilliard_explicit/custom_pde.h b/tests/performance_tests/cahn_hilliard_explicit/custom_pde.h index 181e4c7f5..99afa20dd 100644 --- a/tests/performance_tests/cahn_hilliard_explicit/custom_pde.h +++ b/tests/performance_tests/cahn_hilliard_explicit/custom_pde.h @@ -283,4 +283,4 @@ CustomPDE::compute_postprocess_explicit_rhs( INSTANTIATE_TRI_TEMPLATE(CustomPDE) -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/performance_tests/cahn_hilliard_explicit/main.cc b/tests/performance_tests/cahn_hilliard_explicit/main.cc index 15c7b293a..6f9ba45db 100644 --- a/tests/performance_tests/cahn_hilliard_explicit/main.cc +++ b/tests/performance_tests/cahn_hilliard_explicit/main.cc @@ -265,4 +265,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/performance_tests/scale_problem.sh b/tests/performance_tests/scale_problem.sh index 7745a092a..c7b56c5b8 100755 --- a/tests/performance_tests/scale_problem.sh +++ b/tests/performance_tests/scale_problem.sh @@ -42,9 +42,9 @@ for ((i=0; i "trial_${i}_${N_COPIES}.txt" 2>&1 -done \ No newline at end of file +done diff --git a/tests/regression_tests/CMakeLists.txt b/tests/regression_tests/CMakeLists.txt index 63873f2cf..2acfc082c 100644 --- a/tests/regression_tests/CMakeLists.txt +++ b/tests/regression_tests/CMakeLists.txt @@ -44,7 +44,7 @@ foreach(test_app ${REGRESSION_TEST_APPS}) " message(STATUS \"Building regression test: ${test_app}\") execute_process( - COMMAND ${CMAKE_COMMAND} + COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release -S ${CMAKE_INSTALL_PREFIX}/tests/regression_tests/${test_app}/ WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/tests/regression_tests/${test_app} diff --git a/tests/regression_tests/allen_cahn_explicit/ICs_and_BCs.cc b/tests/regression_tests/allen_cahn_explicit/ICs_and_BCs.cc index 9790ba5ab..2fa049989 100644 --- a/tests/regression_tests/allen_cahn_explicit/ICs_and_BCs.cc +++ b/tests/regression_tests/allen_cahn_explicit/ICs_and_BCs.cc @@ -69,4 +69,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/allen_cahn_explicit/custom_pde.h b/tests/regression_tests/allen_cahn_explicit/custom_pde.h index 54450cba3..320544d50 100644 --- a/tests/regression_tests/allen_cahn_explicit/custom_pde.h +++ b/tests/regression_tests/allen_cahn_explicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KnV = get_user_inputs().get_user_constants().get_model_constant_double("KnV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/allen_cahn_explicit/gold_output.txt b/tests/regression_tests/allen_cahn_explicit/gold_output.txt index b944da707..89a718772 100644 --- a/tests/regression_tests/allen_cahn_explicit/gold_output.txt +++ b/tests/regression_tests/allen_cahn_explicit/gold_output.txt @@ -17,7 +17,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -87,4 +87,3 @@ Iteration: 1500 | reinitialize matrix-free objects | 1 | 0.0465s | 2.1% | | reinitialize solution set | 1 | 0.00111s | 0% | +-----------------------------------+-----------+------------+------------+ - diff --git a/tests/regression_tests/allen_cahn_explicit/main.cc b/tests/regression_tests/allen_cahn_explicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/allen_cahn_explicit/main.cc +++ b/tests/regression_tests/allen_cahn_explicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/allen_cahn_implicit/ICs_and_BCs.cc b/tests/regression_tests/allen_cahn_implicit/ICs_and_BCs.cc index 7285858ca..4bd0cba21 100644 --- a/tests/regression_tests/allen_cahn_implicit/ICs_and_BCs.cc +++ b/tests/regression_tests/allen_cahn_implicit/ICs_and_BCs.cc @@ -69,4 +69,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/allen_cahn_implicit/custom_pde.h b/tests/regression_tests/allen_cahn_implicit/custom_pde.h index 54450cba3..320544d50 100644 --- a/tests/regression_tests/allen_cahn_implicit/custom_pde.h +++ b/tests/regression_tests/allen_cahn_implicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KnV = get_user_inputs().get_user_constants().get_model_constant_double("KnV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/allen_cahn_implicit/gold_output.txt b/tests/regression_tests/allen_cahn_implicit/gold_output.txt index d1684644d..b4410bed5 100644 --- a/tests/regression_tests/allen_cahn_implicit/gold_output.txt +++ b/tests/regression_tests/allen_cahn_implicit/gold_output.txt @@ -17,7 +17,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -87,4 +87,3 @@ Iteration: 1500 | reinitialize matrix-free objects | 1 | 0.0553s | 0.35% | | reinitialize solution set | 1 | 0.00146s | 0% | +-----------------------------------+-----------+------------+------------+ - diff --git a/tests/regression_tests/allen_cahn_implicit/main.cc b/tests/regression_tests/allen_cahn_implicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/allen_cahn_implicit/main.cc +++ b/tests/regression_tests/allen_cahn_implicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/cahn_hilliard_explicit/ICs_and_BCs.cc b/tests/regression_tests/cahn_hilliard_explicit/ICs_and_BCs.cc index 80e367fd6..e05998a52 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/ICs_and_BCs.cc +++ b/tests/regression_tests/cahn_hilliard_explicit/ICs_and_BCs.cc @@ -73,4 +73,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/cahn_hilliard_explicit/custom_pde.h b/tests/regression_tests/cahn_hilliard_explicit/custom_pde.h index 57d24c40b..84a12d931 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/custom_pde.h +++ b/tests/regression_tests/cahn_hilliard_explicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KcV = get_user_inputs().get_user_constants().get_model_constant_double("KcV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/cahn_hilliard_explicit/gold_output.txt b/tests/regression_tests/cahn_hilliard_explicit/gold_output.txt index 16118068b..40bcc1023 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/gold_output.txt +++ b/tests/regression_tests/cahn_hilliard_explicit/gold_output.txt @@ -16,7 +16,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -86,4 +86,3 @@ Iteration: 2500 | reinitialize matrix-free objects | 1 | 0.035s | 1.1% | | reinitialize solution set | 1 | 0.00517s | 0.16% | +-----------------------------------+-----------+------------+------------+ - diff --git a/tests/regression_tests/cahn_hilliard_explicit/main.cc b/tests/regression_tests/cahn_hilliard_explicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/cahn_hilliard_explicit/main.cc +++ b/tests/regression_tests/cahn_hilliard_explicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/cahn_hilliard_implicit/ICs_and_BCs.cc b/tests/regression_tests/cahn_hilliard_implicit/ICs_and_BCs.cc index a7c6156f7..602521d68 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/ICs_and_BCs.cc +++ b/tests/regression_tests/cahn_hilliard_implicit/ICs_and_BCs.cc @@ -72,4 +72,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/cahn_hilliard_implicit/custom_pde.h b/tests/regression_tests/cahn_hilliard_implicit/custom_pde.h index 2e3311115..6db3a033c 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/custom_pde.h +++ b/tests/regression_tests/cahn_hilliard_implicit/custom_pde.h @@ -133,4 +133,4 @@ class CustomPDE : public PDEOperator number KcV = get_user_inputs().get_user_constants().get_model_constant_double("KcV"); }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/cahn_hilliard_implicit/gold_output.txt b/tests/regression_tests/cahn_hilliard_implicit/gold_output.txt index 1739650e6..6b7b74d56 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/gold_output.txt +++ b/tests/regression_tests/cahn_hilliard_implicit/gold_output.txt @@ -17,7 +17,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -87,4 +87,3 @@ Iteration: 500 | reinitialize matrix-free objects | 1 | 0.036s | 0.12% | | reinitialize solution set | 1 | 0.000805s | 0% | +-----------------------------------+-----------+------------+------------+ - diff --git a/tests/regression_tests/cahn_hilliard_implicit/main.cc b/tests/regression_tests/cahn_hilliard_implicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/cahn_hilliard_implicit/main.cc +++ b/tests/regression_tests/cahn_hilliard_implicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/cavity_flow/custom_pde.h b/tests/regression_tests/cavity_flow/custom_pde.h index 3472a923c..165fdbb0f 100644 --- a/tests/regression_tests/cavity_flow/custom_pde.h +++ b/tests/regression_tests/cavity_flow/custom_pde.h @@ -142,7 +142,7 @@ class CustomPDE : public PDEOperator dealii::Utilities::fixed_power<2>(1.0 / get_timestep()); /** - * @brief Compute the stabilization paramters + * @brief Compute the stabilization parameters */ ScalarValue compute_stabilization_parameter(const VectorValue &velocity, diff --git a/tests/regression_tests/cavity_flow/gold_output.txt b/tests/regression_tests/cavity_flow/gold_output.txt index d1b130735..d8c3a8288 100644 --- a/tests/regression_tests/cavity_flow/gold_output.txt +++ b/tests/regression_tests/cavity_flow/gold_output.txt @@ -54,7 +54,7 @@ initializing solvers for solve block 1 ... no fields for this solver exist trying to initialize sequential co-nonlinear solvers... no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -69,59 +69,59 @@ solving 0th timestep for solve block 1 ... solving postprocessed variables... outputting initial condition... Iteration: 0 - Solution index 0 l2-norm: 10.761 integrated value: 0.00240885 0 - Solution index 1 l2-norm: 10.761 integrated value: 0.00240885 0 + Solution index 0 l2-norm: 10.761 integrated value: 0.00240885 0 + Solution index 1 l2-norm: 10.761 integrated value: 0.00240885 0 Solution index 2 l2-norm: 17.9121 integrated value: 0.0389768 Iteration: 100 - Solution index 0 l2-norm: 11.5885 integrated value: -2.71991e-05 -0.000102663 - Solution index 1 l2-norm: 11.5883 integrated value: 7.31186e-06 -0.000101503 + Solution index 0 l2-norm: 11.5885 integrated value: -2.71991e-05 -0.000102663 + Solution index 1 l2-norm: 11.5883 integrated value: 7.31186e-06 -0.000101503 Solution index 2 l2-norm: 2.52893 integrated value: 0.0192762 Iteration: 200 - Solution index 0 l2-norm: 12.4076 integrated value: -3.13275e-05 -0.000113021 - Solution index 1 l2-norm: 12.4081 integrated value: -2.76707e-06 -0.000110749 + Solution index 0 l2-norm: 12.4076 integrated value: -3.13275e-05 -0.000113021 + Solution index 1 l2-norm: 12.4081 integrated value: -2.76707e-06 -0.000110749 Solution index 2 l2-norm: 2.6702 integrated value: 0.020295 Iteration: 300 - Solution index 0 l2-norm: 13.022 integrated value: -3.22198e-05 -0.000112373 - Solution index 1 l2-norm: 13.0227 integrated value: -5.51849e-06 -0.000108644 + Solution index 0 l2-norm: 13.022 integrated value: -3.22198e-05 -0.000112373 + Solution index 1 l2-norm: 13.0227 integrated value: -5.51849e-06 -0.000108644 Solution index 2 l2-norm: 2.68708 integrated value: 0.0200857 Iteration: 400 - Solution index 0 l2-norm: 13.5109 integrated value: -3.20351e-05 -0.000111946 - Solution index 1 l2-norm: 13.5117 integrated value: -5.69371e-06 -0.000107095 + Solution index 0 l2-norm: 13.5109 integrated value: -3.20351e-05 -0.000111946 + Solution index 1 l2-norm: 13.5117 integrated value: -5.69371e-06 -0.000107095 Solution index 2 l2-norm: 2.70714 integrated value: 0.0198506 Iteration: 500 - Solution index 0 l2-norm: 13.9244 integrated value: -3.20883e-05 -0.000111665 - Solution index 1 l2-norm: 13.9252 integrated value: -5.83468e-06 -0.000106036 + Solution index 0 l2-norm: 13.9244 integrated value: -3.20883e-05 -0.000111665 + Solution index 1 l2-norm: 13.9252 integrated value: -5.83468e-06 -0.000106036 Solution index 2 l2-norm: 2.71764 integrated value: 0.0196197 Iteration: 600 - Solution index 0 l2-norm: 14.2925 integrated value: -3.15949e-05 -0.00011115 - Solution index 1 l2-norm: 14.2933 integrated value: -5.3126e-06 -0.000104946 + Solution index 0 l2-norm: 14.2925 integrated value: -3.15949e-05 -0.00011115 + Solution index 1 l2-norm: 14.2933 integrated value: -5.3126e-06 -0.000104946 Solution index 2 l2-norm: 2.71869 integrated value: 0.0193709 Iteration: 700 - Solution index 0 l2-norm: 14.629 integrated value: -3.11855e-05 -0.000110898 - Solution index 1 l2-norm: 14.6297 integrated value: -4.89831e-06 -0.000104306 + Solution index 0 l2-norm: 14.629 integrated value: -3.11855e-05 -0.000110898 + Solution index 1 l2-norm: 14.6297 integrated value: -4.89831e-06 -0.000104306 Solution index 2 l2-norm: 2.71186 integrated value: 0.0190907 Iteration: 800 - Solution index 0 l2-norm: 14.9415 integrated value: -3.08083e-05 -0.000110761 - Solution index 1 l2-norm: 14.9423 integrated value: -4.49404e-06 -0.000103865 + Solution index 0 l2-norm: 14.9415 integrated value: -3.08083e-05 -0.000110761 + Solution index 1 l2-norm: 14.9423 integrated value: -4.49404e-06 -0.000103865 Solution index 2 l2-norm: 2.70429 integrated value: 0.0188292 Iteration: 900 - Solution index 0 l2-norm: 15.2356 integrated value: -3.05322e-05 -0.000110666 - Solution index 1 l2-norm: 15.2362 integrated value: -4.18701e-06 -0.000103525 + Solution index 0 l2-norm: 15.2356 integrated value: -3.05322e-05 -0.000110666 + Solution index 1 l2-norm: 15.2362 integrated value: -4.18701e-06 -0.000103525 Solution index 2 l2-norm: 2.69528 integrated value: 0.0185743 Iteration: 1000 - Solution index 0 l2-norm: 15.5145 integrated value: -3.03352e-05 -0.000110577 - Solution index 1 l2-norm: 15.5152 integrated value: -3.96146e-06 -0.000103236 + Solution index 0 l2-norm: 15.5145 integrated value: -3.03352e-05 -0.000110577 + Solution index 1 l2-norm: 15.5152 integrated value: -3.96146e-06 -0.000103236 Solution index 2 l2-norm: 2.68484 integrated value: 0.0183214 Serial: Auxiliary solver - 3.564e-06s (1.782e-06s/call, 2 calls) diff --git a/tests/regression_tests/cavity_flow/main.cc b/tests/regression_tests/cavity_flow/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/cavity_flow/main.cc +++ b/tests/regression_tests/cavity_flow/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/cavity_flow/parameters.prm b/tests/regression_tests/cavity_flow/parameters.prm index 17a4aec45..2a52d27e8 100644 --- a/tests/regression_tests/cavity_flow/parameters.prm +++ b/tests/regression_tests/cavity_flow/parameters.prm @@ -49,4 +49,4 @@ subsection linear solver parameters: p set min mg level = 0 end -set Model constant Re = 10000.0, DOUBLE \ No newline at end of file +set Model constant Re = 10000.0, DOUBLE diff --git a/tests/regression_tests/fracture/gold_output.txt b/tests/regression_tests/fracture/gold_output.txt index 0fdf1e9ef..90be7a7e3 100644 --- a/tests/regression_tests/fracture/gold_output.txt +++ b/tests/regression_tests/fracture/gold_output.txt @@ -31,7 +31,7 @@ initializing multgrid element volumes at level 7... Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -41,7 +41,7 @@ solving 0th timestep for solve block 0 ... outputting initial condition... Iteration: 0 Solution index 0 l2-norm: 5.09902 integrated value: 1.52588e-05 - Solution index 1 l2-norm: 0.485669 integrated value: 3.13599e-05 1.92903e-07 + Solution index 1 l2-norm: 0.485669 integrated value: 3.13599e-05 1.92903e-07 Solution index 2 l2-norm: 30525.2 integrated value: -0.298384 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 @@ -56,7 +56,7 @@ Iteration: 0 Iteration: 6 Solution index 0 l2-norm: 5.11949 integrated value: 2.11511e-05 - Solution index 1 l2-norm: 0.486042 integrated value: 3.13572e-05 1.93264e-07 + Solution index 1 l2-norm: 0.486042 integrated value: 3.13572e-05 1.93264e-07 Solution index 2 l2-norm: 620.354 integrated value: 0.0284768 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 @@ -70,7 +70,7 @@ Iteration: 6 Iteration: 12 Solution index 0 l2-norm: 5.15255 integrated value: 2.28388e-05 - Solution index 1 l2-norm: 0.486532 integrated value: 3.13533e-05 1.93706e-07 + Solution index 1 l2-norm: 0.486532 integrated value: 3.13533e-05 1.93706e-07 Solution index 2 l2-norm: 592.22 integrated value: 0.0284713 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 @@ -84,7 +84,7 @@ Iteration: 12 Iteration: 18 Solution index 0 l2-norm: 5.20679 integrated value: 2.4725e-05 - Solution index 1 l2-norm: 0.48704 integrated value: 3.13507e-05 1.94157e-07 + Solution index 1 l2-norm: 0.48704 integrated value: 3.13507e-05 1.94157e-07 Solution index 2 l2-norm: 567.001 integrated value: 0.0284659 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 @@ -98,7 +98,7 @@ Iteration: 18 Iteration: 24 Solution index 0 l2-norm: 5.28092 integrated value: 2.66864e-05 - Solution index 1 l2-norm: 0.48756 integrated value: 3.13489e-05 1.94613e-07 + Solution index 1 l2-norm: 0.48756 integrated value: 3.13489e-05 1.94613e-07 Solution index 2 l2-norm: 544.645 integrated value: 0.0284605 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 @@ -112,7 +112,7 @@ Iteration: 24 Iteration: 30 Solution index 0 l2-norm: 5.37405 integrated value: 2.87961e-05 - Solution index 1 l2-norm: 0.488099 integrated value: 3.13484e-05 1.95079e-07 + Solution index 1 l2-norm: 0.488099 integrated value: 3.13484e-05 1.95079e-07 Solution index 2 l2-norm: 524.879 integrated value: 0.0284551 Solution index 3 l2-norm: 129 integrated value: 0.01 Solution index 4 l2-norm: 129 integrated value: 0.01 diff --git a/tests/regression_tests/fracture/main.cc b/tests/regression_tests/fracture/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/fracture/main.cc +++ b/tests/regression_tests/fracture/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/heat_equation_steady_state/ICs_and_BCs.cc b/tests/regression_tests/heat_equation_steady_state/ICs_and_BCs.cc index ee5a7cb62..100368106 100644 --- a/tests/regression_tests/heat_equation_steady_state/ICs_and_BCs.cc +++ b/tests/regression_tests/heat_equation_steady_state/ICs_and_BCs.cc @@ -49,4 +49,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/heat_equation_steady_state/custom_pde.h b/tests/regression_tests/heat_equation_steady_state/custom_pde.h index 4a1be6579..671dba12e 100644 --- a/tests/regression_tests/heat_equation_steady_state/custom_pde.h +++ b/tests/regression_tests/heat_equation_steady_state/custom_pde.h @@ -130,4 +130,4 @@ class CustomPDE : public PDEOperator Types::Index solve_block) const override; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/heat_equation_steady_state/equations.cc b/tests/regression_tests/heat_equation_steady_state/equations.cc index 39be65ea9..4bc2dbf5e 100644 --- a/tests/regression_tests/heat_equation_steady_state/equations.cc +++ b/tests/regression_tests/heat_equation_steady_state/equations.cc @@ -100,4 +100,4 @@ CustomPDE::compute_postprocess_explicit_rhs( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/heat_equation_steady_state/gold_output.txt b/tests/regression_tests/heat_equation_steady_state/gold_output.txt index cded550d0..0f8ee1c6d 100644 --- a/tests/regression_tests/heat_equation_steady_state/gold_output.txt +++ b/tests/regression_tests/heat_equation_steady_state/gold_output.txt @@ -29,7 +29,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... diff --git a/tests/regression_tests/heat_equation_steady_state/main.cc b/tests/regression_tests/heat_equation_steady_state/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/heat_equation_steady_state/main.cc +++ b/tests/regression_tests/heat_equation_steady_state/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/linear_solve_old_solution/ICs_and_BCs.cc b/tests/regression_tests/linear_solve_old_solution/ICs_and_BCs.cc index 8a71b9787..e2ca59543 100644 --- a/tests/regression_tests/linear_solve_old_solution/ICs_and_BCs.cc +++ b/tests/regression_tests/linear_solve_old_solution/ICs_and_BCs.cc @@ -39,4 +39,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/linear_solve_old_solution/custom_pde.h b/tests/regression_tests/linear_solve_old_solution/custom_pde.h index 4a1be6579..671dba12e 100644 --- a/tests/regression_tests/linear_solve_old_solution/custom_pde.h +++ b/tests/regression_tests/linear_solve_old_solution/custom_pde.h @@ -130,4 +130,4 @@ class CustomPDE : public PDEOperator Types::Index solve_block) const override; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/linear_solve_old_solution/gold_output.txt b/tests/regression_tests/linear_solve_old_solution/gold_output.txt index aaa15ad7d..753fe5485 100644 --- a/tests/regression_tests/linear_solve_old_solution/gold_output.txt +++ b/tests/regression_tests/linear_solve_old_solution/gold_output.txt @@ -24,7 +24,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... diff --git a/tests/regression_tests/linear_solve_old_solution/main.cc b/tests/regression_tests/linear_solve_old_solution/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/linear_solve_old_solution/main.cc +++ b/tests/regression_tests/linear_solve_old_solution/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/linear_solve_old_solution/parameters.prm b/tests/regression_tests/linear_solve_old_solution/parameters.prm index 873873ae6..fe3a018cc 100644 --- a/tests/regression_tests/linear_solve_old_solution/parameters.prm +++ b/tests/regression_tests/linear_solve_old_solution/parameters.prm @@ -19,4 +19,4 @@ subsection output set number = 1 end -set boundary condition for u = Dirichlet: 0.0, Dirichlet: 1.0, Natural, Natural \ No newline at end of file +set boundary condition for u = Dirichlet: 0.0, Dirichlet: 1.0, Natural, Natural diff --git a/tests/regression_tests/mechanics/ICs_and_BCs.cc b/tests/regression_tests/mechanics/ICs_and_BCs.cc index 8a71b9787..e2ca59543 100644 --- a/tests/regression_tests/mechanics/ICs_and_BCs.cc +++ b/tests/regression_tests/mechanics/ICs_and_BCs.cc @@ -39,4 +39,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/mechanics/gold_output.txt b/tests/regression_tests/mechanics/gold_output.txt index 3e7c158e2..7807261e1 100644 --- a/tests/regression_tests/mechanics/gold_output.txt +++ b/tests/regression_tests/mechanics/gold_output.txt @@ -27,7 +27,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -36,7 +36,7 @@ solving 0th timestep for solve block 0 ... solving postprocessed variables... outputting initial condition... Iteration: 0 - Solution index 0 l2-norm: 41.9487 integrated value: -500000 -1.34155e-10 -1.81899e-11 + Solution index 0 l2-norm: 41.9487 integrated value: -500000 -1.34155e-10 -1.81899e-11 Serial: Auxiliary solver - 1.187e-06s (1.187e-06s/call, 1 calls) diff --git a/tests/regression_tests/mechanics/main.cc b/tests/regression_tests/mechanics/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/mechanics/main.cc +++ b/tests/regression_tests/mechanics/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/precipitate_explicit/gold_output.txt b/tests/regression_tests/precipitate_explicit/gold_output.txt index 174e80116..e19d470b4 100644 --- a/tests/regression_tests/precipitate_explicit/gold_output.txt +++ b/tests/regression_tests/precipitate_explicit/gold_output.txt @@ -29,7 +29,7 @@ Initializing solvers for solve block 0 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... @@ -42,7 +42,7 @@ Iteration: 0 Solution index 1 l2-norm: 27.8326 integrated value: 40.1673 Solution index 2 l2-norm: 19.6806 integrated value: 20.0837 Solution index 3 l2-norm: 19.6806 integrated value: 20.0837 - Solution index 4 l2-norm: 3.42424 integrated value: -0.73956 0.73956 + Solution index 4 l2-norm: 3.42424 integrated value: -0.73956 0.73956 Solution index 5 l2-norm: 357.19 integrated value: -2961.1 @@ -51,7 +51,7 @@ Iteration: 10 Solution index 1 l2-norm: 27.2076 integrated value: 39.1555 Solution index 2 l2-norm: 19.2362 integrated value: 19.5736 Solution index 3 l2-norm: 19.2356 integrated value: 19.5725 - Solution index 4 l2-norm: 3.32301 integrated value: -0.713791 0.712968 + Solution index 4 l2-norm: 3.32301 integrated value: -0.713791 0.712968 Solution index 5 l2-norm: 357.284 integrated value: -2961.81 Iteration: 20 @@ -59,7 +59,7 @@ Iteration: 20 Solution index 1 l2-norm: 26.6332 integrated value: 38.1392 Solution index 2 l2-norm: 18.8276 integrated value: 19.0613 Solution index 3 l2-norm: 18.8264 integrated value: 19.0591 - Solution index 4 l2-norm: 3.22758 integrated value: -0.689252 0.687675 + Solution index 4 l2-norm: 3.22758 integrated value: -0.689252 0.687675 Solution index 5 l2-norm: 357.349 integrated value: -2962.27 Iteration: 30 @@ -67,7 +67,7 @@ Iteration: 30 Solution index 1 l2-norm: 26.091 integrated value: 37.1381 Solution index 2 l2-norm: 18.4419 integrated value: 18.5568 Solution index 3 l2-norm: 18.4401 integrated value: 18.5536 - Solution index 4 l2-norm: 3.13715 integrated value: -0.665947 0.663696 + Solution index 4 l2-norm: 3.13715 integrated value: -0.665947 0.663696 Solution index 5 l2-norm: 357.403 integrated value: -2962.63 Iteration: 40 @@ -75,7 +75,7 @@ Iteration: 40 Solution index 1 l2-norm: 25.5745 integrated value: 36.1616 Solution index 2 l2-norm: 18.0745 integrated value: 18.065 Solution index 3 l2-norm: 18.0721 integrated value: 18.0608 - Solution index 4 l2-norm: 3.05131 integrated value: -0.643843 0.640997 + Solution index 4 l2-norm: 3.05131 integrated value: -0.643843 0.640997 Solution index 5 l2-norm: 357.45 integrated value: -2962.94 Iteration: 50 @@ -83,7 +83,7 @@ Iteration: 50 Solution index 1 l2-norm: 25.0805 integrated value: 35.2155 Solution index 2 l2-norm: 17.7228 integrated value: 17.5884 Solution index 3 l2-norm: 17.72 integrated value: 17.5833 - Solution index 4 l2-norm: 2.96978 integrated value: -0.6229 0.619525 + Solution index 4 l2-norm: 2.96978 integrated value: -0.6229 0.619525 Solution index 5 l2-norm: 357.491 integrated value: -2963.21 Serial: Auxiliary solver - 1.187e-06s (1.187e-06s/call, 1 calls) diff --git a/tests/regression_tests/precipitate_explicit/main.cc b/tests/regression_tests/precipitate_explicit/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/precipitate_explicit/main.cc +++ b/tests/regression_tests/precipitate_explicit/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/regression_tests/solution_blocks/ICs_and_BCs.cc b/tests/regression_tests/solution_blocks/ICs_and_BCs.cc index 8a71b9787..e2ca59543 100644 --- a/tests/regression_tests/solution_blocks/ICs_and_BCs.cc +++ b/tests/regression_tests/solution_blocks/ICs_and_BCs.cc @@ -39,4 +39,4 @@ CustomPDE::set_nonuniform_dirichlet( #include "custom_pde.inst" -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/solution_blocks/custom_pde.h b/tests/regression_tests/solution_blocks/custom_pde.h index 4a1be6579..671dba12e 100644 --- a/tests/regression_tests/solution_blocks/custom_pde.h +++ b/tests/regression_tests/solution_blocks/custom_pde.h @@ -130,4 +130,4 @@ class CustomPDE : public PDEOperator Types::Index solve_block) const override; }; -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/regression_tests/solution_blocks/gold_output.txt b/tests/regression_tests/solution_blocks/gold_output.txt index a7ee0be3d..746fd55bd 100644 --- a/tests/regression_tests/solution_blocks/gold_output.txt +++ b/tests/regression_tests/solution_blocks/gold_output.txt @@ -25,7 +25,7 @@ Initializing solvers for solve block 1 ... no fields for this solver exist no fields for this solver exist no fields for this solver exist -initializing grid refiner... grid refinment disabled... +initializing grid refiner... grid refinement disabled... solving 0th timestep for solve block 0 ... solving auxiliary variables... solving linear time-independent variables... diff --git a/tests/regression_tests/solution_blocks/main.cc b/tests/regression_tests/solution_blocks/main.cc index 9cd0b22fa..a376b9106 100644 --- a/tests/regression_tests/solution_blocks/main.cc +++ b/tests/regression_tests/solution_blocks/main.cc @@ -260,4 +260,4 @@ main(int argc, char *argv[]) } return 0; -} \ No newline at end of file +} diff --git a/tests/unit_tests/.gitignore b/tests/unit_tests/.gitignore index 5ad35957f..f208c2f5b 100644 --- a/tests/unit_tests/.gitignore +++ b/tests/unit_tests/.gitignore @@ -2,4 +2,4 @@ test_core test_field_input test_user_inputs -test_utilities \ No newline at end of file +test_utilities diff --git a/tests/unit_tests/core/field_solve_type.cc b/tests/unit_tests/core/field_solve_type.cc index 0405b5725..b03aebee9 100644 --- a/tests/unit_tests/core/field_solve_type.cc +++ b/tests/unit_tests/core/field_solve_type.cc @@ -15,7 +15,7 @@ PRISMS_PF_BEGIN_NAMESPACE /** * This unit test looks at variable_attributes.h and variable_attribute_loader.h and how - * the parser determines the field sovle type of each field. In turn, the determines the + * the parser determines the field solve type of each field. In turn, the determines the * solver and other information such as nonlinearity. */ TEST_CASE("Field solve types") diff --git a/tests/unit_tests/core/main.cc b/tests/unit_tests/core/main.cc index 649c944c5..7b3647500 100644 --- a/tests/unit_tests/core/main.cc +++ b/tests/unit_tests/core/main.cc @@ -2,4 +2,4 @@ // SPDX-License-Identifier: GNU Lesser General Public Version 2.1 #define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file +#include "catch.hpp" diff --git a/tests/unit_tests/core/variable_attribute_loader.cc b/tests/unit_tests/core/variable_attribute_loader.cc index a04529b26..cea9141ed 100644 --- a/tests/unit_tests/core/variable_attribute_loader.cc +++ b/tests/unit_tests/core/variable_attribute_loader.cc @@ -15,7 +15,7 @@ PRISMS_PF_BEGIN_NAMESPACE /** * This unit tests looks at variable_attributes.h and variable_attribute_loader.h and how - * the parser interpretes invalid user dependencies. + * the parser interprets invalid user dependencies. */ TEST_CASE("Invalid dependencies") { diff --git a/tests/unit_tests/field_input/.gitignore b/tests/unit_tests/field_input/.gitignore index a3b8f9ff1..923979040 100644 --- a/tests/unit_tests/field_input/.gitignore +++ b/tests/unit_tests/field_input/.gitignore @@ -1,3 +1,3 @@ # Exlcude vtk files here !*.vtk -!*.vtu \ No newline at end of file +!*.vtu diff --git a/tests/unit_tests/field_input/main.cc b/tests/unit_tests/field_input/main.cc index 649c944c5..7b3647500 100644 --- a/tests/unit_tests/field_input/main.cc +++ b/tests/unit_tests/field_input/main.cc @@ -2,4 +2,4 @@ // SPDX-License-Identifier: GNU Lesser General Public Version 2.1 #define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file +#include "catch.hpp" diff --git a/tests/unit_tests/field_input/read_binary.cc b/tests/unit_tests/field_input/read_binary.cc index bddf3cd8d..85868ac67 100644 --- a/tests/unit_tests/field_input/read_binary.cc +++ b/tests/unit_tests/field_input/read_binary.cc @@ -466,4 +466,4 @@ TEST_CASE("Read binary file") } } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/unit_tests/field_input/read_vtk.cc b/tests/unit_tests/field_input/read_vtk.cc index bcbcbdada..bdedffe54 100644 --- a/tests/unit_tests/field_input/read_vtk.cc +++ b/tests/unit_tests/field_input/read_vtk.cc @@ -104,4 +104,4 @@ TEST_CASE("Read vtk file") PRISMS_PF_END_NAMESPACE -#endif \ No newline at end of file +#endif diff --git a/tests/unit_tests/field_input/test_2D_1degree.vtk b/tests/unit_tests/field_input/test_2D_1degree.vtk index 728f097be..7093edf6b 100644 --- a/tests/unit_tests/field_input/test_2D_1degree.vtk +++ b/tests/unit_tests/field_input/test_2D_1degree.vtk @@ -32,7 +32,7 @@ CELL_TYPES 4 POINT_DATA 16 SCALARS n double 1 LOOKUP_TABLE default -0 5 0 5 5 10 5 10 0 5 0 5 5 10 5 10 +0 5 0 5 5 10 5 10 0 5 0 5 5 10 5 10 SCALARS |nx| double 1 LOOKUP_TABLE default -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/tests/unit_tests/field_input/test_2D_2degree.vtk b/tests/unit_tests/field_input/test_2D_2degree.vtk index 694993214..ba22ef850 100644 --- a/tests/unit_tests/field_input/test_2D_2degree.vtk +++ b/tests/unit_tests/field_input/test_2D_2degree.vtk @@ -64,7 +64,7 @@ CELL_TYPES 16 POINT_DATA 36 SCALARS n double 1 LOOKUP_TABLE default -0 2.5 5 0 2.5 5 0 2.5 5 5 7.5 10 5 7.5 10 5 7.5 10 0 2.5 5 0 2.5 5 0 2.5 5 5 7.5 10 5 7.5 10 5 7.5 10 +0 2.5 5 0 2.5 5 0 2.5 5 5 7.5 10 5 7.5 10 5 7.5 10 0 2.5 5 0 2.5 5 0 2.5 5 5 7.5 10 5 7.5 10 5 7.5 10 SCALARS |nx| double 1 LOOKUP_TABLE default -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/tests/unit_tests/field_input/test_3D_1degree.vtk b/tests/unit_tests/field_input/test_3D_1degree.vtk index c6c3ea58a..64e4f9267 100644 --- a/tests/unit_tests/field_input/test_3D_1degree.vtk +++ b/tests/unit_tests/field_input/test_3D_1degree.vtk @@ -84,7 +84,7 @@ CELL_TYPES 8 POINT_DATA 64 SCALARS n double 1 LOOKUP_TABLE default -0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 +0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 0 5 0 5 0 5 0 5 5 10 5 10 5 10 5 10 SCALARS |nx| double 1 LOOKUP_TABLE default -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/tests/unit_tests/user_inputs/initial_condition_read_in.cc b/tests/unit_tests/user_inputs/initial_condition_read_in.cc index fd1090605..ca10c4b47 100644 --- a/tests/unit_tests/user_inputs/initial_condition_read_in.cc +++ b/tests/unit_tests/user_inputs/initial_condition_read_in.cc @@ -36,4 +36,4 @@ TEST_CASE("Initial condition read in") } } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/unit_tests/user_inputs/main.cc b/tests/unit_tests/user_inputs/main.cc index 649c944c5..7b3647500 100644 --- a/tests/unit_tests/user_inputs/main.cc +++ b/tests/unit_tests/user_inputs/main.cc @@ -2,4 +2,4 @@ // SPDX-License-Identifier: GNU Lesser General Public Version 2.1 #define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file +#include "catch.hpp" diff --git a/tests/unit_tests/user_inputs/nonlinear_solve_parameters.cc b/tests/unit_tests/user_inputs/nonlinear_solve_parameters.cc index 916382e44..22f7def32 100644 --- a/tests/unit_tests/user_inputs/nonlinear_solve_parameters.cc +++ b/tests/unit_tests/user_inputs/nonlinear_solve_parameters.cc @@ -59,4 +59,4 @@ TEST_CASE("Nonlinear solve parameters") } } -PRISMS_PF_END_NAMESPACE \ No newline at end of file +PRISMS_PF_END_NAMESPACE diff --git a/tests/unit_tests/utilities/main.cc b/tests/unit_tests/utilities/main.cc index 649c944c5..7b3647500 100644 --- a/tests/unit_tests/utilities/main.cc +++ b/tests/unit_tests/utilities/main.cc @@ -2,4 +2,4 @@ // SPDX-License-Identifier: GNU Lesser General Public Version 2.1 #define CATCH_CONFIG_MAIN -#include "catch.hpp" \ No newline at end of file +#include "catch.hpp" diff --git a/tests/unit_tests/utilities/utilities.cc b/tests/unit_tests/utilities/utilities.cc index 81fab6953..4250f71b7 100644 --- a/tests/unit_tests/utilities/utilities.cc +++ b/tests/unit_tests/utilities/utilities.cc @@ -12,7 +12,7 @@ PRISMS_PF_BEGIN_NAMESPACE /** - * This unit test looks at the compute stress utility funcition + * This unit test looks at the compute stress utility function */ TEST_CASE("Compute stress") { diff --git a/version_changes.md b/version_changes.md index 243f72e2e..a3ab72334 100644 --- a/version_changes.md +++ b/version_changes.md @@ -1,11 +1,11 @@ # Version 2.4.1 -Minor update from 2.4. The main changes are: +Minor update from 2.4. The main changes are: * Minor bug fixes. * Compilation has been fixed for clang, gcc, and intel-oneapi compilers that support the c++17 standard. * deal.II 9.5.0 or later is now required. # Version 2.4 -Moderate update from 2.3. The main changes are compatibility with deal.II 9.6.0, support for the use of up to 6th order elements, +Moderate update from 2.3. The main changes are compatibility with deal.II 9.6.0, support for the use of up to 6th order elements, improved testing and continuous integration, code auto-formatting, and bug fixes. ## Features @@ -37,11 +37,11 @@ improved testing and continuous integration, code auto-formatting, and bug fixes # Version 2.3 -Moderate update from 2.2, released in July 2021. The main changes are new applications, new postprocessing scripts, improvements in performance, bug fixes and comparibility with the latest version of deal.II. +Moderate update from 2.2, released in July 2021. The main changes are new applications, new postprocessing scripts, improvements in performance, bug fixes and compatibility with the latest version of deal.II. ## Added Features: -- New applications: +- New applications: - [corrosion_microgalvanic](https://github.com/prisms-center/phaseField/tree/master/applications/corrosion_microgalvanic): Simulates the evolution of the metal-electrolyte interface during free immersion due to the microgalvanic coupling between anodic and cathodic metals. - [alloySolidification_uniform](https://github.com/prisms-center/phaseField/tree/master/applications/alloySolidification_uniform): Simulates solidification of a binary alloy at uniform temperature. - [allenCahn_conserved](https://github.com/prisms-center/phaseField/tree/master/applications/allenCahn_conserved): Simulates a system undergoing Allen-Cahn dynamics subject to global (as opposed to local) conservation. @@ -49,14 +49,14 @@ Moderate update from 2.2, released in July 2021. The main changes are new applic - plot_and_save.py - This script creates a pseudocolor (in 2D) or contour (in 3D) plot for each outputted time states and saves the serieas of plots as png images. - domain_stats.py - This script calculates the following quantities for each of the time states: - Number of domains, defined as the number or separate regions based on the values of field variable, "n". Each interconnected region for which n>0.5 is counted as a separate domain. - + - Average domain size (area in 2D and volume in 3D) - + - Standard deviation of the domain sizes - splitvtufiles.py - This script splits the output .vtu files into several files, allowing for parallel visualization in VisIt or ParaView. - New options for nucleation were added: an option to set the time interval for then nucleation is allowed and an option to allow for microstructure evolution before the first nucleation event. - Improved the method for grain detection when reading data from a DREAM3D microstructure file. -- Added depencency of element degree for time step used in initial smoothing after reading from a DREAM3D microstructure file. This avoids posible numerical instabilities. +- Added dependency of element degree for time step used in initial smoothing after reading from a DREAM3D microstructure file. This avoids possible numerical instabilities. - Added Troubleshooting/FAQ page with the most common compilation/runtime errors and the way to fix them. ## Bug Fixes: @@ -68,7 +68,7 @@ Moderate update from 2.2, released in July 2021. The main changes are new applic ## Other Changes: -- Updated comparibility with deal.II version 9.5.x +- Updated compatibility with deal.II version 9.5.x # Version 2.2 From c430f118dd585a087f3c1218ca5d1fbdf7dccbae Mon Sep 17 00:00:00 2001 From: Jason Landini <123970616+landinjm@users.noreply.github.com> Date: Fri, 2 Jan 2026 17:45:22 -0500 Subject: [PATCH 3/4] clang format (#760) --- .github/workflows/clang-format.yml | 3 --- .pre-commit-config.yaml | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index b6bf57bc1..070bc6790 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -5,9 +5,6 @@ on: branches: - master pull_request: - branches: - - master - - devel paths-ignore: - 'doc/**' - 'contrib/**' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 45dc87b4e..bebee9cba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,3 +49,10 @@ repos: rev: 0.25.0 hooks: - id: gersemi +# c++ formatting +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.8 + hooks: + - id: clang-format + types_or: [c++, c, cuda] + exclude: ^contrib/catch/ From c81b828f510d00c77f533878e0662a79d0f8235b Mon Sep 17 00:00:00 2001 From: landinjm Date: Mon, 12 Jan 2026 14:15:20 -0500 Subject: [PATCH 4/4] removing these checks --- .github/workflows/clang-tidy.yml | 54 -------------------------------- .github/workflows/cppcheck.yml | 52 ------------------------------ 2 files changed, 106 deletions(-) delete mode 100644 .github/workflows/clang-tidy.yml delete mode 100644 .github/workflows/cppcheck.yml diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml deleted file mode 100644 index 740e84a8f..000000000 --- a/.github/workflows/clang-tidy.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Clang-tidy - -on: - push: - branches: - - master - pull_request: - branches: - - master - - devel - types: - - opened - - reopened - - synchronize - - ready_for_review - paths-ignore: - - 'applications/**' - - 'contrib/**' - - 'doc/**' - - 'tests/**' - - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request'}} - -jobs: - clang-tidy: - runs-on: [ubuntu-22.04] - timeout-minutes: 120 - - container: - image: dealii/dealii:v9.6.0-jammy - options: --user root - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 30 - - - name: Install llvm-20 - run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - ./llvm.sh 20 all - - - name: Set up path for llvm-20 - run: | - echo "/usr/lib/llvm-20/bin" >> "$GITHUB_PATH" - - - name: Run clang-tidy - run: | - ./contrib/utilities/clang_tidy.sh -j$(nproc) diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml deleted file mode 100644 index 400c814ec..000000000 --- a/.github/workflows/cppcheck.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Cppcheck - -on: - push: - branches: - - master - pull_request: - branches: - - master - - devel - types: - - opened - - reopened - - synchronize - - ready_for_review - paths-ignore: - - 'contrib/**' - - 'doc/**' - - -concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request'}} - -jobs: - cppcheck: - runs-on: [ubuntu-22.04] - - container: - image: dealii/dealii:v9.6.0-jammy - options: --user root - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 30 - - - name: Install cppcheck - run: | - wget https://github.com/danmar/cppcheck/archive/refs/tags/2.17.1.tar.gz - tar -xvzf 2.17.1.tar.gz - cd cppcheck-2.17.1/ - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. - cmake --build . --config RelWithDebInfo - sudo make install - - - name: Run cppcheck - run: | - ./contrib/utilities/cppcheck.sh -j$(nproc)