diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index ff35588f45..3584d48332 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -43,7 +43,7 @@ jobs: remove-docker-images: 'true' - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # It's easier to reference named variables than indexes of the matrix - name: Set Environment diff --git a/.github/workflows/builds-and-tests.yml b/.github/workflows/builds-and-tests.yml index a4e3d49690..0091c8d7e8 100644 --- a/.github/workflows/builds-and-tests.yml +++ b/.github/workflows/builds-and-tests.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -104,7 +104,7 @@ jobs: # This external action allows to interrupt a workflow already running on # the same branch to save resources. - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} @@ -120,7 +120,7 @@ jobs: # /home/runner/work/mfem/mfem/mfem # Note: Done now to access "install-hypre" and "install-metis" actions. - name: checkout mfem - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ${{ env.MFEM_TOP_DIR }} # Fetch the complete history for codecov to access commits ID @@ -166,7 +166,7 @@ jobs: - name: cache hypre id: hypre-cache if: matrix.mpi == 'par' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.HYPRE_TOP_DIR }} key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-${{ matrix.hypre-target }}-v2.2 @@ -194,7 +194,7 @@ jobs: - name: cache metis id: metis-cache if: matrix.mpi == 'par' && matrix.os != 'windows-latest' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.METIS_TOP_DIR }} key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.2 @@ -209,7 +209,7 @@ jobs: - name: cache vcpkg (Windows) id: vcpkg-cache if: matrix.os == 'windows-latest' - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: vcpkg_cache key: ${{ runner.os }}-${{ matrix.mpi }}-vcpkg-v1 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index edf71c2ff3..8e3cdb8a4e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/mfem-analysis.yml b/.github/workflows/mfem-analysis.yml index 94a597fcaa..bd99ec49df 100644 --- a/.github/workflows/mfem-analysis.yml +++ b/.github/workflows/mfem-analysis.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -35,12 +35,12 @@ jobs: steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - name: checkout MFEM - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: mfem @@ -50,7 +50,7 @@ jobs: - name: Cache Hypre Install id: hypre-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.HYPRE_TOP_DIR }} key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2.2 @@ -65,7 +65,7 @@ jobs: - name: Cache Metis Install id: metis-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.METIS_TOP_DIR }} key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.2 diff --git a/.github/workflows/mfem-sanitizer.yml b/.github/workflows/mfem-sanitizer.yml index 7370843703..d6bc78df9a 100644 --- a/.github/workflows/mfem-sanitizer.yml +++ b/.github/workflows/mfem-sanitizer.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -28,12 +28,12 @@ jobs: steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - name: MFEM Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: mfem diff --git a/.github/workflows/repo-check.yml b/.github/workflows/repo-check.yml index 994a9faf44..bb34ac3cf6 100644 --- a/.github/workflows/repo-check.yml +++ b/.github/workflows/repo-check.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -34,12 +34,12 @@ jobs: github.event.pull_request.head.repo.full_name != github.repository) steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.1 with: access_token: ${{ github.token }} - name: checkout mfem - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: copyright check id: copyright @@ -60,11 +60,18 @@ jobs: ./config/githooks/pre-push --release continue-on-error: true + - name: math check + id: math + run: | + ./config/githooks/pre-push --math + continue-on-error: true + - name: wrap-up if: | steps.copyright.outcome != 'success' || steps.license.outcome != 'success' || - steps.release.outcome != 'success' + steps.release.outcome != 'success' || + steps.math.outcome != 'success' run: | if [[ "${{ steps.copyright.outcome }}" != "success" ]]; then echo "copyright check failed, unroll log for details" @@ -75,6 +82,9 @@ jobs: if [[ "${{ steps.release.outcome }}" != "success" ]]; then echo "release check failed, unroll log for details" fi + if [[ "${{ steps.math.outcome }}" != "success" ]]; then + echo "math check failed, unroll log for details" + fi exit 1 code-style: @@ -84,7 +94,7 @@ jobs: github.event.pull_request.head.repo.full_name != github.repository) steps: - name: checkout mfem - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: get astyle run: | @@ -101,7 +111,7 @@ jobs: github.event.pull_request.head.repo.full_name != github.repository) steps: - name: checkout mfem - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: get doxygen and graphviz run: | @@ -126,7 +136,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout mfem - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.gitignore b/.gitignore index f7e7265d6a..1ba1a28c87 100644 --- a/.gitignore +++ b/.gitignore @@ -342,6 +342,7 @@ miniapps/toys/mondrian.mesh miniapps/solvers/block-solvers miniapps/solvers/lor_solvers miniapps/solvers/plor_solvers +miniapps/solvers/lor_elast miniapps/solvers/ParaView miniapps/solvers/mesh.* miniapps/solvers/sol.* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 525407f74e..84e7e6374d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/common.yml b/.gitlab/configs/common.yml index fa2b46f85f..5a47df771a 100644 --- a/.gitlab/configs/common.yml +++ b/.gitlab/configs/common.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/corona-config.yml b/.gitlab/configs/corona-config.yml index afac505b26..9e745e3a07 100644 --- a/.gitlab/configs/corona-config.yml +++ b/.gitlab/configs/corona-config.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/lassen-config.yml b/.gitlab/configs/lassen-config.yml index 6f6605fc7c..bba553b084 100644 --- a/.gitlab/configs/lassen-config.yml +++ b/.gitlab/configs/lassen-config.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/quartz-config.yml b/.gitlab/configs/quartz-config.yml index 3586afc7d4..80aaad5155 100644 --- a/.gitlab/configs/quartz-config.yml +++ b/.gitlab/configs/quartz-config.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/report-build-and-test.yml b/.gitlab/configs/report-build-and-test.yml index 7b3d856728..ea551c0dd4 100644 --- a/.gitlab/configs/report-build-and-test.yml +++ b/.gitlab/configs/report-build-and-test.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/setup-baseline.yml b/.gitlab/configs/setup-baseline.yml index af72cd9196..b270fa1129 100644 --- a/.gitlab/configs/setup-baseline.yml +++ b/.gitlab/configs/setup-baseline.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/configs/setup-build-and-test.yml b/.gitlab/configs/setup-build-and-test.yml index c236318790..eea20e9757 100644 --- a/.gitlab/configs/setup-build-and-test.yml +++ b/.gitlab/configs/setup-build-and-test.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/corona-build-and-test.yml b/.gitlab/corona-build-and-test.yml index e13c54c320..f5190d0324 100644 --- a/.gitlab/corona-build-and-test.yml +++ b/.gitlab/corona-build-and-test.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/lassen-build-and-test.yml b/.gitlab/lassen-build-and-test.yml index 617186b868..8e0f8880dd 100644 --- a/.gitlab/lassen-build-and-test.yml +++ b/.gitlab/lassen-build-and-test.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/quartz-baseline.yml b/.gitlab/quartz-baseline.yml index 361d3b5bab..e03c794ade 100644 --- a/.gitlab/quartz-baseline.yml +++ b/.gitlab/quartz-baseline.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/quartz-build-and-test.yml b/.gitlab/quartz-build-and-test.yml index 3f7ec7be7c..4c5e440da4 100644 --- a/.gitlab/quartz-build-and-test.yml +++ b/.gitlab/quartz-build-and-test.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -23,7 +23,7 @@ allocate_resource: stage: allocate_resource script: - echo ${ALLOC_NAME} - - salloc --exclusive --nodes=1 --partition=pdebug --time=45 --no-shell --job-name=${ALLOC_NAME} + - salloc --exclusive --nodes=1 --reservation=ci --time=60 --no-shell --job-name=${ALLOC_NAME} timeout: 6h # GitLab jobs for the Quartz machine at LLNL diff --git a/.gitlab/scripts/baseline b/.gitlab/scripts/baseline index 540ee3957a..7734995b3d 100755 --- a/.gitlab/scripts/baseline +++ b/.gitlab/scripts/baseline @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/scripts/git_try_to_push b/.gitlab/scripts/git_try_to_push index b28c15441a..3bfa2bb632 100755 --- a/.gitlab/scripts/git_try_to_push +++ b/.gitlab/scripts/git_try_to_push @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/scripts/rebaseline b/.gitlab/scripts/rebaseline index 4e8175bbd9..4d858ef253 100755 --- a/.gitlab/scripts/rebaseline +++ b/.gitlab/scripts/rebaseline @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/scripts/report_build_and_test_failure b/.gitlab/scripts/report_build_and_test_failure index 7a32363af1..08dd37a5eb 100755 --- a/.gitlab/scripts/report_build_and_test_failure +++ b/.gitlab/scripts/report_build_and_test_failure @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/scripts/report_build_and_test_success b/.gitlab/scripts/report_build_and_test_success index 6f9159aec1..65ecb9f5e2 100755 --- a/.gitlab/scripts/report_build_and_test_success +++ b/.gitlab/scripts/report_build_and_test_success @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/.gitlab/scripts/safe_create_rundir b/.gitlab/scripts/safe_create_rundir index f87ad7941f..a8e651e985 100755 --- a/.gitlab/scripts/safe_create_rundir +++ b/.gitlab/scripts/safe_create_rundir @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/CHANGELOG b/CHANGELOG index f309fb30b5..70b7325cf8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,6 +22,23 @@ Discretization improvements IntegrationRules through a moment-fitting approach. The cut is specified by the zero level set of a Coefficient. See fem/intrules_cut.hpp and Example 38. +GPU support +---------------------------- +- Added support for full assembly on simplices. +- Added functionality for BilinearFormIntegrators to use kernels that work for both + tensor and unstructured elements. +- Added partial assembly for linear elasticity. Does not use sum factorization for now. + +New and updated examples and miniapps +------------------------------------- +- Added a new block solver in miniapp/solvers for the Darcy problem. + The new solver is based on a Bramble-Pasciak preconditioning. User can + use and implement their own preconditioner for the mass matrix. + +- Added miniapp to demonstrate new elasticity integrator and unstructured element GPU support, + and a block diagonal preconditioner using low order refinement. Allows comparison with + currently existing legacy mode integrator. See miniapps/solvers/lor_elast. + Miscellaneous ------------- - The ReadCubit Genesis mesh importer has been rewritten to improve readability. diff --git a/CMakeLists.txt b/CMakeLists.txt index e4440ac02b..a7098d6e8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -18,9 +18,10 @@ set(USER_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/config/user.cmake" CACHE PATH "Path to optional user configuration file.") # Require C++11 and disable compiler-specific extensions -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to use.") +set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL + "Force the use of the chosen C++ standard.") +set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Enable C++ standard extensions.") # Load user settings before the defaults - this way the defaults will not # overwrite the user set options. If the user has not set all options, we still @@ -93,7 +94,7 @@ if ((MFEM_USE_SUNDIALS OR MFEM_USE_RAJA OR MFEM_USE_UMPIRE) AND ("${CMAKE_CXX_STANDARD}" LESS "14")) - set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to use." FORCE) endif() # Include xSDK default CMake file. @@ -104,7 +105,8 @@ enable_language(CXX) if (MINGW) # MinGW GCC does not expose the functions jn/_jn, yn/_yn (used in Example # 25/25p) unless we use '-std=gnu++11': - set(CMAKE_CXX_EXTENSIONS ON) + set(CMAKE_CXX_EXTENSIONS ON + CACHE BOOL "Enable C++ standard extensions." FORCE) endif() if (MFEM_USE_CUDA) if (MFEM_USE_HIP) @@ -115,9 +117,11 @@ if (MFEM_USE_CUDA) set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER}) endif() enable_language(CUDA) - set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) - set(CMAKE_CUDA_STANDARD_REQUIRED ON) - set(CMAKE_CUDA_EXTENSIONS OFF) + set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD} CACHE STRING + "CUDA standard to use.") + set(CMAKE_CUDA_STANDARD_REQUIRED ON CACHE BOOL + "Force the use of the chosen CUDA standard.") + set(CMAKE_CUDA_EXTENSIONS OFF CACHE BOOL "Enable CUDA standard extensions.") set(CUDA_FLAGS "--expt-extended-lambda") if (CMAKE_VERSION VERSION_LESS 3.18.0) set(CUDA_FLAGS "-arch=${CUDA_ARCH} ${CUDA_FLAGS}") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2282995370..292e4f7723 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -346,6 +346,9 @@ Before you can start, you need a GitHub account, here are a few suggestions: - Code specifics - All new public, protected, and private classes, methods, data members, and functions have Doxygen-style documentation in source comments. + - Math formulas can be included in the Doxygen comments either with standard + LaTeX (`$..$` and `$$..$$`) for portions that need detailed explanation, or with + [Unicode](https://www.unicodeit.net/) or plain text when short or readable description is preferable. - In addition to arguments and functionality, documentation should include the current limitations of the code, any background information that is implicitly assumed in the implementation, and the ownership and lifetime diff --git a/LICENSE b/LICENSE index 3dc5646efa..c927547f9a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC +Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt index 3ea94fdb1e..87c6064592 100644 --- a/config/CMakeLists.txt +++ b/config/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/MFEMConfig.cmake.in b/config/cmake/MFEMConfig.cmake.in index ed271311ae..a1a51e28df 100644 --- a/config/cmake/MFEMConfig.cmake.in +++ b/config/cmake/MFEMConfig.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/config.hpp.in b/config/cmake/config.hpp.in index 7cb2a958d7..aae737aa26 100644 --- a/config/cmake/config.hpp.in +++ b/config/cmake/config.hpp.in @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/cmake/modules/FindAMGX.cmake b/config/cmake/modules/FindAMGX.cmake index 7450068c4c..f2d0c91103 100644 --- a/config/cmake/modules/FindAMGX.cmake +++ b/config/cmake/modules/FindAMGX.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindAlgoim.cmake b/config/cmake/modules/FindAlgoim.cmake index e0ec4520bb..3cb40f2eb0 100644 --- a/config/cmake/modules/FindAlgoim.cmake +++ b/config/cmake/modules/FindAlgoim.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindAxom.cmake b/config/cmake/modules/FindAxom.cmake index 7cccc83ea4..195e9f05b4 100644 --- a/config/cmake/modules/FindAxom.cmake +++ b/config/cmake/modules/FindAxom.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindBenchmark.cmake b/config/cmake/modules/FindBenchmark.cmake index 8c32b97168..2be226cdeb 100644 --- a/config/cmake/modules/FindBenchmark.cmake +++ b/config/cmake/modules/FindBenchmark.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindBlitz.cmake b/config/cmake/modules/FindBlitz.cmake index 8c895b9b66..1b905eff55 100644 --- a/config/cmake/modules/FindBlitz.cmake +++ b/config/cmake/modules/FindBlitz.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindCODIPACK.cmake b/config/cmake/modules/FindCODIPACK.cmake index 01f796f9c9..ae0ede07d5 100644 --- a/config/cmake/modules/FindCODIPACK.cmake +++ b/config/cmake/modules/FindCODIPACK.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindCXXABIDemangle.cmake b/config/cmake/modules/FindCXXABIDemangle.cmake index 04fd5e3520..39c22abde4 100644 --- a/config/cmake/modules/FindCXXABIDemangle.cmake +++ b/config/cmake/modules/FindCXXABIDemangle.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindCaliper.cmake b/config/cmake/modules/FindCaliper.cmake index fb9d7aeccf..4845aad841 100644 --- a/config/cmake/modules/FindCaliper.cmake +++ b/config/cmake/modules/FindCaliper.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindConduit.cmake b/config/cmake/modules/FindConduit.cmake index 4b25ef46ad..6b5c263290 100644 --- a/config/cmake/modules/FindConduit.cmake +++ b/config/cmake/modules/FindConduit.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindENZYME.cmake b/config/cmake/modules/FindENZYME.cmake index 08374de15a..76b5b21f2b 100644 --- a/config/cmake/modules/FindENZYME.cmake +++ b/config/cmake/modules/FindENZYME.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindFMS.cmake b/config/cmake/modules/FindFMS.cmake index b71c78e342..1d3f1df458 100644 --- a/config/cmake/modules/FindFMS.cmake +++ b/config/cmake/modules/FindFMS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindGSLIB.cmake b/config/cmake/modules/FindGSLIB.cmake index 7a314eb7f9..2f662daf79 100644 --- a/config/cmake/modules/FindGSLIB.cmake +++ b/config/cmake/modules/FindGSLIB.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindHDF5.cmake b/config/cmake/modules/FindHDF5.cmake index 2617fb9a4d..edfb981c39 100644 --- a/config/cmake/modules/FindHDF5.cmake +++ b/config/cmake/modules/FindHDF5.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindHIOP.cmake b/config/cmake/modules/FindHIOP.cmake index 19c9fa5924..e2cdf5299f 100644 --- a/config/cmake/modules/FindHIOP.cmake +++ b/config/cmake/modules/FindHIOP.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindHYPRE.cmake b/config/cmake/modules/FindHYPRE.cmake index b21a1f7190..eeaf453093 100644 --- a/config/cmake/modules/FindHYPRE.cmake +++ b/config/cmake/modules/FindHYPRE.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindLIBDL.cmake b/config/cmake/modules/FindLIBDL.cmake index 254b99fb5b..2d570b57fb 100644 --- a/config/cmake/modules/FindLIBDL.cmake +++ b/config/cmake/modules/FindLIBDL.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindLibunwind.cmake b/config/cmake/modules/FindLibunwind.cmake index 21dcf3c54c..ef927e5d48 100644 --- a/config/cmake/modules/FindLibunwind.cmake +++ b/config/cmake/modules/FindLibunwind.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMETIS.cmake b/config/cmake/modules/FindMETIS.cmake index 8de8d6a223..c5154bf278 100644 --- a/config/cmake/modules/FindMETIS.cmake +++ b/config/cmake/modules/FindMETIS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMFEMBacktrace.cmake b/config/cmake/modules/FindMFEMBacktrace.cmake index 9ffcd88244..5ce9997b57 100644 --- a/config/cmake/modules/FindMFEMBacktrace.cmake +++ b/config/cmake/modules/FindMFEMBacktrace.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMKL_CPARDISO.cmake b/config/cmake/modules/FindMKL_CPARDISO.cmake index a3798bddf2..bc909f7742 100644 --- a/config/cmake/modules/FindMKL_CPARDISO.cmake +++ b/config/cmake/modules/FindMKL_CPARDISO.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMKL_PARDISO.cmake b/config/cmake/modules/FindMKL_PARDISO.cmake index 9a3d62080e..6f9eb94ab8 100644 --- a/config/cmake/modules/FindMKL_PARDISO.cmake +++ b/config/cmake/modules/FindMKL_PARDISO.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMPFR.cmake b/config/cmake/modules/FindMPFR.cmake index 3490034559..ca7d6c59e5 100644 --- a/config/cmake/modules/FindMPFR.cmake +++ b/config/cmake/modules/FindMPFR.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindMUMPS.cmake b/config/cmake/modules/FindMUMPS.cmake index 2b034d216d..304e44d3e6 100644 --- a/config/cmake/modules/FindMUMPS.cmake +++ b/config/cmake/modules/FindMUMPS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindNetCDF.cmake b/config/cmake/modules/FindNetCDF.cmake index 8755184016..fa64e7a107 100644 --- a/config/cmake/modules/FindNetCDF.cmake +++ b/config/cmake/modules/FindNetCDF.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindOCCA.cmake b/config/cmake/modules/FindOCCA.cmake index 75d3a18106..ca726654e7 100644 --- a/config/cmake/modules/FindOCCA.cmake +++ b/config/cmake/modules/FindOCCA.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindPARELAG.cmake b/config/cmake/modules/FindPARELAG.cmake index 547c647db9..2064857061 100644 --- a/config/cmake/modules/FindPARELAG.cmake +++ b/config/cmake/modules/FindPARELAG.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindPOSIXClocks.cmake b/config/cmake/modules/FindPOSIXClocks.cmake index 4d0bf8ade9..356798b02f 100644 --- a/config/cmake/modules/FindPOSIXClocks.cmake +++ b/config/cmake/modules/FindPOSIXClocks.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindParMETIS.cmake b/config/cmake/modules/FindParMETIS.cmake index 87ed238001..b5388ca737 100644 --- a/config/cmake/modules/FindParMETIS.cmake +++ b/config/cmake/modules/FindParMETIS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindRAJA.cmake b/config/cmake/modules/FindRAJA.cmake index a4cd810ed7..0d0e2f10df 100644 --- a/config/cmake/modules/FindRAJA.cmake +++ b/config/cmake/modules/FindRAJA.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindSLEPc.cmake b/config/cmake/modules/FindSLEPc.cmake index b4e8d0951e..d13e7ebcca 100644 --- a/config/cmake/modules/FindSLEPc.cmake +++ b/config/cmake/modules/FindSLEPc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindSTRUMPACK.cmake b/config/cmake/modules/FindSTRUMPACK.cmake index 543e164dcd..4089cbe857 100644 --- a/config/cmake/modules/FindSTRUMPACK.cmake +++ b/config/cmake/modules/FindSTRUMPACK.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindSUNDIALS.cmake b/config/cmake/modules/FindSUNDIALS.cmake index 889ca03175..9a624a9c51 100644 --- a/config/cmake/modules/FindSUNDIALS.cmake +++ b/config/cmake/modules/FindSUNDIALS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindScotch.cmake b/config/cmake/modules/FindScotch.cmake index dbca25b6f2..2c98463f40 100644 --- a/config/cmake/modules/FindScotch.cmake +++ b/config/cmake/modules/FindScotch.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindSuiteSparse.cmake b/config/cmake/modules/FindSuiteSparse.cmake index ed6eef73a9..0ef1c79eaf 100644 --- a/config/cmake/modules/FindSuiteSparse.cmake +++ b/config/cmake/modules/FindSuiteSparse.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindSuperLUDist.cmake b/config/cmake/modules/FindSuperLUDist.cmake index 8a330b2db5..3d840fe633 100644 --- a/config/cmake/modules/FindSuperLUDist.cmake +++ b/config/cmake/modules/FindSuperLUDist.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindUMPIRE.cmake b/config/cmake/modules/FindUMPIRE.cmake index 50fd772393..8ed1d9569a 100644 --- a/config/cmake/modules/FindUMPIRE.cmake +++ b/config/cmake/modules/FindUMPIRE.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/Find_GnuTLS.cmake b/config/cmake/modules/Find_GnuTLS.cmake index 5d15292fbf..26e6a08393 100644 --- a/config/cmake/modules/Find_GnuTLS.cmake +++ b/config/cmake/modules/Find_GnuTLS.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/FindlibCEED.cmake b/config/cmake/modules/FindlibCEED.cmake index cf68a41469..9cd725f432 100644 --- a/config/cmake/modules/FindlibCEED.cmake +++ b/config/cmake/modules/FindlibCEED.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/cmake/modules/MfemCmakeUtilities.cmake b/config/cmake/modules/MfemCmakeUtilities.cmake index 204b7d87f1..b4f7264b70 100644 --- a/config/cmake/modules/MfemCmakeUtilities.cmake +++ b/config/cmake/modules/MfemCmakeUtilities.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/config.hpp b/config/config.hpp index a8d48de795..44610d614d 100644 --- a/config/config.hpp +++ b/config/config.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/config.hpp.in b/config/config.hpp.in index 39d7737c70..60d454a259 100644 --- a/config/config.hpp.in +++ b/config/config.hpp.in @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/config.mk.in b/config/config.mk.in index 303750bf5f..3679894d78 100644 --- a/config/config.mk.in +++ b/config/config.mk.in @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/defaults.cmake b/config/defaults.cmake index 3985ebd933..164b62110d 100644 --- a/config/defaults.cmake +++ b/config/defaults.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/defaults.mk b/config/defaults.mk index 7e359e06a1..63142abd8d 100644 --- a/config/defaults.mk +++ b/config/defaults.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/get_hypre_version.cpp b/config/get_hypre_version.cpp index 05a7f06e0c..9520729707 100644 --- a/config/get_hypre_version.cpp +++ b/config/get_hypre_version.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/get_mumps_version.cpp b/config/get_mumps_version.cpp index 7f1626bdce..9bee645286 100644 --- a/config/get_mumps_version.cpp +++ b/config/get_mumps_version.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/githooks/pre-push b/config/githooks/pre-push index fc53aaab5e..1c7808a97f 100755 --- a/config/githooks/pre-push +++ b/config/githooks/pre-push @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -21,6 +21,7 @@ if [[ "${option}" == "--help" ]]; then echo " --copyright" echo " --license" echo " --release" + echo " --math" echo " --style" echo " --history" echo "" @@ -35,8 +36,8 @@ cd $(git rev-parse --show-toplevel) # copyright check copyright=true if [[ "${option}" == "--copyright" || "${option}" == "" ]]; then - if git grep -n "^\(#\|//\).*Copyright.*2010-20\(2[^3]\|[^2].\)" > matches.txt; then - echo "Please update the following files to Copyright (c) 2010-2023:" + if git grep -n "^\(#\|//\).*Copyright.*2010-20\(2[^4]\|[^2].\)" > matches.txt; then + echo "Please update the following files to Copyright (c) 2010-2024:" cat matches.txt copyright=false fi @@ -63,6 +64,18 @@ if [[ "${option}" == "--release" || "${option}" == "" ]]; then fi fi +# math in doxygen check +math=true +if [[ "${option}" == "--math" || "${option}" == "" ]]; then + if grep '\\f' -R doc/CodeDocumentation.dox mfem.hpp config general linalg mesh fem examples miniapps | grep -v '\\frac' | grep -v fem/picojson.h | grep -v config/githooks/pre-push > matches.txt + then + echo "Please use $..$ and \$\$..\$\$ for LaTeX formulas in the following" + echo "comments instead of the Doxygen style \f$..\f$, \f[..\f], etc." + cat matches.txt + math=false + fi +fi + # wrap-up code=0 if ! $copyright ; then @@ -77,6 +90,10 @@ if ! $release ; then echo "release check failed, unroll log for details" code=1 fi +if ! $math ; then + echo "math in doxygen check failed, unroll log for details" + code=1 +fi # `code-style` is not just a check, it will actually reformat the code if # necessary. This means that if one pushes while the repo is in dirty state diff --git a/config/makefile b/config/makefile index 95a0390769..8082ac62b4 100644 --- a/config/makefile +++ b/config/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/sample-runs.sh b/config/sample-runs.sh index c0eb122115..788a223800 100755 --- a/config/sample-runs.sh +++ b/config/sample-runs.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/config/tconfig.hpp b/config/tconfig.hpp index b24d575762..44336d0b5b 100644 --- a/config/tconfig.hpp +++ b/config/tconfig.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/config/test.mk b/config/test.mk index b6137203a9..21d79f8a75 100644 --- a/config/test.mk +++ b/config/test.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/data/ball-nurbs.mesh b/data/ball-nurbs.mesh index 590118d2da..9d9651d172 100644 --- a/data/ball-nurbs.mesh +++ b/data/ball-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/beam-hex-nurbs.mesh b/data/beam-hex-nurbs.mesh index f64a6da57f..599bc7678e 100644 --- a/data/beam-hex-nurbs.mesh +++ b/data/beam-hex-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/beam-hex.mesh b/data/beam-hex.mesh index 28d7b33625..e277359468 100644 --- a/data/beam-hex.mesh +++ b/data/beam-hex.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/beam-quad-nurbs.mesh b/data/beam-quad-nurbs.mesh index 11031b7660..2401e458f3 100644 --- a/data/beam-quad-nurbs.mesh +++ b/data/beam-quad-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/beam-quad.mesh b/data/beam-quad.mesh index 0fba24fe2f..29ba6e877d 100644 --- a/data/beam-quad.mesh +++ b/data/beam-quad.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/beam-tet.mesh b/data/beam-tet.mesh index 68a2edea0a..f828cbf01a 100644 --- a/data/beam-tet.mesh +++ b/data/beam-tet.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/beam-tri.mesh b/data/beam-tri.mesh index c53dd0795a..a96302e5f6 100644 --- a/data/beam-tri.mesh +++ b/data/beam-tri.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/beam-wedge.mesh b/data/beam-wedge.mesh index b28e493709..ba7987a897 100644 --- a/data/beam-wedge.mesh +++ b/data/beam-wedge.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/cube-nurbs.mesh b/data/cube-nurbs.mesh index 513b58982b..4c4d860859 100644 --- a/data/cube-nurbs.mesh +++ b/data/cube-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/diag-segment-2d.mesh b/data/diag-segment-2d.mesh index 793d883d85..54fc181332 100644 --- a/data/diag-segment-2d.mesh +++ b/data/diag-segment-2d.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/diag-segment-3d.mesh b/data/diag-segment-3d.mesh index 593c609986..dca4eb0e10 100644 --- a/data/diag-segment-3d.mesh +++ b/data/diag-segment-3d.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/disc-nurbs.mesh b/data/disc-nurbs.mesh index 13655d872e..9c2c7ee6b8 100644 --- a/data/disc-nurbs.mesh +++ b/data/disc-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/escher-p2.mesh b/data/escher-p2.mesh index 6a91aa875b..424e69cff2 100644 --- a/data/escher-p2.mesh +++ b/data/escher-p2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/escher-p3.mesh b/data/escher-p3.mesh index eb1925f041..bb20b5e411 100644 --- a/data/escher-p3.mesh +++ b/data/escher-p3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/escher.mesh b/data/escher.mesh index 2f04bada52..fe2fb4c214 100644 --- a/data/escher.mesh +++ b/data/escher.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-mixed-p2.mesh b/data/fichera-mixed-p2.mesh index b36ccf6018..05266b368b 100644 --- a/data/fichera-mixed-p2.mesh +++ b/data/fichera-mixed-p2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-mixed.mesh b/data/fichera-mixed.mesh index f98134f4fb..1c18dae1a0 100644 --- a/data/fichera-mixed.mesh +++ b/data/fichera-mixed.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-q2.mesh b/data/fichera-q2.mesh index ce03d407ef..8d183d92e8 100644 --- a/data/fichera-q2.mesh +++ b/data/fichera-q2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-q3.mesh b/data/fichera-q3.mesh index b1d3ec683d..0db43520c6 100644 --- a/data/fichera-q3.mesh +++ b/data/fichera-q3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-quad-mixed.mesh b/data/fichera-quad-mixed.mesh index a3458665ac..e9f9ab6cfc 100644 --- a/data/fichera-quad-mixed.mesh +++ b/data/fichera-quad-mixed.mesh @@ -1,6 +1,6 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera-quad.mesh b/data/fichera-quad.mesh index afd2df9c85..be5ab2a68b 100644 --- a/data/fichera-quad.mesh +++ b/data/fichera-quad.mesh @@ -1,6 +1,6 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/fichera.mesh b/data/fichera.mesh index b82f56d576..3d11c8ec42 100644 --- a/data/fichera.mesh +++ b/data/fichera.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/hexagon.mesh b/data/hexagon.mesh index 6014a43323..bbafc2877b 100644 --- a/data/hexagon.mesh +++ b/data/hexagon.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/klein-bottle.mesh b/data/klein-bottle.mesh index 9f50e97dd2..c87719f39e 100644 --- a/data/klein-bottle.mesh +++ b/data/klein-bottle.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/klein-donut.mesh b/data/klein-donut.mesh index c2312ef2e0..994e13c21b 100644 --- a/data/klein-donut.mesh +++ b/data/klein-donut.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/l-shape.mesh b/data/l-shape.mesh index 9244f83ec0..c093a01c83 100644 --- a/data/l-shape.mesh +++ b/data/l-shape.mesh @@ -1,6 +1,6 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/llnl-p3.mesh b/data/llnl-p3.mesh index cd82b4bf1f..9434871649 100644 --- a/data/llnl-p3.mesh +++ b/data/llnl-p3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/mobius-strip.mesh b/data/mobius-strip.mesh index c180f79108..88e88f58db 100644 --- a/data/mobius-strip.mesh +++ b/data/mobius-strip.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/octahedron.mesh b/data/octahedron.mesh index 4c281b52ff..1a51c38427 100644 --- a/data/octahedron.mesh +++ b/data/octahedron.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/periodic-cube.mesh b/data/periodic-cube.mesh index 8ea7aaa9a1..93373e94f5 100644 --- a/data/periodic-cube.mesh +++ b/data/periodic-cube.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/periodic-hexagon.mesh b/data/periodic-hexagon.mesh index 5a5d448bcb..63d59286f2 100644 --- a/data/periodic-hexagon.mesh +++ b/data/periodic-hexagon.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/periodic-segment.mesh b/data/periodic-segment.mesh index fd088747fc..751924e749 100644 --- a/data/periodic-segment.mesh +++ b/data/periodic-segment.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/periodic-square.mesh b/data/periodic-square.mesh index 7d0bf5af37..677ba0d24d 100644 --- a/data/periodic-square.mesh +++ b/data/periodic-square.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/pipe-nurbs-2d.mesh b/data/pipe-nurbs-2d.mesh index b02c040635..5d0de6135f 100644 --- a/data/pipe-nurbs-2d.mesh +++ b/data/pipe-nurbs-2d.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/pipe-nurbs.mesh b/data/pipe-nurbs.mesh index 4d0e425de3..bc5cc2f729 100644 --- a/data/pipe-nurbs.mesh +++ b/data/pipe-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/ref-cube.mesh b/data/ref-cube.mesh index a9e5dedb94..54e054ea8a 100644 --- a/data/ref-cube.mesh +++ b/data/ref-cube.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-prism.mesh b/data/ref-prism.mesh index 48ed733d0f..65493d6475 100644 --- a/data/ref-prism.mesh +++ b/data/ref-prism.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-pyramid.mesh b/data/ref-pyramid.mesh index 73222008f3..0c9f641989 100644 --- a/data/ref-pyramid.mesh +++ b/data/ref-pyramid.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-segment.mesh b/data/ref-segment.mesh index b69cf7ce90..a3e5ea59d5 100644 --- a/data/ref-segment.mesh +++ b/data/ref-segment.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-square.mesh b/data/ref-square.mesh index b3c23dd588..733e198c3b 100644 --- a/data/ref-square.mesh +++ b/data/ref-square.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-tetrahedron.mesh b/data/ref-tetrahedron.mesh index 5f6e8a6a56..859abcacfc 100644 --- a/data/ref-tetrahedron.mesh +++ b/data/ref-tetrahedron.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/ref-triangle.mesh b/data/ref-triangle.mesh index 804bdf1ea8..e9ddb03347 100644 --- a/data/ref-triangle.mesh +++ b/data/ref-triangle.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/rt-2d-p4-tri.mesh b/data/rt-2d-p4-tri.mesh index e7955b6e4e..2e4fadc1ef 100644 --- a/data/rt-2d-p4-tri.mesh +++ b/data/rt-2d-p4-tri.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/rt-2d-q3.mesh b/data/rt-2d-q3.mesh index d0d1de0a0b..d9359f8638 100644 --- a/data/rt-2d-q3.mesh +++ b/data/rt-2d-q3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/segment-nurbs.mesh b/data/segment-nurbs.mesh index d204f9c74a..dcc9ae4aa9 100644 --- a/data/segment-nurbs.mesh +++ b/data/segment-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/square-disc-nurbs.mesh b/data/square-disc-nurbs.mesh index cc981641a8..259c4fa328 100644 --- a/data/square-disc-nurbs.mesh +++ b/data/square-disc-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/square-disc-p2.mesh b/data/square-disc-p2.mesh index b28c20673c..040cdf1241 100644 --- a/data/square-disc-p2.mesh +++ b/data/square-disc-p2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/square-disc-p3.mesh b/data/square-disc-p3.mesh index bd5bf360c9..ff6f7f8410 100644 --- a/data/square-disc-p3.mesh +++ b/data/square-disc-p3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/square-disc-surf.mesh b/data/square-disc-surf.mesh index 164f2aca36..b9bd696fbf 100644 --- a/data/square-disc-surf.mesh +++ b/data/square-disc-surf.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/square-disc.mesh b/data/square-disc.mesh index eb94e18327..77da4488fd 100644 --- a/data/square-disc.mesh +++ b/data/square-disc.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/square-mixed.mesh b/data/square-mixed.mesh index 96e84839d2..dcfcf79f5c 100644 --- a/data/square-mixed.mesh +++ b/data/square-mixed.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/square-nurbs.mesh b/data/square-nurbs.mesh index 282818ff41..d3bcb3f2b9 100644 --- a/data/square-nurbs.mesh +++ b/data/square-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/data/star-mixed-p2.mesh b/data/star-mixed-p2.mesh index 4f644c3ece..ff1dc96031 100644 --- a/data/star-mixed-p2.mesh +++ b/data/star-mixed-p2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/star-mixed.mesh b/data/star-mixed.mesh index 118853cdc3..8fc158ba26 100644 --- a/data/star-mixed.mesh +++ b/data/star-mixed.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/star-q2.mesh b/data/star-q2.mesh index 31cd8c7081..e3987271bc 100644 --- a/data/star-q2.mesh +++ b/data/star-q2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/star-q3.mesh b/data/star-q3.mesh index a0d96deb6e..f963d2cd5e 100644 --- a/data/star-q3.mesh +++ b/data/star-q3.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/star-surf.mesh b/data/star-surf.mesh index 22070fcc34..08bcf2bca6 100644 --- a/data/star-surf.mesh +++ b/data/star-surf.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/star.mesh b/data/star.mesh index f6d6f2d8c2..94cd1199f6 100644 --- a/data/star.mesh +++ b/data/star.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/tinyzoo-3d.mesh b/data/tinyzoo-3d.mesh index f269c4e765..b0c238a6b1 100644 --- a/data/tinyzoo-3d.mesh +++ b/data/tinyzoo-3d.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/toroid-hex.mesh b/data/toroid-hex.mesh index 5bfedaa45f..5944b70170 100644 --- a/data/toroid-hex.mesh +++ b/data/toroid-hex.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/data/toroid-wedge.mesh b/data/toroid-wedge.mesh index d5679aa239..0b86fbd5be 100644 --- a/data/toroid-wedge.mesh +++ b/data/toroid-wedge.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9c0cc23211..fdb8857de9 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/doc/CodeDocumentation.conf.in b/doc/CodeDocumentation.conf.in index 04d44d04a7..7438d0b981 100644 --- a/doc/CodeDocumentation.conf.in +++ b/doc/CodeDocumentation.conf.in @@ -1125,7 +1125,13 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +# Allow the use of standard LaTeX formulas in MFEM comments by replacing +# $$...$$ with \f[...\f] and $...$ with \f$...\f$ before running Doxygen. +# The regular expression ((?:.|\n)+?) is a lazy match for one or more +# characters, include newline. If present, Doxygen-style LaTeX commands +# such as \f$, \f[, etc., are left unchanged. + +INPUT_FILTER = perl -0777 -pe 's/\$\$((?:.|\n)+?)\$\$/\\f[\1\\f]/g; s/(?SPDE Solvers: SPDE solver random field generation * - DPG Diffusion example: DPG formulation for the diffusion problem * - DPG Maxwell example: DPG formulation for the indefinite Maxwell problem + * - LOR Elasticity: solve linear elasticity with LOR preconditioning on GPUs * * See also the examples documentation online. */ diff --git a/doc/makefile b/doc/makefile index 738e223ec1..ac2a7c63b2 100644 --- a/doc/makefile +++ b/doc/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7865b71b95..eab250f7f0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/amgx/CMakeLists.txt b/examples/amgx/CMakeLists.txt index 43ee4d76b3..30e0674321 100644 --- a/examples/amgx/CMakeLists.txt +++ b/examples/amgx/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/amgx/makefile b/examples/amgx/makefile index 5d80737114..91f385efcc 100644 --- a/examples/amgx/makefile +++ b/examples/amgx/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/caliper/CMakeLists.txt b/examples/caliper/CMakeLists.txt index 572c5bb0e2..c63c321f46 100644 --- a/examples/caliper/CMakeLists.txt +++ b/examples/caliper/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/caliper/makefile b/examples/caliper/makefile index 688bac869f..1072ffc3ef 100644 --- a/examples/caliper/makefile +++ b/examples/caliper/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/ex25.cpp b/examples/ex25.cpp index adaf950e17..45df8fe7ef 100644 --- a/examples/ex25.cpp +++ b/examples/ex25.cpp @@ -305,7 +305,7 @@ int main(int argc, char *argv[]) for (int j = 0; j < mesh->GetNBE(); j++) { Vector center(dim); - int bdrgeom = mesh->GetBdrElementBaseGeometry(j); + int bdrgeom = mesh->GetBdrElementGeometry(j); ElementTransformation * tr = mesh->GetBdrElementTransformation(j); tr->Transform(Geometries.GetCenter(bdrgeom),center); int k = mesh->GetBdrAttribute(j); diff --git a/examples/ex25p.cpp b/examples/ex25p.cpp index cf5daf4123..2b5451f113 100644 --- a/examples/ex25p.cpp +++ b/examples/ex25p.cpp @@ -350,7 +350,7 @@ int main(int argc, char *argv[]) for (int j = 0; j < pmesh->GetNBE(); j++) { Vector center(dim); - int bdrgeom = pmesh->GetBdrElementBaseGeometry(j); + int bdrgeom = pmesh->GetBdrElementGeometry(j); ElementTransformation * tr = pmesh->GetBdrElementTransformation(j); tr->Transform(Geometries.GetCenter(bdrgeom),center); int k = pmesh->GetBdrAttribute(j); diff --git a/examples/ex26.cpp b/examples/ex26.cpp index c83f4db139..07f9b77dd7 100644 --- a/examples/ex26.cpp +++ b/examples/ex26.cpp @@ -43,43 +43,38 @@ using namespace mfem; class DiffusionMultigrid : public GeometricMultigrid { private: - ConstantCoefficient one; + ConstantCoefficient coeff; public: // Constructs a diffusion multigrid for the given FiniteElementSpaceHierarchy // and the array of essential boundaries DiffusionMultigrid(FiniteElementSpaceHierarchy& fespaces, Array& ess_bdr) - : GeometricMultigrid(fespaces), one(1.0) + : GeometricMultigrid(fespaces, ess_bdr), coeff(1.0) { - ConstructCoarseOperatorAndSolver(fespaces.GetFESpaceAtLevel(0), ess_bdr); - + ConstructCoarseOperatorAndSolver(fespaces.GetFESpaceAtLevel(0)); for (int level = 1; level < fespaces.GetNumLevels(); ++level) { - ConstructOperatorAndSmoother(fespaces.GetFESpaceAtLevel(level), ess_bdr); + ConstructOperatorAndSmoother(fespaces.GetFESpaceAtLevel(level), level); } } private: - void ConstructBilinearForm(FiniteElementSpace& fespace, Array& ess_bdr) + void ConstructBilinearForm(FiniteElementSpace& fespace) { BilinearForm* form = new BilinearForm(&fespace); form->SetAssemblyLevel(AssemblyLevel::PARTIAL); - form->AddDomainIntegrator(new DiffusionIntegrator(one)); + form->AddDomainIntegrator(new DiffusionIntegrator(coeff)); form->Assemble(); bfs.Append(form); - - essentialTrueDofs.Append(new Array()); - fespace.GetEssentialTrueDofs(ess_bdr, *essentialTrueDofs.Last()); } - void ConstructCoarseOperatorAndSolver(FiniteElementSpace& coarse_fespace, - Array& ess_bdr) + void ConstructCoarseOperatorAndSolver(FiniteElementSpace& coarse_fespace) { - ConstructBilinearForm(coarse_fespace, ess_bdr); + ConstructBilinearForm(coarse_fespace); OperatorPtr opr; opr.SetType(Operator::ANY_TYPE); - bfs.Last()->FormSystemMatrix(*essentialTrueDofs.Last(), opr); + bfs[0]->FormSystemMatrix(*essentialTrueDofs[0], opr); opr.SetOperatorOwner(false); CGSolver* pcg = new CGSolver(); @@ -92,21 +87,20 @@ private: AddLevel(opr.Ptr(), pcg, true, true); } - void ConstructOperatorAndSmoother(FiniteElementSpace& fespace, - Array& ess_bdr) + void ConstructOperatorAndSmoother(FiniteElementSpace& fespace, int level) { - ConstructBilinearForm(fespace, ess_bdr); + const Array &ess_tdof_list = *essentialTrueDofs[level]; + ConstructBilinearForm(fespace); OperatorPtr opr; opr.SetType(Operator::ANY_TYPE); - bfs.Last()->FormSystemMatrix(*essentialTrueDofs.Last(), opr); + bfs[level]->FormSystemMatrix(ess_tdof_list, opr); opr.SetOperatorOwner(false); Vector diag(fespace.GetTrueVSize()); - bfs.Last()->AssembleDiagonal(diag); + bfs[level]->AssembleDiagonal(diag); - Solver* smoother = new OperatorChebyshevSmoother(*opr, diag, - *essentialTrueDofs.Last(), 2); + Solver* smoother = new OperatorChebyshevSmoother(*opr, diag, ess_tdof_list, 2); AddLevel(opr.Ptr(), smoother, true, true); } }; diff --git a/examples/ex26p.cpp b/examples/ex26p.cpp index 85931dc5b0..ff02bb0720 100644 --- a/examples/ex26p.cpp +++ b/examples/ex26p.cpp @@ -40,7 +40,7 @@ using namespace mfem; class DiffusionMultigrid : public GeometricMultigrid { private: - ConstantCoefficient one; + ConstantCoefficient coeff; HypreBoomerAMG* amg; public: @@ -48,13 +48,13 @@ public: // and the array of essential boundaries DiffusionMultigrid(ParFiniteElementSpaceHierarchy& fespaces, Array& ess_bdr) - : GeometricMultigrid(fespaces), one(1.0) + : GeometricMultigrid(fespaces, ess_bdr), coeff(1.0) { - ConstructCoarseOperatorAndSolver(fespaces.GetFESpaceAtLevel(0), ess_bdr); + ConstructCoarseOperatorAndSolver(fespaces.GetFESpaceAtLevel(0)); for (int level = 1; level < fespaces.GetNumLevels(); ++level) { - ConstructOperatorAndSmoother(fespaces.GetFESpaceAtLevel(level), ess_bdr); + ConstructOperatorAndSmoother(fespaces.GetFESpaceAtLevel(level), level); } } @@ -64,7 +64,7 @@ public: } private: - void ConstructBilinearForm(ParFiniteElementSpace& fespace, Array& ess_bdr, + void ConstructBilinearForm(ParFiniteElementSpace& fespace, bool partial_assembly) { ParBilinearForm* form = new ParBilinearForm(&fespace); @@ -72,21 +72,17 @@ private: { form->SetAssemblyLevel(AssemblyLevel::PARTIAL); } - form->AddDomainIntegrator(new DiffusionIntegrator(one)); + form->AddDomainIntegrator(new DiffusionIntegrator(coeff)); form->Assemble(); bfs.Append(form); - - essentialTrueDofs.Append(new Array()); - fespace.GetEssentialTrueDofs(ess_bdr, *essentialTrueDofs.Last()); } - void ConstructCoarseOperatorAndSolver(ParFiniteElementSpace& coarse_fespace, - Array& ess_bdr) + void ConstructCoarseOperatorAndSolver(ParFiniteElementSpace& coarse_fespace) { - ConstructBilinearForm(coarse_fespace, ess_bdr, false); + ConstructBilinearForm(coarse_fespace, false); HypreParMatrix* hypreCoarseMat = new HypreParMatrix(); - bfs.Last()->FormSystemMatrix(*essentialTrueDofs.Last(), *hypreCoarseMat); + bfs[0]->FormSystemMatrix(*essentialTrueDofs[0], *hypreCoarseMat); amg = new HypreBoomerAMG(*hypreCoarseMat); amg->SetPrintLevel(-1); @@ -102,21 +98,21 @@ private: AddLevel(hypreCoarseMat, pcg, true, true); } - void ConstructOperatorAndSmoother(ParFiniteElementSpace& fespace, - Array& ess_bdr) + void ConstructOperatorAndSmoother(ParFiniteElementSpace& fespace, int level) { - ConstructBilinearForm(fespace, ess_bdr, true); + const Array &ess_tdof_list = *essentialTrueDofs[level]; + ConstructBilinearForm(fespace, true); OperatorPtr opr; opr.SetType(Operator::ANY_TYPE); - bfs.Last()->FormSystemMatrix(*essentialTrueDofs.Last(), opr); + bfs.Last()->FormSystemMatrix(ess_tdof_list, opr); opr.SetOperatorOwner(false); Vector diag(fespace.GetTrueVSize()); bfs.Last()->AssembleDiagonal(diag); - Solver* smoother = new OperatorChebyshevSmoother(*opr, diag, - *essentialTrueDofs.Last(), 2, fespace.GetParMesh()->GetComm()); + Solver* smoother = new OperatorChebyshevSmoother( + *opr, diag, ess_tdof_list, 2, fespace.GetParMesh()->GetComm()); AddLevel(opr.Ptr(), smoother, true, true); } diff --git a/examples/ex37.cpp b/examples/ex37.cpp index 94566e1d86..229dceca2b 100644 --- a/examples/ex37.cpp +++ b/examples/ex37.cpp @@ -102,7 +102,7 @@ double proj(GridFunction &psi, double target_volume, double tol=1e-12, return int_sigmoid_psi.Sum(); } -/** +/* * --------------------------------------------------------------- * ALGORITHM PREAMBLE * --------------------------------------------------------------- diff --git a/examples/ex37p.cpp b/examples/ex37p.cpp index 323493322c..fe6d654766 100644 --- a/examples/ex37p.cpp +++ b/examples/ex37p.cpp @@ -107,7 +107,7 @@ double proj(ParGridFunction &psi, double target_volume, double tol=1e-12, return material_volume; } -/** +/* * --------------------------------------------------------------- * ALGORITHM PREAMBLE * --------------------------------------------------------------- diff --git a/examples/ginkgo/CMakeLists.txt b/examples/ginkgo/CMakeLists.txt index e460575ca7..a489efe88d 100644 --- a/examples/ginkgo/CMakeLists.txt +++ b/examples/ginkgo/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/ginkgo/makefile b/examples/ginkgo/makefile index 6384fb8439..68531a850f 100644 --- a/examples/ginkgo/makefile +++ b/examples/ginkgo/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/hiop/CMakeLists.txt b/examples/hiop/CMakeLists.txt index 8a0e9b007e..2274c906f0 100644 --- a/examples/hiop/CMakeLists.txt +++ b/examples/hiop/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/hiop/makefile b/examples/hiop/makefile index 8a6fe26ad5..9d1f87bf11 100644 --- a/examples/hiop/makefile +++ b/examples/hiop/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/makefile b/examples/makefile index f0cbce70b3..77a13d9b4b 100644 --- a/examples/makefile +++ b/examples/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/moonolith/CMakeLists.txt b/examples/moonolith/CMakeLists.txt index 6e321759dd..f02e747dfc 100644 --- a/examples/moonolith/CMakeLists.txt +++ b/examples/moonolith/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/moonolith/makefile b/examples/moonolith/makefile index 3efaa23fea..e8d1e68a8a 100644 --- a/examples/moonolith/makefile +++ b/examples/moonolith/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/petsc/CMakeLists.txt b/examples/petsc/CMakeLists.txt index 8f3f379c61..a04ee3bb00 100644 --- a/examples/petsc/CMakeLists.txt +++ b/examples/petsc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/petsc/makefile b/examples/petsc/makefile index 03806144e7..4cdab502a0 100644 --- a/examples/petsc/makefile +++ b/examples/petsc/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/pumi/CMakeLists.txt b/examples/pumi/CMakeLists.txt index a75d1df6a7..a8e70a5df1 100644 --- a/examples/pumi/CMakeLists.txt +++ b/examples/pumi/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/pumi/makefile b/examples/pumi/makefile index 3784da8adf..e122cf332b 100644 --- a/examples/pumi/makefile +++ b/examples/pumi/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/sundials/CMakeLists.txt b/examples/sundials/CMakeLists.txt index ce1800a363..ba06626b42 100644 --- a/examples/sundials/CMakeLists.txt +++ b/examples/sundials/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/sundials/makefile b/examples/sundials/makefile index 15c5615de4..ce06ed94c1 100644 --- a/examples/sundials/makefile +++ b/examples/sundials/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/superlu/CMakeLists.txt b/examples/superlu/CMakeLists.txt index e5964b31e8..d9a6d890ae 100644 --- a/examples/superlu/CMakeLists.txt +++ b/examples/superlu/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/examples/superlu/makefile b/examples/superlu/makefile index 59efb8540a..b62f1a10df 100644 --- a/examples/superlu/makefile +++ b/examples/superlu/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/fem/CMakeLists.txt b/fem/CMakeLists.txt index e2490e7c6f..fea018a994 100644 --- a/fem/CMakeLists.txt +++ b/fem/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -25,6 +25,8 @@ set(SRCS integ/bilininteg_diffusion_ea.cpp integ/bilininteg_diffusion_patch.cpp integ/bilininteg_divdiv_pa.cpp + integ/bilininteg_elasticity_ea.cpp + integ/bilininteg_elasticity_pa.cpp integ/bilininteg_gradient_pa.cpp integ/bilininteg_interp_pa.cpp integ/bilininteg_mass_mf.cpp @@ -41,6 +43,7 @@ set(SRCS integ/bilininteg_vectorfediv_pa.cpp integ/bilininteg_vectorfemass_pa.cpp integ/bilininteg_diffusion_kernels.cpp + integ/bilininteg_elasticity_kernels.cpp integ/bilininteg_hcurl_kernels.cpp integ/bilininteg_hdiv_kernels.cpp integ/bilininteg_hcurlhdiv_kernels.cpp @@ -153,6 +156,7 @@ set(HDRS bilinearform_ext.hpp bilininteg.hpp integ/bilininteg_diffusion_kernels.hpp + integ/bilininteg_elasticity_kernels.hpp integ/bilininteg_hcurl_kernels.hpp integ/bilininteg_hdiv_kernels.hpp integ/bilininteg_hcurlhdiv_kernels.hpp diff --git a/fem/adios2datacollection.cpp b/fem/adios2datacollection.cpp index 144fabc8cb..e36065cfae 100644 --- a/fem/adios2datacollection.cpp +++ b/fem/adios2datacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/adios2datacollection.hpp b/fem/adios2datacollection.hpp index d7f0a5e143..f8e4be348a 100644 --- a/fem/adios2datacollection.hpp +++ b/fem/adios2datacollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/bilinearform.cpp b/fem/bilinearform.cpp index 2661ff7f13..bd076d848a 100644 --- a/fem/bilinearform.cpp +++ b/fem/bilinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1585,9 +1585,10 @@ void MixedBilinearForm::Assemble(int skip_zeros) ftr = mesh->GetBdrFaceTransformations(i); if (ftr) { - trial_fes->GetFaceVDofs(ftr->ElementNo, trial_vdofs); + const int iface = mesh->GetBdrElementFaceIndex(i); + trial_fes->GetFaceVDofs(iface, trial_vdofs); test_fes->GetElementVDofs(ftr->Elem1No, test_vdofs); - trial_face_fe = trial_fes->GetFaceElement(ftr->ElementNo); + trial_face_fe = trial_fes->GetFaceElement(iface); test_fe1 = test_fes->GetFE(ftr->Elem1No); // The test_fe2 object is really a dummy and not used on the // boundaries, but we can't dereference a NULL pointer, and we don't diff --git a/fem/bilinearform.hpp b/fem/bilinearform.hpp index d4ffd4a376..571174339d 100644 --- a/fem/bilinearform.hpp +++ b/fem/bilinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -62,24 +62,29 @@ class BilinearForm : public Matrix friend FABilinearFormExtension; protected: - /// Sparse matrix \f$ M \f$ to be associated with the form. Owned. + /// Sparse matrix $ M $ to be associated with the form. Owned. SparseMatrix *mat; - /** @brief Sparse Matrix \f$ M_e \f$ used to store the eliminations + /** @brief Sparse Matrix $ M_e $ used to store the eliminations from the b.c. Owned. - \f$ M + M_e = M_{original} \f$ */ + $ M + M_e = M_{original} $ */ SparseMatrix *mat_e; /// FE space on which the form lives. Not owned. FiniteElementSpace *fes; - /// The assembly level of the form (full, partial, etc.) + /** @brief The ::AssemblyLevel of the form (AssemblyLevel::LEGACY, + AssemblyLevel::FULL, AssemblyLevel::ELEMENT, AssemblyLevel::PARTIAL) */ AssemblyLevel assembly; + /// Element batch size used in the form action (1, 8, num_elems, etc.) int batch; - /** @brief Extension for supporting Full Assembly (FA), Element Assembly (EA), - Partial Assembly (PA), or Matrix Free assembly (MF). */ + + /** @brief Extension for supporting Full Assembly (FA), + Element Assembly (EA),Partial Assembly (PA), + or Matrix Free assembly (MF). */ BilinearFormExtension *ext; + /** Indicates if the sparse matrix is sorted after assembly when using Full Assembly (FA). */ bool sort_sparse_matrix = false; @@ -95,6 +100,7 @@ protected: /// Set of Domain Integrators to be applied. Array domain_integs; + /// Element attribute marker (should be of length mesh->attributes.Max() or /// 0 if mesh->attributes is empty) /// Includes all by default. @@ -121,18 +127,24 @@ protected: StaticCondensation *static_cond; ///< Owned. Hybridization *hybridization; ///< Owned. - /** This data member allows one to specify what should be done to the + /** @brief This data member allows one to specify what should be done to the diagonal matrix entries and corresponding RHS values upon elimination of the constrained DoFs. */ DiagonalPolicy diag_policy; int precompute_sparsity; - // Allocate appropriate SparseMatrix and assign it to mat + + /// Allocate appropriate SparseMatrix and assign it to #mat void AllocMat(); + /** @brief For partially conforming trial and/or test FE spaces, complete the + assembly process by performing $ P^t A P $ where $ A $ is the + internal sparse matrix and $ P $ is the conforming prolongation + matrix of the trial/test FE space. After this call the + BilinearForm becomes an operator on the conforming FE space. */ void ConformingAssemble(); - // may be used in the construction of derived classes + /// may be used in the construction of derived classes BilinearForm() : Matrix (0) { fes = NULL; sequence = -1; @@ -205,9 +217,9 @@ public: Hybridization *GetHybridization() const { return hybridization; } /** @brief Enable the use of static condensation. For details see the - description for class StaticCondensation in fem/staticcond.hpp This method - should be called before assembly. If the number of unknowns after static - condensation is not reduced, it is not enabled. */ + description for class StaticCondensation in fem/staticcond.hpp This + method should be called before assembly. If the number of unknowns after + static condensation is not reduced, it is not enabled. */ void EnableStaticCondensation(); /** @brief Check if static condensation was actually enabled by a previous @@ -226,9 +238,9 @@ public: BilinearFormIntegrator *constr_integ, const Array &ess_tdof_list); - /** @brief For scalar FE spaces, precompute the sparsity pattern of the matrix - (assuming dense element matrices) based on the types of integrators - present in the bilinear form. */ + /** @brief For scalar FE spaces, precompute the sparsity pattern of the + matrix (assuming dense element matrices) based on the types of + integrators present in the bilinear form. */ void UsePrecomputedSparsity(int ps = 1) { precompute_sparsity = ps; } /** @brief Use the given CSR sparsity pattern to allocate the internal @@ -245,8 +257,8 @@ public: /// Use the sparsity of @a A to allocate the internal SparseMatrix. void UseSparsity(SparseMatrix &A); - /// Pre-allocate the internal SparseMatrix before assembly. - /** If the flag 'precompute sparsity' + /** @brief Pre-allocate the internal SparseMatrix before assembly. + If the internal flag #precompute_sparsity is set, the matrix is allocated in CSR format (i.e. finalized) and the entries are initialized with zeros. */ void AllocateMatrix() { if (mat == NULL) { AllocMat(); } } @@ -254,10 +266,9 @@ public: /// Access all the integrators added with AddDomainIntegrator(). Array *GetDBFI() { return &domain_integs; } - /// @brief Access all boundary markers added with AddDomainIntegrator(). - /// - /// If no marker was specified when the integrator was added, the - /// corresponding pointer (to Array) will be NULL. */ + /** @brief Access all boundary markers added with AddDomainIntegrator(). + If no marker was specified when the integrator was added, the + corresponding pointer (to Array) will be NULL. */ Array*> *GetDBFI_Marker() { return &domain_integs_marker; } /// Access all the integrators added with AddBoundaryIntegrator(). @@ -272,66 +283,71 @@ public: /// Access all integrators added with AddBdrFaceIntegrator(). Array *GetBFBFI() { return &boundary_face_integs; } + /** @brief Access all boundary markers added with AddBdrFaceIntegrator(). If no marker was specified when the integrator was added, the corresponding pointer (to Array) will be NULL. */ Array*> *GetBFBFI_Marker() { return &boundary_face_integs_marker; } - /// Returns a reference to: \f$ M_{ij} \f$ + /// Returns a reference to: $ M_{ij} $ const double &operator()(int i, int j) { return (*mat)(i,j); } - /// Returns a reference to: \f$ M_{ij} \f$ + /// Returns a reference to: $ M_{ij} $ virtual double &Elem(int i, int j); - /// Returns constant reference to: \f$ M_{ij} \f$ + /// Returns constant reference to: $ M_{ij} $ virtual const double &Elem(int i, int j) const; - /// Matrix vector multiplication: \f$ y = M x \f$ + /// Matrix vector multiplication: $ y = M x $ virtual void Mult(const Vector &x, Vector &y) const; /** @brief Matrix vector multiplication with the original uneliminated - matrix. The original matrix is \f$ M + M_e \f$ so we have: - \f$ y = M x + M_e x \f$ */ + matrix. The original matrix is $ M + M_e $ so we have: + $ y = M x + M_e x $ */ void FullMult(const Vector &x, Vector &y) const { mat->Mult(x, y); mat_e->AddMult(x, y); } - /// Add the matrix vector multiple to a vector: \f$ y += a M x \f$ + /// Add the matrix vector multiple to a vector: $ y += a M x $ virtual void AddMult(const Vector &x, Vector &y, const double a = 1.0) const { mat -> AddMult (x, y, a); } /** @brief Add the original uneliminated matrix vector multiple to a vector. - The original matrix is \f$ M + Me \f$ so we have: - \f$ y += M x + M_e x \f$ */ + The original matrix is $ M + Me $ so we have: + $ y += M x + M_e x $ */ void FullAddMult(const Vector &x, Vector &y) const { mat->AddMult(x, y); mat_e->AddMult(x, y); } - /// Add the matrix transpose vector multiplication: \f$ y += a M^T x \f$ + /// Add the matrix transpose vector multiplication: $ y += a M^T x $ virtual void AddMultTranspose(const Vector & x, Vector & y, const double a = 1.0) const { mat->AddMultTranspose(x, y, a); } /** @brief Add the original uneliminated matrix transpose vector - multiple to a vector. The original matrix is \f$ M + M_e \f$ - so we have: \f$ y += M^T x + {M_e}^T x \f$ */ + multiple to a vector. The original matrix is $ M + M_e $ + so we have: $ y += M^T x + {M_e}^T x $ */ void FullAddMultTranspose(const Vector & x, Vector & y) const { mat->AddMultTranspose(x, y); mat_e->AddMultTranspose(x, y); } - /// Matrix transpose vector multiplication: \f$ y = M^T x \f$ + /// Matrix transpose vector multiplication: $ y = M^T x $ virtual void MultTranspose(const Vector & x, Vector & y) const; - /// Compute \f$ y^T M x \f$ + /// Compute $ y^T M x $ double InnerProduct(const Vector &x, const Vector &y) const { return mat->InnerProduct (x, y); } - /// Returns a pointer to (approximation) of the matrix inverse: \f$ M^{-1} \f$ + /** @brief Returns a pointer to (approximation) of the matrix inverse: + $ M^{-1} $ (currently returns NULL) */ virtual MatrixInverse *Inverse() const; - /// Finalizes the matrix initialization. + /** @brief Finalizes the matrix initialization if the ::AssemblyLevel is + AssemblyLevel::LEGACY. + THe matrix that gets finalized is different if you are using static + condensation or hybridization.*/ virtual void Finalize(int skip_zeros = 1); - /** @brief Returns a const reference to the sparse matrix: \f$ M \f$ - + /** @brief Returns a const reference to the sparse matrix: $ M $ + * This will fail if HasSpMat() is false. */ const SparseMatrix &SpMat() const { @@ -339,8 +355,8 @@ public: return *mat; } - /** @brief Returns a reference to the sparse matrix: \f$ M \f$ - + /** @brief Returns a reference to the sparse matrix: $ M $ + * This will fail if HasSpMat() is false. */ SparseMatrix &SpMat() { @@ -349,7 +365,7 @@ public: } /** @brief Returns true if the sparse matrix is not null, false otherwise. - + * @sa SpMat(). */ bool HasSpMat() { @@ -357,12 +373,12 @@ public: } - /** @brief Nullifies the internal matrix \f$ M \f$ and returns a pointer + /** @brief Nullifies the internal matrix $ M $ and returns a pointer to it. Used for transferring ownership. */ SparseMatrix *LoseMat() { SparseMatrix *tmp = mat; mat = NULL; return tmp; } /** @brief Returns a const reference to the sparse matrix of eliminated b.c.: - \f$ M_e \f$ + $ M_e $ This will fail if HasSpMatElim() is false. */ const SparseMatrix &SpMatElim() const @@ -372,7 +388,7 @@ public: } /** @brief Returns a reference to the sparse matrix of eliminated b.c.: - \f$ M_e \f$ + $ M_e $ This will fail if HasSpMatElim() is false. */ SparseMatrix &SpMatElim() @@ -381,8 +397,8 @@ public: return *mat_e; } - /** @brief Returns true if the sparse matrix of eliminated b.c.s is not null, - false otherwise. + /** @brief Returns true if the sparse matrix of eliminated b.c.s is not + null, false otherwise. @sa SpMatElim(). */ bool HasSpMatElim() @@ -392,6 +408,7 @@ public: /// Adds new Domain Integrator. Assumes ownership of @a bfi. void AddDomainIntegrator(BilinearFormIntegrator *bfi); + /// Adds new Domain Integrator restricted to certain elements specified by /// the @a elem_attr_marker. void AddDomainIntegrator(BilinearFormIntegrator *bfi, @@ -422,7 +439,7 @@ public: void AddBdrFaceIntegrator(BilinearFormIntegrator *bfi, Array &bdr_marker); - /// Sets all sparse values of \f$ M \f$ and \f$ M_e \f$ to 'a'. + /// Sets all sparse values of $ M $ and $ M_e $ to 'a'. void operator=(const double a) { if (mat != NULL) { *mat = a; } @@ -446,12 +463,15 @@ public: /// Get the finite element space prolongation operator. virtual const Operator *GetProlongation() const { return fes->GetConformingProlongation(); } + /// Get the finite element space restriction operator virtual const Operator *GetRestriction() const { return fes->GetConformingRestriction(); } + /// Get the output finite element space prolongation matrix virtual const Operator *GetOutputProlongation() const { return GetProlongation(); } + /** @brief Returns the output fe space restriction matrix, transposed Logically, this is the transpose of GetOutputRestriction, but in @@ -459,11 +479,12 @@ public: construction of RAP operators in matrix-free methods. */ virtual const Operator *GetOutputRestrictionTranspose() const { return fes->GetRestrictionTransposeOperator(); } + /// Get the output finite element space restriction matrix virtual const Operator *GetOutputRestriction() const { return GetRestriction(); } - /// @brief Compute serial RAP operator and store it in @a A as a SparseMatrix. + /// Compute serial RAP operator and store it in @a A as a SparseMatrix. void SerialRAP(OperatorHandle &A) { MFEM_ASSERT(mat, "SerialRAP requires the SparseMatrix to be assembled."); @@ -595,8 +616,8 @@ public: /** The boundary element matrix @a elmat is assembled for the boundary element @a i, i.e. added to the system matrix. The vdofs of the element are returned in @a vdofs. The flag @a skip_zeros skips the zero elements - of the matrix, unless they are breaking the symmetry of the system matrix. - */ + of the matrix, unless they are breaking the symmetry of the system + matrix. */ void AssembleBdrElementMatrix(int i, const DenseMatrix &elmat, Array &vdofs, int skip_zeros = 1); @@ -617,24 +638,29 @@ public: double value); /// Eliminate the given @a vdofs. NOTE: here, @a vdofs is a list of DOFs. - /** In this case the eliminations are applied to the internal \f$ M \f$ - and @a rhs without storing the elimination matrix \f$ M_e \f$. */ + /** In this case the eliminations are applied to the internal $ M $ + and @a rhs without storing the elimination matrix $ M_e $. */ void EliminateVDofs(const Array &vdofs, const Vector &sol, Vector &rhs, DiagonalPolicy dpolicy = DIAG_ONE); - /// Eliminate the given @a vdofs, storing the eliminated part internally in \f$ M_e \f$. - /** This method works in conjunction with EliminateVDofsInRHS() and allows + /** @brief Eliminate the given @a vdofs, storing the eliminated part + internally in $ M_e $. + + This method works in conjunction with EliminateVDofsInRHS() and allows elimination of boundary conditions in multiple right-hand sides. In this method, @a vdofs is a list of DOFs. */ void EliminateVDofs(const Array &vdofs, DiagonalPolicy dpolicy = DIAG_ONE); /** @brief Similar to - EliminateVDofs(const Array &, const Vector &, Vector &, DiagonalPolicy) + EliminateVDofs(const Array &, const Vector &, + Vector &, DiagonalPolicy) but here @a ess_dofs is a marker (boolean) array on all vector-dofs (@a ess_dofs[i] < 0 is true). */ - void EliminateEssentialBCFromDofs(const Array &ess_dofs, const Vector &sol, - Vector &rhs, DiagonalPolicy dpolicy = DIAG_ONE); + void EliminateEssentialBCFromDofs(const Array &ess_dofs, + const Vector &sol, + Vector &rhs, + DiagonalPolicy dpolicy = DIAG_ONE); /** @brief Similar to EliminateVDofs(const Array &, DiagonalPolicy) but here @a ess_dofs is a marker (boolean) array on all vector-dofs @@ -651,11 +677,13 @@ public: void EliminateVDofsInRHS(const Array &vdofs, const Vector &x, Vector &b); - /// Compute inner product for full uneliminated matrix \f$ y^T M x + y^T M_e x \f$ + /** @brief Compute inner product for full uneliminated matrix: + $ y^T M x + y^T M_e x $ */ double FullInnerProduct(const Vector &x, const Vector &y) const { return mat->InnerProduct(x, y) + mat_e->InnerProduct(x, y); } - /// Update the @a FiniteElementSpace and delete all data associated with the old one. + /** @brief Update the @a FiniteElementSpace and delete all data associated + with the old one. */ virtual void Update(FiniteElementSpace *nfes = NULL); /// (DEPRECATED) Return the FE space associated with the BilinearForm. @@ -664,11 +692,13 @@ public: /// Return the FE space associated with the BilinearForm. FiniteElementSpace *FESpace() { return fes; } + /// Read-only access to the associated FiniteElementSpace. const FiniteElementSpace *FESpace() const { return fes; } - /// Sets diagonal policy used upon construction of the linear system. - /** Policies include: + /** @brief Sets Operator::DiagonalPolicy used upon construction of the + linear system. + Policies include: - DIAG_ZERO (Set the diagonal values to zero) - DIAG_ONE (Set the diagonal values to one) @@ -679,7 +709,8 @@ public: /// Indicate that integrators are not owned by the BilinearForm void UseExternalIntegrators() { extern_bfs = 1; } - /// Destroys bilinear form. + /** @brief Deletes internal matrices, bilinear integrators, and the + BilinearFormExtension */ virtual ~BilinearForm(); }; @@ -715,8 +746,10 @@ protected: Partial Assembly (PA), or Matrix Free assembly (MF). */ MixedBilinearFormExtension *ext; - /** @brief Indicates the BilinearFormIntegrator%s stored in #domain_integs, - #boundary_integs, #trace_face_integs and #boundary_trace_face_integs + /** @brief Indicates the BilinearFormIntegrator%s stored in + MixedBilinearForm#domain_integs, MixedBilinearForm#boundary_integs, + MixedBilinearForm#trace_face_integs and + MixedBilinearForm#boundary_trace_face_integs are owned by another MixedBilinearForm. */ int extern_bfs; @@ -769,39 +802,49 @@ public: FiniteElementSpace *te_fes, MixedBilinearForm *mbf); - /// Returns a reference to: \f$ M_{ij} \f$ + /// Returns a reference to: $ M_{ij} $ virtual double &Elem(int i, int j); - /// Returns a reference to: \f$ M_{ij} \f$ + /// Returns a reference to: $ M_{ij} $ virtual const double &Elem(int i, int j) const; - /// Matrix multiplication: \f$ y = M x \f$ + /// Matrix multiplication: $ y = M x $ virtual void Mult(const Vector & x, Vector & y) const; + /// Add the matrix vector multiple to a vector: $ y += a M x $ virtual void AddMult(const Vector & x, Vector & y, const double a = 1.0) const; + /// Matrix transpose vector multiplication: $ y = M^T x $ virtual void MultTranspose(const Vector & x, Vector & y) const; + + /// Add the matrix transpose vector multiplication: $ y += a M^T x $ virtual void AddMultTranspose(const Vector & x, Vector & y, const double a = 1.0) const; + /** @brief Returns a pointer to (approximation) of the matrix inverse: + $ M^{-1} $ (currently unimplemented and returns NULL)*/ virtual MatrixInverse *Inverse() const; - /// Finalizes the matrix initialization. + /** @brief Finalizes the matrix initialization if the ::AssemblyLevel is + AssemblyLevel::LEGACY.*/ virtual void Finalize(int skip_zeros = 1); - /** Extract the associated matrix as SparseMatrix blocks. The number of - block rows and columns is given by the vector dimensions (vdim) of the + /** @brief Extract the associated matrix as SparseMatrix blocks. The number + of block rows and columns is given by the vector dimensions (vdim) of the test and trial spaces, respectively. */ void GetBlocks(Array2D &blocks) const; - /// Returns a const reference to the sparse matrix: \f$ M \f$ + /// Returns a const reference to the sparse matrix: $ M $ + /** This will segfault if the usual sparse mat is not defined + like when static condensation is being used or AllocMat() has + not yet been called. */ const SparseMatrix &SpMat() const { return *mat; } - /// Returns a reference to the sparse matrix: \f$ M \f$ + /// Returns a reference to the sparse matrix: $ M $ SparseMatrix &SpMat() { return *mat; } - /** @brief Nullifies the internal matrix \f$ M \f$ and returns a pointer + /** @brief Nullifies the internal matrix $ M $ and returns a pointer to it. Used for transferring ownership. */ SparseMatrix *LoseMat() { SparseMatrix *tmp = mat; mat = NULL; return tmp; } @@ -822,8 +865,8 @@ public: /** @brief Add a trace face integrator. Assumes ownership of @a bfi. This type of integrator assembles terms over all faces of the mesh using - the face FE from the trial space and the two adjacent volume FEs from the - test space. */ + the face FE from the trial space and the two adjacent volume FEs from + the test space. */ void AddTraceFaceIntegrator(BilinearFormIntegrator *bfi); /// Adds a boundary trace face integrator. Assumes ownership of @a bfi. @@ -842,7 +885,9 @@ public: /// Access all integrators added with AddBoundaryIntegrator(). Array *GetBBFI() { return &boundary_integs; } + /** @brief Access all boundary markers added with AddBoundaryIntegrator(). + If no marker was specified when the integrator was added, the corresponding pointer (to Array) will be NULL. */ Array*> *GetBBFI_Marker() { return &boundary_integs_marker; } @@ -853,17 +898,19 @@ public: /// Access all integrators added with AddBdrTraceFaceIntegrator(). Array *GetBTFBFI() { return &boundary_trace_face_integs; } - /** @brief Access all boundary markers added with AddBdrTraceFaceIntegrator(). + + /** @brief Access all boundary markers added with AddBdrTraceFaceIntegrator() + If no marker was specified when the integrator was added, the corresponding pointer (to Array) will be NULL. */ Array*> *GetBTFBFI_Marker() { return &boundary_trace_face_integs_marker; } - /// Sets all sparse values of \f$ M \f$ to @a a. + /// Sets all sparse values of $ M $ to @a a. void operator=(const double a) { *mat = a; } /// Set the desired assembly level. The default is AssemblyLevel::LEGACY. - /** This method must be called before assembly. */ + /** This method must be called before assembly. See ::AssemblyLevel*/ void SetAssemblyLevel(AssemblyLevel assembly_level); void Assemble(int skip_zeros = 1); @@ -888,11 +935,12 @@ public: virtual const Operator *GetOutputRestriction() const { return test_fes->GetRestrictionMatrix(); } - /** For partially conforming trial and/or test FE spaces, complete the - assembly process by performing A := P2^t A P1 where A is the internal - sparse matrix; P1 and P2 are the conforming prolongation matrices of the - trial and test FE spaces, respectively. After this call the - MixedBilinearForm becomes an operator on the conforming FE spaces. */ + /** @brief For partially conforming trial and/or test FE spaces, complete the + assembly process by performing $ P2^t A P1 $ where $ A $ is the + internal sparse matrix; $ P1 $ and $ P2 $ are the conforming + prolongation matrices of the trial and test FE spaces, respectively. + After this call the MixedBilinearForm becomes an operator on the + conforming FE spaces. */ void ConformingAssemble(); /// Compute the element matrix of the given element @@ -935,18 +983,29 @@ public: element @a i, i.e. added to the system matrix. The vdofs of the element are returned in @a trial_vdofs and @a test_vdofs. The flag @a skip_zeros skips the zero elements of the matrix, unless they are breaking the - symmetry of the system matrix. - */ + symmetry of the system matrix.*/ void AssembleBdrElementMatrix(int i, const DenseMatrix &elmat, - Array &trial_vdofs, Array &test_vdofs, + Array &trial_vdofs, + Array &test_vdofs, int skip_zeros = 1); + /// Eliminate essential boundary DOFs from the columns of the system. + /** The array @a bdr_attr_is_ess marks boundary attributes that constitute + the essential part of the boundary. All entries in the columns will be + set to 0.0 through elimination.*/ void EliminateTrialDofs(const Array &bdr_attr_is_ess, const Vector &sol, Vector &rhs); + /// Eliminate the list of DOFs from the columns of the system. + /** @a marked_vdofs is the of colunm numbers that will be eliminated. All + entries in the columns will be set to 0.0 through elimination.*/ void EliminateEssentialBCFromTrialDofs(const Array &marked_vdofs, const Vector &sol, Vector &rhs); + /// Eliminate essential boundary DOFs from the rows of the system. + /** The array @a bdr_attr_is_ess marks boundary attributes that constitute + the essential part of the boundary. All entries in the rows will be + set to 0.0 through elimination.*/ virtual void EliminateTestDofs(const Array &bdr_attr_is_ess); /** @brief Return in @a A that is column-constrained. @@ -958,13 +1017,12 @@ public: OperatorHandle &A); /** @brief Form the column-constrained linear system matrix A. - See FormRectangularSystemMatrix() for details. - Version of the method FormRectangularSystemMatrix() where the system matrix is - returned in the variable @a A, of type OpType, holding a *reference* to - the system matrix (created with the method OpType::MakeRef()). The - reference will be invalidated when SetOperatorType(), Update(), or the - destructor is called. */ + Version of the method FormRectangularSystemMatrix() where the system + matrix is returned in the variable @a A, of type OpType, holding a + *reference* to the system matrix (created with the method + OpType::MakeRef()). The reference will be invalidated when + SetOperatorType(), Update(), or the destructor is called. */ template void FormRectangularSystemMatrix(const Array &trial_tdof_list, const Array &test_tdof_list, OpType &A) @@ -976,12 +1034,12 @@ public: A.MakeRef(*A_ptr); } - /** @brief Form the linear system A X = B, corresponding to this mixed bilinear - form and the linear form @a b(.). + /** @brief Form the linear system A X = B, corresponding to this mixed + bilinear form and the linear form @a b(.). - Return in @a A a *reference* to the system matrix that is column-constrained. - The reference will be invalidated when SetOperatorType(), Update(), or the - destructor is called. */ + Return in @a A a *reference* to the system matrix that is + column-constrained. The reference will be invalidated when + SetOperatorType(), Update(), or the destructor is called. */ virtual void FormRectangularLinearSystem(const Array &trial_tdof_list, const Array &test_tdof_list, Vector &x, Vector &b, @@ -991,11 +1049,11 @@ public: /** @brief Form the linear system A X = B, corresponding to this bilinear form and the linear form @a b(.). - Version of the method FormRectangularLinearSystem() where the system matrix is - returned in the variable @a A, of type OpType, holding a *reference* to - the system matrix (created with the method OpType::MakeRef()). The - reference will be invalidated when SetOperatorType(), Update(), or the - destructor is called. */ + Version of the method FormRectangularLinearSystem() where the system + matrix is returned in the variable @a A, of type OpType, holding a + *reference* to the system matrix (created with the method + OpType::MakeRef()). The reference will be invalidated when + SetOperatorType(), Update(), or the destructor is called. */ template void FormRectangularLinearSystem(const Array &trial_tdof_list, const Array &test_tdof_list, @@ -1003,24 +1061,30 @@ public: OpType &A, Vector &X, Vector &B) { OperatorHandle Ah; - FormRectangularLinearSystem(trial_tdof_list, test_tdof_list, x, b, Ah, X, B); + FormRectangularLinearSystem(trial_tdof_list, test_tdof_list, x, b, + Ah, X, B); OpType *A_ptr = Ah.Is(); MFEM_VERIFY(A_ptr, "invalid OpType used"); A.MakeRef(*A_ptr); } + /// Must be called after making changes to #trial_fes or #test_fes. void Update(); /// Return the trial FE space associated with the BilinearForm. FiniteElementSpace *TrialFESpace() { return trial_fes; } + /// Read-only access to the associated trial FiniteElementSpace. const FiniteElementSpace *TrialFESpace() const { return trial_fes; } /// Return the test FE space associated with the BilinearForm. FiniteElementSpace *TestFESpace() { return test_fes; } + /// Read-only access to the associated test FiniteElementSpace. const FiniteElementSpace *TestFESpace() const { return test_fes; } + /** @brief Deletes internal matrices, bilinear integrators, and the + BilinearFormExtension */ virtual ~MixedBilinearForm(); }; diff --git a/fem/bilinearform_ext.cpp b/fem/bilinearform_ext.cpp index 7f523e24f6..1c26575b88 100644 --- a/fem/bilinearform_ext.cpp +++ b/fem/bilinearform_ext.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -255,9 +255,7 @@ PABilinearFormExtension::PABilinearFormExtension(BilinearForm *form) void PABilinearFormExtension::SetupRestrictionOperators(const L2FaceValues m) { if ( Device::Allows(Backend::CEED_MASK) ) { return; } - ElementDofOrdering ordering = UsesTensorBasis(*a->FESpace())? - ElementDofOrdering::LEXICOGRAPHIC: - ElementDofOrdering::NATIVE; + ElementDofOrdering ordering = GetEVectorOrdering(*a->FESpace()); elem_restrict = trial_fes->GetElementRestriction(ordering); if (elem_restrict) { diff --git a/fem/bilinearform_ext.hpp b/fem/bilinearform_ext.hpp index 97334aa46b..69caf2d428 100644 --- a/fem/bilinearform_ext.hpp +++ b/fem/bilinearform_ext.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/bilininteg.cpp b/fem/bilininteg.cpp index 59a35f4606..fa91a77f2c 100644 --- a/fem/bilininteg.cpp +++ b/fem/bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -14,6 +14,7 @@ #include "fem.hpp" #include #include +#include using namespace std; @@ -2948,16 +2949,16 @@ void VectorDiffusionIntegrator::AssembleElementVector( } dshape.SetSize(dof, dim); - dshapedxt.SetSize(dof, dim); - // pelmat.SetSize(dim); + dshapedxt.SetSize(dof, sdim); + pelmat.SetSize(dof); - elvect.SetSize(dim*dof); + elvect.SetSize(vdim*dof); // NOTE: DenseMatrix is in column-major order. This is consistent with // vectors ordered byNODES. In the resulting DenseMatrix, each column // corresponds to a particular vdim. - DenseMatrix mat_in(elfun.GetData(), dof, dim); - DenseMatrix mat_out(elvect.GetData(), dof, dim); + DenseMatrix mat_in(elfun.GetData(), dof, vdim); + DenseMatrix mat_out(elvect.GetData(), dof, vdim); const IntegrationRule *ir = IntRule; if (ir == NULL) @@ -3016,6 +3017,12 @@ void VectorDiffusionIntegrator::AssembleElementVector( } } +ElasticityComponentIntegrator::ElasticityComponentIntegrator( + ElasticityIntegrator &parent_, int i_, int j_) + : parent(parent_), + i_block(i_), + j_block(j_) +{ } void ElasticityIntegrator::AssembleElementMatrix( const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat) diff --git a/fem/bilininteg.hpp b/fem/bilininteg.hpp index a4ac630d64..84e4e809df 100644 --- a/fem/bilininteg.hpp +++ b/fem/bilininteg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -16,6 +16,8 @@ #include "nonlininteg.hpp" #include "fespace.hpp" #include "ceed/interface/util.hpp" +#include "qfunction.hpp" +#include namespace mfem { @@ -40,8 +42,6 @@ public: // make sense for the action of the nonlinear operator (but they all make // sense for its Jacobian). - using NonlinearFormIntegrator::AssemblePA; - /// Method defining partial assembly. /** The result of the partial assembly is stored internally so that it can be used later in the methods AddMultPA() and AddMultTransposePA(). */ @@ -64,7 +64,7 @@ public: /// Assemble diagonal and add it to Vector @a diag. virtual void AssembleDiagonalPA(Vector &diag); - /// Assemble diagonal of \f$ADA^{\mathrm{T}}\f$ (\f$A\f$ is this integrator) and add it to @a diag. + /// Assemble diagonal of $A D A^T$ ($A$ is this integrator) and add it to @a diag. virtual void AssembleDiagonalPA_ADAt(const Vector &D, Vector &diag); /// Method for partially assembled action. @@ -137,8 +137,8 @@ public: DenseMatrix &elmat); /** Compute the local matrix representation of a bilinear form - \f$a(u,v)\f$ defined on different trial (given by \f$u\f$) and test - (given by \f$v\f$) spaces. The rows in the local matrix correspond + $a(u,v)$ defined on different trial (given by $u$) and test + (given by $v$) spaces. The rows in the local matrix correspond to the test dofs and the columns -- to the trial dofs. */ virtual void AssembleElementMatrix2(const FiniteElement &trial_fe, const FiniteElement &test_fe, @@ -280,7 +280,7 @@ private: DenseMatrix bfi_elmat; public: - TransposeIntegrator (BilinearFormIntegrator *bfi_, int own_bfi_ = 1) + TransposeIntegrator(BilinearFormIntegrator *bfi_, int own_bfi_ = 1) { bfi = bfi_; own_bfi = own_bfi_; } virtual void SetIntRule(const IntegrationRule *ir); @@ -300,8 +300,6 @@ public: FaceElementTransformations &Trans, DenseMatrix &elmat); - using BilinearFormIntegrator::AssemblePA; - virtual void AssemblePA(const FiniteElementSpace& fes) { bfi->AssemblePA(fes); @@ -706,9 +704,9 @@ private: }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q u, v)\f$ in either 1D, 2D, - or 3D and where \f$Q\f$ is an optional scalar coefficient, \f$u\f$ and \f$v\f$ are each in \f$H^1\f$ - or \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (Q u, v)$ in either 1D, 2D, + or 3D and where $Q$ is an optional scalar coefficient, $u$ and $v$ are each in $H^1$ + or $L_2$. */ class MixedScalarMassIntegrator : public MixedScalarIntegrator { public: @@ -717,9 +715,9 @@ public: : MixedScalarIntegrator(q) { same_calc_shape = true; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} u, v)\f$ in either 2D, or - 3D and where \f$\vec{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H^1\f$ or \f$L_2\f$ and \f$v\f$ is in \f$H\f$(curl) - or \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} u, v)$ in either 2D, or + 3D and where $\vec{V}$ is a vector coefficient, $u$ is in $H^1$ or $L_2$ and $v$ is in $H(curl$ + or $H(div)$. */ class MixedVectorProductIntegrator : public MixedScalarVectorIntegrator { public: @@ -727,8 +725,8 @@ public: : MixedScalarVectorIntegrator(vq) {} }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla u, v)\f$ in 1D where Q - is an optional scalar coefficient, \f$u\f$ is in \f$H^1\f$, and \f$v\f$ is in \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla u, v)$ in 1D where Q + is an optional scalar coefficient, $u$ is in $H^1$, and $v$ is in $L_2$. */ class MixedScalarDerivativeIntegrator : public MixedScalarIntegrator { public: @@ -762,8 +760,8 @@ protected: } }; -/** Class for integrating the bilinear form \f$a(u,v) := -(Q u, \nabla v)\f$ in 1D where \f$Q\f$ - is an optional scalar coefficient, \f$u\f$ is in \f$L_2\f$, and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := -(Q u, \nabla v)$ in 1D where $Q$ + is an optional scalar coefficient, $u$ is in $L_2$, and $v$ is in $H^1$. */ class MixedScalarWeakDerivativeIntegrator : public MixedScalarIntegrator { public: @@ -799,8 +797,8 @@ protected: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla \cdot u, v)\f$ in either 2D - or 3D where \f$Q\f$ is an optional scalar coefficient, \f$u\f$ is in \f$H\f$(div), and \f$v\f$ is a +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla \cdot u, v)$ in either 2D + or 3D where $Q$ is an optional scalar coefficient, $u$ is in $H(div)$, and $v$ is a scalar field. */ class MixedScalarDivergenceIntegrator : public MixedScalarIntegrator { @@ -821,7 +819,7 @@ protected: inline virtual const char * FiniteElementTypeFailureMessage() const { return "MixedScalarDivergenceIntegrator: " - "Trial must be \f$H\f$(div) and the test space must be a " + "Trial must be $H(div)$ and the test space must be a " "scalar field"; } @@ -836,8 +834,8 @@ protected: { trial_fe.CalcPhysDivShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \nabla \cdot u, v)\f$ in either 2D - or 3D where \f$\vec{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H\f$(div), and \f$v\f$ is in \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \nabla \cdot u, v)$ in either 2D + or 3D where $\vec{V}$ is a vector coefficient, $u$ is in $H(div)$, and $v$ is in $H(div)$. */ class MixedVectorDivergenceIntegrator : public MixedScalarVectorIntegrator { public: @@ -873,9 +871,9 @@ protected: { scalar_fe.CalcPhysDivShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := -(Q u, \nabla \cdot v)\f$ in either 2D - or 3D where \f$Q\f$ is an optional scalar coefficient, \f$u\f$ is in \f$L_2\f$ or \f$H^1\f$, and \f$v\f$ is - in \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := -(Q u, \nabla \cdot v)$ in either 2D + or 3D where $Q$ is an optional scalar coefficient, $u$ is in $L_2$ or $H^1$, and $v$ is + in $H(div)$. */ class MixedScalarWeakGradientIntegrator : public MixedScalarIntegrator { public: @@ -913,9 +911,9 @@ protected: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \mathrm{curl}(u), v)\f$ in 2D where - \f$Q\f$ is an optional scalar coefficient, \f$u\f$ is in \f$H\f$(curl), and \f$v\f$ is in \f$L_2\f$ or - \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (Q \mathrm{curl}(u), v)$ in 2D where + $Q$ is an optional scalar coefficient, $u$ is in $H(curl$, and $v$ is in $L_2$ or + $H^1$. */ class MixedScalarCurlIntegrator : public MixedScalarIntegrator { public: @@ -967,9 +965,9 @@ protected: int dim, ne, dofs1D, quad1D, dofs1Dtest; }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q u, \mathrm{curl}(v))\f$ in 2D where - \f$Q\f$ is an optional scalar coefficient, \f$u\f$ is in \f$L_2\f$ or \f$H^1\f$, and \f$v\f$ is in - \f$H\f$(curl). Partial assembly (PA) is supported but could be further optimized +/** Class for integrating the bilinear form $a(u,v) := (Q u, \mathrm{curl}(v))$ in 2D where + $Q$ is an optional scalar coefficient, $u$ is in $L_2$ or $H^1$, and $v$ is in + $H(curl$. Partial assembly (PA) is supported but could be further optimized by using more efficient threading and shared memory. */ class MixedScalarWeakCurlIntegrator : public MixedScalarIntegrator @@ -1005,9 +1003,9 @@ protected: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q u, v)\f$ in either 2D or - 3D and where \f$Q\f$ is an optional coefficient (of type scalar, matrix, or - diagonal matrix) \f$u\f$ and \f$v\f$ are each in \f$H\f$(curl) or \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (Q u, v)$ in either 2D or + 3D and where $Q$ is an optional coefficient (of type scalar, matrix, or + diagonal matrix) $u$ and $v$ are each in $H(curl$ or $H(div)$. */ class MixedVectorMassIntegrator : public MixedVectorIntegrator { public: @@ -1020,8 +1018,8 @@ public: : MixedVectorIntegrator(mq) { same_calc_shape = true; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times u, v)\f$ in 3D and where - \f$\vec{V}\f$ is a vector coefficient \f$u\f$ and \f$v\f$ are each in \f$H\f$(curl) or \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times u, v)$ in 3D and where + $\vec{V}$ is a vector coefficient $u$ and $v$ are each in $H(curl$ or $H(div)$. */ class MixedCrossProductIntegrator : public MixedVectorIntegrator { public: @@ -1029,9 +1027,9 @@ public: : MixedVectorIntegrator(vq, false) { same_calc_shape = true; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \cdot u, v)\f$ in 2D or 3D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in \f$H^1\f$ or - \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \cdot u, v)$ in 2D or 3D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in $H^1$ or + $L_2$. */ class MixedDotProductIntegrator : public MixedScalarVectorIntegrator { public: @@ -1054,9 +1052,9 @@ public: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (-\vec{V} \cdot u, \nabla \cdot v)\f$ in 2D or - 3D and where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in - \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (-\vec{V} \cdot u, \nabla \cdot v)$ in 2D or + 3D and where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in + $H(div)$. */ class MixedWeakGradDotIntegrator : public MixedScalarVectorIntegrator { public: @@ -1092,8 +1090,8 @@ public: { scalar_fe.CalcPhysDivShape(Trans, shape); shape *= -1.0; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (v \vec{V} \times u, \nabla v)\f$ in 3D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (v \vec{V} \times u, \nabla v)$ in 3D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in $H^1$. */ class MixedWeakDivCrossIntegrator : public MixedVectorIntegrator { public: @@ -1126,9 +1124,9 @@ public: { test_fe.CalcPhysDShape(Trans, shape); shape *= -1.0; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla u, \nabla v)\f$ in 3D - or in 2D and where \f$Q\f$ is a scalar or matrix coefficient \f$u\f$ and \f$v\f$ are both in - \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla u, \nabla v)$ in 3D + or in 2D and where $Q$ is a scalar or matrix coefficient $u$ and $v$ are both in + $H^1$. */ class MixedGradGradIntegrator : public MixedVectorIntegrator { public: @@ -1184,8 +1182,8 @@ public: { test_fe.CalcPhysDShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \nabla u, \nabla v)\f$ in 3D - or in 2D and where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ and \f$v\f$ are both in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \nabla u, \nabla v)$ in 3D + or in 2D and where $\vec{V}$ is a vector coefficient $u$ and $v$ are both in $H^1$. */ class MixedCrossGradGradIntegrator : public MixedVectorIntegrator { public: @@ -1226,9 +1224,9 @@ public: { test_fe.CalcPhysDShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \mathrm{curl}(u), \mathrm{curl}(v))\f$ in 3D - and where \f$Q\f$ is a scalar or matrix coefficient \f$u\f$ and \f$v\f$ are both in - \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (Q \mathrm{curl}(u), \mathrm{curl}(v))$ in 3D + and where $Q$ is a scalar or matrix coefficient $u$ and $v$ are both in + $H(curl$. */ class MixedCurlCurlIntegrator : public MixedVectorIntegrator { public: @@ -1275,8 +1273,8 @@ public: { test_fe.CalcPhysCurlShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \mathrm{curl}(u), \mathrm{curl}(v))\f$ in 3D - and where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ and \f$v\f$ are both in \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \mathrm{curl}(u), \mathrm{curl}(v))$ in 3D + and where $\vec{V}$ is a vector coefficient $u$ and $v$ are both in $H(curl$. */ class MixedCrossCurlCurlIntegrator : public MixedVectorIntegrator { public: @@ -1319,8 +1317,8 @@ public: { test_fe.CalcPhysCurlShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \mathrm{curl}(u), \nabla \cdot v)\f$ in 3D - and where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \mathrm{curl}(u), \nabla \cdot v)$ in 3D + and where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ and $v$ is in $H^1$. */ class MixedCrossCurlGradIntegrator : public MixedVectorIntegrator { public: @@ -1362,8 +1360,8 @@ public: { test_fe.CalcPhysDShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (v \times \nabla \cdot u, \mathrm{curl}(v))\f$ in 3D - and where \f$v\f$ is a scalar coefficient \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (v \times \nabla \cdot u, \mathrm{curl}(v))$ in 3D + and where $v$ is a scalar coefficient $u$ is in $H^1$ and $v$ is in $H(curl$. */ class MixedCrossGradCurlIntegrator : public MixedVectorIntegrator { public: @@ -1405,9 +1403,9 @@ public: { test_fe.CalcPhysCurlShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times u, \mathrm{curl}(v))\f$ in 3D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in - \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times u, \mathrm{curl}(v))$ in 3D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in + $H(curl$. */ class MixedWeakCurlCrossIntegrator : public MixedVectorIntegrator { public: @@ -1440,9 +1438,9 @@ public: { test_fe.CalcPhysCurlShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times u, \mathrm{curl}(v))\f$ in 2D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in - \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times u, \mathrm{curl}(v))$ in 2D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in + $H(curl$. */ class MixedScalarWeakCurlCrossIntegrator : public MixedScalarVectorIntegrator { public: @@ -1475,9 +1473,9 @@ public: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \nabla \cdot u, v)\f$ in 3D or - in 2D and where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H\f$(curl) or - \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \nabla \cdot u, v)$ in 3D or + in 2D and where $\vec{V}$ is a vector coefficient $u$ is in $H^1$ and $v$ is in $H(curl$ or + $H(div)$. */ class MixedCrossGradIntegrator : public MixedVectorIntegrator { public: @@ -1515,9 +1513,9 @@ public: { test_fe.CalcVShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \mathrm{curl}(u), v)\f$ in 3D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) and \f$v\f$ is in \f$H\f$(curl) or - \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \mathrm{curl}(u), v)$ in 3D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ and $v$ is in $H(curl$ or + $H(div)$. */ class MixedCrossCurlIntegrator : public MixedVectorIntegrator { public: @@ -1550,9 +1548,9 @@ public: { trial_fe.CalcPhysCurlShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \mathrm{curl}(u), v)\f$ in 2D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) and \f$v\f$ is in \f$H\f$(curl) or - \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \mathrm{curl}(u), v)$ in 2D and + where $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ and $v$ is in $H(curl$ or + $H(div)$. */ class MixedScalarCrossCurlIntegrator : public MixedScalarVectorIntegrator { public: @@ -1585,8 +1583,8 @@ public: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times \nabla \cdot u, v)\f$ in 2D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H^1\f$ or \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times \nabla \cdot u, v)$ in 2D and + where $\vec{V}$ is a vector coefficient $u$ is in $H^1$ and $v$ is in $H^1$ or $L_2$. */ class MixedScalarCrossGradIntegrator : public MixedScalarVectorIntegrator { public: @@ -1619,8 +1617,8 @@ public: { vector_fe.CalcPhysDShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times u, v)\f$ in 2D and where - \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H\f$(curl) or \f$H\f$(div) and \f$v\f$ is in \f$H^1\f$ or \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times u, v)$ in 2D and where + $\vec{V}$ is a vector coefficient $u$ is in $H(curl$ or $H(div)$ and $v$ is in $H^1$ or $L_2$. */ class MixedScalarCrossProductIntegrator : public MixedScalarVectorIntegrator { public: @@ -1644,10 +1642,10 @@ public: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \times u \hat{z}, v)\f$ in 2D and - where \f$\vec{V}\f$ is a vector coefficient \f$u\f$ is in \f$H^1\f$ or \f$L_2\f$ and \f$v\f$ is in \f$H\f$(curl) or \f$H\f$(div). +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \times u \hat{z}, v)$ in 2D and + where $\vec{V}$ is a vector coefficient $u$ is in $H^1$ or $L_2$ and $v$ is in $H(curl$ or $H(div)$. - \todo Documentation what \f$\hat{z}\f$ is (also missing in https://mfem.org/bilininteg/). + \todo Documentation what $\hat{z}$ is (also missing in https://mfem.org/bilininteg/). */ class MixedScalarWeakCrossProductIntegrator : public MixedScalarVectorIntegrator { @@ -1677,8 +1675,8 @@ public: { scalar_fe.CalcPhysShape(Trans, shape); shape *= -1.0; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (\vec{V} \cdot \nabla u, v)\f$ in 2D or - 3D and where \f$\vec{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H^1\f$ or \f$L_2\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (\vec{V} \cdot \nabla u, v)$ in 2D or + 3D and where $\vec{V}$ is a vector coefficient, $u$ is in $H^1$ and $v$ is in $H^1$ or $L_2$. */ class MixedDirectionalDerivativeIntegrator : public MixedScalarVectorIntegrator { public: @@ -1710,8 +1708,8 @@ public: { vector_fe.CalcPhysDShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (-\hat{V} \cdot \nabla \cdot u, \nabla \cdot v)\f$ in 2D - or 3D and where \f$\hat{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H\f$(div). */ +/** Class for integrating the bilinear form $a(u,v) := (-\hat{V} \cdot \nabla \cdot u, \nabla \cdot v)$ in 2D + or 3D and where $\hat{V}$ is a vector coefficient, $u$ is in $H^1$ and $v$ is in $H(div)$. */ class MixedGradDivIntegrator : public MixedScalarVectorIntegrator { public: @@ -1749,8 +1747,8 @@ public: { scalar_fe.CalcPhysDivShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (-\hat{V} \nabla \cdot u, \nabla \cdot v)\f$ in 2D - or 3D and where \f$\hat{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H\f$(div) and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (-\hat{V} \nabla \cdot u, \nabla \cdot v)$ in 2D + or 3D and where $\hat{V}$ is a vector coefficient, $u$ is in $H(div)$ and $v$ is in $H^1$. */ class MixedDivGradIntegrator : public MixedScalarVectorIntegrator { public: @@ -1789,8 +1787,8 @@ public: { scalar_fe.CalcPhysDivShape(Trans, shape); } }; -/** Class for integrating the bilinear form \f$a(u,v) := (-\hat{V} u, \nabla \cdot v)\f$ in 2D or 3D - and where \f$\hat{V}\f$ is a vector coefficient, \f$u\f$ is in \f$H^1\f$ or \f$L_2\f$ and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := (-\hat{V} u, \nabla \cdot v)$ in 2D or 3D + and where $\hat{V}$ is a vector coefficient, $u$ is in $H^1$ or $L_2$ and $v$ is in $H^1$. */ class MixedScalarWeakDivergenceIntegrator : public MixedScalarVectorIntegrator { public: @@ -1822,9 +1820,9 @@ public: { vector_fe.CalcPhysDShape(Trans, shape); shape *= -1.0; } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla u, v)\f$ in either 2D - or 3D and where \f$Q\f$ is an optional coefficient (of type scalar, matrix, or - diagonal matrix) \f$u\f$ is in \f$H^1\f$ and \f$v\f$ is in \f$H\f$(curl) or \f$H\f$(div). Partial assembly +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla u, v)$ in either 2D + or 3D and where $Q$ is an optional coefficient (of type scalar, matrix, or + diagonal matrix) $u$ is in $H^1$ and $v$ is in $H(curl$ or $H(div)$. Partial assembly (PA) is supported but could be further optimized by using more efficient threading and shared memory. */ @@ -1851,7 +1849,7 @@ protected: inline virtual const char * FiniteElementTypeFailureMessage() const { return "MixedVectorGradientIntegrator: " - "Trial spaces must be \f$H^1\f$ and the test space must be a " + "Trial spaces must be $H^1$ and the test space must be a " "vector field in 2D or 3D"; } @@ -1883,9 +1881,9 @@ private: int dim, ne, dofs1D, quad1D; }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \mathrm{curl}(u), v)\f$ in 3D and - where \f$Q\f$ is an optional coefficient (of type scalar, matrix, or diagonal - matrix) \f$u\f$ is in \f$H\f$(curl) and \f$v\f$ is in \f$H\f$(div) or \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (Q \mathrm{curl}(u), v)$ in 3D and + where $Q$ is an optional coefficient (of type scalar, matrix, or diagonal + matrix) $u$ is in $H(curl$ and $v$ is in $H(div)$ or $H(curl$. */ class MixedVectorCurlIntegrator : public MixedVectorIntegrator { public: @@ -1942,9 +1940,9 @@ private: int dim, ne, dofs1D, dofs1Dtest,quad1D, testType, trialType, coeffDim; }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q u, \mathrm{curl}(v))\f$ in 3D and - where \f$Q\f$ is an optional coefficient (of type scalar, matrix, or diagonal - matrix) \f$u\f$ is in \f$H\f$(div) or \f$H\f$(curl) and \f$v\f$ is in \f$H\f$(curl). */ +/** Class for integrating the bilinear form $a(u,v) := (Q u, \mathrm{curl}(v))$ in 3D and + where $Q$ is an optional coefficient (of type scalar, matrix, or diagonal + matrix) $u$ is in $H(div)$ or $H(curl$ and $v$ is in $H(curl$. */ class MixedVectorWeakCurlIntegrator : public MixedVectorIntegrator { public: @@ -1999,9 +1997,9 @@ private: int dim, ne, dofs1D, quad1D, testType, trialType, coeffDim; }; -/** Class for integrating the bilinear form \f$a(u,v) := - (Q u, \nabla v)\f$ in either - 2D or 3D and where \f$Q\f$ is an optional coefficient (of type scalar, matrix, or - diagonal matrix) \f$u\f$ is in \f$H\f$(div) or \f$H\f$(curl) and \f$v\f$ is in \f$H^1\f$. */ +/** Class for integrating the bilinear form $a(u,v) := - (Q u, \nabla v)$ in either + 2D or 3D and where $Q$ is an optional coefficient (of type scalar, matrix, or + diagonal matrix) $u$ is in $H(div)$ or $H(curl$ and $v$ is in $H^1$. */ class MixedVectorWeakDivergenceIntegrator : public MixedVectorIntegrator { public: @@ -2041,11 +2039,11 @@ protected: } }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla u, v)\f$ where \f$Q\f$ is a - scalar coefficient, \f$u\f$ is in (\f$H^1\f$), and \f$v\f$ is a vector with components - \f$v_i\f$ in (\f$H^1\f$) or (\f$L^2\f$). +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla u, v)$ where $Q$ is a + scalar coefficient, $u$ is in ($H^1$), and $v$ is a vector with components + $v_i$ in ($H^1$) or ($L^2$). - See also MixedVectorGradientIntegrator when \f$v\f$ is in \f$H\f$(curl). */ + See also MixedVectorGradientIntegrator when $v$ is in $H(curl$. */ class GradientIntegrator : public BilinearFormIntegrator { protected: @@ -2092,7 +2090,7 @@ public: ElementTransformation &Trans); }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \nabla u, \nabla v)\f$ where \f$Q\f$ +/** Class for integrating the bilinear form $a(u,v) := (Q \nabla u, \nabla v)$ where $Q$ can be a scalar or a matrix coefficient. */ class DiffusionIntegrator: public BilinearFormIntegrator { @@ -2228,10 +2226,9 @@ public: ElementTransformation &Trans, Vector &flux, Vector *d_energy = NULL); - using BilinearFormIntegrator::AssemblePA; - virtual void AssembleMF(const FiniteElementSpace &fes); + using BilinearFormIntegrator::AssemblePA; virtual void AssemblePA(const FiniteElementSpace &fes); virtual void AssembleEA(const FiniteElementSpace &fes, Vector &emat, @@ -2259,7 +2256,7 @@ public: Coefficient *GetCoefficient() const { return Q; } }; -/** Class for local mass matrix assembling \f$a(u,v) := (Q u, v)\f$ */ +/** Class for local mass matrix assembling $a(u,v) := (Q u, v)$ */ class MassIntegrator: public BilinearFormIntegrator { friend class DGMassInverse; @@ -2294,10 +2291,9 @@ public: ElementTransformation &Trans, DenseMatrix &elmat); - using BilinearFormIntegrator::AssemblePA; - virtual void AssembleMF(const FiniteElementSpace &fes); + using BilinearFormIntegrator::AssemblePA; virtual void AssemblePA(const FiniteElementSpace &fes); virtual void AssemblePABoundary(const FiniteElementSpace &fes); @@ -2324,21 +2320,20 @@ public: const Coefficient *GetCoefficient() const { return Q; } }; -/** Mass integrator \f$(u, v)\f$ restricted to the boundary of a domain */ +/** Mass integrator $(u, v)$ restricted to the boundary of a domain */ class BoundaryMassIntegrator : public MassIntegrator { public: BoundaryMassIntegrator(Coefficient &q) : MassIntegrator(q) { } using BilinearFormIntegrator::AssembleFaceMatrix; - virtual void AssembleFaceMatrix(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Trans, DenseMatrix &elmat); }; -/// \f$ \alpha (Q \cdot \nabla u, v)\f$ +/// $\alpha (Q \cdot \nabla u, v)$ class ConvectionIntegrator : public BilinearFormIntegrator { protected: @@ -2364,10 +2359,9 @@ public: ElementTransformation &, DenseMatrix &); - using BilinearFormIntegrator::AssemblePA; - virtual void AssembleMF(const FiniteElementSpace &fes); + using BilinearFormIntegrator::AssemblePA; virtual void AssemblePA(const FiniteElementSpace&); virtual void AssembleEA(const FiniteElementSpace &fes, Vector &emat, @@ -2396,7 +2390,7 @@ public: // Alias for @ConvectionIntegrator. using NonconservativeConvectionIntegrator = ConvectionIntegrator; -/// \f$-\alpha (u, q \cdot \nabla v)\f$, negative transpose of ConvectionIntegrator +/// $-\alpha (u, q \cdot \nabla v)$, negative transpose of ConvectionIntegrator class ConservativeConvectionIntegrator : public TransposeIntegrator { public: @@ -2404,7 +2398,7 @@ public: : TransposeIntegrator(new ConvectionIntegrator(q, -a)) { } }; -/// \f$ \alpha (Q \cdot \nabla u, v)\f$ using the "group" FE discretization +/// $\alpha (Q \cdot \nabla u, v)$ using the "group" FE discretization class GroupConvectionIntegrator : public BilinearFormIntegrator { protected: @@ -2423,8 +2417,8 @@ public: DenseMatrix &); }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q u, v)\f$, - where \f$ u=(u_1,\dots,u_n) \f$ and \f$ v=(v_1,\dots,v_n)\f$, \f$u_i\f$ and \f$v_i\f$ are defined +/** Class for integrating the bilinear form $a(u,v) := (Q u, v)$, + where $u=(u_1,\dots,u_n)$ and $v=(v_1,\dots,v_n)$, $u_i$ and $v_i$ are defined by scalar FE through standard transformation. */ class VectorMassIntegrator: public BilinearFormIntegrator { @@ -2485,10 +2479,10 @@ public: }; -/** Class for integrating \f$(\nabla \cdot u, p)\f$ where \f$u\f$ is a vector field given by - VectorFiniteElement through Piola transformation (for Raviart-Thomas elements); \f$p\f$ is +/** Class for integrating $(\nabla \cdot u, p)$ where $u$ is a vector field given by + VectorFiniteElement through Piola transformation (for Raviart-Thomas elements); $p$ is scalar function given by FiniteElement through standard transformation. - Here, \f$u\f$ is the trial function and \f$p\f$ is the test function. + Here, $u$ is the trial function and $p$ is the test function. Note: if the test space does not have map type INTEGRAL, then the element matrix returned by AssembleElementMatrix2 will not depend on the @@ -2532,8 +2526,8 @@ public: }; -/** Integrator for \f$(-Q u, \nabla v)\f$ for Nedelec (\f$u\f$) and \f$H^1\f$ (\f$v\f$) elements. - This is equivalent to a weak divergence of the \f$H\f$(curl) basis functions. */ +/** Integrator for $(-Q u, \nabla v)$ for Nedelec ($u$) and $H^1$ ($v$) elements. + This is equivalent to a weak divergence of the $H(curl$ basis functions. */ class VectorFEWeakDivergenceIntegrator: public BilinearFormIntegrator { protected: @@ -2559,8 +2553,8 @@ public: DenseMatrix &elmat); }; -/** Integrator for \f$(\mathrm{curl}(u), v)\f$ for Nedelec and Raviart-Thomas elements. If the trial and - test spaces are switched, assembles the form \f$(u, \mathrm{curl}(v))\f$. */ +/** Integrator for $(\mathrm{curl}(u), v)$ for Nedelec and Raviart-Thomas elements. If the trial and + test spaces are switched, assembles the form $(u, \mathrm{curl}(v))$. */ class VectorFECurlIntegrator: public BilinearFormIntegrator { protected: @@ -2585,7 +2579,7 @@ public: DenseMatrix &elmat); }; -/// Class for integrating \f$ (Q \partial_i(u), v) \f$ where \f$u\f$ and \f$v\f$ are scalars +/// Class for integrating $ (Q \partial_i(u), v) $ where $u$ and $v$ are scalars class DerivativeIntegrator : public BilinearFormIntegrator { protected: @@ -2608,7 +2602,7 @@ public: DenseMatrix &elmat); }; -/// Integrator for \f$(\mathrm{curl}(u), \mathrm{curl}(v))\f$ for Nedelec elements +/// Integrator for $(\mathrm{curl}(u), \mathrm{curl}(v))$ for Nedelec elements class CurlCurlIntegrator: public BilinearFormIntegrator { private: @@ -2673,7 +2667,7 @@ public: const Coefficient *GetCoefficient() const { return Q; } }; -/** Integrator for \f$(\mathrm{curl}(u), \mathrm{curl}(v))\f$ for FE spaces defined by 'dim' copies of a +/** Integrator for $(\mathrm{curl}(u), \mathrm{curl}(v))$ for FE spaces defined by 'dim' copies of a scalar FE space. */ class VectorCurlCurlIntegrator: public BilinearFormIntegrator { @@ -2694,19 +2688,19 @@ public: virtual void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat); - /// Compute element energy: \f$ \frac{1}{2} (\mathrm{curl}(u), \mathrm{curl}(u))_E\f$ + /// Compute element energy: $ \frac{1}{2} (\mathrm{curl}(u), \mathrm{curl}(u))_E$ virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun); }; -/** Class for integrating the bilinear form \f$a(u,v) := (Q \mathrm{curl}(u), v)\f$ where \f$Q\f$ is - an optional scalar coefficient, and \f$v\f$ is a vector with components \f$v_i\f$ in - the \f$L_2\f$ or \f$H^1\f$ space. This integrator handles 3 cases: - 1. u ∈ \f$H\f$(curl) in 3D, \f$v\f$ is a 3D vector with components \f$v_i\f$ in \f$L^2\f$ or \f$H^1\f$ - 2. u ∈ \f$H\f$(curl) in 2D, \f$v\f$ is a scalar field in \f$L^2\f$ or \f$H^1\f$ - 3. u is a scalar field in \f$H^1\f$, i.e, \f$\mathrm{curl}(u) := \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}\f$, \f$\nabla u\f$ and \f$v\f$ is a - 2D vector field with components \f$v_i\f$ in \f$L^2\f$ or \f$H^1\f$ space. +/** Class for integrating the bilinear form $a(u,v) := (Q \mathrm{curl}(u), v)$ where $Q$ is + an optional scalar coefficient, and $v$ is a vector with components $v_i$ in + the $L_2$ or $H^1$ space. This integrator handles 3 cases: + 1. u ∈ $H(curl$ in 3D, $v$ is a 3D vector with components $v_i$ in $L^2$ or $H^1$ + 2. u ∈ $H(curl$ in 2D, $v$ is a scalar field in $L^2$ or $H^1$ + 3. u is a scalar field in $H^1$, i.e, $\mathrm{curl}(u) := \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}$, $\nabla u$ and $v$ is a + 2D vector field with components $v_i$ in $L^2$ or $H^1$ space. Note: Case 2 can also be handled by MixedScalarCurlIntegrator */ class MixedCurlIntegrator : public BilinearFormIntegrator @@ -2730,10 +2724,10 @@ public: DenseMatrix &elmat); }; -/** Integrator for \f$(Q u, v)\f$, where \f$Q\f$ is an optional coefficient (of type scalar, - vector (diagonal matrix), or matrix), trial function \f$u\f$ is in \f$H\f$(curl) or - \f$H\f$(div), and test function \f$v\f$ is in \f$H\f$(curl), \f$H\f$(div), or \f$v=(v_1,\dots,v_n)\f$, where - \f$v_i\f$ are in \f$H^1\f$. */ +/** Integrator for $(Q u, v)$, where $Q$ is an optional coefficient (of type scalar, + vector (diagonal matrix), or matrix), trial function $u$ is in $H(curl$ or + $H(div)$, and test function $v$ is in $H(curl$, $H(div)$, or $v=(v_1,\dots,v_n)$, where + $v_i$ are in $H^1$. */ class VectorFEMassIntegrator: public BilinearFormIntegrator { private: @@ -2781,7 +2775,6 @@ public: ElementTransformation &Trans, DenseMatrix &elmat); - using BilinearFormIntegrator::AssemblePA; virtual void AssemblePA(const FiniteElementSpace &fes); virtual void AssemblePA(const FiniteElementSpace &trial_fes, const FiniteElementSpace &test_fes); @@ -2792,8 +2785,8 @@ public: const Coefficient *GetCoefficient() const { return Q; } }; -/** Integrator for \f$(Q \nabla \cdot u, v)\f$ where \f$u=(u_1,\cdots,u_n)\f$ and all \f$u_i\f$ are in the same - scalar FE space; \f$v\f$ is also in a (different) scalar FE space. */ +/** Integrator for $(Q \nabla \cdot u, v)$ where $u=(u_1,\cdots,u_n)$ and all $u_i$ are in the same + scalar FE space; $v$ is also in a (different) scalar FE space. */ class VectorDivergenceIntegrator : public BilinearFormIntegrator { protected: @@ -2840,7 +2833,7 @@ public: ElementTransformation &Trans); }; -/// \f$(Q \nabla \cdot u, \nabla \cdot v)\f$ for Raviart-Thomas elements +/// $(Q \nabla \cdot u, \nabla \cdot v)$ for Raviart-Thomas elements class DivDivIntegrator: public BilinearFormIntegrator { protected: @@ -2881,10 +2874,10 @@ public: }; /** Integrator for - \f[ + $$ (Q \nabla u, \nabla v) = \sum_i (Q \nabla u_i, \nabla v_i) e_i e_i^{\mathrm{T}} - \f] - for vector FE spaces, where \f$e_i\f$ is the unit vector in the \f$i\f$-th direction. + $$ + for vector FE spaces, where $e_i$ is the unit vector in the $i$-th direction. The resulting local element matrix is square, of size vdim*dof , where \c vdim is the vector dimension space and \c dof is the local degrees of freedom. The integrator is not aware of the true vector dimension and @@ -2945,7 +2938,7 @@ public: \c Vector. The element matrix is block-diagonal and each block is integrated with - coefficient \f$q_{i}\f$. + coefficient $q_{i}$. If the vector dimension does not match the true dimension of the space, the resulting element matrix will be mathematically invalid. */ @@ -2957,7 +2950,7 @@ public: \c Matrix. The element matrix is populated in each block. Each block is integrated - with coefficient \f$q_{ij}\f$. + with coefficient $q_{ij}$. If the vector dimension does not match the true dimension of the space, the resulting element matrix will be mathematically invalid. */ @@ -2981,14 +2974,16 @@ public: }; /** Integrator for the linear elasticity form: - \f[ + $$ a(u,v) = (\lambda \mathrm{div}(u), \mathrm{div}(v)) + (2 \mu \varepsilon(u), \varepsilon(v)), - \f] - where \f$\varepsilon(v) = \frac{1}{2} (\mathrm{grad}(v) + \mathrm{grad}(v)^{\mathrm{T}})\f$. + $$ + where $\varepsilon(v) = \frac{1}{2} (\mathrm{grad}(v) + \mathrm{grad}(v)^{\mathrm{T}})$. This is a 'Vector' integrator, i.e. defined for FE spaces using multiple copies of a scalar FE space. */ class ElasticityIntegrator : public BilinearFormIntegrator { + friend class ElasticityComponentIntegrator; + protected: double q_lambda, q_mu; Coefficient *lambda, *mu; @@ -3000,24 +2995,49 @@ private: Vector divshape; #endif + // PA extension + + const DofToQuad *maps; ///< Not owned + const GeometricFactors *geom; ///< Not owned + int vdim, ndofs; + const FiniteElementSpace *fespace; ///< Not owned. + + std::unique_ptr q_space; + /// Coefficients projected onto q_space + std::unique_ptr lambda_quad, mu_quad; + /// Workspace vector + std::unique_ptr q_vec; + + /// Set up the quadrature space and project lambda and mu coefficients + void SetUpQuadratureSpaceAndCoefficients(const FiniteElementSpace &fes); + public: ElasticityIntegrator(Coefficient &l, Coefficient &m) { lambda = &l; mu = &m; } - /** With this constructor \f$\lambda = q_l * m\f$ and \f$\mu = q_m * m\f$ - if \f$dim * q_l + 2 * q_m = 0\f$ then \f$\tr(\sigma) = 0\f$. */ + /** With this constructor $\lambda = q_l m$ and $\mu = q_m m$ + if $dim q_l + 2 q_m = 0$ then $tr(\sigma) = 0$. */ ElasticityIntegrator(Coefficient &m, double q_l, double q_m) { lambda = NULL; mu = &m; q_lambda = q_l; q_mu = q_m; } - virtual void AssembleElementMatrix(const FiniteElement &, - ElementTransformation &, - DenseMatrix &); + virtual void AssembleElementMatrix(const FiniteElement &el, + ElementTransformation &Tr, + DenseMatrix &elmat); - /** Compute the stress corresponding to the local displacement @a \f$u\f$ and + using BilinearFormIntegrator::AssemblePA; + virtual void AssemblePA(const FiniteElementSpace &fes); + + virtual void AssembleDiagonalPA(Vector &diag); + + virtual void AddMultPA(const Vector &x, Vector &y) const; + + virtual void AddMultTransposePA(const Vector &x, Vector &y) const; + + /** Compute the stress corresponding to the local displacement @a $u$ and interpolate it at the nodes of the given @a fluxelem. Only the symmetric part of the stress is stored, so that the size of @a flux is equal to the number of DOFs in @a fluxelem times dim*(dim+1)/2. In 2D, the order - of the stress components is: \f$s_xx, s_yy, s_xy\f$. In 3D, it is: \f$s_xx, s_yy, - s_zz, s_xy, s_xz, s_yz\f$. In other words, @a flux is the local vector for + of the stress components is: $s_xx, s_yy, s_xy$. In 3D, it is: $s_xx, s_yy, + s_zz, s_xy, s_xz, s_yz$. In other words, @a flux is the local vector for a FE space with dim*(dim+1)/2 vector components, based on the finite element @a fluxelem. The integration rule is taken from @a fluxelem. @a ir exists to specific an alternative integration rule. */ @@ -3035,39 +3055,71 @@ public: dim*(dim+1)/2 vector components, based on the finite element @a fluxelem. The number of components, dim*(dim+1)/2 is such that it represents the symmetric part of the (symmetric) stress tensor. The order of the - components is: \f$s_xx, s_yy, s_xy\f$ in 2D, and \f$s_xx, s_yy, s_zz, s_xy, s_xz, - s_yz\f$ in 3D. */ + components is: $s_xx, s_yy, s_xy$ in 2D, and $s_xx, s_yy, s_zz, s_xy, s_xz, + s_yz$ in 3D. */ virtual double ComputeFluxEnergy(const FiniteElement &fluxelem, ElementTransformation &Trans, Vector &flux, Vector *d_energy = NULL); }; -/** Integrator for the DG form: - \f[ - \alpha \langle \rho_u (u \cdot n) \{v\},[w] \rangle + \beta \langle \rho_u |u \cdot n| [v],[w] \rangle, - \f] - where \f$v\f$ and \f$w\f$ are the trial and test variables, respectively, and \f$\rho\f$/\f$u\f$ are - given scalar/vector coefficients. \f$\{v\}\f$ represents the average value of \f$v\f$ on - the face and \f$[v]\f$ is the jump such that \f$\{v\}=(v_1+v_2)/2\f$ and \f$[v]=(v_1-v_2)\f$ for the - face between elements \f$1\f$ and \f$2\f$. For boundary elements, \f$v2=0\f$. The vector - coefficient, \f$u\f$, is assumed to be continuous across the faces and when given - the scalar coefficient, \f$\rho\f$, is assumed to be discontinuous. The integrator - uses the upwind value of \f$\rho\f$, denoted by \f$\rho_u\f$, which is value from the side into which - the vector coefficient, \f$u\f$, points. +/// @brief Integrator that computes the PA action of one of the blocks in an +/// ElasticityIntegrator, considering the elasticity operator as a dim x dim +/// block operator. +class ElasticityComponentIntegrator : public BilinearFormIntegrator +{ + ElasticityIntegrator &parent; + const int i_block; + const int j_block; - One use case for this integrator is to discretize the operator \f$-u \cdot \nabla v\f$ + const DofToQuad *maps; ///< Not owned + const GeometricFactors *geom; ///< Not owned + const FiniteElementSpace *fespace; ///< Not owned. + +public: + /// @brief Given an ElasticityIntegrator, create an integrator that + /// represents the $(i,j)$th component block. + /// + /// @note The parent ElasticityIntegrator must remain valid throughout the + /// lifetime of this integrator. + ElasticityComponentIntegrator(ElasticityIntegrator &parent_, int i_, int j_); + + using BilinearFormIntegrator::AssemblePA; + virtual void AssemblePA(const FiniteElementSpace &fes); + + virtual void AssembleEA(const FiniteElementSpace &fes, Vector &emat, + const bool add = true); + + virtual void AddMultPA(const Vector &x, Vector &y) const; + + virtual void AddMultTransposePA(const Vector &x, Vector &y) const; +}; + +/** Integrator for the DG form: + $$ + \alpha \langle \rho_u (u \cdot n) \{v\},[w] \rangle + \beta \langle \rho_u |u \cdot n| [v],[w] \rangle, + $$ + where $v$ and $w$ are the trial and test variables, respectively, and $\rho$/$u$ are + given scalar/vector coefficients. $\{v\}$ represents the average value of $v$ on + the face and $[v]$ is the jump such that $\{v\}=(v_1+v_2)/2$ and $[v]=(v_1-v_2)$ for the + face between elements $1$ and $2$. For boundary elements, $v2=0$. The vector + coefficient, $u$, is assumed to be continuous across the faces and when given + the scalar coefficient, $\rho$, is assumed to be discontinuous. The integrator + uses the upwind value of $\rho$, denoted by $\rho_u$, which is value from the side into which + the vector coefficient, $u$, points. + + One use case for this integrator is to discretize the operator $-u \cdot \nabla v$ with a DG formulation. The resulting formulation uses the - ConvectionIntegrator (with coefficient \f$u\f$, and parameter \f$\alpha = -1\f$) and the - transpose of the DGTraceIntegrator (with coefficient \f$u\f$, and parameters \f$\alpha - = 1\f$, \f$\beta = -1/2\f$ to use the upwind face flux, see also + ConvectionIntegrator (with coefficient $u$, and parameter $\alpha = -1$) and the + transpose of the DGTraceIntegrator (with coefficient $u$, and parameters $\alpha = 1$, + $\beta = -1/2$ to use the upwind face flux, see also NonconservativeDGTraceIntegrator). This discretization and the handling of the inflow and outflow boundaries is illustrated in Example 9/9p. - Another use case for this integrator is to discretize the operator \f$-\mathrm{div}(u v)\f$ + Another use case for this integrator is to discretize the operator $-\mathrm{div}(u v)$ with a DG formulation. The resulting formulation is conservative and - consists of the ConservativeConvectionIntegrator (with coefficient \f$u\f$, and - parameter \f$\alpha = -1\f$) plus the DGTraceIntegrator (with coefficient \f$u\f$, and - parameters \f$\alpha = -1\f$, \f$\beta = -1/2\f$ to use the upwind face flux). + consists of the ConservativeConvectionIntegrator (with coefficient $u$, and + parameter $\alpha = -1$) plus the DGTraceIntegrator (with coefficient $u$, and + parameters $\alpha = -1$, $\beta = -1/2$ to use the upwind face flux). */ class DGTraceIntegrator : public BilinearFormIntegrator { @@ -3085,11 +3137,11 @@ private: Vector shape1, shape2; public: - /// Construct integrator with \f$\rho = 1\f$, \f$\beta = \alpha/2\f$. + /// Construct integrator with $\rho = 1$, $\beta = \alpha/2$. DGTraceIntegrator(VectorCoefficient &u_, double a) { rho = NULL; u = &u_; alpha = a; beta = 0.5*a; } - /// Construct integrator with \f$\rho = 1\f$. + /// Construct integrator with $\rho = 1$. DGTraceIntegrator(VectorCoefficient &u_, double a, double b) { rho = NULL; u = &u_; alpha = a; beta = b; } @@ -3103,8 +3155,6 @@ public: FaceElementTransformations &Trans, DenseMatrix &elmat); - using BilinearFormIntegrator::AssemblePA; - virtual void AssemblePAInteriorFaces(const FiniteElementSpace &fes); virtual void AssemblePABoundaryFaces(const FiniteElementSpace &fes); @@ -3134,9 +3184,9 @@ using ConservativeDGTraceIntegrator = DGTraceIntegrator; /** Integrator that represents the face terms used for the non-conservative DG discretization of the convection equation: - \f[ + $$ -\alpha \langle \rho_u (u \cdot n) \{v\},[w] \rangle + \beta \langle \rho_u |u \cdot n| [v],[w] \rangle. - \f] + $$ This integrator can be used with together with ConvectionIntegrator to implement an upwind DG discretization in non-conservative form, see ex9 and ex9p. */ @@ -3155,17 +3205,17 @@ public: }; /** Integrator for the DG form: - \f[ + $$ - \langle \{(Q \nabla u) \cdot n\}, [v] \rangle + \sigma \langle [u], \{(Q \nabla v) \cdot n \} \rangle + \kappa \langle \{h^{-1} Q\} [u], [v] \rangle - \f] - where \f$Q\f$ is a scalar or matrix diffusion coefficient and \f$u\f$, \f$v\f$ are the trial - and test spaces, respectively. The parameters \f$\sigma\f$ and \f$\kappa\f$ determine the + $$ + where $Q$ is a scalar or matrix diffusion coefficient and $u$, $v$ are the trial + and test spaces, respectively. The parameters $\sigma$ and $\kappa$ determine the DG method to be used (when this integrator is added to the "broken" DiffusionIntegrator): - - \f$\sigma = -1\f$, \f$\kappa \geq \kappa_0\f$: symm. interior penalty (IP or SIPG) method, - - \f$\sigma = +1\f$, \f$\kappa > 0\f$: non-symmetric interior penalty (NIPG) method, - - \f$\sigma = +1\f$, \f$\kappa = 0\f$: the method of Baumann and Oden. + - $\sigma = -1$, $\kappa \geq \kappa_0$: symm. interior penalty (IP or SIPG) method, + - $\sigma = +1$, $\kappa > 0$: non-symmetric interior penalty (NIPG) method, + - $\sigma = +1$, $\kappa = 0$: the method of Baumann and Oden. \todo Clarify used notation. */ class DGDiffusionIntegrator : public BilinearFormIntegrator @@ -3194,11 +3244,11 @@ public: }; /** Integrator for the "BR2" diffusion stabilization term - \f[ + $$ \sum_e \eta (r_e([u]), r_e([v])) - \f] - where \f$r_e\f$ is the lifting operator defined on each edge \f$e\f$ (potentially - weighted by a coefficient \f$Q\f$). The parameter eta can be chosen to be one to + $$ + where $r_e$ is the lifting operator defined on each edge $e$ (potentially + weighted by a coefficient $Q$). The parameter eta can be chosen to be one to obtain a stable discretization. The constructor for this integrator requires the finite element space because the lifting operator depends on the element-wise inverse mass matrix. @@ -3260,52 +3310,52 @@ public: Crouzeix-Raviart %Element: Application to Elasticity, PREPRINT 2000-09, p.3 - \f[ + $$ - \left< \{ \tau(u) \}, [v] \right> + \alpha \left< \{ \tau(v) \}, [u] \right> + \kappa \left< h^{-1} \{ \lambda + 2 \mu \} [u], [v] \right> - \f] + $$ - where \f$ \left = \int_{F} u \cdot v \f$, and \f$ F \f$ is a - face which is either a boundary face \f$ F_b \f$ of an element \f$ K \f$ or - an interior face \f$ F_i \f$ separating elements \f$ K_1 \f$ and \f$ K_2 \f$. + where $ \left = \int_{F} u \cdot v $, and $ F $ is a + face which is either a boundary face $ F_b $ of an element $ K $ or + an interior face $ F_i $ separating elements $ K_1 $ and $ K_2 $. - In the bilinear form above \f$ \tau(u) \f$ is traction, and it's also - \f$ \tau(u) = \sigma(u) \cdot \vec{n} \f$, where \f$ \sigma(u) \f$ is - stress, and \f$ \vec{n} \f$ is the unit normal vector w.r.t. to \f$ F \f$. + In the bilinear form above $ \tau(u) $ is traction, and it's also + $ \tau(u) = \sigma(u) \cdot \vec{n} $, where $ \sigma(u) $ is + stress, and $ \vec{n} $ is the unit normal vector w.r.t. to $ F $. In other words, we have - \f[ + $$ - \left< \{ \sigma(u) \cdot \vec{n} \}, [v] \right> + \alpha \left< \{ \sigma(v) \cdot \vec{n} \}, [u] \right> + \kappa \left< h^{-1} \{ \lambda + 2 \mu \} [u], [v] \right> - \f] + $$ For isotropic media - \f[ + $$ \begin{split} \sigma(u) &= \lambda \nabla \cdot u I + 2 \mu \varepsilon(u) \\ &= \lambda \nabla \cdot u I + 2 \mu \frac{1}{2} (\nabla u + \nabla u^{\mathrm{T}}) \\ &= \lambda \nabla \cdot u I + \mu (\nabla u + \nabla u^{\mathrm{T}}) \end{split} - \f] + $$ - where \f$ I \f$ is identity matrix, \f$ \lambda \f$ and \f$ \mu \f$ are Lame - coefficients (see ElasticityIntegrator), \f$ u, v \f$ are the trial and test + where $ I $ is identity matrix, $ \lambda $ and $ \mu $ are Lame + coefficients (see ElasticityIntegrator), $ u, v $ are the trial and test functions, respectively. - The parameters \f$ \alpha \f$ and \f$ \kappa \f$ determine the DG method to + The parameters $ \alpha $ and $ \kappa $ determine the DG method to use (when this integrator is added to the "broken" ElasticityIntegrator): - - IIPG, \f$\alpha = 0\f$, + - IIPG, $\alpha = 0$, C. Dawson, S. Sun, M. Wheeler, Compatible algorithms for coupled flow and transport, Comp. Meth. Appl. Mech. Eng., 193(23-26), 2565-2580, 2004. - - SIPG, \f$\alpha = -1\f$, + - SIPG, $\alpha = -1$, M. Grote, A. Schneebeli, D. Schotzau, Discontinuous Galerkin Finite %Element Method for the Wave Equation, SINUM, 44(6), 2408-2431, 2006. - - NIPG, \f$\alpha = 1\f$, + - NIPG, $\alpha = 1$, B. Riviere, M. Wheeler, V. Girault, A Priori Error Estimates for Finite %Element Methods Based on Discontinuous Approximation Spaces for Elliptic Problems, SINUM, 39(3), 902-931, 2001. @@ -3363,8 +3413,8 @@ protected: DenseMatrix &elmat, DenseMatrix &jmat); }; -/** Integrator for the DPG form:\f$ \langle v, [w] \rangle \f$ over all faces (the interface) where - the trial variable \f$v\f$ is defined on the interface and the test variable \f$w\f$ is +/** Integrator for the DPG form:$ \langle v, [w] \rangle $ over all faces (the interface) where + the trial variable $v$ is defined on the interface and the test variable $w$ is defined inside the elements, generally in a DG space. */ class TraceJumpIntegrator : public BilinearFormIntegrator { @@ -3381,9 +3431,9 @@ public: DenseMatrix &elmat); }; -/** Integrator for the form:\f$ \langle v, [w \cdot n] \rangle \f$ over all faces (the interface) where - the trial variable \f$v\f$ is defined on the interface and the test variable \f$w\f$ is - in an \f$H\f$(div)-conforming space. */ +/** Integrator for the form:$ \langle v, [w \cdot n] \rangle $ over all faces (the interface) where + the trial variable $v$ is defined on the interface and the test variable $w$ is + in an $H(div)$-conforming space. */ class NormalTraceJumpIntegrator : public BilinearFormIntegrator { private: @@ -3400,10 +3450,10 @@ public: DenseMatrix &elmat); }; -/** Integrator for the DPG form:\f$ \langle v, w \rangle \f$ over a face (the interface) where - the trial variable \f$v\f$ is defined on the interface - (\f$H^{-1/2}\f$ i.e., \f$v := u \cdot n\f$ normal trace of \f$H\f$(div)) - and the test variable \f$w\f$ is in an \f$H^1\f$-conforming space. */ +/** Integrator for the DPG form:$ \langle v, w \rangle $ over a face (the interface) where + the trial variable $v$ is defined on the interface + ($H^{-1/2}$ i.e., $v := u \cdot n$ normal trace of $H(div)$) + and the test variable $w$ is in an $H^1$-conforming space. */ class TraceIntegrator : public BilinearFormIntegrator { private: @@ -3417,9 +3467,9 @@ public: DenseMatrix &elmat); }; -/** Integrator for the form: \f$ \langle v, w \cdot n \rangle \f$ over a face (the interface) where - the trial variable \f$v\f$ is defined on the interface (\f$H^{1/2}\f$, i.e., trace of \f$H^1\f$) - and the test variable \f$w\f$ is in an \f$H\f$(div)-conforming space. */ +/** Integrator for the form: $ \langle v, w \cdot n \rangle $ over a face (the interface) where + the trial variable $v$ is defined on the interface ($H^{1/2}$, i.e., trace of $H^1$) + and the test variable $w$ is in an $H(div)$-conforming space. */ class NormalTraceIntegrator : public BilinearFormIntegrator { private: @@ -3436,10 +3486,10 @@ public: }; -/** Integrator for the form: \f$\langle v, w \times n \rangle\f$ over a face (the interface) - * In 3D the trial variable \f$v\f$ is defined on the interface (\f$H^{-1/2}\f$(curl), trace of \f$H\f$(curl)) - * In 2D it's defined on the interface (\f$H^{1/2}\f$, trace of \f$H^1\f$) - * The test variable \f$w\f$ is in an \f$H\f$(curl)-conforming space. */ +/** Integrator for the form: $\langle v, w \times n \rangle$ over a face (the interface) + * In 3D the trial variable $v$ is defined on the interface ($H^{-1/2}$(curl), trace of $H(curl$) + * In 2D it's defined on the interface ($H^{1/2}$, trace of $H^1$) + * The test variable $w$ is in an $H(curl$-conforming space. */ class TangentTraceIntegrator : public BilinearFormIntegrator { private: @@ -3487,8 +3537,8 @@ class DiscreteInterpolator : public BilinearFormIntegrator { }; /** Class for constructing the gradient as a DiscreteLinearOperator from an - \f$H^1\f$-conforming space to an \f$H\f$(curl)-conforming space. The range space can be - vector \f$L_2\f$ space as well. */ + $H^1$-conforming space to an $H(curl$-conforming space. The range space can be + vector $L_2$ space as well. */ class GradientInterpolator : public DiscreteInterpolator { public: @@ -3505,8 +3555,8 @@ public: /** @brief Setup method for PA data. - @param[in] trial_fes \f$H^1\f$ Lagrange space - @param[in] test_fes \f$H\f$(curl) Nedelec space + @param[in] trial_fes $H^1$ Lagrange space + @param[in] test_fes $H(curl$ Nedelec space */ virtual void AssemblePA(const FiniteElementSpace &trial_fes, const FiniteElementSpace &test_fes); @@ -3540,7 +3590,6 @@ public: { ran_fe.Project(dom_fe, Trans, elmat); } using BilinearFormIntegrator::AssemblePA; - virtual void AssemblePA(const FiniteElementSpace &trial_fes, const FiniteElementSpace &test_fes); @@ -3580,7 +3629,7 @@ public: the global discrete divergence matrix. Note: Since the dofs in the L2_FECollection are nodal values, the local - discrete divergence matrix (with an \f$H\f$(div)-type domain space) will depend on + discrete divergence matrix (with an $H(div)$-type domain space) will depend on the transformation. On the other hand, the local matrix returned by VectorFEDivergenceIntegrator is independent of the transformation. */ class DivergenceInterpolator : public DiscreteInterpolator @@ -3595,8 +3644,8 @@ public: /** A trace face interpolator class for interpolating the normal component of - the domain space, e.g. vector \f$H^1\f$, into the range space, e.g. the trace of - \f$H\f$(div) which uses FiniteElement::INTEGRAL map type. */ + the domain space, e.g. vector $H^1$, into the range space, e.g. the trace of + $H(div)$ which uses FiniteElement::INTEGRAL map type. */ class NormalInterpolator : public DiscreteInterpolator { public: @@ -3658,7 +3707,7 @@ protected: }; /** Interpolator of the 2D cross product between a vector coefficient and an - \f$H\f$(curl)-conforming field onto an \f$L_2\f$-conforming field. */ + $H(curl$-conforming field onto an $L_2$-conforming field. */ class ScalarCrossProductInterpolator : public DiscreteInterpolator { public: @@ -3674,8 +3723,8 @@ protected: }; /** Interpolator of the cross product between a vector coefficient and an - \f$H\f$(curl)-conforming field onto an \f$H\f$(div)-conforming field. The range space - can also be vector \f$L_2\f$. */ + $H(curl$-conforming field onto an $H(div)$-conforming field. The range space + can also be vector $L_2$. */ class VectorCrossProductInterpolator : public DiscreteInterpolator { public: @@ -3691,8 +3740,8 @@ protected: }; /** Interpolator of the inner product between a vector coefficient and an - \f$H\f$(div)-conforming field onto an \f$L_2\f$-conforming field. The range space can - also be \f$H^1\f$. */ + $H(div)$-conforming field onto an $L_2$-conforming field. The range space can + also be $H^1$. */ class VectorInnerProductInterpolator : public DiscreteInterpolator { public: diff --git a/fem/ceed/integrators/convection/convection.cpp b/fem/ceed/integrators/convection/convection.cpp index c5560f354b..398fcbff25 100644 --- a/fem/ceed/integrators/convection/convection.cpp +++ b/fem/ceed/integrators/convection/convection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/convection/convection.hpp b/fem/ceed/integrators/convection/convection.hpp index 1cd9687707..ecd60a8bd4 100644 --- a/fem/ceed/integrators/convection/convection.hpp +++ b/fem/ceed/integrators/convection/convection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/convection/convection_qf.h b/fem/ceed/integrators/convection/convection_qf.h index 68e96895e2..c18cf19820 100644 --- a/fem/ceed/integrators/convection/convection_qf.h +++ b/fem/ceed/integrators/convection/convection_qf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/diffusion/diffusion.cpp b/fem/ceed/integrators/diffusion/diffusion.cpp index 4cd68669f3..169526cfa2 100644 --- a/fem/ceed/integrators/diffusion/diffusion.cpp +++ b/fem/ceed/integrators/diffusion/diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/diffusion/diffusion.hpp b/fem/ceed/integrators/diffusion/diffusion.hpp index dd28c9d165..ba5737cc7e 100644 --- a/fem/ceed/integrators/diffusion/diffusion.hpp +++ b/fem/ceed/integrators/diffusion/diffusion.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/diffusion/diffusion_qf.h b/fem/ceed/integrators/diffusion/diffusion_qf.h index aa4850e372..db13be7385 100644 --- a/fem/ceed/integrators/diffusion/diffusion_qf.h +++ b/fem/ceed/integrators/diffusion/diffusion_qf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/mass/mass.cpp b/fem/ceed/integrators/mass/mass.cpp index dfcc9a8ce6..0c6bc65cb5 100644 --- a/fem/ceed/integrators/mass/mass.cpp +++ b/fem/ceed/integrators/mass/mass.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/mass/mass.hpp b/fem/ceed/integrators/mass/mass.hpp index 696f8c3dcd..cf6bb0c5ee 100644 --- a/fem/ceed/integrators/mass/mass.hpp +++ b/fem/ceed/integrators/mass/mass.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/mass/mass_qf.h b/fem/ceed/integrators/mass/mass_qf.h index 85002ae04a..4fa73d89b0 100644 --- a/fem/ceed/integrators/mass/mass_qf.h +++ b/fem/ceed/integrators/mass/mass_qf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/nlconvection/nlconvection.cpp b/fem/ceed/integrators/nlconvection/nlconvection.cpp index ba4a274dc2..afa7269e92 100644 --- a/fem/ceed/integrators/nlconvection/nlconvection.cpp +++ b/fem/ceed/integrators/nlconvection/nlconvection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/nlconvection/nlconvection.hpp b/fem/ceed/integrators/nlconvection/nlconvection.hpp index 3efe887288..37cbadde13 100644 --- a/fem/ceed/integrators/nlconvection/nlconvection.hpp +++ b/fem/ceed/integrators/nlconvection/nlconvection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/integrators/nlconvection/nlconvection_qf.h b/fem/ceed/integrators/nlconvection/nlconvection_qf.h index ef0d413270..a83e2eb71b 100644 --- a/fem/ceed/integrators/nlconvection/nlconvection_qf.h +++ b/fem/ceed/integrators/nlconvection/nlconvection_qf.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/basis.cpp b/fem/ceed/interface/basis.cpp index 37858cb785..50e7247703 100644 --- a/fem/ceed/interface/basis.cpp +++ b/fem/ceed/interface/basis.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/basis.hpp b/fem/ceed/interface/basis.hpp index 3781f4cf73..38d45ba05f 100644 --- a/fem/ceed/interface/basis.hpp +++ b/fem/ceed/interface/basis.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/ceed.hpp b/fem/ceed/interface/ceed.hpp index 4c522c74d9..00f70135fe 100644 --- a/fem/ceed/interface/ceed.hpp +++ b/fem/ceed/interface/ceed.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/coefficient.hpp b/fem/ceed/interface/coefficient.hpp index abb70e8b82..4c2f088974 100644 --- a/fem/ceed/interface/coefficient.hpp +++ b/fem/ceed/interface/coefficient.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/integrator.hpp b/fem/ceed/interface/integrator.hpp index 340ed12ca7..cbac7f87fe 100644 --- a/fem/ceed/interface/integrator.hpp +++ b/fem/ceed/interface/integrator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/interface.hpp b/fem/ceed/interface/interface.hpp index 0a69121ad5..066ef3e314 100644 --- a/fem/ceed/interface/interface.hpp +++ b/fem/ceed/interface/interface.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/mixed_integrator.hpp b/fem/ceed/interface/mixed_integrator.hpp index 8d344f4d90..ab9e9f226c 100644 --- a/fem/ceed/interface/mixed_integrator.hpp +++ b/fem/ceed/interface/mixed_integrator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/operator.cpp b/fem/ceed/interface/operator.cpp index 8545ccaa84..d6d4716bca 100644 --- a/fem/ceed/interface/operator.cpp +++ b/fem/ceed/interface/operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/operator.hpp b/fem/ceed/interface/operator.hpp index cffea2fc7e..ed16fe6fae 100644 --- a/fem/ceed/interface/operator.hpp +++ b/fem/ceed/interface/operator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/restriction.cpp b/fem/ceed/interface/restriction.cpp index e7e8539bd3..796728477f 100644 --- a/fem/ceed/interface/restriction.cpp +++ b/fem/ceed/interface/restriction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/restriction.hpp b/fem/ceed/interface/restriction.hpp index 221716b392..d7d019019c 100644 --- a/fem/ceed/interface/restriction.hpp +++ b/fem/ceed/interface/restriction.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/util.cpp b/fem/ceed/interface/util.cpp index 694f59fded..0897d1639e 100644 --- a/fem/ceed/interface/util.cpp +++ b/fem/ceed/interface/util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/interface/util.hpp b/fem/ceed/interface/util.hpp index babae868f4..4bdb64c59a 100644 --- a/fem/ceed/interface/util.hpp +++ b/fem/ceed/interface/util.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/solvers/algebraic.cpp b/fem/ceed/solvers/algebraic.cpp index 9c4ae930d2..981b8d202c 100644 --- a/fem/ceed/solvers/algebraic.cpp +++ b/fem/ceed/solvers/algebraic.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -305,7 +305,7 @@ AlgebraicMultigrid::AlgebraicMultigrid( AlgebraicSpaceHierarchy &hierarchy, BilinearForm &form, const Array &ess_tdofs -) : GeometricMultigrid(hierarchy) +) : GeometricMultigrid(hierarchy, Array()) { int nlevels = fespaces.GetNumLevels(); ceed_operators.SetSize(nlevels); diff --git a/fem/ceed/solvers/algebraic.hpp b/fem/ceed/solvers/algebraic.hpp index 49cdbca980..9d4cd508e2 100644 --- a/fem/ceed/solvers/algebraic.hpp +++ b/fem/ceed/solvers/algebraic.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/solvers/full-assembly.cpp b/fem/ceed/solvers/full-assembly.cpp index dc98b9de83..9df6e2bf96 100644 --- a/fem/ceed/solvers/full-assembly.cpp +++ b/fem/ceed/solvers/full-assembly.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/solvers/full-assembly.hpp b/fem/ceed/solvers/full-assembly.hpp index c65e3842d6..19f2f405a8 100644 --- a/fem/ceed/solvers/full-assembly.hpp +++ b/fem/ceed/solvers/full-assembly.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/solvers/solvers-atpmg.cpp b/fem/ceed/solvers/solvers-atpmg.cpp index f24762f915..6561b90c4a 100644 --- a/fem/ceed/solvers/solvers-atpmg.cpp +++ b/fem/ceed/solvers/solvers-atpmg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/ceed/solvers/solvers-atpmg.hpp b/fem/ceed/solvers/solvers-atpmg.hpp index 8d85b18407..ea8699d07c 100644 --- a/fem/ceed/solvers/solvers-atpmg.hpp +++ b/fem/ceed/solvers/solvers-atpmg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/coefficient.cpp b/fem/coefficient.cpp index 90eef2c9ce..70a8a9232f 100644 --- a/fem/coefficient.cpp +++ b/fem/coefficient.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1568,7 +1568,7 @@ double ComputeGlobalLpNorm(double p, VectorCoefficient &coeff, ParMesh &pmesh, #endif VectorQuadratureFunctionCoefficient::VectorQuadratureFunctionCoefficient( - QuadratureFunction &qf) + const QuadratureFunction &qf) : VectorCoefficient(qf.GetVDim()), QuadF(qf), index(0) { } void VectorQuadratureFunctionCoefficient::SetComponent(int index_, int length_) @@ -1622,7 +1622,7 @@ void VectorQuadratureFunctionCoefficient::Project(QuadratureFunction &qf) } QuadratureFunctionCoefficient::QuadratureFunctionCoefficient( - QuadratureFunction &qf) : QuadF(qf) + const QuadratureFunction &qf) : QuadF(qf) { MFEM_VERIFY(qf.GetVDim() == 1, "QuadratureFunction's vdim must be 1"); } diff --git a/fem/coefficient.hpp b/fem/coefficient.hpp index 568c9376f0..9f8d0e1132 100644 --- a/fem/coefficient.hpp +++ b/fem/coefficient.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -414,7 +414,7 @@ public: /** @brief A coefficient that depends on 1 or 2 parent coefficients and a transformation rule represented by a C-function. - \f$ C(x,t) = T(Q1(x,t)) \f$ or \f$ C(x,t) = T(Q1(x,t), Q2(x,t)) \f$ + $ C(x,t) = T(Q1(x,t)) $ or $ C(x,t) = T(Q1(x,t), Q2(x,t)) $ where T is the transformation rule, and Q1/Q2 are the parent coefficients.*/ class TransformedCoefficient : public Coefficient @@ -442,7 +442,7 @@ public: /** @brief Delta function coefficient optionally multiplied by a weight coefficient and a scaled time dependent C-function. - \f$ F(x,t) = w(x,t) s T(t) d(x - xc) \f$ + $ F(x,t) = w(x,t) s T(t) d(x - xc) $ where w is the optional weight coefficient, @a s is a scale factor T is an optional time-dependent function and d is a delta function. @@ -517,7 +517,7 @@ public: const double *Center() { return center; } /** @brief Return the scale factor times the optional time dependent - function. Returns \f$ s T(t) \f$ with \f$ T(t) = 1 \f$ when + function. Returns $ s T(t) $ with $ T(t) = 1 $ when not set by the user. */ double Scale() { return tdf ? (*tdf)(GetTime())*scale : scale; } @@ -1683,7 +1683,7 @@ private: mutable Vector va; mutable Vector vb; public: - /// Construct with the two vector coefficients. Result is \f$ A \cdot B \f$. + /// Construct with the two vector coefficients. Result is $ A \cdot B $. InnerProductCoefficient(VectorCoefficient &A, VectorCoefficient &B); /// Set the time for internally stored coefficients @@ -1715,7 +1715,7 @@ private: mutable Vector vb; public: - /// Constructor with two vector coefficients. Result is \f$ A_x B_y - A_y * B_x; \f$. + /// Constructor with two vector coefficients. Result is $ A_x B_y - A_y * B_x; $. VectorRotProductCoefficient(VectorCoefficient &A, VectorCoefficient &B); /// Set the time for internally stored coefficients @@ -2119,7 +2119,7 @@ private: MatrixCoefficient * a; public: - /// Construct with the matrix coefficient. Result is \f$ A^T \f$. + /// Construct with the matrix coefficient. Result is $ A^T $. TransposeMatrixCoefficient(MatrixCoefficient &A); /// Set the time for internally stored coefficients @@ -2142,7 +2142,7 @@ private: MatrixCoefficient * a; public: - /// Construct with the matrix coefficient. Result is \f$ A^{-1} \f$. + /// Construct with the matrix coefficient. Result is $ A^{-1} $. InverseMatrixCoefficient(MatrixCoefficient &A); /// Set the time for internally stored coefficients @@ -2169,7 +2169,7 @@ private: mutable Vector vb; public: - /// Construct with two vector coefficients. Result is \f$ A B^T \f$. + /// Construct with two vector coefficients. Result is $ A B^T $. OuterProductCoefficient(VectorCoefficient &A, VectorCoefficient &B); /// Set the time for internally stored coefficients @@ -2192,8 +2192,8 @@ public: /** @brief Matrix coefficient defined as -a k x k x, for a vector k and scalar a - This coefficient returns \f$a * (|k|^2 I - k \otimes k)\f$, where I is - the identity matrix and \f$\otimes\f$ indicates the outer product. This + This coefficient returns $a * (|k|^2 I - k \otimes k)$, where I is + the identity matrix and $\otimes$ indicates the outer product. This can be evaluated for vectors of any dimension but in three dimensions it corresponds to computing the cross product with k twice. */ @@ -2245,7 +2245,7 @@ private: public: /// Constructor with a quadrature function as input - VectorQuadratureFunctionCoefficient(QuadratureFunction &qf); + VectorQuadratureFunctionCoefficient(const QuadratureFunction &qf); /** Set the starting index within the QuadFunc that'll be used to project outwards as well as the corresponding length. The projected length should @@ -2273,7 +2273,7 @@ private: public: /// Constructor with a quadrature function as input - QuadratureFunctionCoefficient(QuadratureFunction &qf); + QuadratureFunctionCoefficient(const QuadratureFunction &qf); const QuadratureFunction& GetQuadFunction() const { return QuadF; } @@ -2397,23 +2397,23 @@ public: }; /** @brief Compute the Lp norm of a function f. - \f$ \| f \|_{Lp} = ( \int_\Omega | f |^p d\Omega)^{1/p} \f$ */ + $ \| f \|_{Lp} = ( \int_\Omega | f |^p d\Omega)^{1/p} $ */ double ComputeLpNorm(double p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[]); /** @brief Compute the Lp norm of a vector function f = {f_i}_i=1...N. - \f$ \| f \|_{Lp} = ( \sum_i \| f_i \|_{Lp}^p )^{1/p} \f$ */ + $ \| f \|_{Lp} = ( \sum_i \| f_i \|_{Lp}^p )^{1/p} $ */ double ComputeLpNorm(double p, VectorCoefficient &coeff, Mesh &mesh, const IntegrationRule *irs[]); #ifdef MFEM_USE_MPI /** @brief Compute the global Lp norm of a function f. - \f$ \| f \|_{Lp} = ( \int_\Omega | f |^p d\Omega)^{1/p} \f$ */ + $ \| f \|_{Lp} = ( \int_\Omega | f |^p d\Omega)^{1/p} $ */ double ComputeGlobalLpNorm(double p, Coefficient &coeff, ParMesh &pmesh, const IntegrationRule *irs[]); /** @brief Compute the global Lp norm of a vector function f = {f_i}_i=1...N. - \f$ \| f \|_{Lp} = ( \sum_i \| f_i \|_{Lp}^p )^{1/p} \f$ */ + $ \| f \|_{Lp} = ( \sum_i \| f_i \|_{Lp}^p )^{1/p} $ */ double ComputeGlobalLpNorm(double p, VectorCoefficient &coeff, ParMesh &pmesh, const IntegrationRule *irs[]); #endif diff --git a/fem/complex_fem.cpp b/fem/complex_fem.cpp index 2cd4e68a84..95565804df 100644 --- a/fem/complex_fem.cpp +++ b/fem/complex_fem.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/complex_fem.hpp b/fem/complex_fem.hpp index 32b69b3686..c52dac3124 100644 --- a/fem/complex_fem.hpp +++ b/fem/complex_fem.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/conduitdatacollection.cpp b/fem/conduitdatacollection.cpp index 8da785bdfb..75bea64dc6 100644 --- a/fem/conduitdatacollection.cpp +++ b/fem/conduitdatacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/conduitdatacollection.hpp b/fem/conduitdatacollection.hpp index f2904ba4cb..6ff1804e09 100644 --- a/fem/conduitdatacollection.hpp +++ b/fem/conduitdatacollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/convergence.hpp b/fem/convergence.hpp index 9b9d12e6f7..d38651b5b7 100644 --- a/fem/convergence.hpp +++ b/fem/convergence.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/datacollection.cpp b/fem/datacollection.cpp index 0dc718b070..d73d2bb5b7 100644 --- a/fem/datacollection.cpp +++ b/fem/datacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/datacollection.hpp b/fem/datacollection.hpp index c216188afb..351c1239d0 100644 --- a/fem/datacollection.hpp +++ b/fem/datacollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/dgmassinv.cpp b/fem/dgmassinv.cpp index f9b494b36a..fef4605b0d 100644 --- a/fem/dgmassinv.cpp +++ b/fem/dgmassinv.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/dgmassinv.hpp b/fem/dgmassinv.hpp index 71c525cb51..e6a568299f 100644 --- a/fem/dgmassinv.hpp +++ b/fem/dgmassinv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/dgmassinv_kernels.hpp b/fem/dgmassinv_kernels.hpp index 62f03e564c..814cec7647 100644 --- a/fem/dgmassinv_kernels.hpp +++ b/fem/dgmassinv_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/doftrans.cpp b/fem/doftrans.cpp index 0b4dbcef7e..d707a75492 100644 --- a/fem/doftrans.cpp +++ b/fem/doftrans.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/doftrans.hpp b/fem/doftrans.hpp index 81956bdbff..aa5d1ff2c8 100644 --- a/fem/doftrans.hpp +++ b/fem/doftrans.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/eltrans.cpp b/fem/eltrans.cpp index 96aa854a5a..1e6d3564ea 100644 --- a/fem/eltrans.cpp +++ b/fem/eltrans.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/eltrans.hpp b/fem/eltrans.hpp index 3d0ccb97f1..7087adefb3 100644 --- a/fem/eltrans.hpp +++ b/fem/eltrans.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -127,7 +127,7 @@ public: /** @brief Return the weight of the Jacobian matrix of the transformation at the currently set IntegrationPoint. - The Weight evaluates to \f$ \sqrt{\lvert J^T J \rvert} \f$. */ + The Weight evaluates to $ \sqrt{\lvert J^T J \rvert} $. */ double Weight() { return (EvalState & WEIGHT_MASK) ? Wght : EvalWeight(); } /** @brief Return the adjugate of the Jacobian matrix of the transformation @@ -155,7 +155,7 @@ public: of the transformation. */ virtual int OrderW() const = 0; - /// Return the order of \f$ adj(J)^T \nabla fi \f$ + /// Return the order of $ adj(J)^T \nabla fi $ virtual int OrderGrad(const FiniteElement *fe) const = 0; /// Return the Geometry::Type of the reference element. @@ -170,12 +170,13 @@ public: virtual int GetSpaceDim() const = 0; /** @brief Transform a point @a pt from physical space to a point @a ip in - reference space. */ + reference space and optionally can set a solver tolerance using @a phys_tol. */ /** Attempt to find the IntegrationPoint that is transformed into the given point in physical space. If the inversion fails a non-zero value is returned. This method is not 100 percent reliable for non-linear transformations. */ - virtual int TransformBack(const Vector &pt, IntegrationPoint &ip) = 0; + virtual int TransformBack(const Vector &pt, IntegrationPoint &ip, + const double phys_tol = 1e-15) = 0; virtual ~ElementTransformation() { } }; @@ -391,11 +392,11 @@ public: /// @brief Set the underlying point matrix describing the transformation. /** The dimensions of the matrix are space-dim x dof. The transformation is defined as - \f$ x = F( \hat x ) = P \phi( \hat x ) \f$ + $ x = F( \hat x ) = P \phi( \hat x ) $ - where \f$ \hat x \f$ is the reference point, @a x is the corresponding - physical point, @a P is the point matrix, and \f$ \phi( \hat x ) \f$ is - the column-vector of all basis functions evaluated at \f$ \hat x \f$ . + where $ \hat x $ is the reference point, @a x is the corresponding + physical point, @a P is the point matrix, and $ \phi( \hat x ) $ is + the column-vector of all basis functions evaluated at $ \hat x $ . The columns of @a P represent the control points in physical space defining the transformation. */ void SetPointMat(const DenseMatrix &pm) { PointMat = pm; EvalState = 0; } @@ -436,20 +437,22 @@ public: of the transformation. */ virtual int OrderW() const; - /// Return the order of \f$ adj(J)^T \nabla fi \f$ + /// Return the order of $ adj(J)^T \nabla fi $ virtual int OrderGrad(const FiniteElement *fe) const; virtual int GetSpaceDim() const { return PointMat.Height(); } /** @brief Transform a point @a pt from physical space to a point @a ip in - reference space. */ + reference space and optionally can set a solver tolerance using @a phys_tol. */ /** Attempt to find the IntegrationPoint that is transformed into the given point in physical space. If the inversion fails a non-zero value is returned. This method is not 100 percent reliable for non-linear transformations. */ - virtual int TransformBack(const Vector & v, IntegrationPoint & ip) + virtual int TransformBack(const Vector & v, IntegrationPoint & ip, + const double phys_rel_tol = 1e-15) { InverseElementTransformation inv_tr(this); + inv_tr.SetPhysicalRelTol(phys_rel_tol); return inv_tr.Transform(v, ip); } diff --git a/fem/estimators.cpp b/fem/estimators.cpp index a141eb7c3c..09fd27d503 100644 --- a/fem/estimators.cpp +++ b/fem/estimators.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/estimators.hpp b/fem/estimators.hpp index 70f884940f..f456223bdb 100644 --- a/fem/estimators.hpp +++ b/fem/estimators.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe.cpp b/fem/fe.cpp index 44390f76c5..55aec6cb67 100644 --- a/fem/fe.cpp +++ b/fem/fe.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe.hpp b/fem/fe.hpp index 2c2ebb4694..91964e52d3 100644 --- a/fem/fe.hpp +++ b/fem/fe.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/face_map_utils.cpp b/fem/fe/face_map_utils.cpp index cdd1ae4285..bf6f296f52 100644 --- a/fem/fe/face_map_utils.cpp +++ b/fem/fe/face_map_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/face_map_utils.hpp b/fem/fe/face_map_utils.hpp index 7c0300d8df..f31bcfbf9d 100644 --- a/fem/fe/face_map_utils.hpp +++ b/fem/fe/face_map_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_base.cpp b/fem/fe/fe_base.cpp index 4387ae7750..87352e5a5b 100644 --- a/fem/fe/fe_base.cpp +++ b/fem/fe/fe_base.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -648,6 +648,79 @@ void ScalarFiniteElement::ScalarLocalL2Restriction( } } +void NodalFiniteElement::CreateLexicographicFullMap(const IntegrationRule &ir) +const +{ + // Get the FULL version of the map. + auto &d2q = GetDofToQuad(ir, DofToQuad::FULL); + //Undo the native ordering which is what FiniteElement::GetDofToQuad returns. + auto *d2q_new = new DofToQuad(d2q); + d2q_new->mode = DofToQuad::LEXICOGRAPHIC_FULL; + const int nqpt = ir.GetNPoints(); + + const int b_dim = (range_type == VECTOR) ? dim : 1; + + for (int i = 0; i < nqpt; i++) + { + for (int d = 0; d < b_dim; d++) + { + for (int j = 0; j < dof; j++) + { + const double val = d2q.B[i + nqpt*(d+b_dim*lex_ordering[j])]; + d2q_new->B[i+nqpt*(d+b_dim*j)] = val; + d2q_new->Bt[j+dof*(i+nqpt*d)] = val; + } + } + } + + const int g_dim = [this]() + { + switch (deriv_type) + { + case GRAD: return dim; + case DIV: return 1; + case CURL: return cdim; + default: return 0; + } + }(); + + for (int i = 0; i < nqpt; i++) + { + for (int d = 0; d < g_dim; d++) + { + for (int j = 0; j < dof; j++) + { + const double val = d2q.G[i + nqpt*(d+g_dim*lex_ordering[j])]; + d2q_new->G[i+nqpt*(d+g_dim*j)] = val; + d2q_new->Gt[j+dof*(i+nqpt*d)] = val; + } + } + } + + dof2quad_array.Append(d2q_new); +} + +const DofToQuad &NodalFiniteElement::GetDofToQuad(const IntegrationRule &ir, + DofToQuad::Mode mode) const +{ + //Should make this loop a function of FiniteElement + for (int i = 0; i < dof2quad_array.Size(); i++) + { + const DofToQuad &d2q = *dof2quad_array[i]; + if (d2q.IntRule == &ir && d2q.mode == mode) { return d2q; } + } + + if (mode != DofToQuad::LEXICOGRAPHIC_FULL) + { + return FiniteElement::GetDofToQuad(ir, mode); + } + else + { + CreateLexicographicFullMap(ir); + return NodalFiniteElement::GetDofToQuad(ir, mode); + } +} + void NodalFiniteElement::ProjectCurl_2D( const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const @@ -2563,6 +2636,20 @@ void NodalTensorFiniteElement::SetMapType(const int map_type) } } +const DofToQuad &NodalTensorFiniteElement::GetDofToQuad( + const IntegrationRule &ir, + DofToQuad::Mode mode) const +{ + if (mode != DofToQuad::TENSOR) + { + return NodalFiniteElement::GetDofToQuad(ir, mode); + } + else + { + return GetTensorDofToQuad(*this, ir, mode, basis1d, true, dof2quad_array); + } +} + void NodalTensorFiniteElement::GetFaceMap(const int face_id, Array &face_map) const { diff --git a/fem/fe/fe_base.hpp b/fem/fe/fe_base.hpp index 421810b4f2..c943fbf4b8 100644 --- a/fem/fe/fe_base.hpp +++ b/fem/fe/fe_base.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -158,7 +158,12 @@ public: freedom. */ /** When representing a vector-valued FiniteElement, two DofToQuad objects are used to describe the "closed" and "open" 1D basis functions. */ - TENSOR + TENSOR, + + /** @brief Full multidimensional representation which does not use tensor + product structure. The ordering of the degrees of freedom is the + same as TENSOR, but the sizes of B and G are the same as FULL.*/ + LEXICOGRAPHIC_FULL }; /// Describes the contents of the #B, #Bt, #G, and #Gt arrays, see #Mode. @@ -259,27 +264,27 @@ public: /** @brief Enumeration for MapType: defines how reference functions are mapped to physical space. - A reference function \f$ \hat u(\hat x) \f$ can be mapped to a function - \f$ u(x) \f$ on a general physical element in following ways: - - \f$ x = T(\hat x) \f$ is the image of the reference point \f$ \hat x \f$ - - \f$ J = J(\hat x) \f$ is the Jacobian matrix of the transformation T - - \f$ w = w(\hat x) = det(J) \f$ is the transformation weight factor for square J - - \f$ w = w(\hat x) = det(J^t J)^{1/2} \f$ is the transformation weight factor in general + A reference function $ \hat u(\hat x) $ can be mapped to a function + $ u(x) $ on a general physical element in following ways: + - $ x = T(\hat x) $ is the image of the reference point $ \hat x $ + - $ J = J(\hat x) $ is the Jacobian matrix of the transformation T + - $ w = w(\hat x) = det(J) $ is the transformation weight factor for square J + - $ w = w(\hat x) = det(J^t J)^{1/2} $ is the transformation weight factor in general */ enum MapType { UNKNOWN_MAP_TYPE = -1, /**< Used to distinguish an unset MapType variable from the known values below. */ VALUE, /**< For scalar fields; preserves point values - \f$ u(x) = \hat u(\hat x) \f$ */ + $ u(x) = \hat u(\hat x) $ */ INTEGRAL, /**< For scalar fields; preserves volume integrals - \f$ u(x) = (1/w) \hat u(\hat x) \f$ */ + $ u(x) = (1/w) \hat u(\hat x) $ */ H_DIV, /**< For vector fields; preserves surface integrals of the - normal component \f$ u(x) = (J/w) \hat u(\hat x) \f$ */ + normal component $ u(x) = (J/w) \hat u(\hat x) $ */ H_CURL /**< For vector fields; preserves line integrals of the tangential component - \f$ u(x) = J^{-t} \hat u(\hat x) \f$ (square J), - \f$ u(x) = J(J^t J)^{-1} \hat u(\hat x) \f$ (general J) */ + $ u(x) = J^{-t} \hat u(\hat x) $ (square J), + $ u(x) = J(J^t J)^{-1} \hat u(\hat x) $ (general J) */ }; /** @brief Enumeration for DerivType: defines which derivative method @@ -708,6 +713,9 @@ public: /// Class for standard nodal finite elements. class NodalFiniteElement : public ScalarFiniteElement { +private: + /// Create and cache the LEXICOGRAPHIC_FULL DofToQuad maps. + void CreateLexicographicFullMap(const IntegrationRule &ir) const; protected: Array lex_ordering; void ProjectCurl_2D(const FiniteElement &fe, @@ -726,6 +734,9 @@ public: int F = FunctionSpace::Pk) : ScalarFiniteElement(D, G, Do, O, F) { } + const DofToQuad &GetDofToQuad(const IntegrationRule &ir, + DofToQuad::Mode mode) const override; + void GetLocalInterpolation(ElementTransformation &Trans, DenseMatrix &I) const override { NodalLocalInterpolation(Trans, I, *this); } @@ -1249,12 +1260,7 @@ public: const DofMapType dmtype); const DofToQuad &GetDofToQuad(const IntegrationRule &ir, - DofToQuad::Mode mode) const override - { - return (mode == DofToQuad::FULL) ? - FiniteElement::GetDofToQuad(ir, mode) : - GetTensorDofToQuad(*this, ir, mode, basis1d, true, dof2quad_array); - } + DofToQuad::Mode mode) const override; void SetMapType(const int map_type_) override; @@ -1297,15 +1303,15 @@ public: const DofToQuad &GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const override { - return (mode == DofToQuad::FULL) ? - FiniteElement::GetDofToQuad(ir, mode) : - GetTensorDofToQuad(*this, ir, mode, basis1d, true, dof2quad_array); + return (mode == DofToQuad::TENSOR) ? + GetTensorDofToQuad(*this, ir, mode, basis1d, true, dof2quad_array) : + FiniteElement::GetDofToQuad(ir, mode); } const DofToQuad &GetDofToQuadOpen(const IntegrationRule &ir, DofToQuad::Mode mode) const { - MFEM_VERIFY(mode != DofToQuad::FULL, "invalid mode requested"); + MFEM_VERIFY(mode == DofToQuad::TENSOR, "invalid mode requested"); return GetTensorDofToQuad(*this, ir, mode, obasis1d, false, dof2quad_array_open); } diff --git a/fem/fe/fe_fixed_order.cpp b/fem/fe/fe_fixed_order.cpp index 938e70817b..33c7ca399a 100644 --- a/fem/fe/fe_fixed_order.cpp +++ b/fem/fe/fe_fixed_order.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_fixed_order.hpp b/fem/fe/fe_fixed_order.hpp index 0177af9ab0..9d5307099c 100644 --- a/fem/fe/fe_fixed_order.hpp +++ b/fem/fe/fe_fixed_order.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_h1.cpp b/fem/fe/fe_h1.cpp index 40357675a6..3a430e3ac0 100644 --- a/fem/fe/fe_h1.cpp +++ b/fem/fe/fe_h1.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_h1.hpp b/fem/fe/fe_h1.hpp index 0a9e767951..80755cfcbc 100644 --- a/fem/fe/fe_h1.hpp +++ b/fem/fe/fe_h1.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_l2.cpp b/fem/fe/fe_l2.cpp index 7b7a036010..706ae3f3b0 100644 --- a/fem/fe/fe_l2.cpp +++ b/fem/fe/fe_l2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_l2.hpp b/fem/fe/fe_l2.hpp index 2b1bf3a604..4f575c94a2 100644 --- a/fem/fe/fe_l2.hpp +++ b/fem/fe/fe_l2.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_nd.cpp b/fem/fe/fe_nd.cpp index 7522b5a769..60dc55e3b2 100644 --- a/fem/fe/fe_nd.cpp +++ b/fem/fe/fe_nd.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_nd.hpp b/fem/fe/fe_nd.hpp index c01129aed9..1da01beb1b 100644 --- a/fem/fe/fe_nd.hpp +++ b/fem/fe/fe_nd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_nurbs.cpp b/fem/fe/fe_nurbs.cpp index ddea7dd810..987db40298 100644 --- a/fem/fe/fe_nurbs.cpp +++ b/fem/fe/fe_nurbs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_nurbs.hpp b/fem/fe/fe_nurbs.hpp index d919dcbcbc..cbf3d2aa2a 100644 --- a/fem/fe/fe_nurbs.hpp +++ b/fem/fe/fe_nurbs.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_pos.cpp b/fem/fe/fe_pos.cpp index 1f67479139..7e275065fb 100644 --- a/fem/fe/fe_pos.cpp +++ b/fem/fe/fe_pos.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_pos.hpp b/fem/fe/fe_pos.hpp index 0154798f6f..3391c9dc10 100644 --- a/fem/fe/fe_pos.hpp +++ b/fem/fe/fe_pos.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_rt.cpp b/fem/fe/fe_rt.cpp index e38dc7de00..d854131340 100644 --- a/fem/fe/fe_rt.cpp +++ b/fem/fe/fe_rt.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_rt.hpp b/fem/fe/fe_rt.hpp index 5d9851aff5..d7859d6259 100644 --- a/fem/fe/fe_rt.hpp +++ b/fem/fe/fe_rt.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_ser.cpp b/fem/fe/fe_ser.cpp index e6accd926d..9e5abbedf3 100644 --- a/fem/fe/fe_ser.cpp +++ b/fem/fe/fe_ser.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe/fe_ser.hpp b/fem/fe/fe_ser.hpp index 0ca3ce03d8..bbfce979ec 100644 --- a/fem/fe/fe_ser.hpp +++ b/fem/fe/fe_ser.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe_coll.cpp b/fem/fe_coll.cpp index 6556da637a..d12437aea0 100644 --- a/fem/fe_coll.cpp +++ b/fem/fe_coll.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fe_coll.hpp b/fem/fe_coll.hpp index 5d7a79dc36..3f1414c051 100644 --- a/fem/fe_coll.hpp +++ b/fem/fe_coll.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fem.hpp b/fem/fem.hpp index 7d67f1b61f..9ff31383a3 100644 --- a/fem/fem.hpp +++ b/fem/fem.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fespace.cpp b/fem/fespace.cpp index 6cdf693810..03ef7afd12 100644 --- a/fem/fespace.cpp +++ b/fem/fespace.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -587,7 +587,7 @@ void FiniteElementSpace::GetEssentialVDofs(const Array &bdr_attr_is_ess, void FiniteElementSpace::GetEssentialTrueDofs(const Array &bdr_attr_is_ess, Array &ess_tdof_list, - int component) + int component) const { Array ess_vdofs, ess_tdofs; GetEssentialVDofs(bdr_attr_is_ess, ess_vdofs, component); @@ -2858,12 +2858,12 @@ void FiniteElementSpace::GetBdrElementDofs(int bel, Array &dofs, { bdr_elem_dof->GetRow(bel, dofs); - if (DoFTransArray[mesh->GetBdrElementBaseGeometry(bel)]) + if (DoFTransArray[mesh->GetBdrElementGeometry(bel)]) { Array Fo; bdr_elem_fos -> GetRow (bel, Fo); doftrans.SetDofTransformation( - *DoFTransArray[mesh->GetBdrElementBaseGeometry(bel)]); + *DoFTransArray[mesh->GetBdrElementGeometry(bel)]); doftrans.SetFaceOrientations(Fo); doftrans.SetVDim(); } @@ -2894,12 +2894,12 @@ void FiniteElementSpace::GetBdrElementDofs(int bel, Array &dofs, { mesh->GetBdrElementFace(bel, &F, &oF); - if (DoFTransArray[mesh->GetBdrElementBaseGeometry(bel)]) + if (DoFTransArray[mesh->GetBdrElementGeometry(bel)]) { mfem::Array Fo(1); Fo[0] = oF; doftrans.SetDofTransformation( - *DoFTransArray[mesh->GetBdrElementBaseGeometry(bel)]); + *DoFTransArray[mesh->GetBdrElementGeometry(bel)]); doftrans.SetFaceOrientations(Fo); doftrans.SetVDim(); } @@ -3221,7 +3221,7 @@ const FiniteElement *FiniteElementSpace::GetBE(int i) const break; case 3: default: - BE = fec->GetFE(mesh->GetBdrElementBaseGeometry(i), order); + BE = fec->GetFE(mesh->GetBdrElementGeometry(i), order); } if (NURBSext) @@ -3714,4 +3714,11 @@ FiniteElementCollection *FiniteElementSpace::Load(Mesh *m, std::istream &input) return r_fec; } +ElementDofOrdering GetEVectorOrdering(const FiniteElementSpace& fes) +{ + return UsesTensorBasis(fes)? + ElementDofOrdering::LEXICOGRAPHIC: + ElementDofOrdering::NATIVE; +} + } // namespace mfem diff --git a/fem/fespace.hpp b/fem/fespace.hpp index aaf95ea825..1e4d00857b 100644 --- a/fem/fespace.hpp +++ b/fem/fespace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1199,7 +1199,7 @@ public: to restricts the marked tDOFs to the specified component. */ virtual void GetEssentialTrueDofs(const Array &bdr_attr_is_ess, Array &ess_tdof_list, - int component = -1); + int component = -1) const; /** @brief Get a list of all boundary true dofs, @a boundary_dofs. For spaces with 'vdim' > 1, the 'component' parameter can be used to restricts the @@ -1351,6 +1351,10 @@ inline bool UsesTensorBasis(const FiniteElementSpace& fes) dynamic_cast(fes.GetFE(0))!=nullptr; } +/// @brief Return LEXICOGRAPHIC if mesh contains only one topology and the elements are tensor +/// elements, otherwise, return NATIVE. +ElementDofOrdering GetEVectorOrdering(const FiniteElementSpace& fes); + } #endif diff --git a/fem/fespacehierarchy.cpp b/fem/fespacehierarchy.cpp index 8a6e3ee5d5..75a7b81d09 100644 --- a/fem/fespacehierarchy.cpp +++ b/fem/fespacehierarchy.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fespacehierarchy.hpp b/fem/fespacehierarchy.hpp index 87f23510b3..30f19f8de5 100644 --- a/fem/fespacehierarchy.hpp +++ b/fem/fespacehierarchy.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fmsconvert.cpp b/fem/fmsconvert.cpp index d9a05716c3..8a5e2d78d0 100644 --- a/fem/fmsconvert.cpp +++ b/fem/fmsconvert.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fmsconvert.hpp b/fem/fmsconvert.hpp index 17b2fa2f69..d0aa7639b5 100644 --- a/fem/fmsconvert.hpp +++ b/fem/fmsconvert.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fmsdatacollection.cpp b/fem/fmsdatacollection.cpp index c501f3bee2..372824ba56 100644 --- a/fem/fmsdatacollection.cpp +++ b/fem/fmsdatacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/fmsdatacollection.hpp b/fem/fmsdatacollection.hpp index 03ec3c0614..4c604a240d 100644 --- a/fem/fmsdatacollection.hpp +++ b/fem/fmsdatacollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/geom.cpp b/fem/geom.cpp index 2d9f4e9074..fb20ff5957 100644 --- a/fem/geom.cpp +++ b/fem/geom.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -252,6 +252,34 @@ Geometry::Geometry() } } +template +int GetInverseOrientation_(int orientation) +{ + using geom_t = Geometry::Constants; + MFEM_ASSERT(0 <= orientation && orientation < geom_t::NumOrient, + "Invalid orientation"); + return geom_t::InvOrient[orientation]; +} + +int Geometry::GetInverseOrientation(Type geom_type, int orientation) +{ + switch (geom_type) + { + case Geometry::POINT: + return GetInverseOrientation_(orientation); + case Geometry::SEGMENT: + return GetInverseOrientation_(orientation); + case Geometry::TRIANGLE: + return GetInverseOrientation_(orientation); + case Geometry::SQUARE: + return GetInverseOrientation_(orientation); + case Geometry::TETRAHEDRON: + return GetInverseOrientation_(orientation); + default: + MFEM_ABORT("Geometry type does not have inverse orientations"); + } +} + Geometry::~Geometry() { for (int i = 0; i < NumGeom; i++) diff --git a/fem/geom.hpp b/fem/geom.hpp index 67293e0482..d64281d689 100644 --- a/fem/geom.hpp +++ b/fem/geom.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -122,6 +122,9 @@ public: } } + /// Return the inverse of the given orientation for the specified geometry type. + static int GetInverseOrientation(Type geom_type, int orientation); + /// Return the number of boundary "faces" of a given Geometry::Type. int NumBdr(int GeomType) const { return NumBdrArray[GeomType]; } }; diff --git a/fem/gridfunc.cpp b/fem/gridfunc.cpp index 310d8d7043..1c81680af5 100644 --- a/fem/gridfunc.cpp +++ b/fem/gridfunc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1924,9 +1924,9 @@ void GridFunction::GetNodalValues(Vector &nval, int vdim) const Array values; Array overlap(fes->GetNV()); nval.SetSize(fes->GetNV()); - nval = 0.0; overlap = 0; + nval.HostReadWrite(); for (i = 0; i < fes->GetNE(); i++) { fes->GetElementVertices(i, vertices); @@ -2058,7 +2058,7 @@ void GridFunction::AccumulateAndCountZones(VectorCoefficient &vcoeff, } void GridFunction::AccumulateAndCountBdrValues( - Coefficient *coeff[], VectorCoefficient *vcoeff, Array &attr, + Coefficient *coeff[], VectorCoefficient *vcoeff, const Array &attr, Array &values_counter) { int i, j, fdof, d, ind, vdim; @@ -2200,7 +2200,7 @@ static void accumulate_dofs(const Array &dofs, const Vector &vals, } void GridFunction::AccumulateAndCountBdrTangentValues( - VectorCoefficient &vcoeff, Array &bdr_attr, + VectorCoefficient &vcoeff, const Array &bdr_attr, Array &values_counter) { const FiniteElement *fe; @@ -2576,7 +2576,7 @@ void GridFunction::ProjectDiscCoefficient(VectorCoefficient &coeff, } void GridFunction::ProjectBdrCoefficient(VectorCoefficient &vcoeff, - Array &attr) + const Array &attr) { Array values_counter; AccumulateAndCountBdrValues(NULL, &vcoeff, attr, values_counter); @@ -2593,7 +2593,8 @@ void GridFunction::ProjectBdrCoefficient(VectorCoefficient &vcoeff, #endif } -void GridFunction::ProjectBdrCoefficient(Coefficient *coeff[], Array &attr) +void GridFunction::ProjectBdrCoefficient(Coefficient *coeff[], + const Array &attr) { Array values_counter; // this->HostReadWrite(); // done inside the next call @@ -2623,7 +2624,7 @@ void GridFunction::ProjectBdrCoefficient(Coefficient *coeff[], Array &attr) } void GridFunction::ProjectBdrCoefficientNormal( - VectorCoefficient &vcoeff, Array &bdr_attr) + VectorCoefficient &vcoeff, const Array &bdr_attr) { #if 0 // implementation for the case when the face dofs are integrals of the @@ -2698,7 +2699,7 @@ void GridFunction::ProjectBdrCoefficientNormal( } void GridFunction::ProjectBdrCoefficientTangent( - VectorCoefficient &vcoeff, Array &bdr_attr) + VectorCoefficient &vcoeff, const Array &bdr_attr) { Array values_counter; AccumulateAndCountBdrTangentValues(vcoeff, bdr_attr, values_counter); @@ -2746,7 +2747,8 @@ double GridFunction::ComputeL2Error( for (j = 0; j < ir->GetNPoints(); j++) { const IntegrationPoint &ip = ir->IntPoint(j); - fe->CalcShape(ip, shape); + transf->SetIntPoint(&ip); + fe->CalcPhysShape(*transf, shape); for (d = 0; d < fes->GetVDim(); d++) { a = 0; @@ -2759,7 +2761,6 @@ double GridFunction::ComputeL2Error( { a -= (*this)(-1-vdofs[fdof*d+k]) * shape(k); } - transf->SetIntPoint(&ip); a -= exsol[d]->Eval(*transf, ip); error += ip.weight * transf->Weight() * a * a; } diff --git a/fem/gridfunc.hpp b/fem/gridfunc.hpp index d7cf303be5..74df80bb1b 100644 --- a/fem/gridfunc.hpp +++ b/fem/gridfunc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -355,8 +355,8 @@ public: variable. */ void GetVectorGradientHat(ElementTransformation &T, DenseMatrix &gh) const; - /** Compute \f$ (\int_{\Omega} (*this) \psi_i)/(\int_{\Omega} \psi_i) \f$, - where \f$ \psi_i \f$ are the basis functions for the FE space of avgs. + /** Compute $ (\int_{\Omega} (*this) \psi_i)/(\int_{\Omega} \psi_i) $, + where $ \psi_i $ are the basis functions for the FE space of avgs. Both FE spaces should be scalar and on the same mesh. */ void GetElementAverages(GridFunction &avgs) const; @@ -446,11 +446,12 @@ protected: Array &zones_per_dof); void AccumulateAndCountBdrValues(Coefficient *coeff[], - VectorCoefficient *vcoeff, Array &attr, + VectorCoefficient *vcoeff, + const Array &attr, Array &values_counter); void AccumulateAndCountBdrTangentValues(VectorCoefficient &vcoeff, - Array &bdr_attr, + const Array &bdr_attr, Array &values_counter); // Complete the computation of averages; called e.g. after @@ -465,7 +466,7 @@ public: /** @brief Project a Coefficient on the GridFunction, modifying only DOFs on the boundary associated with the boundary attributes marked in the @a attr array. */ - void ProjectBdrCoefficient(Coefficient &coeff, Array &attr) + void ProjectBdrCoefficient(Coefficient &coeff, const Array &attr) { Coefficient *coeff_p = &coeff; ProjectBdrCoefficient(&coeff_p, attr); @@ -475,26 +476,27 @@ public: DOFs on the boundary associated with the boundary attributes marked in the @a attr array. */ virtual void ProjectBdrCoefficient(VectorCoefficient &vcoeff, - Array &attr); + const Array &attr); /** @brief Project a set of Coefficient%s on the components of the GridFunction, modifying only DOFs on the boundary associated with the boundary attributed marked in the @a attr array. */ /** If a Coefficient pointer in the array @a coeff is NULL, that component will not be touched. */ - virtual void ProjectBdrCoefficient(Coefficient *coeff[], Array &attr); + virtual void ProjectBdrCoefficient(Coefficient *coeff[], + const Array &attr); /** Project the normal component of the given VectorCoefficient on the boundary. Only boundary attributes that are marked in 'bdr_attr' are projected. Assumes RT-type VectorFE GridFunction. */ void ProjectBdrCoefficientNormal(VectorCoefficient &vcoeff, - Array &bdr_attr); + const Array &bdr_attr); /** @brief Project the tangential components of the given VectorCoefficient on the boundary. Only boundary attributes that are marked in @a bdr_attr are projected. Assumes ND-type VectorFE GridFunction. */ virtual void ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff, - Array &bdr_attr); + const Array &bdr_attr); virtual double ComputeL2Error(Coefficient *exsol[], const IntegrationRule *irs[] = NULL, diff --git a/fem/gslib.cpp b/fem/gslib.cpp index 99f12fe355..270862feb4 100644 --- a/fem/gslib.cpp +++ b/fem/gslib.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -159,7 +159,11 @@ void FindPointsGSLIB::Setup(Mesh &m, const double bb_t, const double newt_tol, { unsigned nr[2] = { dof1D, dof1D }; unsigned mr[2] = { 2*dof1D, 2*dof1D }; - double * const elx[2] = { &gsl_mesh(0), &gsl_mesh(pts_cnt) }; + double * const elx[2] = + { + pts_cnt == 0 ? nullptr : &gsl_mesh(0), + pts_cnt == 0 ? nullptr : &gsl_mesh(pts_cnt) + }; fdata2D = findpts_setup_2(gsl_comm, elx, nr, NEtot, mr, bb_t, pts_cnt, pts_cnt, npt_max, newt_tol); } @@ -168,7 +172,11 @@ void FindPointsGSLIB::Setup(Mesh &m, const double bb_t, const double newt_tol, unsigned nr[3] = { dof1D, dof1D, dof1D }; unsigned mr[3] = { 2*dof1D, 2*dof1D, 2*dof1D }; double * const elx[3] = - { &gsl_mesh(0), &gsl_mesh(pts_cnt), &gsl_mesh(2*pts_cnt) }; + { + pts_cnt == 0 ? nullptr : &gsl_mesh(0), + pts_cnt == 0 ? nullptr : &gsl_mesh(pts_cnt), + pts_cnt == 0 ? nullptr : &gsl_mesh(2*pts_cnt) + }; fdata3D = findpts_setup_3(gsl_comm, elx, nr, NEtot, mr, bb_t, pts_cnt, pts_cnt, npt_max, newt_tol); } @@ -1229,7 +1237,11 @@ void OversetFindPointsGSLIB::Setup(Mesh &m, const int meshid, { unsigned nr[2] = { dof1D, dof1D }; unsigned mr[2] = { 2*dof1D, 2*dof1D }; - double * const elx[2] = { &gsl_mesh(0), &gsl_mesh(pts_cnt) }; + double * const elx[2] = + { + pts_cnt == 0 ? nullptr : &gsl_mesh(0), + pts_cnt == 0 ? nullptr : &gsl_mesh(pts_cnt) + }; fdata2D = findptsms_setup_2(gsl_comm, elx, nr, NEtot, mr, bb_t, pts_cnt, pts_cnt, npt_max, newt_tol, &u_meshid, &distfint(0)); @@ -1239,7 +1251,11 @@ void OversetFindPointsGSLIB::Setup(Mesh &m, const int meshid, unsigned nr[3] = { dof1D, dof1D, dof1D }; unsigned mr[3] = { 2*dof1D, 2*dof1D, 2*dof1D }; double * const elx[3] = - { &gsl_mesh(0), &gsl_mesh(pts_cnt), &gsl_mesh(2*pts_cnt) }; + { + pts_cnt == 0 ? nullptr : &gsl_mesh(0), + pts_cnt == 0 ? nullptr : &gsl_mesh(pts_cnt), + pts_cnt == 0 ? nullptr : &gsl_mesh(2*pts_cnt) + }; fdata3D = findptsms_setup_3(gsl_comm, elx, nr, NEtot, mr, bb_t, pts_cnt, pts_cnt, npt_max, newt_tol, &u_meshid, &distfint(0)); diff --git a/fem/gslib.hpp b/fem/gslib.hpp index 3be11924d5..c785f28d98 100644 --- a/fem/gslib.hpp +++ b/fem/gslib.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/hybridization.cpp b/fem/hybridization.cpp index f9d4699c2a..6fac83522a 100644 --- a/fem/hybridization.cpp +++ b/fem/hybridization.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/hybridization.hpp b/fem/hybridization.hpp index b8ea3a7d8f..1f600d73d4 100644 --- a/fem/hybridization.hpp +++ b/fem/hybridization.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -22,38 +22,38 @@ namespace mfem /** Auxiliary class Hybridization, used to implement BilinearForm hybridization. Hybridization can be viewed as a technique for solving linear systems - obtained through finite element assembly. The assembled matrix \f$ A \f$ can + obtained through finite element assembly. The assembled matrix $ A $ can be written as: - \f[ A = P^T \hat{A} P, \f] - where \f$ P \f$ is the matrix mapping the conforming finite element space to + $$ A = P^T \hat{A} P, $$ + where $ P $ is the matrix mapping the conforming finite element space to the purely local finite element space without any inter-element constraints - imposed, and \f$ \hat{A} \f$ is the block-diagonal matrix of all element + imposed, and $ \hat{A} $ is the block-diagonal matrix of all element matrices. We assume that: - - \f$ \hat{A} \f$ is invertible, - - \f$ P \f$ has a left inverse \f$ R \f$, such that \f$ R P = I \f$, - - a constraint matrix \f$ C \f$ can be constructed, such that - \f$ \operatorname{Ker}(C) = \operatorname{Im}(P) \f$. + - $ \hat{A} $ is invertible, + - $ P $ has a left inverse $ R $, such that $ R P = I $, + - a constraint matrix $ C $ can be constructed, such that + $ \operatorname{Ker}(C) = \operatorname{Im}(P) $. - Under these conditions, the linear system \f$ A x = b \f$ can be solved + Under these conditions, the linear system $ A x = b $ can be solved using the following procedure: - - solve for \f$ \lambda \f$ in the linear system: - \f[ (C \hat{A}^{-1} C^T) \lambda = C \hat{A}^{-1} R^T b \f] - - compute \f$ x = R \hat{A}^{-1} (R^T b - C^T \lambda) \f$ + - solve for $ \lambda $ in the linear system: + $$ (C \hat{A}^{-1} C^T) \lambda = C \hat{A}^{-1} R^T b $$ + - compute $ x = R \hat{A}^{-1} (R^T b - C^T \lambda) $ Hybridization is advantageous when the matrix - \f$ H = (C \hat{A}^{-1} C^T) \f$ of the hybridized system is either smaller + $ H = (C \hat{A}^{-1} C^T) $ of the hybridized system is either smaller than the original system, or is simpler to invert with a known method. - In some cases, e.g. high-order elements, the matrix \f$ C \f$ can be written + In some cases, e.g. high-order elements, the matrix $ C $ can be written as - \f[ C = \begin{pmatrix} 0 & C_b \end{pmatrix}, \f] - and then the hybridized matrix \f$ H \f$ can be assembled using the identity - \f[ H = C_b S_b^{-1} C_b^T, \f] - where \f$ S_b \f$ is the Schur complement of \f$ \hat{A} \f$ with respect to - the same decomposition as the columns of \f$ C \f$: - \f[ S_b = \hat{A}_b - \hat{A}_{bf} \hat{A}_{f}^{-1} \hat{A}_{fb}. \f] + $$ C = \begin{pmatrix} 0 & C_b \end{pmatrix}, $$ + and then the hybridized matrix $ H $ can be assembled using the identity + $$ H = C_b S_b^{-1} C_b^T, $$ + where $ S_b $ is the Schur complement of $ \hat{A} $ with respect to + the same decomposition as the columns of $ C $: + $$ S_b = \hat{A}_b - \hat{A}_{bf} \hat{A}_{f}^{-1} \hat{A}_{fb}. $$ Hybridization can also be viewed as a discretization method for imposing (weak) continuity constraints between neighboring elements. */ diff --git a/fem/integ/bilininteg_br2.cpp b/fem/integ/bilininteg_br2.cpp index 1599470292..7953617c07 100644 --- a/fem/integ/bilininteg_br2.cpp +++ b/fem/integ/bilininteg_br2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_convection_ea.cpp b/fem/integ/bilininteg_convection_ea.cpp index f90032bab3..6c70cb292e 100644 --- a/fem/integ/bilininteg_convection_ea.cpp +++ b/fem/integ/bilininteg_convection_ea.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_convection_mf.cpp b/fem/integ/bilininteg_convection_mf.cpp index 22ed53c33b..e695ea7e04 100644 --- a/fem/integ/bilininteg_convection_mf.cpp +++ b/fem/integ/bilininteg_convection_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_convection_pa.cpp b/fem/integ/bilininteg_convection_pa.cpp index 8c9689e8ea..2f434c0f49 100644 --- a/fem/integ/bilininteg_convection_pa.cpp +++ b/fem/integ/bilininteg_convection_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_curlcurl_pa.cpp b/fem/integ/bilininteg_curlcurl_pa.cpp index 68914fe141..aa69244ccc 100644 --- a/fem/integ/bilininteg_curlcurl_pa.cpp +++ b/fem/integ/bilininteg_curlcurl_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_dgtrace_ea.cpp b/fem/integ/bilininteg_dgtrace_ea.cpp index f957276641..60d5ef44ed 100644 --- a/fem/integ/bilininteg_dgtrace_ea.cpp +++ b/fem/integ/bilininteg_dgtrace_ea.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_dgtrace_pa.cpp b/fem/integ/bilininteg_dgtrace_pa.cpp index fc27f04567..51887b1f11 100644 --- a/fem/integ/bilininteg_dgtrace_pa.cpp +++ b/fem/integ/bilininteg_dgtrace_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_ea.cpp b/fem/integ/bilininteg_diffusion_ea.cpp index baedc64ebf..a789288d34 100644 --- a/fem/integ/bilininteg_diffusion_ea.cpp +++ b/fem/integ/bilininteg_diffusion_ea.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_kernels.cpp b/fem/integ/bilininteg_diffusion_kernels.cpp index 162444bee0..ad8552bf9a 100644 --- a/fem/integ/bilininteg_diffusion_kernels.cpp +++ b/fem/integ/bilininteg_diffusion_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_kernels.hpp b/fem/integ/bilininteg_diffusion_kernels.hpp index 8df5623ce0..f50cc819dd 100644 --- a/fem/integ/bilininteg_diffusion_kernels.hpp +++ b/fem/integ/bilininteg_diffusion_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_mf.cpp b/fem/integ/bilininteg_diffusion_mf.cpp index 449246a02f..de388a8356 100644 --- a/fem/integ/bilininteg_diffusion_mf.cpp +++ b/fem/integ/bilininteg_diffusion_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_pa.cpp b/fem/integ/bilininteg_diffusion_pa.cpp index 52521bf0ff..7d9c407166 100644 --- a/fem/integ/bilininteg_diffusion_pa.cpp +++ b/fem/integ/bilininteg_diffusion_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_diffusion_patch.cpp b/fem/integ/bilininteg_diffusion_patch.cpp index 148ccc5c42..5707bc93a2 100644 --- a/fem/integ/bilininteg_diffusion_patch.cpp +++ b/fem/integ/bilininteg_diffusion_patch.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -12,7 +12,6 @@ #include "../fem.hpp" #include "../../mesh/nurbs.hpp" -#include "../../general/tic_toc.hpp" #include "../../linalg/dtensor.hpp" // For Reshape #include "../../general/forall.hpp" diff --git a/fem/integ/bilininteg_divdiv_pa.cpp b/fem/integ/bilininteg_divdiv_pa.cpp index aee788e555..14a8097839 100644 --- a/fem/integ/bilininteg_divdiv_pa.cpp +++ b/fem/integ/bilininteg_divdiv_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_elasticity_ea.cpp b/fem/integ/bilininteg_elasticity_ea.cpp new file mode 100644 index 0000000000..77b0e2e68c --- /dev/null +++ b/fem/integ/bilininteg_elasticity_ea.cpp @@ -0,0 +1,28 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "../../general/forall.hpp" +#include "../bilininteg.hpp" +#include "bilininteg_elasticity_kernels.hpp" + +namespace mfem +{ +void ElasticityComponentIntegrator::AssembleEA(const FiniteElementSpace &fes, + Vector &emat, + const bool add) +{ + AssemblePA(fes); + const auto &ir = parent.q_space->GetIntRule(0); + internal::ElasticityAssembleEA(parent.vdim, i_block, j_block, parent.ndofs, ir, + *parent.lambda_quad, *parent.mu_quad, + *geom, *maps, emat); +} +} diff --git a/fem/integ/bilininteg_elasticity_kernels.cpp b/fem/integ/bilininteg_elasticity_kernels.cpp new file mode 100644 index 0000000000..314c01dfdd --- /dev/null +++ b/fem/integ/bilininteg_elasticity_kernels.cpp @@ -0,0 +1,132 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "bilininteg_elasticity_kernels.hpp" + +namespace mfem +{ + +namespace internal +{ + +void ElasticityComponentAddMultPA(const int dim, const int nDofs, + const FiniteElementSpace &fespace, const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, const Vector &x, QuadratureFunction &QVec, Vector &y, + const int i_block, const int j_block) +{ + const int id = (dim << 8)| (i_block << 4) | j_block; + switch (id) + { + case 0x200: + ElasticityAddMultPA_<2,0,0>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x211: + ElasticityAddMultPA_<2,1,1>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x201: + ElasticityAddMultPA_<2,0,1>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x210: + ElasticityAddMultPA_<2,1,0>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x300: + ElasticityAddMultPA_<3,0,0>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x311: + ElasticityAddMultPA_<3,1,1>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x322: + ElasticityAddMultPA_<3,2,2>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x301: + ElasticityAddMultPA_<3,0,1>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x302: + ElasticityAddMultPA_<3,0,2>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x312: + ElasticityAddMultPA_<3,1,2>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x310: + ElasticityAddMultPA_<3,1,0>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x320: + ElasticityAddMultPA_<3,2,0>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 0x321: + ElasticityAddMultPA_<3,2,1>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + default: + MFEM_ABORT("Invalid configuration."); + } +} + +void ElasticityAddMultPA(const int dim, const int nDofs, + const FiniteElementSpace &fespace, const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, const Vector &x, QuadratureFunction &QVec, Vector &y) +{ + switch (dim) + { + case 2: + ElasticityAddMultPA_<2>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + case 3: + ElasticityAddMultPA_<3>(nDofs, fespace, lambda, mu, geom, maps, x, QVec, y); + break; + default: + MFEM_ABORT("Only dimensions 2 and 3 supported."); + } +} + +void ElasticityAssembleDiagonalPA(const int dim, const int nDofs, + const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, QuadratureFunction &QVec, Vector &diag) +{ + switch (dim) + { + case 2: + ElasticityAssembleDiagonalPA_<2>(nDofs, lambda, mu, geom, maps, QVec, diag); + break; + case 3: + ElasticityAssembleDiagonalPA_<3>(nDofs, lambda, mu, geom, maps, QVec, diag); + break; + default: + MFEM_ABORT("Only dimensions 2 and 3 supported."); + } +} + +void ElasticityAssembleEA(const int dim, const int i_block, const int j_block, + const int nDofs, const IntegrationRule &ir, + const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, Vector &emat) +{ + switch (dim) + { + case 2: + ElasticityAssembleEA_<2>(i_block, j_block, nDofs, ir, lambda, mu, geom, maps, + emat); + break; + case 3: + ElasticityAssembleEA_<3>(i_block, j_block, nDofs, ir, lambda, mu, geom, maps, + emat); + break; + default: + MFEM_ABORT("Only dimensions 2 and 3 supported."); + } +} + +} // namespace internal + +} // namespace mfem diff --git a/fem/integ/bilininteg_elasticity_kernels.hpp b/fem/integ/bilininteg_elasticity_kernels.hpp new file mode 100644 index 0000000000..4f3693a5fd --- /dev/null +++ b/fem/integ/bilininteg_elasticity_kernels.hpp @@ -0,0 +1,417 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +/** + * @brief Header for small strain, isotropic, linear elasticity kernels. + * + * Strong form: -div(sigma(u)) + * + * The constitutive model is given in terms of Lame parameters, + * sigma(u) = lambda*div(u)I + 2*mu*sym(grad(u)). + * The weak form implemented is (suppressing integral) + * + * Weak form : lambda*div(u)*div(v) + 2*mu*sym(grad(u))*sym(grad(v)) + * + * DATA LAYOUT ASSUMPTIONS : + * Finite element space - Ordering::byNODES + * Finite element basis - ElementDofOrdering::NATIVE + * Quadrature functions - QVectorLayout::byNODES + * All elements in "fespace" are the same. + */ + +#ifndef MFEM_BILININTEG_ELASTICITY_KERNELS_HPP +#define MFEM_BILININTEG_ELASTICITY_KERNELS_HPP + +#include "../../config/config.hpp" +#include "../../general/array.hpp" +#include "../../general/forall.hpp" +#include "../../linalg/dtensor.hpp" +#include "../../linalg/vector.hpp" +#include "../../linalg/tensor.hpp" +#include "../quadinterpolator.hpp" +#include "../bilininteg.hpp" +#include "../coefficient.hpp" +#include "../qfunction.hpp" + +namespace mfem +{ + +namespace internal +{ + +/// @brief Elasticity kernel for AddMultPA. +/// +/// Performs y += Ax. Implemented for byNODES ordering only, and does not use +/// tensor basis, so it should work for any H1 element. +/// +/// @param[in] dim 2 or 3 +/// @param[in] nDofs Number of scalar dofs per element. +/// @param[in] fespace Vector-valued finite element space. +/// @param[in] lambda Quadrature function for first Lame param. +/// @param[in] mu Quadrature function for second Lame param. +/// @param[in] geom Geometric factors corresponding to fespace. +/// @param[in] maps DofToQuad maps for one element (assume elements all same). +/// @param[in] x Input vector. nDofs x dim x numEls. +/// @param Q Scratch Q-Vector. nQuad x dim x dim x numEls. +/// @param[in,out] y Ax gets added to this. nDofs x dim x numEls. +void ElasticityAddMultPA(const int dim, const int nDofs, + const FiniteElementSpace &fespace, const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, const Vector &x, QuadratureFunction &QVec, Vector &y); + +/// @brief Elasticity component kernel for AddMultPA. +/// +/// Performs y += Ax. Implemented for byNODES ordering only, and does not use +/// tensor basis, so it should work for any H1 element. i_block and j_block are +/// the dimensional component that is integrated. They must both be +/// non-negative. +/// +/// Example: In 2D, A = [A_00 A_01], x = [x_0], y = [y_0] +/// [A_10 A_11] [x_1] [y_1]. +/// So i_block = 0, j_block = 1 implies only y_0 += A_01*x_1 is evaluated. +/// +/// @param[in] dim 2 or 3 +/// @param[in] nDofs Number of scalar dofs per element. +/// @param[in] fespace Scalar-valued finite element space. +/// @param[in] lambda Quadrature function for first Lame param. +/// @param[in] mu Quadrature function for second Lame param. +/// @param[in] geom Geometric factors corresponding to fespace. +/// @param[in] maps DofToQuad maps for one element (assume elements all same). +/// @param[in] x Input vector. nDofs x numEls. +/// @param Q Scratch Q-Vector. nQuad x dim x numEls. +/// @param[in,out] y Ax gets added to this. nDofs x numEls. +/// @param[in] i_block The row dimensional component. <= dim - 1 +/// @param[in] j_block The column dimensional component. <= dim -1 +void ElasticityComponentAddMultPA( + const int dim, const int nDofs, const FiniteElementSpace &fespace, + const CoefficientVector &lambda, const CoefficientVector &mu, + const GeometricFactors &geom, const DofToQuad &maps, const Vector &x, + QuadratureFunction &QVec, Vector &y, const int i_block, const int j_block); + +/// @brief Elasticity kernel for AssembleEA. +/// +/// Assembles the E-Matrix for a single dimensional component. Does not require +/// tensor product elements. +/// +/// Example: In 2D, A = [A_00 A_01] +/// [A_10 A_11]. +/// So i_block = 0, j_block = 1 implies only A_01 is assembled. +/// +/// Mainly intended to be used for order 1 elements on gpus to enable +/// preconditioning with a LOR-AMG operator. It's expected behavior that higher +/// orders may request too many resources. +/// +/// @param[in] dim 2 or 3 +/// @param[in] i_block The row dimensional component. 0 <= i_block <= dim - 1 +/// @param[in] j_block The column dimensional component. 0 <= j_block<= dim -1 +/// @param[in] nDofs Number of scalar dofs per element. +/// @param[in] lambda Quadrature function for first Lame param. +/// @param[in] mu Quadrature function for second Lame param. +/// @param[in] geom Geometric factors corresponding to fespace. +/// @param[in] maps DofToQuad maps for one element (assume elements all same). +/// @param[out] emat Resulting E-Matrix Vector. nDofs x nDofs x numEls. +void ElasticityAssembleEA(const int dim, const int i_block, const int j_block, + const int nDofs, const IntegrationRule &ir, + const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, Vector &emat); + +/// @brief Elasticity kernel for AssembleDiagonalPA. +/// +/// @param[in] dim 2 or 3 +/// @param[in] nDofs Number of scalar dofs per element. +/// @param[in] lambda Quadrature function for first Lame param. +/// @param[in] mu Quadrature function for second Lame param. +/// @param[in] geom Geometric factors corresponding to fespace. +/// @param[in] maps DofToQuad maps for one element (assume elements all same). +/// @param QVec Scratch Q-Vector. nQuad x dim x dim x dim x dim x numEls. +/// @param[out] diag diagonal of A. nDofs x dim x numEls. +void ElasticityAssembleDiagonalPA(const int dim, const int nDofs, + const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, QuadratureFunction &QVec, Vector &diag); + +/// Templated implementation of ElasticityAddMultPA. +template +void ElasticityAddMultPA_(const int nDofs, const FiniteElementSpace &fespace, + const CoefficientVector &lambda, const CoefficientVector &mu, + const GeometricFactors &geom, const DofToQuad &maps, const Vector &x, + QuadratureFunction &QVec, Vector &y) +{ + static_assert((i_block < 0) == (j_block < 0), + "i_block and j_block must both be non-negative or strictly negative."); + static constexpr int d = dim; + static constexpr int qLower = (i_block < 0) ? 0 : i_block; + static constexpr int qUpper = (i_block < 0) ? d : i_block+1; + static constexpr int qSize = qUpper-qLower; + static constexpr int aLower = (j_block < 0) ? 0 : j_block; + static constexpr int aUpper = (j_block < 0) ? d : j_block+1; + static constexpr int aSize = aUpper-aLower; + static constexpr bool isComponent = (i_block >= 0); + + //Assuming all elements are the same + const auto &ir = QVec.GetIntRule(0); + const QuadratureInterpolator *E_To_Q_Map = fespace.GetQuadratureInterpolator( + ir); + E_To_Q_Map->SetOutputLayout(QVectorLayout::byNODES); + // interpolate physical derivatives to quadrature points. + E_To_Q_Map->PhysDerivatives(x, QVec); + + const int numPoints = ir.GetNPoints(); + const int numEls = fespace.GetNE(); + const auto lamDev = Reshape(lambda.Read(), numPoints, numEls); + const auto muDev = Reshape(mu.Read(), numPoints, numEls); + const auto J = Reshape(geom.J.Read(), numPoints, d, d, numEls); + auto Q = Reshape(QVec.ReadWrite(), numPoints, d, qSize, numEls); + const double *ipWeights = ir.GetWeights().Read(); + mfem::forall_2D(numEls, numPoints, 1, [=] MFEM_HOST_DEVICE (int e) + { + // for(int p = 0; p < numPoints, ) + MFEM_FOREACH_THREAD(p, x,numPoints) + { + auto invJ = inv(make_tensor( + [&](int i, int j) { return J(p, i, j, e); })); + tensor gradx; + //load grad(x) into gradx + if (isComponent) + { + for (int i = 0; i < d; i++) + { + gradx(0,i) = Q(p, i, 0, e); + } + } + else + { + for (int j = 0; j < d; j++) + { + for (int i = 0; i < d; i++) + { + gradx(i,j) = Q(p, i, j, e); + } + } + } + //compute divergence + double div = 0.; + for (int i = aLower; i < aUpper; i++) + { + //take size of gradx into account + const int iIndex = isComponent ? 0 : i; + div += gradx(iIndex,i); + } + const double w = ipWeights[p] /det(invJ); + for (int m = 0; m < d; m++) + { + for (int q = qLower; q < qUpper; q++) + { + //compute contraction of 4*sym(grad(u))sym(grad(v)) term. + //this contraction could be made slightly cheaper using Voigt + //notation, but repeated entries are summed for simplicity. + double contraction = 0.; + //not sure how to combine cases + if (isComponent) + { + for (int a = 0; a < d; a++) + { + contraction += 2*((a == q)*invJ(m,j_block) + (j_block==q)*invJ(m,a))*(gradx(0, + a)); + } + } + else + { + for (int a = 0; a < d; a++) + { + for (int b = 0; b < d; b++) + { + contraction += ((a == q)*invJ(m,b) + (b==q)*invJ(m,a)) + *(gradx(a,b) + gradx(b, a)); + } + } + } + // lambda*div(u)*div(v) + 2*mu*sym(grad(u))*sym(grad(v)) + // contraction = 4*sym(grad(u))sym(grad(v)) + const int qIndex = isComponent ? 0 : q; + Q(p,m,qIndex,e) = w*(lamDev(p, e)*invJ(m,q)*div + 0.5*muDev(p, e)*contraction); + } + } + } + }); + + // Reduce quadrature function to an E-Vector + const auto QRead = Reshape(QVec.Read(), numPoints, d, qSize, numEls); + const auto G = Reshape(maps.G.Read(), numPoints, d, nDofs); + auto yDev = Reshape(y.ReadWrite(), nDofs, qSize, numEls); + mfem::forall_2D(numEls, qSize, nDofs, [=] MFEM_HOST_DEVICE (int e) + { + MFEM_FOREACH_THREAD(i, y, nDofs) + { + MFEM_FOREACH_THREAD(q, x, qSize) + { + const int qIndex = isComponent ? 0 : q; + double sum = 0.; + for (int m = 0; m < d; m++ ) + { + for (int p = 0; p < numPoints; p++ ) + { + sum += QRead(p,m,qIndex,e)*G(p,m,i); + } + } + yDev(i, qIndex, e) += sum; + } + } + }); +} + +/// Templated implementation of ElasticityAssembleDiagonalPA. +template +void ElasticityAssembleDiagonalPA_(const int nDofs, + const CoefficientVector &lambda, + const CoefficientVector &mu, const GeometricFactors &geom, + const DofToQuad &maps, QuadratureFunction &QVec, Vector &diag) +{ + //Assuming all elements are the same + const auto &ir = QVec.GetIntRule(0); + static constexpr int d = dim; + const int numPoints = ir.GetNPoints(); + const int numEls = lambda.Size()/numPoints; + const auto lamDev = Reshape(lambda.Read(), numPoints, numEls); + const auto muDev = Reshape(mu.Read(), numPoints, numEls); + const auto J = Reshape(geom.J.Read(), numPoints, d, d, numEls); + auto Q = Reshape(QVec.ReadWrite(), numPoints, d,d, d, numEls); + const double *ipWeights = ir.GetWeights().Read(); + mfem::forall_2D(numEls, numPoints,1, [=] MFEM_HOST_DEVICE (int e) + { + MFEM_FOREACH_THREAD(p, x,numPoints) + { + auto invJ = inv(make_tensor( + [&](int i, int j) { return J(p, i, j, e); })); + const double w = ipWeights[p] /det(invJ); + for (int n = 0; n < d; n++) + { + for (int m = 0; m < d; m++) + { + for (int q = 0; q < d; q++) + { + //compute contraction of 4*sym(grad(u))sym(grad(v)) term. + //this contraction could be made slightly cheaper using Voigt + //notation, but repeated entries are summed for simplicity. + double contraction = 0.; + for (int a = 0; a < d; a++) + { + for (int b = 0; b < d; b++) + { + contraction += ((a == q)*invJ(m,b) + (b==q)*invJ(m,a))*((a == q) + *invJ(n, b) + (b==q)*invJ(n,a)); + } + } + // lambda*div(u)*div(v) + 2*mu*sym(grad(u))*sym(grad(v)) + // contraction = 4*sym(grad(u))sym(grad(v)) + Q(p,m,n,q,e) = w*(lamDev(p, e)*invJ(m,q)*invJ(n,q) + + 0.5*muDev(p, e)*contraction); + } + } + } + } + }); + + //Reduce quadrature function to an E-Vector + const auto QRead = Reshape(QVec.Read(), numPoints, d, d, d, numEls); + auto diagDev = Reshape(diag.Write(), nDofs, d, numEls); + const auto G = Reshape(maps.G.Read(), numPoints, d, nDofs); + mfem::forall_2D(numEls, d, nDofs, [=] MFEM_HOST_DEVICE (int e) + { + MFEM_FOREACH_THREAD(i, y, nDofs) + { + MFEM_FOREACH_THREAD(q, x, d) + { + double sum = 0.; + for (int n = 0; n < d; n++) + { + for (int m = 0; m < d; m++) + { + for (int p = 0; p < numPoints; p++ ) + { + sum += QRead(p,m,n,q,e)*G(p,m,i)*G(p,n,i); + } + } + } + diagDev(i, q, e) = sum; + } + } + }); +} + +//Templated implementation of ElasticityAssembleEA. +template +void ElasticityAssembleEA_(const int i_block, + const int j_block, + const int nDofs, + const IntegrationRule &ir, + const CoefficientVector &lambda, + const CoefficientVector &mu, + const GeometricFactors &geom, + const DofToQuad &maps, + Vector &emat) +{ + //Assuming all elements are the same + static constexpr int d = dim; + const int numPoints = ir.GetNPoints(); + const int numEls = lambda.Size()/numPoints; + const auto lamDev = Reshape(lambda.Read(), numPoints, numEls); + const auto muDev = Reshape(mu.Read(), numPoints, numEls); + const auto J = Reshape(geom.J.Read(), numPoints, d, d, numEls); + const auto G = Reshape(maps.G.Read(), numPoints, d, nDofs); + auto ematDev = Reshape(emat.Write(), nDofs, nDofs, numEls); + const double *ipWeights = ir.GetWeights().Read(); + mfem::forall_2D(numEls, nDofs, nDofs, [=] MFEM_HOST_DEVICE (int e) + { + MFEM_FOREACH_THREAD(JDof, y, nDofs) + { + MFEM_FOREACH_THREAD(IDof, x, nDofs) + { + double sum = 0; + for (int p = 0 ; p < numPoints; p++) + { + auto invJ = inv(make_tensor( + [&](int i, int j) { return J(p, i, j, e); })); + const double w = ipWeights[p] /det(invJ); + for (int n = 0; n < d; n++) + { + for (int m = 0; m < d; m++) + { + //compute contraction of 4*sym(grad(u))sym(grad(v)) term. + double contraction = 0.; + for (int a = 0; a < d; a++) + { + for (int b = 0; b < d; b++) + { + contraction += ((a == i_block)*invJ(m,b) + (b==i_block)*invJ(m, + a))*((a == j_block)*invJ(n, + b) + (b==j_block)*invJ(n,a)); + } + } + // lambda*div(u)*div(v) + 2*mu*sym(grad(u))*sym(grad(v)) + // contraction = 4*sym(grad(u))sym(grad(v)) + sum += w*(lamDev(p, e)*invJ(m,i_block)*invJ(n,j_block) + + 0.5*muDev(p, e)*contraction)*G(p,m,IDof)*G(p,n,JDof); + } + } + } + ematDev(IDof, JDof, e) = sum; + } + } + }); +} + +} // namespace internal + +} // namespace mfem + +#endif diff --git a/fem/integ/bilininteg_elasticity_pa.cpp b/fem/integ/bilininteg_elasticity_pa.cpp new file mode 100644 index 0000000000..ddbf283e42 --- /dev/null +++ b/fem/integ/bilininteg_elasticity_pa.cpp @@ -0,0 +1,118 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "../bilininteg.hpp" +#include "../gridfunc.hpp" +#include "../qfunction.hpp" +#include "bilininteg_elasticity_kernels.hpp" + +namespace mfem +{ + +void ElasticityIntegrator::SetUpQuadratureSpaceAndCoefficients( + const FiniteElementSpace &fes) +{ + if (IntRule == nullptr) + { + // This is where it's assumed that all elements are the same. + const auto &T = *fes.GetElementTransformation(0); + int quad_order = 2 * T.OrderGrad(fes.GetFE(0)); + IntRule = &IntRules.Get(T.GetGeometryType(), quad_order); + } + + Mesh &mesh = *fespace->GetMesh(); + + q_space.reset(new QuadratureSpace(mesh, *IntRule)); + lambda_quad.reset(new CoefficientVector(lambda, *q_space, + CoefficientStorage::FULL)); + mu_quad.reset(new CoefficientVector(mu, *q_space, CoefficientStorage::FULL)); + q_vec.reset(new QuadratureFunction(*q_space, vdim*vdim)); +} + +void ElasticityIntegrator::AssemblePA(const FiniteElementSpace &fes) +{ + MFEM_VERIFY(fes.GetOrdering() == Ordering::byNODES, + "Elasticity PA only implemented for byNODES ordering."); + + fespace = &fes; + Mesh &mesh = *fespace->GetMesh(); + MFEM_VERIFY(fespace->GetVDim() == mesh.Dimension(), ""); + vdim = fespace->GetVDim(); + ndofs = fespace->GetFE(0)->GetDof(); + + SetUpQuadratureSpaceAndCoefficients(fes); + + auto ordering = GetEVectorOrdering(*fespace); + auto mode = ordering == ElementDofOrdering::NATIVE ? DofToQuad::FULL : + DofToQuad::LEXICOGRAPHIC_FULL; + maps = &fespace->GetFE(0)->GetDofToQuad(*IntRule, mode); + geom = mesh.GetGeometricFactors(*IntRule, GeometricFactors::JACOBIANS); +} + +void ElasticityIntegrator::AssembleDiagonalPA(Vector &diag) +{ + q_vec->SetVDim(vdim*vdim*vdim*vdim); + internal::ElasticityAssembleDiagonalPA(vdim, ndofs, *lambda_quad, *mu_quad, + *geom, *maps, *q_vec, diag); +} + +void ElasticityIntegrator::AddMultPA(const Vector &x, Vector &y) const +{ + internal::ElasticityAddMultPA(vdim, ndofs, *fespace, *lambda_quad, *mu_quad, + *geom, *maps, x, *q_vec, y); +} + +void ElasticityIntegrator::AddMultTransposePA(const Vector &x, Vector &y) const +{ + AddMultPA(x, y); // Operator is symmetric +} + +void ElasticityComponentIntegrator::AssemblePA(const FiniteElementSpace &fes) +{ + fespace = &fes; + + // Avoid projecting the coefficients more than once. If the coefficients + // change, the parent ElasticityIntegrator must be reassembled. + if (!parent.q_space) + { + parent.SetUpQuadratureSpaceAndCoefficients(fes); + } + else + { + IntRule = parent.IntRule; + } + + auto ordering = GetEVectorOrdering(*fespace); + auto mode = ordering == ElementDofOrdering::NATIVE ? DofToQuad::FULL : + DofToQuad::LEXICOGRAPHIC_FULL; + geom = fes.GetMesh()->GetGeometricFactors(*IntRule, + GeometricFactors::JACOBIANS); + maps = &fespace->GetFE(0)->GetDofToQuad(*IntRule, mode); +} + +void ElasticityComponentIntegrator::AddMultPA(const Vector &x, Vector &y) const +{ + internal::ElasticityComponentAddMultPA( + parent.vdim, parent.ndofs, *fespace, *parent.lambda_quad, *parent.mu_quad, + *geom, *maps, x, *parent.q_vec, y, i_block, j_block); +} + +void ElasticityComponentIntegrator::AddMultTransposePA(const Vector &x, + Vector &y) const +{ + // Each block in the operator is symmetric, so we can just switch the roles + // of i_block and j_block + internal::ElasticityComponentAddMultPA( + parent.vdim, parent.ndofs, *fespace, *parent.lambda_quad, *parent.mu_quad, + *geom, *maps, x, *parent.q_vec, y, j_block, i_block); +} + +} // namespace mfem diff --git a/fem/integ/bilininteg_gradient_pa.cpp b/fem/integ/bilininteg_gradient_pa.cpp index 89c00e683c..51390b321f 100644 --- a/fem/integ/bilininteg_gradient_pa.cpp +++ b/fem/integ/bilininteg_gradient_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hcurl_kernels.cpp b/fem/integ/bilininteg_hcurl_kernels.cpp index 92d3ceae98..6d55a58542 100644 --- a/fem/integ/bilininteg_hcurl_kernels.cpp +++ b/fem/integ/bilininteg_hcurl_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hcurl_kernels.hpp b/fem/integ/bilininteg_hcurl_kernels.hpp index 049cfa0721..a806934cf7 100644 --- a/fem/integ/bilininteg_hcurl_kernels.hpp +++ b/fem/integ/bilininteg_hcurl_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hcurlhdiv_kernels.cpp b/fem/integ/bilininteg_hcurlhdiv_kernels.cpp index 942d17db1c..ddb6bd2d59 100644 --- a/fem/integ/bilininteg_hcurlhdiv_kernels.cpp +++ b/fem/integ/bilininteg_hcurlhdiv_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hcurlhdiv_kernels.hpp b/fem/integ/bilininteg_hcurlhdiv_kernels.hpp index 2508d9f848..e7ebe5b854 100644 --- a/fem/integ/bilininteg_hcurlhdiv_kernels.hpp +++ b/fem/integ/bilininteg_hcurlhdiv_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hdiv_kernels.cpp b/fem/integ/bilininteg_hdiv_kernels.cpp index 52a6fe65aa..835d2cdca8 100644 --- a/fem/integ/bilininteg_hdiv_kernels.cpp +++ b/fem/integ/bilininteg_hdiv_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_hdiv_kernels.hpp b/fem/integ/bilininteg_hdiv_kernels.hpp index 2dbe444a85..11715bf372 100644 --- a/fem/integ/bilininteg_hdiv_kernels.hpp +++ b/fem/integ/bilininteg_hdiv_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -155,6 +155,7 @@ inline void SmemPAHdivMassApply2D(const int NE, DeviceMatrix X(sm0, D1D*(D1D-1), VDIM); DeviceCube QD(sm1, Q1D, D1D, VDIM); DeviceCube QQ(sm0, Q1D, Q1D, VDIM); + DeviceCube DQ(sm1, D1D, Q1D, VDIM); // Load X, Bo and Bc into shared memory MFEM_FOREACH_THREAD(vd,z,VDIM) @@ -163,7 +164,10 @@ inline void SmemPAHdivMassApply2D(const int NE, { MFEM_FOREACH_THREAD(qx,x,Q1D) { - if (qx < D1D && dy < (D1D-1)) { X(qx + dy*D1D,vd) = x(qx+dy*D1D,vd,e); } + if (qx < D1D && dy < (D1D-1)) + { + X(qx + dy*D1D,vd) = x(qx+dy*D1D,vd,e); + } if (tidz == 0) { if (dy < (D1D-1)) { Bo(dy,qx) = bo(qx,dy); } @@ -247,7 +251,7 @@ inline void SmemPAHdivMassApply2D(const int NE, { qd += QQ(qx,qy,vd) * Btx(dx,qx); } - QD(dx,qy,vd) = qd; + DQ(dx,qy,vd) = qd; } } } @@ -265,7 +269,7 @@ inline void SmemPAHdivMassApply2D(const int NE, double dd = 0.0; for (int qy = 0; qy < Q1D; ++qy) { - dd += QD(dx,qy,vd) * Bty(dy,qy); + dd += DQ(dx,qy,vd) * Bty(dy,qy); } Yxy(dx,dy,vd,e) += dd; } diff --git a/fem/integ/bilininteg_interp_pa.cpp b/fem/integ/bilininteg_interp_pa.cpp index 70a2123050..79b324bdaa 100644 --- a/fem/integ/bilininteg_interp_pa.cpp +++ b/fem/integ/bilininteg_interp_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mass_ea.cpp b/fem/integ/bilininteg_mass_ea.cpp index 55aab027e0..2edd5f75c9 100644 --- a/fem/integ/bilininteg_mass_ea.cpp +++ b/fem/integ/bilininteg_mass_ea.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mass_kernels.cpp b/fem/integ/bilininteg_mass_kernels.cpp index 23a65d8b7f..c7a5a3b40b 100644 --- a/fem/integ/bilininteg_mass_kernels.cpp +++ b/fem/integ/bilininteg_mass_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mass_kernels.hpp b/fem/integ/bilininteg_mass_kernels.hpp index 3536988f54..869a0612e1 100644 --- a/fem/integ/bilininteg_mass_kernels.hpp +++ b/fem/integ/bilininteg_mass_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mass_mf.cpp b/fem/integ/bilininteg_mass_mf.cpp index 18a0edfca6..0789b49796 100644 --- a/fem/integ/bilininteg_mass_mf.cpp +++ b/fem/integ/bilininteg_mass_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mass_pa.cpp b/fem/integ/bilininteg_mass_pa.cpp index fce1f3df86..7d962ad0e6 100644 --- a/fem/integ/bilininteg_mass_pa.cpp +++ b/fem/integ/bilininteg_mass_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mixedcurl_pa.cpp b/fem/integ/bilininteg_mixedcurl_pa.cpp index 8be2134dd9..d506a2519d 100644 --- a/fem/integ/bilininteg_mixedcurl_pa.cpp +++ b/fem/integ/bilininteg_mixedcurl_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_mixedvecgrad_pa.cpp b/fem/integ/bilininteg_mixedvecgrad_pa.cpp index d2e7758a8e..97645d1aee 100644 --- a/fem/integ/bilininteg_mixedvecgrad_pa.cpp +++ b/fem/integ/bilininteg_mixedvecgrad_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_transpose_ea.cpp b/fem/integ/bilininteg_transpose_ea.cpp index 4ff8be04bc..812d80a77c 100644 --- a/fem/integ/bilininteg_transpose_ea.cpp +++ b/fem/integ/bilininteg_transpose_ea.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vecdiffusion_mf.cpp b/fem/integ/bilininteg_vecdiffusion_mf.cpp index 150b662f1b..5f5ff480da 100644 --- a/fem/integ/bilininteg_vecdiffusion_mf.cpp +++ b/fem/integ/bilininteg_vecdiffusion_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vecdiffusion_pa.cpp b/fem/integ/bilininteg_vecdiffusion_pa.cpp index e36eec8d48..453a47b897 100644 --- a/fem/integ/bilininteg_vecdiffusion_pa.cpp +++ b/fem/integ/bilininteg_vecdiffusion_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vecdiv_pa.cpp b/fem/integ/bilininteg_vecdiv_pa.cpp index 7e1f61a5cd..341a697db0 100644 --- a/fem/integ/bilininteg_vecdiv_pa.cpp +++ b/fem/integ/bilininteg_vecdiv_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vecmass_mf.cpp b/fem/integ/bilininteg_vecmass_mf.cpp index d71f058084..0e3bfb5f49 100644 --- a/fem/integ/bilininteg_vecmass_mf.cpp +++ b/fem/integ/bilininteg_vecmass_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vecmass_pa.cpp b/fem/integ/bilininteg_vecmass_pa.cpp index 88364ce89d..0fb5d71943 100644 --- a/fem/integ/bilininteg_vecmass_pa.cpp +++ b/fem/integ/bilininteg_vecmass_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vectorfediv_pa.cpp b/fem/integ/bilininteg_vectorfediv_pa.cpp index 97843a5763..47b215c81a 100644 --- a/fem/integ/bilininteg_vectorfediv_pa.cpp +++ b/fem/integ/bilininteg_vectorfediv_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/bilininteg_vectorfemass_pa.cpp b/fem/integ/bilininteg_vectorfemass_pa.cpp index f8d6f63d49..94c9cbf612 100644 --- a/fem/integ/bilininteg_vectorfemass_pa.cpp +++ b/fem/integ/bilininteg_vectorfemass_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/lininteg_boundary.cpp b/fem/integ/lininteg_boundary.cpp index 77e39204f2..01e35c4aa7 100644 --- a/fem/integ/lininteg_boundary.cpp +++ b/fem/integ/lininteg_boundary.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/lininteg_boundary_flux.cpp b/fem/integ/lininteg_boundary_flux.cpp index cefebc6352..8734d5ad2f 100644 --- a/fem/integ/lininteg_boundary_flux.cpp +++ b/fem/integ/lininteg_boundary_flux.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/lininteg_domain.cpp b/fem/integ/lininteg_domain.cpp index b8e0d2f6c0..0b1357d3eb 100644 --- a/fem/integ/lininteg_domain.cpp +++ b/fem/integ/lininteg_domain.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/lininteg_domain_grad.cpp b/fem/integ/lininteg_domain_grad.cpp index 906ebca7dc..b64995e4b0 100644 --- a/fem/integ/lininteg_domain_grad.cpp +++ b/fem/integ/lininteg_domain_grad.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/lininteg_domain_vectorfe.cpp b/fem/integ/lininteg_domain_vectorfe.cpp index a9af17e0cb..3d81023837 100644 --- a/fem/integ/lininteg_domain_vectorfe.cpp +++ b/fem/integ/lininteg_domain_vectorfe.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/nonlininteg_vecconvection_mf.cpp b/fem/integ/nonlininteg_vecconvection_mf.cpp index edcf7d20fb..e52bde3548 100644 --- a/fem/integ/nonlininteg_vecconvection_mf.cpp +++ b/fem/integ/nonlininteg_vecconvection_mf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/integ/nonlininteg_vecconvection_pa.cpp b/fem/integ/nonlininteg_vecconvection_pa.cpp index a361ffdd00..d1740d7dac 100644 --- a/fem/integ/nonlininteg_vecconvection_pa.cpp +++ b/fem/integ/nonlininteg_vecconvection_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/intrules.cpp b/fem/intrules.cpp index cb9544852f..7e7bb4e398 100644 --- a/fem/intrules.cpp +++ b/fem/intrules.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -917,6 +917,7 @@ int Quadrature1D::CheckClosed(int type) { case GaussLobatto: case ClosedUniform: + case ClosedGL: return type; default: return Invalid; diff --git a/fem/intrules.hpp b/fem/intrules.hpp index 1d57579943..08654b79da 100644 --- a/fem/intrules.hpp +++ b/fem/intrules.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/intrules_cut.cpp b/fem/intrules_cut.cpp index 823cfeaf72..cf14a4c307 100644 --- a/fem/intrules_cut.cpp +++ b/fem/intrules_cut.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/intrules_cut.hpp b/fem/intrules_cut.hpp index 89fb3a9bde..eee8b10961 100644 --- a/fem/intrules_cut.hpp +++ b/fem/intrules_cut.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/kdtree.cpp b/fem/kdtree.cpp index 2e1779da95..7915210583 100644 --- a/fem/kdtree.cpp +++ b/fem/kdtree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/kdtree.hpp b/fem/kdtree.hpp index 43787b6fd0..83c8caf4b1 100644 --- a/fem/kdtree.hpp +++ b/fem/kdtree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/kernels.hpp b/fem/kernels.hpp index b27b0bb1a6..0eac5ec3af 100644 --- a/fem/kernels.hpp +++ b/fem/kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/linearform.cpp b/fem/linearform.cpp index 84efbaa3ae..c0c8ab79af 100644 --- a/fem/linearform.cpp +++ b/fem/linearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/linearform.hpp b/fem/linearform.hpp index c241184265..54cd7815ba 100644 --- a/fem/linearform.hpp +++ b/fem/linearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/linearform_ext.cpp b/fem/linearform_ext.cpp index b5999f6079..355431eb7f 100644 --- a/fem/linearform_ext.cpp +++ b/fem/linearform_ext.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/linearform_ext.hpp b/fem/linearform_ext.hpp index 2cc861cea3..0103185e02 100644 --- a/fem/linearform_ext.hpp +++ b/fem/linearform_ext.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lininteg.cpp b/fem/lininteg.cpp index e531d589a7..a782aff0d5 100644 --- a/fem/lininteg.cpp +++ b/fem/lininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lininteg.hpp b/fem/lininteg.hpp index 0cc5a80d44..08f42e21b8 100644 --- a/fem/lininteg.hpp +++ b/fem/lininteg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -104,7 +104,7 @@ public: }; -/// Class for domain integration \f$ L(v) := (f, v) \f$ +/// Class for domain integration $ L(v) := (f, v) $ class DomainLFIntegrator : public DeltaLFIntegrator { Vector shape; @@ -141,7 +141,7 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// Class for domain integrator \f$ L(v) := (f, \nabla v) \f$ +/// Class for domain integrator $ L(v) := (f, \nabla v) $ class DomainLFGradIntegrator : public DeltaLFIntegrator { private: @@ -150,7 +150,7 @@ private: DenseMatrix dshape; public: - /// Constructs the domain integrator \f$ (Q, \nabla v) \f$ + /// Constructs the domain integrator $ (Q, \nabla v) $ DomainLFGradIntegrator(VectorCoefficient &QF) : DeltaLFIntegrator(QF), Q(QF) { } @@ -175,7 +175,7 @@ public: }; -/// Class for boundary integration \f$ L(v) := (g, v) \f$ +/// Class for boundary integration $ L(v) := (g, v) $ class BoundaryLFIntegrator : public LinearFormIntegrator { Vector shape; @@ -206,7 +206,7 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// Class for boundary integration \f$ L(v) = (g \cdot n, v) \f$ +/// Class for boundary integration $ L(v) = (g \cdot n, v) $ class BoundaryNormalLFIntegrator : public LinearFormIntegrator { Vector shape; @@ -231,7 +231,7 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// Class for boundary integration \f$ L(v) = (g \cdot \tau, v) \f$ in 2D +/// Class for boundary integration $ L(v) = (g \cdot \tau, v) $ in 2D class BoundaryTangentialLFIntegrator : public LinearFormIntegrator { Vector shape; @@ -249,8 +249,8 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/** Class for domain integration of \f$ L(v) := (f, v) \f$, where - \f$ f = (f_1,\dots,f_n)\f$ and \f$ v = (v_1,\dots,v_n) \f$. */ +/** Class for domain integration of $ L(v) := (f, v) $, where + $ f = (f_1,\dots,f_n)$ and $ v = (v_1,\dots,v_n) $. */ class VectorDomainLFIntegrator : public DeltaLFIntegrator { private: @@ -282,8 +282,8 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/** Class for domain integrator \f$ L(v) := (f, \nabla v) \f$, where - \f$ f = (f_{1x},f_{1y},f_{1z},\dots,f_{nx},f_{ny},f_{nz})\f$ and \f$v=(v_1,\dots,v_n)\f$. */ +/** Class for domain integrator $ L(v) := (f, \nabla v) $, where + $ f = (f_{1x},f_{1y},f_{1z},\dots,f_{nx},f_{ny},f_{nz})$ and $v=(v_1,\dots,v_n)$. */ class VectorDomainLFGradIntegrator : public DeltaLFIntegrator { private: @@ -316,8 +316,8 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/** Class for boundary integration of \f$ L(v) := (g, v) \f$, where - \f$f=(f_1,\dots,f_n)\f$ and \f$v=(v_1,\dots,v_n)\f$. */ +/** Class for boundary integration of $ L(v) := (g, v) $, where + $g=(g_1,\dots,g_n)$ and $v=(v_1,\dots,v_n)$. */ class VectorBoundaryLFIntegrator : public LinearFormIntegrator { private: @@ -342,7 +342,7 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// \f$ (f, v)_{\Omega} \f$ for VectorFiniteElements (Nedelec, Raviart-Thomas) +/// $ (f, v)_{\Omega} $ for VectorFiniteElements (Nedelec, Raviart-Thomas) class VectorFEDomainLFIntegrator : public DeltaLFIntegrator { private: @@ -371,7 +371,7 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// \f$ (Q, \mathrm{curl}(v))_{\Omega} \f$ for Nedelec Elements +/// $ (Q, \mathrm{curl}(v))_{\Omega} $ for Nedelec Elements class VectorFEDomainLFCurlIntegrator : public DeltaLFIntegrator { private: @@ -380,7 +380,7 @@ private: Vector vec; public: - /// Constructs the domain integrator \f$(Q, \mathrm{curl}(v)) \f$ + /// Constructs the domain integrator $(Q, \mathrm{curl}(v)) $ VectorFEDomainLFCurlIntegrator(VectorCoefficient &F) : DeltaLFIntegrator(F), QF(&F) { } @@ -395,14 +395,14 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/// \f$ (Q, \mathrm{div}(v))_{\Omega} \f$ for RT Elements +/// $ (Q, \mathrm{div}(v))_{\Omega} $ for RT Elements class VectorFEDomainLFDivIntegrator : public DeltaLFIntegrator { private: Vector divshape; Coefficient &Q; public: - /// Constructs the domain integrator \f$ (Q, \mathrm{div}(v)) \f$ + /// Constructs the domain integrator $ (Q, \mathrm{div}(v)) $ VectorFEDomainLFDivIntegrator(Coefficient &QF) : DeltaLFIntegrator(QF), Q(QF) { } @@ -419,8 +419,8 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/** \f$ (f, v \cdot n)_{\partial\Omega} \f$ for vector test function - \f$v=(v_1,\dots,v_n)\f$ where all vi are in the same scalar FE space and \f$f\f$ is a +/** $ (f, v \cdot n)_{\partial\Omega} $ for vector test function + $v=(v_1,\dots,v_n)$ where all vi are in the same scalar FE space and $f$ is a scalar function. */ class VectorBoundaryFluxLFIntegrator : public LinearFormIntegrator { @@ -441,8 +441,8 @@ public: using LinearFormIntegrator::AssembleRHSElementVect; }; -/** Class for boundary integration of \f$ (f, v \cdot n)\f$ for scalar coefficient \f$f\f$ and - RT vector test function \f$v\f$. This integrator works with RT spaces defined +/** Class for boundary integration of $ (f, v \cdot n) $ for scalar coefficient $f$ and + RT vector test function $v$. This integrator works with RT spaces defined using the RT_FECollection class. */ class VectorFEBoundaryFluxLFIntegrator : public LinearFormIntegrator { @@ -470,7 +470,7 @@ public: Vector &b); }; -/// Class for boundary integration \f$ L(v) = (n \times f, v) \f$ +/// Class for boundary integration $ L(v) = (n \times f, v) $ class VectorFEBoundaryTangentLFIntegrator : public LinearFormIntegrator { private: @@ -491,9 +491,9 @@ public: /** Class for boundary integration of the linear form: - \f$ \frac{\alpha}{2} \langle (u \cdot n) f, w \rangle - \beta \langle |u \cdot n| f, w \rangle \f$ - where \f$f\f$ and \f$u\f$ are given scalar and vector coefficients, respectively, - and \f$w\f$ is the scalar test function. */ + $ \frac{\alpha}{2} \langle (u \cdot n) f, w \rangle - \beta \langle |u \cdot n| f, w \rangle $ + where $f$ and $u$ are given scalar and vector coefficients, respectively, + and $w$ is the scalar test function. */ class BoundaryFlowIntegrator : public LinearFormIntegrator { private: @@ -525,13 +525,13 @@ public: /** Boundary linear integrator for imposing non-zero Dirichlet boundary conditions, to be used in conjunction with DGDiffusionIntegrator. - Specifically, given the Dirichlet data \f$u_D\f$, the linear form assembles the + Specifically, given the Dirichlet data $u_D$, the linear form assembles the following integrals on the boundary: - \f[ + $$ \sigma \langle u_D, (Q \nabla v)) \cdot n \rangle + \kappa \langle {h^{-1} Q} u_D, v \rangle, - \f] + $$ where Q is a scalar or matrix diffusion coefficient and v is the test - function. The parameters \f$\sigma\f$ and \f$\kappa\f$ should be the same as the ones + function. The parameters $\sigma$ and $\kappa$ should be the same as the ones used in the DGDiffusionIntegrator. */ class DGDirichletLFIntegrator : public LinearFormIntegrator { @@ -568,12 +568,12 @@ public: /** Boundary linear form integrator for imposing non-zero Dirichlet boundary conditions, in a DG elasticity formulation. Specifically, the linear form is given by - \f[ + $$ \alpha \langle u_D, (\lambda \mathrm{div}(v) I + \mu (\nabla v + \nabla v^{\mathrm{T}})) \cdot n \rangle + + \kappa \langle h^{-1} (\lambda + 2 \mu) u_D, v \rangle, - \f] - where u_D is the given Dirichlet data. The parameters \f$\alpha\f$, \f$\kappa\f$, \f$\lambda\f$ - and \f$\mu\f$, should match the parameters with the same names used in the bilinear + $$ + where u_D is the given Dirichlet data. The parameters $\alpha$, $\kappa$, $\lambda$ + and $\mu$, should match the parameters with the same names used in the bilinear form integrator, DGElasticityIntegrator. */ class DGElasticityDirichletLFIntegrator : public LinearFormIntegrator { @@ -612,18 +612,18 @@ public: /** Class for spatial white Gaussian noise integration. - The target problem is the linear SPDE \f$ a(u,v) = F(v)\f$ with \f$F(v) := <\dot{W},v> \f$, - where \f$\dot{W}\f$ is spatial white Gaussian noise. When the Galerkin method is used to - discretize this problem into a linear system of equations \f$Ax = b\f$, the RHS is - a Gaussian random vector \f$b \sim N(0,M)\f$ whose covariance matrix is the same as the - mass matrix \f$M_{ij} = (v_i,v_j)\f$. This property can be ensured if \f$b = H w\f$, where - \f$HH^{\mathrm{T}} = M\f$ and each component \f$w_i\sim N(0,1)\f$. + The target problem is the linear SPDE $ a(u,v) = F(v)$ with $F(v) := <\dot{W},v> $, + where $\dot{W}$ is spatial white Gaussian noise. When the Galerkin method is used to + discretize this problem into a linear system of equations $Ax = b$, the RHS is + a Gaussian random vector $b \sim N(0,M)$ whose covariance matrix is the same as the + mass matrix $M_{ij} = (v_i,v_j)$. This property can be ensured if $b = H w$, where + $HH^{\mathrm{T}} = M$ and each component $w_i\sim N(0,1)$. - There is much flexibility in how we may wish to define \f$H\f$. In this PR, we - define \f$H = P^{\mathrm{T}} diag(L_e)\f$, where \f$P\f$ is the local-to-global dof assembly matrix - and \f$\mathrm{diag}(L_e)\f$ is a block-diagonal matrix with \f$L_e L_e^{\mathrm{T}} = M_e\f$, where \f$M_e\f$ is - the element mass matrix for element \f$e\f$. A straightforward computation shows - that \f$HH^{\mathrm{T}} = P^{\mathrm{T}} diag(M_e) P = M\f$, as necessary. */ + There is much flexibility in how we may wish to define $H$. In this PR, we + define $H = P^{\mathrm{T}} diag(L_e)$, where $P$ is the local-to-global dof assembly matrix + and $\mathrm{diag}(L_e)$ is a block-diagonal matrix with $L_e L_e^{\mathrm{T}} = M_e$, where $M_e$ is + the element mass matrix for element $e$. A straightforward computation shows + that $HH^{\mathrm{T}} = P^{\mathrm{T}} diag(M_e) P = M$, as necessary. */ class WhiteGaussianNoiseDomainLFIntegrator : public LinearFormIntegrator { #ifdef MFEM_USE_MPI @@ -718,8 +718,8 @@ public: }; -/** Class for domain integration of \f$ L(v) := (f, v) \f$, where - \f$ f=(f_1,\dots,f_n)\f$ and \f$v=(v_1,\dots,v_n)\f$. that makes use of +/** Class for domain integration of $ L(v) := (f, v) $, where + $ f=(f_1,\dots,f_n)$ and $v=(v_1,\dots,v_n)$. that makes use of VectorQuadratureFunctionCoefficient*/ class VectorQuadratureLFIntegrator : public LinearFormIntegrator { @@ -728,7 +728,7 @@ private: public: VectorQuadratureLFIntegrator(VectorQuadratureFunctionCoefficient &vqfc, - const IntegrationRule *ir) + const IntegrationRule *ir = NULL) : LinearFormIntegrator(ir), vqfc(vqfc) { if (ir) @@ -751,7 +751,7 @@ public: }; -/** Class for domain integration \f$ L(v) := (f, v) \f$ that makes use +/** Class for domain integration $ L(v) := (f, v) $ that makes use of QuadratureFunctionCoefficient. */ class QuadratureLFIntegrator : public LinearFormIntegrator { @@ -760,7 +760,7 @@ private: public: QuadratureLFIntegrator(QuadratureFunctionCoefficient &qfc, - const IntegrationRule *ir) + const IntegrationRule *ir = NULL) : LinearFormIntegrator(ir), qfc(qfc) { if (ir) diff --git a/fem/lor/lor.cpp b/fem/lor/lor.cpp index b78fd83b0f..312d2b278f 100644 --- a/fem/lor/lor.cpp +++ b/fem/lor/lor.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor.hpp b/fem/lor/lor.hpp index 3a9e122f8a..cae433aef9 100644 --- a/fem/lor/lor.hpp +++ b/fem/lor/lor.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_ads.cpp b/fem/lor/lor_ads.cpp index 3ba4816ee5..7e0017319a 100644 --- a/fem/lor/lor_ads.cpp +++ b/fem/lor/lor_ads.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_ads.hpp b/fem/lor/lor_ads.hpp index 5f99cd8944..7675932ba9 100644 --- a/fem/lor/lor_ads.hpp +++ b/fem/lor/lor_ads.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_ams.cpp b/fem/lor/lor_ams.cpp index 98ccfc2ae4..f8d0dfd8c9 100644 --- a/fem/lor/lor_ams.cpp +++ b/fem/lor/lor_ams.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_ams.hpp b/fem/lor/lor_ams.hpp index f7a4d50540..39a1177613 100644 --- a/fem/lor/lor_ams.hpp +++ b/fem/lor/lor_ams.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_batched.cpp b/fem/lor/lor_batched.cpp index e0e762e3bc..0a62c1874e 100644 --- a/fem/lor/lor_batched.cpp +++ b/fem/lor/lor_batched.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_batched.hpp b/fem/lor/lor_batched.hpp index 53a9a7bfa8..6cc24b4776 100644 --- a/fem/lor/lor_batched.hpp +++ b/fem/lor/lor_batched.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_h1.hpp b/fem/lor/lor_h1.hpp index 8ea3138010..9ee5efab65 100644 --- a/fem/lor/lor_h1.hpp +++ b/fem/lor/lor_h1.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_h1_impl.hpp b/fem/lor/lor_h1_impl.hpp index 4a8d51fa83..a413e55b98 100644 --- a/fem/lor/lor_h1_impl.hpp +++ b/fem/lor/lor_h1_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_nd.hpp b/fem/lor/lor_nd.hpp index e33492e805..e9683cbeaa 100644 --- a/fem/lor/lor_nd.hpp +++ b/fem/lor/lor_nd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_nd_impl.hpp b/fem/lor/lor_nd_impl.hpp index e32d3d2dea..0f107a1313 100644 --- a/fem/lor/lor_nd_impl.hpp +++ b/fem/lor/lor_nd_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_rt.hpp b/fem/lor/lor_rt.hpp index d3f7de1911..48b6148907 100644 --- a/fem/lor/lor_rt.hpp +++ b/fem/lor/lor_rt.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_rt_impl.hpp b/fem/lor/lor_rt_impl.hpp index 87039d2082..368b1d146c 100644 --- a/fem/lor/lor_rt_impl.hpp +++ b/fem/lor/lor_rt_impl.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/lor/lor_util.hpp b/fem/lor/lor_util.hpp index 3534ad1d07..1dff6c8cde 100644 --- a/fem/lor/lor_util.hpp +++ b/fem/lor/lor_util.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/CMakeLists.txt b/fem/moonolith/CMakeLists.txt index a3b5621647..7b8dcb6e59 100644 --- a/fem/moonolith/CMakeLists.txt +++ b/fem/moonolith/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/fem/moonolith/cut.cpp b/fem/moonolith/cut.cpp index 7b4d3661c7..d40b26e9c7 100644 --- a/fem/moonolith/cut.cpp +++ b/fem/moonolith/cut.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/cut.hpp b/fem/moonolith/cut.hpp index 37bcf8df53..9cc7441f4c 100644 --- a/fem/moonolith/cut.hpp +++ b/fem/moonolith/cut.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/mortarassembler.cpp b/fem/moonolith/mortarassembler.cpp index e610c6d0a2..60c2af8759 100644 --- a/fem/moonolith/mortarassembler.cpp +++ b/fem/moonolith/mortarassembler.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/mortarassembler.hpp b/fem/moonolith/mortarassembler.hpp index bef0163134..c2e835d646 100644 --- a/fem/moonolith/mortarassembler.hpp +++ b/fem/moonolith/mortarassembler.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/mortarintegrator.cpp b/fem/moonolith/mortarintegrator.cpp index 75dfdec7e6..b8c22c6897 100644 --- a/fem/moonolith/mortarintegrator.cpp +++ b/fem/moonolith/mortarintegrator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/mortarintegrator.hpp b/fem/moonolith/mortarintegrator.hpp index eec402229b..6414aff80f 100644 --- a/fem/moonolith/mortarintegrator.hpp +++ b/fem/moonolith/mortarintegrator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -67,8 +67,8 @@ public: /*! * @brief Integrator for scalar finite elements - * \f$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m ) - * and v \in V(\mathcal{T}_s ) \f$ + * $$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m ) + * and v \in V(\mathcal{T}_s ) $$ */ class L2MortarIntegrator : public MortarIntegrator { @@ -86,8 +86,8 @@ public: /*! * @brief Integrator for vector finite elements. Experimental. - * \f$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m ) - * and v \in V(\mathcal{T}_s ) \f$ + * $$ (u, v)_{L^2(\mathcal{T}_m \cap \mathcal{T}_s)}, u \in U(\mathcal{T}_m ) + * and v \in V(\mathcal{T}_s ) $$ */ class VectorL2MortarIntegrator : public MortarIntegrator { diff --git a/fem/moonolith/pmortarassembler.cpp b/fem/moonolith/pmortarassembler.cpp index 0c80f76534..e6e581eee4 100644 --- a/fem/moonolith/pmortarassembler.cpp +++ b/fem/moonolith/pmortarassembler.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/pmortarassembler.hpp b/fem/moonolith/pmortarassembler.hpp index ad7664c480..796dcb360b 100644 --- a/fem/moonolith/pmortarassembler.hpp +++ b/fem/moonolith/pmortarassembler.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/transfer.cpp b/fem/moonolith/transfer.cpp index eef8d518a6..2d53580178 100644 --- a/fem/moonolith/transfer.cpp +++ b/fem/moonolith/transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/transfer.hpp b/fem/moonolith/transfer.hpp index f088c36275..648cfa5c38 100644 --- a/fem/moonolith/transfer.hpp +++ b/fem/moonolith/transfer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/transferutils.cpp b/fem/moonolith/transferutils.cpp index 8c83d96f20..52855cf573 100644 --- a/fem/moonolith/transferutils.cpp +++ b/fem/moonolith/transferutils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/moonolith/transferutils.hpp b/fem/moonolith/transferutils.hpp index 2c1ccc1b03..eb163637fb 100644 --- a/fem/moonolith/transferutils.hpp +++ b/fem/moonolith/transferutils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/multigrid.cpp b/fem/multigrid.cpp index ff1be5b2a4..8368f94669 100644 --- a/fem/multigrid.cpp +++ b/fem/multigrid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -231,10 +231,6 @@ void MultigridBase::Cycle(int level) const } } -Multigrid::Multigrid() - : MultigridBase() -{} - Multigrid::Multigrid(const Array& operators_, const Array& smoothers_, const Array& prolongations_, @@ -258,10 +254,64 @@ Multigrid::~Multigrid() } } -GeometricMultigrid:: -GeometricMultigrid(const FiniteElementSpaceHierarchy& fespaces_) - : MultigridBase(), fespaces(fespaces_) -{} +GeometricMultigrid::GeometricMultigrid( + const FiniteElementSpaceHierarchy& fespaces_) + : fespaces(fespaces_) +{ + const int nlevels = fespaces.GetNumLevels(); + ownedProlongations.SetSize(nlevels - 1); + ownedProlongations = false; + + prolongations.SetSize(nlevels - 1); + for (int level = 0; level < nlevels - 1; ++level) + { + prolongations[level] = fespaces.GetProlongationAtLevel(level); + } +} + +GeometricMultigrid::GeometricMultigrid( + const FiniteElementSpaceHierarchy& fespaces_, + const Array &ess_bdr) + : fespaces(fespaces_) +{ + bool have_ess_bdr = false; + for (int i = 0; i < ess_bdr.Size(); i++) + { + if (ess_bdr[i]) { have_ess_bdr = true; break; } + } + + const int nlevels = fespaces.GetNumLevels(); + ownedProlongations.SetSize(nlevels - 1); + ownedProlongations = have_ess_bdr; + + if (have_ess_bdr) + { + essentialTrueDofs.SetSize(nlevels); + for (int level = 0; level < nlevels; ++level) + { + essentialTrueDofs[level] = new Array; + fespaces.GetFESpaceAtLevel(level).GetEssentialTrueDofs( + ess_bdr, *essentialTrueDofs[level]); + } + } + + prolongations.SetSize(nlevels - 1); + for (int level = 0; level < nlevels - 1; ++level) + { + if (have_ess_bdr) + { + prolongations[level] = new RectangularConstrainedOperator( + fespaces.GetProlongationAtLevel(level), + *essentialTrueDofs[level], + *essentialTrueDofs[level + 1] + ); + } + else + { + prolongations[level] = fespaces.GetProlongationAtLevel(level); + } + } +} GeometricMultigrid::~GeometricMultigrid() { diff --git a/fem/multigrid.hpp b/fem/multigrid.hpp index b97acb8bfb..3e6f0c2116 100644 --- a/fem/multigrid.hpp +++ b/fem/multigrid.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -140,7 +140,7 @@ protected: public: /// Constructs an empty multigrid hierarchy - Multigrid(); + Multigrid() = default; /// Constructs a multigrid hierarchy from the given inputs /** Inputs include operators and smoothers on all levels, prolongation @@ -162,7 +162,7 @@ private: }; /// Geometric multigrid associated with a hierarchy of finite element spaces -class GeometricMultigrid : public MultigridBase +class GeometricMultigrid : public Multigrid { protected: const FiniteElementSpaceHierarchy& fespaces; @@ -170,10 +170,28 @@ protected: Array bfs; public: - /** Construct an empty multigrid object for the given finite element space - hierarchy @a fespaces_ */ + /// @brief Deprecated. + /// + /// Construct an empty geometric multigrid object for the given finite + /// element space hierarchy @a fespaces_. + /// + /// @deprecated Use GeometricMultigrid::GeometricMultigrid(const + /// FiniteElementSpaceHierarchy&, const Array&) instead. This version + /// constructs prolongation and restriction operators without eliminated + /// essential boundary conditions. + MFEM_DEPRECATED GeometricMultigrid(const FiniteElementSpaceHierarchy& fespaces_); + /// @brief Construct a geometric multigrid object for the given finite + /// element space hierarchy @a fespaces_, where @a ess_bdr is a list of + /// mesh boundary element attributes that define the essential DOFs. + /// + /// If @a ess_bdr is empty, or all its entries are 0, then no essential + /// boundary conditions are imposed and the protected array essentialTrueDofs + /// remains empty. + GeometricMultigrid(const FiniteElementSpaceHierarchy& fespaces_, + const Array &ess_bdr); + /// Destructor virtual ~GeometricMultigrid(); @@ -184,13 +202,6 @@ public: /// Recover the solution of a linear system formed with FormFineLinearSystem() void RecoverFineFEMSolution(const Vector& X, const Vector& b, Vector& x); - -private: - /// Returns prolongation operator at given level - virtual const Operator* GetProlongationAtLevel(int level) const override - { - return fespaces.GetProlongationAtLevel(level); - } }; } // namespace mfem diff --git a/fem/nonlinearform.cpp b/fem/nonlinearform.cpp index 88271e234a..003e54611b 100644 --- a/fem/nonlinearform.cpp +++ b/fem/nonlinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -143,6 +143,50 @@ double NonlinearForm::GetGridFunctionEnergy(const Vector &x) const } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < fes->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + fe = fes->GetBE(i); + doftrans = fes->GetBdrElementVDofs(i, vdofs); + T = fes->GetBdrElementTransformation(i); + x.GetSubVector(vdofs, el_x); + if (doftrans) {doftrans->InvTransformPrimal(el_x); } + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + energy += bnfi[k]->GetElementEnergy(*fe, *T, el_x); + } + } + + } + if (fnfi.Size()) { MFEM_ABORT("TODO: add energy contribution from interior face terms"); @@ -246,6 +290,51 @@ void NonlinearForm::Mult(const Vector &x, Vector &y) const } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < fes->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + fe = fes->GetBE(i); + doftrans = fes->GetBdrElementVDofs(i, vdofs); + T = fes->GetBdrElementTransformation(i); + px.GetSubVector(vdofs, el_x); + if (doftrans) {doftrans->InvTransformPrimal(el_x); } + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + bnfi[k]->AssembleElementVector(*fe, *T, el_x, el_y); + if (doftrans) {doftrans->TransformDual(el_y); } + py.AddElementVector(vdofs, el_y); + } + } + } + if (fnfi.Size()) { FaceElementTransformations *tr; @@ -421,6 +510,51 @@ Operator &NonlinearForm::GetGradient(const Vector &x) const } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < fes->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + fe = fes->GetBE(i); + doftrans = fes->GetBdrElementVDofs(i, vdofs); + T = fes->GetBdrElementTransformation(i); + px.GetSubVector(vdofs, el_x); + if (doftrans) {doftrans->InvTransformPrimal(el_x); } + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + bnfi[k]->AssembleElementGrad(*fe, *T, el_x, elmat); + if (doftrans) { doftrans->TransformDual(elmat); } + Grad->AddSubMatrix(vdofs, vdofs, elmat, skip_zeros); + } + } + } + if (fnfi.Size()) { FaceElementTransformations *tr; @@ -554,6 +688,7 @@ NonlinearForm::~NonlinearForm() delete cGrad; delete Grad; for (int i = 0; i < dnfi.Size(); i++) { delete dnfi[i]; } + for (int i = 0; i < bnfi.Size(); i++) { delete bnfi[i]; } for (int i = 0; i < fnfi.Size(); i++) { delete fnfi[i]; } for (int i = 0; i < bfnfi.Size(); i++) { delete bfnfi[i]; } delete ext; @@ -723,6 +858,53 @@ double BlockNonlinearForm::GetEnergyBlocked(const BlockVector &bx) const } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < mesh->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + T = fes[0]->GetBdrElementTransformation(i); + for (int s = 0; s < fes.Size(); ++s) + { + fe[s] = fes[s]->GetBE(i); + doftrans = fes[s]->GetBdrElementVDofs(i, *(vdofs[s])); + bx.GetBlock(s).GetSubVector(*(vdofs[s]), *el_x[s]); + if (doftrans) {doftrans->InvTransformPrimal(*el_x[s]); } + } + + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + energy += bnfi[k]->GetElementEnergy(fe, *T, el_x_const); + } + } + } + // free the allocated memory for (int i = 0; i < fes.Size(); ++i) { @@ -829,6 +1011,61 @@ void BlockNonlinearForm::MultBlocked(const BlockVector &bx, } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < mesh->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + T = fes[0]->GetBdrElementTransformation(i); + for (int s = 0; s < fes.Size(); ++s) + { + doftrans[s] = fes[s]->GetBdrElementVDofs(i, *(vdofs[s])); + fe[s] = fes[s]->GetBE(i); + bx.GetBlock(s).GetSubVector(*(vdofs[s]), *el_x[s]); + if (doftrans[s]) {doftrans[s]->InvTransformPrimal(*el_x[s]); } + } + + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + bnfi[k]->AssembleElementVector(fe, *T, el_x_const, el_y); + + for (int s=0; sSize() == 0) { continue; } + if (doftrans[s]) {doftrans[s]->TransformDual(*el_y[s]); } + by.GetBlock(s).AddElementVector(*(vdofs[s]), *el_y[s]); + } + } + } + } + + if (fnfi.Size()) { FaceElementTransformations *tr; @@ -1080,6 +1317,67 @@ void BlockNonlinearForm::ComputeGradientBlocked(const BlockVector &bx) const } } + if (bnfi.Size()) + { + // Which boundary attributes need to be processed? + Array bdr_attr_marker(mesh->bdr_attributes.Size() ? + mesh->bdr_attributes.Max() : 0); + bdr_attr_marker = 0; + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] == NULL) + { + bdr_attr_marker = 1; + break; + } + Array &bdr_marker = *bnfi_marker[k]; + MFEM_ASSERT(bdr_marker.Size() == bdr_attr_marker.Size(), + "invalid boundary marker for boundary integrator #" + << k << ", counting from zero"); + for (int i = 0; i < bdr_attr_marker.Size(); i++) + { + bdr_attr_marker[i] |= bdr_marker[i]; + } + } + + for (int i = 0; i < mesh->GetNBE(); i++) + { + const int bdr_attr = mesh->GetBdrAttribute(i); + if (bdr_attr_marker[bdr_attr-1] == 0) { continue; } + + T = fes[0]->GetBdrElementTransformation(i); + for (int s = 0; s < fes.Size(); ++s) + { + fe[s] = fes[s]->GetBE(i); + doftrans[s] = fes[s]->GetBdrElementVDofs(i, *(vdofs[s])); + bx.GetBlock(s).GetSubVector(*(vdofs[s]), *el_x[s]); + if (doftrans[s]) {doftrans[s]->InvTransformPrimal(*el_x[s]); } + } + + for (int k = 0; k < bnfi.Size(); k++) + { + if (bnfi_marker[k] && + (*bnfi_marker[k])[bdr_attr-1] == 0) { continue; } + + bnfi[k]->AssembleElementGrad(fe, *T, el_x_const, elmats); + + for (int j=0; jHeight() == 0) { continue; } + if (doftrans[j] || doftrans[l]) + { + TransformDual(doftrans[j], doftrans[l], *elmats(j,l)); + } + Grads(j,l)->AddSubMatrix(*vdofs[j], *vdofs[l], + *elmats(j,l), skip_zeros); + } + } + } + } + } + if (fnfi.Size()) { FaceElementTransformations *tr; @@ -1272,6 +1570,11 @@ BlockNonlinearForm::~BlockNonlinearForm() delete dnfi[i]; } + for (int i = 0; i < bnfi.Size(); ++i) + { + delete bnfi[i]; + } + for (int i = 0; i < fnfi.Size(); ++i) { delete fnfi[i]; diff --git a/fem/nonlinearform.hpp b/fem/nonlinearform.hpp index 77da539f7e..980d0dd149 100644 --- a/fem/nonlinearform.hpp +++ b/fem/nonlinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -39,6 +39,10 @@ protected: Array dnfi; // owned Array*> dnfi_marker; // not owned + /// Set of Boundary Integrators to be assembled (added). + Array bnfi; // owned + Array*> bnfi_marker; // not owned + /// Set of interior face Integrators to be assembled (added). Array fnfi; // owned @@ -120,6 +124,19 @@ public: Array *GetDNFI() { return &dnfi; } const Array *GetDNFI() const { return &dnfi; } + /// Adds new Boundary Integrator. + void AddBoundaryIntegrator(NonlinearFormIntegrator *nlfi) + { bnfi.Append(nlfi); bnfi_marker.Append(NULL); } + + /// Adds new Boundary Integrator, restricted to specific attributes. + void AddBoundaryIntegrator(NonlinearFormIntegrator *nlfi, + Array &elem_marker) + { bnfi.Append(nlfi); bnfi_marker.Append(&elem_marker); } + + /// Access all integrators added with AddBoundaryIntegrator(). + Array *GetBNFI() { return &bnfi; } + const Array *GetBNFI() const { return &bnfi; } + /// Adds new Interior Face Integrator. void AddInteriorFaceIntegrator(NonlinearFormIntegrator *nlfi) { fnfi.Append(nlfi); } @@ -235,6 +252,10 @@ protected: Array dnfi; Array*> dnfi_marker; + /// Set of Boundary Integrators to be assembled (added). + Array bnfi; + Array*> bnfi_marker; + /// Set of interior face Integrators to be assembled (added). Array fnfi; @@ -312,6 +333,15 @@ public: Array &elem_marker) { dnfi.Append(nlfi); dnfi_marker.Append(&elem_marker); } + /// Adds new Boundary Integrator. + void AddBoundaryIntegrator(BlockNonlinearFormIntegrator *nlfi) + { bnfi.Append(nlfi); bnfi_marker.Append(NULL); } + + /// Adds new Boundary Integrator, restricted to specific attributes. + void AddBoundaryIntegrator(BlockNonlinearFormIntegrator *nlfi, + Array &elem_marker) + { bnfi.Append(nlfi); bnfi_marker.Append(&elem_marker); } + /// Adds new Interior Face Integrator. void AddInteriorFaceIntegrator(BlockNonlinearFormIntegrator *nlfi) { fnfi.Append(nlfi); } diff --git a/fem/nonlinearform_ext.cpp b/fem/nonlinearform_ext.cpp index a7adae127a..2d57b62cc3 100644 --- a/fem/nonlinearform_ext.cpp +++ b/fem/nonlinearform_ext.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/nonlinearform_ext.hpp b/fem/nonlinearform_ext.hpp index 87caff54e1..eaa61f5e05 100644 --- a/fem/nonlinearform_ext.hpp +++ b/fem/nonlinearform_ext.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/nonlininteg.cpp b/fem/nonlininteg.cpp index e1558fda4b..0cc0b50c01 100644 --- a/fem/nonlininteg.cpp +++ b/fem/nonlininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/nonlininteg.hpp b/fem/nonlininteg.hpp index fa3d2c75cc..9426e1aac0 100644 --- a/fem/nonlininteg.hpp +++ b/fem/nonlininteg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -140,14 +140,14 @@ public: method AssembleGradPA() has been called. @param[in] x The gradient Operator is applied to the Vector @a x. - @param[in,out] y The result Vector: @f$ y += G x @f$. */ + @param[in,out] y The result Vector: $ y += G x $. */ virtual void AddMultGradPA(const Vector &x, Vector &y) const; /// Method for computing the diagonal of the gradient with partial assembly. /** The result Vector @a diag is an E-Vector. This method can be called only after the method AssembleGradPA() has been called. - @param[in,out] diag The result Vector: @f$ diag += diag(G) @f$. */ + @param[in,out] diag The result Vector: $ diag += diag(G) $. */ virtual void AssembleGradDiagonalPA(Vector &diag) const; /// Indicates whether this integrator can use a Ceed backend. @@ -277,9 +277,9 @@ public: /** Neo-Hookean hyperelastic model with a strain energy density function given - by the formula: \f$(\mu/2)(\bar{I}_1 - dim) + (K/2)(det(J)/g - 1)^2\f$ where - J is the deformation gradient and \f$\bar{I}_1 = (det(J))^{-2/dim} Tr(J - J^t)\f$. The parameters \f$\mu\f$ and K are the shear and bulk moduli, + by the formula: $(\mu/2)(\bar{I}_1 - dim) + (K/2)(det(J)/g - 1)^2$ where + J is the deformation gradient and $$\bar{I}_1 = (det(J))^{-2/dim} Tr(J + J^t)$$. The parameters $\mu$ and K are the shear and bulk moduli, respectively, and g is a reference volumetric scaling. */ class NeoHookeanModel : public HyperelasticModel { @@ -312,7 +312,7 @@ public: /** Hyperelastic integrator for any given HyperelasticModel. - Represents @f$ \int W(Jpt) dx @f$ over a target zone, where W is the + Represents $ \int W(Jpt) dx $ over a target zone, where W is the @a model's strain energy density function, and Jpt is the Jacobian of the target->physical coordinates transformation. The target configuration is given by the current mesh at the time of the evaluation of the integrator. @@ -356,8 +356,8 @@ public: }; /** Hyperelastic incompressible Neo-Hookean integrator with the PK1 stress - \f$P = \mu F - p F^{-T}\f$ where \f$\mu\f$ is the shear modulus, - \f$p\f$ is the pressure, and \f$F\f$ is the deformation gradient */ + $P = \mu F - p F^{-T}$ where $\mu$ is the shear modulus, + $p$ is the pressure, and $F$ is the deformation gradient */ class IncompressibleNeoHookeanIntegrator : public BlockNonlinearFormIntegrator { private: @@ -430,7 +430,7 @@ public: /** This class is used to assemble the convective form of the nonlinear term - arising in the Navier-Stokes equations \f$(u \cdot \nabla v, w )\f$ */ + arising in the Navier-Stokes equations $(u \cdot \nabla v, w )$ */ class ConvectiveVectorConvectionNLFIntegrator : public VectorConvectionNLFIntegrator { @@ -453,7 +453,7 @@ public: /** This class is used to assemble the skew-symmetric form of the nonlinear term arising in the Navier-Stokes equations - \f$.5*(u \cdot \nabla v, w ) - .5*(u \cdot \nabla w, v )\f$ */ + $.5*(u \cdot \nabla v, w ) - .5*(u \cdot \nabla w, v )$ */ class SkewSymmetricVectorConvectionNLFIntegrator : public VectorConvectionNLFIntegrator { diff --git a/fem/occa.okl b/fem/occa.okl index 92890767bf..e43c78dee0 100644 --- a/fem/occa.okl +++ b/fem/occa.okl @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/pbilinearform.cpp b/fem/pbilinearform.cpp index ee1030c485..b593c9bcc2 100644 --- a/fem/pbilinearform.cpp +++ b/fem/pbilinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/pbilinearform.hpp b/fem/pbilinearform.hpp index c8fef567b8..c6c4e33223 100644 --- a/fem/pbilinearform.hpp +++ b/fem/pbilinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/pfespace.cpp b/fem/pfespace.cpp index 78a76041c2..00d4f5d5ee 100644 --- a/fem/pfespace.cpp +++ b/fem/pfespace.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -497,12 +497,12 @@ void ParFiniteElementSpace::GetBdrElementDofs(int i, Array &dofs, { bdr_elem_dof->GetRow(i, dofs); - if (DoFTransArray[mesh->GetBdrElementBaseGeometry(i)]) + if (DoFTransArray[mesh->GetBdrElementGeometry(i)]) { Array Fo; bdr_elem_fos->GetRow(i, Fo); doftrans.SetDofTransformation( - *DoFTransArray[mesh->GetBdrElementBaseGeometry(i)]); + *DoFTransArray[mesh->GetBdrElementGeometry(i)]); doftrans.SetFaceOrientations(Fo); doftrans.SetVDim(); } @@ -1031,7 +1031,7 @@ void ParFiniteElementSpace::GetEssentialVDofs(const Array &bdr_attr_is_ess, void ParFiniteElementSpace::GetEssentialTrueDofs(const Array &bdr_attr_is_ess, Array &ess_tdof_list, - int component) + int component) const { Array ess_dofs, true_ess_dofs; diff --git a/fem/pfespace.hpp b/fem/pfespace.hpp index 2b93230d51..e1aabf3dbc 100644 --- a/fem/pfespace.hpp +++ b/fem/pfespace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -365,7 +365,7 @@ public: boundary attributes marked in the array bdr_attr_is_ess. */ void GetEssentialTrueDofs(const Array &bdr_attr_is_ess, Array &ess_tdof_list, - int component = -1) override; + int component = -1) const override; /** If the given ldof is owned by the current processor, return its local tdof number, otherwise return -1 */ diff --git a/fem/pgridfunc.cpp b/fem/pgridfunc.cpp index e546093599..111b523746 100644 --- a/fem/pgridfunc.cpp +++ b/fem/pgridfunc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -666,7 +666,7 @@ void ParGridFunction::ProjectDiscCoefficient(VectorCoefficient &vcoeff, } void ParGridFunction::ProjectBdrCoefficient( - Coefficient *coeff[], VectorCoefficient *vcoeff, Array &attr) + Coefficient *coeff[], VectorCoefficient *vcoeff, const Array &attr) { Array values_counter; AccumulateAndCountBdrValues(coeff, vcoeff, attr, values_counter); @@ -720,7 +720,7 @@ void ParGridFunction::ProjectBdrCoefficient( } void ParGridFunction::ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff, - Array &bdr_attr) + const Array &bdr_attr) { Array values_counter; AccumulateAndCountBdrTangentValues(vcoeff, bdr_attr, values_counter); diff --git a/fem/pgridfunc.hpp b/fem/pgridfunc.hpp index 58c6c02862..1ed4d30007 100644 --- a/fem/pgridfunc.hpp +++ b/fem/pgridfunc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -44,7 +44,7 @@ protected: Vector send_data; void ProjectBdrCoefficient(Coefficient *coeff[], VectorCoefficient *vcoeff, - Array &attr); + const Array &attr); public: ParGridFunction() { pfes = NULL; } @@ -256,16 +256,17 @@ public: // Only the values in the master are guaranteed to be correct! void ProjectBdrCoefficient(VectorCoefficient &vcoeff, - Array &attr) override + const Array &attr) override { ProjectBdrCoefficient(NULL, &vcoeff, attr); } // Only the values in the master are guaranteed to be correct! - void ProjectBdrCoefficient(Coefficient *coeff[], Array &attr) override + void ProjectBdrCoefficient(Coefficient *coeff[], + const Array &attr) override { ProjectBdrCoefficient(coeff, NULL, attr); } // Only the values in the master are guaranteed to be correct! void ProjectBdrCoefficientTangent(VectorCoefficient &vcoeff, - Array &bdr_attr) override; + const Array &bdr_attr) override; double ComputeL1Error(Coefficient *exsol[], const IntegrationRule *irs[] = NULL) const override diff --git a/fem/plinearform.cpp b/fem/plinearform.cpp index 08f36c8ca1..42f872bfd2 100644 --- a/fem/plinearform.cpp +++ b/fem/plinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/plinearform.hpp b/fem/plinearform.hpp index 08361ed86e..cfdc0b4b84 100644 --- a/fem/plinearform.hpp +++ b/fem/plinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/pnonlinearform.cpp b/fem/pnonlinearform.cpp index 880c560e59..d3eb8bead1 100644 --- a/fem/pnonlinearform.cpp +++ b/fem/pnonlinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/pnonlinearform.hpp b/fem/pnonlinearform.hpp index dc3611c511..982f87618f 100644 --- a/fem/pnonlinearform.hpp +++ b/fem/pnonlinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/prestriction.cpp b/fem/prestriction.cpp index b383af103c..63bf39ab20 100644 --- a/fem/prestriction.cpp +++ b/fem/prestriction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/prestriction.hpp b/fem/prestriction.hpp index 991c6d2d10..3fe45824a6 100644 --- a/fem/prestriction.hpp +++ b/fem/prestriction.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qfunction.cpp b/fem/qfunction.cpp index f22954cc1a..76ea894f27 100644 --- a/fem/qfunction.cpp +++ b/fem/qfunction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -12,6 +12,8 @@ #include "qfunction.hpp" #include "quadinterpolator.hpp" #include "quadinterpolator_face.hpp" +#include "../general/forall.hpp" +#include "../mesh/pmesh.hpp" namespace mfem { @@ -240,4 +242,46 @@ void QuadratureFunction::SaveVTU(const std::string &filename, VTKFormat format, SaveVTU(f, format, compression_level, field_name); } +static double ReduceDouble(const Mesh *mesh, double value) +{ +#ifdef MFEM_USE_MPI + if (auto *pmesh = dynamic_cast(mesh)) + { + MPI_Comm comm = pmesh->GetComm(); + MPI_Allreduce(MPI_IN_PLACE, &value, 1, MPI_DOUBLE, MPI_SUM, comm); + } +#endif + return value; +} + +double QuadratureFunction::Integrate() const +{ + MFEM_VERIFY(vdim == 1, "Only scalar functions are supported.") + const double local_integral = InnerProduct(*this, qspace->GetWeights()); + return ReduceDouble(qspace->GetMesh(), local_integral); +} + +void QuadratureFunction::Integrate(Vector &integrals) const +{ + integrals.SetSize(vdim); + + const Vector &weights = qspace->GetWeights(); + QuadratureFunction component(qspace); + const int N = component.Size(); + const int VDIM = vdim; // avoid capturing 'this' in lambda body + const double *d_v = Read(); + + for (int vd = 0; vd < vdim; ++vd) + { + // Extract the component 'vd' into component. + double *d_c = component.Write(); + mfem::forall(N, [=] MFEM_HOST_DEVICE (int i) + { + d_c[i] = d_v[vd + i*VDIM]; + }); + integrals[vd] = ReduceDouble(qspace->GetMesh(), + InnerProduct(component, weights)); + } +} + } diff --git a/fem/qfunction.hpp b/fem/qfunction.hpp index 1b4f19f637..3b26182bf1 100644 --- a/fem/qfunction.hpp +++ b/fem/qfunction.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -195,6 +195,14 @@ public: void SaveVTU(const std::string &filename, VTKFormat format=VTKFormat::ASCII, int compression_level=0, const std::string &field_name="u") const; + + /// Return the integral of the quadrature function (vdim = 1 only). + double Integrate() const; + + /// @brief Integrate the (potentially vector-valued) quadrature function, + /// storing the results in @a integrals (length @a vdim). + void Integrate(Vector &integrals) const; + virtual ~QuadratureFunction() { if (own_qspace) { delete qspace; } diff --git a/fem/qinterp/det.cpp b/fem/qinterp/det.cpp index de1ef235d0..e0b034b826 100644 --- a/fem/qinterp/det.cpp +++ b/fem/qinterp/det.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -58,11 +58,10 @@ static void Det2D(const int NE, const double *g, const double *x, double *y, - const int vdim = 1, const int d1d = 0, const int q1d = 0) { - constexpr int DIM = 2; + static constexpr int SDIM = 2; static constexpr int NBZ = 1; const int D1D = T_D1D ? T_D1D : d1d; @@ -70,7 +69,7 @@ static void Det2D(const int NE, const auto B = Reshape(b, Q1D, D1D); const auto G = Reshape(g, Q1D, D1D); - const auto X = Reshape(x, D1D, D1D, DIM, NE); + const auto X = Reshape(x, D1D, D1D, SDIM, NE); auto Y = Reshape(y, Q1D, Q1D, NE); mfem::forall_2D_batch(NE, Q1D, Q1D, NBZ, [=] MFEM_HOST_DEVICE (int e) @@ -81,9 +80,9 @@ static void Det2D(const int NE, const int Q1D = T_Q1D ? T_Q1D : q1d; MFEM_SHARED double BG[2][MQ1*MD1]; - MFEM_SHARED double XY[2][NBZ][MD1*MD1]; - MFEM_SHARED double DQ[4][NBZ][MD1*MQ1]; - MFEM_SHARED double QQ[4][NBZ][MQ1*MQ1]; + MFEM_SHARED double XY[SDIM][NBZ][MD1*MD1]; + MFEM_SHARED double DQ[2*SDIM][NBZ][MD1*MQ1]; + MFEM_SHARED double QQ[2*SDIM][NBZ][MQ1*MQ1]; kernels::internal::LoadX(e,D1D,X,XY); kernels::internal::LoadBG(D1D,Q1D,B,G,BG); @@ -103,13 +102,107 @@ static void Det2D(const int NE, }); } +template +static void Det2DSurface(const int NE, + const double *b, + const double *g, + const double *x, + double *y, + const int d1d = 0, + const int q1d = 0) +{ + static constexpr int SDIM = 3; + static constexpr int NBZ = 1; + + const int D1D = T_D1D ? T_D1D : d1d; + const int Q1D = T_Q1D ? T_Q1D : q1d; + + const auto B = Reshape(b, Q1D, D1D); + const auto G = Reshape(g, Q1D, D1D); + const auto X = Reshape(x, D1D, D1D, SDIM, NE); + auto Y = Reshape(y, Q1D, Q1D, NE); + + mfem::forall_2D_batch(NE, Q1D, Q1D, NBZ, [=] MFEM_HOST_DEVICE (int e) + { + constexpr int MQ1 = T_Q1D ? T_Q1D : DofQuadLimits::MAX_Q1D; + constexpr int MD1 = T_D1D ? T_D1D : DofQuadLimits::MAX_D1D; + const int D1D = T_D1D ? T_D1D : d1d; + const int Q1D = T_Q1D ? T_Q1D : q1d; + const int tidz = MFEM_THREAD_ID(z); + + MFEM_SHARED double BG[2][MQ1*MD1]; + MFEM_SHARED double XYZ[SDIM][NBZ][MD1*MD1]; + MFEM_SHARED double DQ[2*SDIM][NBZ][MD1*MQ1]; + + kernels::internal::LoadBG(D1D,Q1D,B,G,BG); + + // Load XYZ components + MFEM_FOREACH_THREAD(dy,y,D1D) + { + MFEM_FOREACH_THREAD(dx,x,D1D) + { + for (int d = 0; d < SDIM; ++d) + { + XYZ[d][tidz][dx + dy*D1D] = X(dx,dy,d,e); + } + } + } + MFEM_SYNC_THREAD; + + ConstDeviceMatrix B_mat(BG[0], D1D, Q1D); + ConstDeviceMatrix G_mat(BG[1], D1D, Q1D); + + // x contraction + MFEM_FOREACH_THREAD(dy,y,D1D) + { + MFEM_FOREACH_THREAD(qx,x,Q1D) + { + for (int d = 0; d < SDIM; ++d) + { + double u = 0.0; + double v = 0.0; + for (int dx = 0; dx < D1D; ++dx) + { + const double xval = XYZ[d][tidz][dx + dy*D1D]; + u += xval * G_mat(dx,qx); + v += xval * B_mat(dx,qx); + } + DQ[d][tidz][dy + qx*D1D] = u; + DQ[3 + d][tidz][dy + qx*D1D] = v; + } + } + } + MFEM_SYNC_THREAD; + // y contraction and determinant computation + MFEM_FOREACH_THREAD(qy,y,Q1D) + { + MFEM_FOREACH_THREAD(qx,x,Q1D) + { + double J_[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + for (int d = 0; d < SDIM; ++d) + { + for (int dy = 0; dy < D1D; ++dy) + { + J_[d] += DQ[d][tidz][dy + qx*D1D] * B_mat(dy,qy); + J_[3 + d] += DQ[3 + d][tidz][dy + qx*D1D] * G_mat(dy,qy); + } + } + DeviceTensor<2> J(J_, 3, 2); + const double E = J(0,0)*J(0,0) + J(1,0)*J(1,0) + J(2,0)*J(2,0); + const double F = J(0,0)*J(0,1) + J(1,0)*J(1,1) + J(2,0)*J(2,1); + const double G = J(0,1)*J(0,1) + J(1,1)*J(1,1) + J(2,1)*J(2,1); + Y(qx,qy,e) = sqrt(E*G - F*F); + } + } + }); +} + template static void Det3D(const int NE, const double *b, const double *g, const double *x, double *y, - const int vdim = 1, const int d1d = 0, const int q1d = 0, Vector *d_buff = nullptr) // used only with SMEM = false @@ -231,7 +324,9 @@ void TensorDeterminants(const int NE, << " are not supported!"); MFEM_VERIFY(Q1D <= MQ, "Quadrature rules with more than " << MQ << " 1D points are not supported!"); - Det2D(NE,B,G,X,Y,vdim,D1D,Q1D); + if (vdim == 2) { Det2D(NE,B,G,X,Y,D1D,Q1D); } + else if (vdim == 3) { Det2DSurface(NE,B,G,X,Y,D1D,Q1D); } + else { MFEM_ABORT("Invalid space dimension."); } return; } } @@ -250,10 +345,10 @@ void TensorDeterminants(const int NE, const int MQ = DeviceDofQuadLimits::Get().MAX_DET_1D; // Highest orders that fit in shared memory if (D1D <= MD && Q1D <= MQ) - { return Det3D<0,0,true>(NE,B,G,X,Y,vdim,D1D,Q1D); } + { return Det3D<0,0,true>(NE,B,G,X,Y,D1D,Q1D); } // Last fall-back will use global memory return Det3D<0,0,false>( - NE,B,G,X,Y,vdim,D1D,Q1D,&d_buff); + NE,B,G,X,Y,D1D,Q1D,&d_buff); } } } diff --git a/fem/qinterp/dispatch.hpp b/fem/qinterp/dispatch.hpp index 4b076740e6..7e7c0ebfa7 100644 --- a/fem/qinterp/dispatch.hpp +++ b/fem/qinterp/dispatch.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/eval.hpp b/fem/qinterp/eval.hpp index 7611ec6461..cb17cddc0f 100644 --- a/fem/qinterp/eval.hpp +++ b/fem/qinterp/eval.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/eval_by_nodes.cpp b/fem/qinterp/eval_by_nodes.cpp index 6d218b75eb..baabf92f5e 100644 --- a/fem/qinterp/eval_by_nodes.cpp +++ b/fem/qinterp/eval_by_nodes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/eval_by_vdim.cpp b/fem/qinterp/eval_by_vdim.cpp index f2fd5d1cec..0b8b2d4b4c 100644 --- a/fem/qinterp/eval_by_vdim.cpp +++ b/fem/qinterp/eval_by_vdim.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/grad.hpp b/fem/qinterp/grad.hpp index 31d6deb898..368bb49a5f 100644 --- a/fem/qinterp/grad.hpp +++ b/fem/qinterp/grad.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/grad_by_nodes.cpp b/fem/qinterp/grad_by_nodes.cpp index f4dbbfd8ec..5fbc1e1cf8 100644 --- a/fem/qinterp/grad_by_nodes.cpp +++ b/fem/qinterp/grad_by_nodes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/grad_by_vdim.cpp b/fem/qinterp/grad_by_vdim.cpp index 24152ff450..3321b85415 100644 --- a/fem/qinterp/grad_by_vdim.cpp +++ b/fem/qinterp/grad_by_vdim.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/grad_phys_by_nodes.cpp b/fem/qinterp/grad_phys_by_nodes.cpp index 0c137e1907..282a8afcb1 100644 --- a/fem/qinterp/grad_phys_by_nodes.cpp +++ b/fem/qinterp/grad_phys_by_nodes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qinterp/grad_phys_by_vdim.cpp b/fem/qinterp/grad_phys_by_vdim.cpp index fcef744ec6..e0c723b24f 100644 --- a/fem/qinterp/grad_phys_by_vdim.cpp +++ b/fem/qinterp/grad_phys_by_vdim.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/qspace.cpp b/fem/qspace.cpp index 826017237b..937f8ac939 100644 --- a/fem/qspace.cpp +++ b/fem/qspace.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -10,6 +10,8 @@ // CONTRIBUTING.md for details. #include "qspace.hpp" +#include "qfunction.hpp" +#include "../general/forall.hpp" namespace mfem { @@ -35,6 +37,63 @@ void QuadratureSpaceBase::ConstructIntRules(int dim) } } +namespace +{ + +void ScaleByQuadratureWeights(Vector &weights, const IntegrationRule &ir) +{ + const int N = weights.Size(); + const int n = ir.Size(); + double *d_weights = weights.ReadWrite(); + const double *d_w = ir.GetWeights().Read(); + + mfem::forall(N, [=] MFEM_HOST_DEVICE (int i) + { + d_weights[i] *= d_w[i%n]; + }); +} + +} // anonymous namespace + +void QuadratureSpaceBase::ConstructWeights() const +{ + // First get the Jacobian determinants (without the quadrature weight + // contributions). We also store the pointer to the Vector object, so that + // we know when the cached weights are invalidated. + nodes_sequence = mesh.GetNodesSequence(); + weights = GetGeometricFactorWeights(); + + // Then scale by the quadrature weights. + const IntegrationRule &ir = GetIntRule(0); + ScaleByQuadratureWeights(weights, ir); +} + +const Vector &QuadratureSpaceBase::GetWeights() const +{ + if (GetNE() == 0) { return weights; } + if (weights.Size() == 0 || nodes_sequence != mesh.GetNodesSequence()) + { + ConstructWeights(); + } + return weights; +} + +double QuadratureSpaceBase::Integrate(Coefficient &coeff) const +{ + QuadratureFunction qf(const_cast(this)); + coeff.Project(qf); + return qf.Integrate(); +} + +void QuadratureSpaceBase::Integrate(VectorCoefficient &coeff, + Vector &integrals) const +{ + const int vdim = coeff.GetVDim(); + QuadratureFunction qf(const_cast(this), vdim); + coeff.Project(qf); + qf.Integrate(integrals); +} + void QuadratureSpace::ConstructOffsets() { const int num_elem = mesh.GetNE(); @@ -94,6 +153,17 @@ void QuadratureSpace::Save(std::ostream &os) const << "Order: " << order << '\n'; } +const Vector &QuadratureSpace::GetGeometricFactorWeights() const +{ + auto flags = GeometricFactors::DETERMINANTS; + // TODO: assumes only one integration rule. This should be fixed once + // Mesh::GetGeometricFactors acceps a QuadratureSpace instead of + // IntegrationRule. + const IntegrationRule &ir = GetIntRule(0); + auto *geom = mesh.GetGeometricFactors(ir, flags); + return geom->detJ; +} + FaceQuadratureSpace::FaceQuadratureSpace(Mesh &mesh_, int order_, FaceType face_type_) : QuadratureSpaceBase(mesh_, order_), @@ -191,4 +261,15 @@ void FaceQuadratureSpace::Save(std::ostream &os) const << "Order: " << order << '\n'; } +const Vector &FaceQuadratureSpace::GetGeometricFactorWeights() const +{ + auto flags = FaceGeometricFactors::DETERMINANTS; + // TODO: assumes only one integration rule. This should be fixed once + // Mesh::GetFaceGeometricFactors acceps a QuadratureSpace instead of + // IntegrationRule. + const IntegrationRule &ir = GetIntRule(0); + auto *geom = mesh.GetFaceGeometricFactors(ir, flags, face_type); + return geom->detJ; +} + } // namespace mfem diff --git a/fem/qspace.hpp b/fem/qspace.hpp index 7e4048ce21..57dcfe94d9 100644 --- a/fem/qspace.hpp +++ b/fem/qspace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -30,6 +30,8 @@ protected: Mesh &mesh; ///< The underlying mesh. int order; ///< The order of integration rule. int size; ///< Total number of quadrature points. + mutable Vector weights; ///< Integration weights. + mutable long nodes_sequence = 0; ///< Nodes counter for cache invalidation. /// @brief Entity quadrature point offset array, of size num_entities + 1. /// @@ -50,6 +52,12 @@ protected: /// Fill the @ref int_rule array for each geometry type using @ref order. void ConstructIntRules(int dim); + /// Compute the det(J) (volume or faces, depending on the type). + virtual const Vector &GetGeometricFactorWeights() const = 0; + + /// Compute the integration weights. + void ConstructWeights() const; + public: /// Return the total number of quadrature points. int GetSize() const { return size; } @@ -94,6 +102,15 @@ public: /// Write the QuadratureSpace to the stream @a out. virtual void Save(std::ostream &out) const = 0; + /// Return the integration weights (including geometric factors). + const Vector &GetWeights() const; + + /// Return the integral of the scalar Coefficient @a coeff. + double Integrate(Coefficient &coeff) const; + + /// Return the integral of the VectorCoefficient @a coeff in @a integrals. + void Integrate(VectorCoefficient &coeff, Vector &integrals) const; + virtual ~QuadratureSpaceBase() { } }; @@ -102,6 +119,7 @@ public: class QuadratureSpace : public QuadratureSpaceBase { protected: + const Vector &GetGeometricFactorWeights() const override; void ConstructOffsets(); void Construct(); public: @@ -159,6 +177,7 @@ class FaceQuadratureSpace : public QuadratureSpaceBase /// Inverse of the map @a face_indices. std::unordered_map face_indices_inv; + const Vector &GetGeometricFactorWeights() const override; void ConstructOffsets(); void Construct(); diff --git a/fem/quadinterpolator.cpp b/fem/quadinterpolator.cpp index 31c03a63a8..8314fdcfbd 100644 --- a/fem/quadinterpolator.cpp +++ b/fem/quadinterpolator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -168,7 +168,6 @@ static void Eval2D(const int NE, MFEM_ASSERT(!geom || geom->mesh->SpaceDimension() == 2, ""); MFEM_VERIFY(ND <= QI::MAX_ND2D, ""); MFEM_VERIFY(NQ <= QI::MAX_NQ2D, ""); - MFEM_VERIFY(VDIM == 2 || !(eval_flags & QI::DETERMINANTS), ""); MFEM_VERIFY(bool(geom) == bool(eval_flags & QI::PHYSICAL_DERIVATIVES), "'geom' must be given (non-null) only when evaluating physical" " derivatives"); @@ -277,11 +276,17 @@ static void Eval2D(const int NE, } } } - if (VDIM == 2 && (eval_flags & QI::DETERMINANTS)) + if (eval_flags & QI::DETERMINANTS) { - // The check (VDIM == 2) should eliminate this block when VDIM is - // known at compile time and (VDIM != 2). - det(q,e) = kernels::Det<2>(D); + if (VDIM == 2) { det(q,e) = kernels::Det<2>(D); } + else + { + DeviceTensor<2> j(D, 3, 2); + const double E = j(0,0)*j(0,0) + j(1,0)*j(1,0) + j(2,0)*j(2,0); + const double F = j(0,0)*j(0,1) + j(1,0)*j(1,1) + j(2,0)*j(2,1); + const double G = j(0,1)*j(0,1) + j(1,1)*j(1,1) + j(2,1)*j(2,1); + det(q,e) = sqrt(E*G - F*F); + } } } } @@ -471,6 +476,7 @@ void QuadratureInterpolator::Mult(const Vector &e_vec, const DofToQuad::Mode mode = use_tensor_eval ? DofToQuad::TENSOR : DofToQuad::FULL; const DofToQuad &maps = fe->GetDofToQuad(*ir, mode); + const int dim = maps.FE->GetDim(); const GeometricFactors *geom = nullptr; if (eval_flags & PHYSICAL_DERIVATIVES) { @@ -478,6 +484,8 @@ void QuadratureInterpolator::Mult(const Vector &e_vec, geom = fespace->GetMesh()->GetGeometricFactors(*ir, jacobians); } + MFEM_ASSERT(!(eval_flags & DETERMINANTS) || dim == vdim || + (dim == 2 && vdim == 3), "Invalid dimensions for determinants."); MFEM_ASSERT(fespace->GetMesh()->GetNumGeometries( fespace->GetMesh()->Dimension()) == 1, "mixed meshes are not supported"); @@ -529,7 +537,6 @@ void QuadratureInterpolator::Mult(const Vector &e_vec, { const int nd = maps.ndof; const int nq = maps.nqpt; - const int dim = maps.FE->GetDim(); void (*mult)(const int NE, const int vdim, diff --git a/fem/quadinterpolator.hpp b/fem/quadinterpolator.hpp index 513bd4495b..6672ee2f1c 100644 --- a/fem/quadinterpolator.hpp +++ b/fem/quadinterpolator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/quadinterpolator_face.cpp b/fem/quadinterpolator_face.cpp index b6b2e71e16..9decd0694f 100644 --- a/fem/quadinterpolator_face.cpp +++ b/fem/quadinterpolator_face.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/quadinterpolator_face.hpp b/fem/quadinterpolator_face.hpp index bbf3564d04..307076db9b 100644 --- a/fem/quadinterpolator_face.hpp +++ b/fem/quadinterpolator_face.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/restriction.cpp b/fem/restriction.cpp index da4eab5fac..25e06a06b9 100644 --- a/fem/restriction.cpp +++ b/fem/restriction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -360,6 +360,10 @@ int ElementRestriction::FillI(SparseMatrix &mat) const const int j_offset = d_offsets[j_L]; const int j_next_offset = d_offsets[j_L+1]; const int j_nbElts = j_next_offset - j_offset; + MFEM_ASSERT_KERNEL( + j_nbElts <= Max, + "The connectivity of this mesh is beyond the max, increase the " + "MaxNbNbr variable to comply with your mesh."); if (i_nbElts == 1 || j_nbElts == 1) // no assembly required { GetAndIncrementNnzIndex(i_L, I); diff --git a/fem/restriction.hpp b/fem/restriction.hpp index 6ee367cde3..023fb5bb4d 100644 --- a/fem/restriction.hpp +++ b/fem/restriction.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/sidredatacollection.cpp b/fem/sidredatacollection.cpp index e2350b84cc..a90cbdb5ca 100644 --- a/fem/sidredatacollection.cpp +++ b/fem/sidredatacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/sidredatacollection.hpp b/fem/sidredatacollection.hpp index 4ddbac9320..217f076d68 100644 --- a/fem/sidredatacollection.hpp +++ b/fem/sidredatacollection.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/staticcond.cpp b/fem/staticcond.cpp index e9640af9cc..c7432f6220 100644 --- a/fem/staticcond.cpp +++ b/fem/staticcond.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/staticcond.hpp b/fem/staticcond.hpp index 99946ab485..fde042b10a 100644 --- a/fem/staticcond.hpp +++ b/fem/staticcond.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -36,32 +36,32 @@ namespace mfem (associated with the element boundaries) are interfacial. In block form the matrix of the system can be written as - \f[ A = + $$ A = \begin{pmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{pmatrix} \begin{array}{l} - \text{-- groups: element interior/private DOFs} \\ - \text{-- interface: element boundary/exposed DOFs} - \end{array} \f] - where the block \f$ A_1 \f$ is itself block diagonal with small local blocks + \text{- groups: element interior/private DOFs} \\ + \text{- interface: element boundary/exposed DOFs} + \end{array} $$ + where the block $ A_1 $ is itself block diagonal with small local blocks and it is, therefore, easily invertible. Starting with the block system - \f[ \begin{pmatrix} + $$ \begin{pmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{pmatrix} \begin{pmatrix} X_1 \\ X_2 \end{pmatrix} = - \begin{pmatrix} B_1 \\ B_2 \end{pmatrix} \f] + \begin{pmatrix} B_1 \\ B_2 \end{pmatrix} $$ the reduced, statically condensed system is given by - \f[ S_{22} X_2 = B_2 - A_{21} A_{11}^{-1} B_1 \f] - where the Schur complement matrix \f$ S_{22} \f$ is given by - \f[ S_{22} = A_{22} - A_{21} A_{11}^{-1} A_{12}. \f] - After solving the Schur complement system, the \f$ X_1 \f$ part of the + $$ S_{22} X_2 = B_2 - A_{21} A_{11}^{-1} B_1 $$ + where the Schur complement matrix $ S_{22} $ is given by + $$ S_{22} = A_{22} - A_{21} A_{11}^{-1} A_{12}. $$ + After solving the Schur complement system, the $ X_1 $ part of the solution can be recovered using the formula - \f[ X_1 = A_{11}^{-1} ( B_1 - A_{12} X_2 ). \f] */ + $$ X_1 = A_{11}^{-1} ( B_1 - A_{12} X_2 ). $$ */ class StaticCondensation { FiniteElementSpace *fes, *tr_fes; diff --git a/fem/tbilinearform.hpp b/fem/tbilinearform.hpp index e789121067..5d6aa4b3bf 100644 --- a/fem/tbilinearform.hpp +++ b/fem/tbilinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tbilininteg.hpp b/fem/tbilininteg.hpp index 4063c03625..89df119f00 100644 --- a/fem/tbilininteg.hpp +++ b/fem/tbilininteg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tcoefficient.hpp b/fem/tcoefficient.hpp index 8b6c4d2c5b..893c866555 100644 --- a/fem/tcoefficient.hpp +++ b/fem/tcoefficient.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/teltrans.hpp b/fem/teltrans.hpp index 2eefb4c202..0f3ee37c06 100644 --- a/fem/teltrans.hpp +++ b/fem/teltrans.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tevaluator.hpp b/fem/tevaluator.hpp index 745b5dea23..2a4857487f 100644 --- a/fem/tevaluator.hpp +++ b/fem/tevaluator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tfe.hpp b/fem/tfe.hpp index 0617d916ef..70ecc9d50b 100644 --- a/fem/tfe.hpp +++ b/fem/tfe.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -24,9 +24,9 @@ namespace mfem element. For tensor product evaluation, this is only called on the 1D reference element, and higher dimensions are put together from that. - The element mass matrix can be written \f$ M_E = B^T D_E B \f$ where the B + The element mass matrix can be written $ M_E = B^T D_E B $ where the B built here is the B, and is unchanging across the mesh. The diagonal matrix - \f$ D_E \f$ then contains all the element-specific geometry and physics data. + $ D_E $ then contains all the element-specific geometry and physics data. @param fe the element we are calculating on @param ir the integration rule to calculate the shape matrix on @param B must be (nip x dof) with column major storage @@ -58,12 +58,12 @@ void CalcShapeMatrix(const FiniteElement &fe, const IntegrationRule &ir, For tensor product evaluation, this is only called on the 1D reference element, and higher dimensions are put together from that. The element stiffness matrix can be written - \f[ + $$ S_E = \sum_{k=1}^{nq} G_{k,i}^T (D_E^G)_{k,k} G_{k,j} - \f] - where \f$ nq \f$ is the number of quadrature points, \f$ D_E^G \f$ contains + $$ + where $ nq $ is the number of quadrature points, $ D_E^G $ contains all the information about the element geometry and coefficients (Jacobians - etc.), and \f$ G \f$ is the matrix built in this routine, which is the same + etc.), and $ G $ is the matrix built in this routine, which is the same for all elements in a mesh. @param fe the element we are calculating on @param ir the integration rule to calculate the gradients on diff --git a/fem/tfespace.hpp b/fem/tfespace.hpp index 359accb570..e04fefc0b7 100644 --- a/fem/tfespace.hpp +++ b/fem/tfespace.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tintrules.hpp b/fem/tintrules.hpp index c602de56dd..40d1578f19 100644 --- a/fem/tintrules.hpp +++ b/fem/tintrules.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop.cpp b/fem/tmop.cpp index 35780c29f2..9e44e8e6de 100644 --- a/fem/tmop.cpp +++ b/fem/tmop.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop.hpp b/fem/tmop.hpp index 8547756aed..80f6ce2a89 100644 --- a/fem/tmop.hpp +++ b/fem/tmop.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1730,7 +1730,7 @@ class TMOPNewtonSolver; /** @brief A TMOP integrator class based on any given TMOP_QualityMetric and TargetConstructor. - Represents @f$ \int W(Jpt) dx @f$ over a target zone, where W is the + Represents $ \int W(Jpt) dx $ over a target zone, where W is the metric's strain energy density function, and Jpt is the Jacobian of the target->physical coordinates transformation. The virtual target zone is defined by the TargetConstructor. */ @@ -2038,7 +2038,7 @@ public: /// Sets a scaling Coefficient for the quality metric term of the integrator. /** With this addition, the integrator becomes - @f$ \int w1 W(Jpt) dx @f$. + $ \int w1 W(Jpt) dx $. Note that the Coefficient is evaluated in the physical configuration and not in the target configuration which may be undefined. */ @@ -2046,7 +2046,7 @@ public: /** @brief Limiting of the mesh displacements (general version). - Adds the term @f$ \int w_0 f(x, x_0, d) dx @f$, where f is a measure of + Adds the term $ \int w_0 f(x, x_0, d) dx $, where f is a measure of the displacement between x and x_0, given the max allowed displacement d. @param[in] n0 Original mesh node coordinates (x0 above). @@ -2065,7 +2065,7 @@ public: /** @brief Restriction of the node positions to certain regions. - Adds the term @f$ \int c (z(x) - z_0(x_0))^2 @f$, where z0(x0) is a given + Adds the term $ \int c (z(x) - z_0(x_0))^2 $, where z0(x0) is a given function on the starting mesh, and z(x) is its image on the new mesh. Minimizing this term means that a node at x0 is allowed to move to a position x(x0) only if z(x) ~ z0(x0). @@ -2087,8 +2087,8 @@ public: Having a level set function s0(x0) on the starting mesh, and a set of marked nodes (or DOFs), we move these nodes to the zero level set of s0. If s(x) is the image of s0(x0) on the current mesh, this function adds to - the TMOP functional the term @f$ \int c \bar{s}(x))^2 @f$, where - @f$\bar{s}(x)@f$ is the restriction of s(x) on the aligned DOFs. + the TMOP functional the term $ \int c \bar{s}(x))^2 $, where + $\bar{s}(x)$ is the restriction of s(x) on the aligned DOFs. Minimizing this term means that a marked node at x0 is allowed to move to a position x(x0) only if s(x) ~ 0. Such term can be used for surface fitting and tangential relaxation. @@ -2146,8 +2146,8 @@ public: physical space x_t, we move these nodes to the target positions during the optimization process. This function adds to the TMOP functional the term - @f$ \sum_{i \in S} c \frac{1}{2} (x_i - x_{t,i})^2 @f$, - where @f$c@f$ corresponds to @a coeff below and is evaluated at the + $ \sum_{i \in S} c \frac{1}{2} (x_i - x_{t,i})^2 $, + where $c$ corresponds to @a coeff below and is evaluated at the DOF locations. @param[in] pos The desired positions for the mesh nodes. diff --git a/fem/tmop/tmop_pa.cpp b/fem/tmop/tmop_pa.cpp index ee3f2b8e28..5dc3ed66c7 100644 --- a/fem/tmop/tmop_pa.cpp +++ b/fem/tmop/tmop_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa.hpp b/fem/tmop/tmop_pa.hpp index 70cf6a5ffd..d27ce9c3d0 100644 --- a/fem/tmop/tmop_pa.hpp +++ b/fem/tmop/tmop_pa.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_da3.cpp b/fem/tmop/tmop_pa_da3.cpp index bba902ff01..17b801ac2e 100644 --- a/fem/tmop/tmop_pa_da3.cpp +++ b/fem/tmop/tmop_pa_da3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2d.cpp b/fem/tmop/tmop_pa_h2d.cpp index 353ef368a4..3430db070c 100644 --- a/fem/tmop/tmop_pa_h2d.cpp +++ b/fem/tmop/tmop_pa_h2d.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2d_c0.cpp b/fem/tmop/tmop_pa_h2d_c0.cpp index 5556f9d5de..3e7e48db50 100644 --- a/fem/tmop/tmop_pa_h2d_c0.cpp +++ b/fem/tmop/tmop_pa_h2d_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2m.cpp b/fem/tmop/tmop_pa_h2m.cpp index f96d2b54b8..61ec741dae 100644 --- a/fem/tmop/tmop_pa_h2m.cpp +++ b/fem/tmop/tmop_pa_h2m.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2m_c0.cpp b/fem/tmop/tmop_pa_h2m_c0.cpp index be405fba33..583bca8ef9 100644 --- a/fem/tmop/tmop_pa_h2m_c0.cpp +++ b/fem/tmop/tmop_pa_h2m_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2s.cpp b/fem/tmop/tmop_pa_h2s.cpp index cfdc7fcb04..8e9593ab34 100644 --- a/fem/tmop/tmop_pa_h2s.cpp +++ b/fem/tmop/tmop_pa_h2s.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h2s_c0.cpp b/fem/tmop/tmop_pa_h2s_c0.cpp index 95cffbf6e1..20a462c416 100644 --- a/fem/tmop/tmop_pa_h2s_c0.cpp +++ b/fem/tmop/tmop_pa_h2s_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3d.cpp b/fem/tmop/tmop_pa_h3d.cpp index 85c8220e51..3c47eed524 100644 --- a/fem/tmop/tmop_pa_h3d.cpp +++ b/fem/tmop/tmop_pa_h3d.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3d_c0.cpp b/fem/tmop/tmop_pa_h3d_c0.cpp index 0a6460f213..f3a8880761 100644 --- a/fem/tmop/tmop_pa_h3d_c0.cpp +++ b/fem/tmop/tmop_pa_h3d_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3m.cpp b/fem/tmop/tmop_pa_h3m.cpp index 334bb1e844..21db1a3453 100644 --- a/fem/tmop/tmop_pa_h3m.cpp +++ b/fem/tmop/tmop_pa_h3m.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3m_c0.cpp b/fem/tmop/tmop_pa_h3m_c0.cpp index ba966c9193..d60f8bd417 100644 --- a/fem/tmop/tmop_pa_h3m_c0.cpp +++ b/fem/tmop/tmop_pa_h3m_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3s.cpp b/fem/tmop/tmop_pa_h3s.cpp index 10629cf49b..4259fdd645 100644 --- a/fem/tmop/tmop_pa_h3s.cpp +++ b/fem/tmop/tmop_pa_h3s.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_h3s_c0.cpp b/fem/tmop/tmop_pa_h3s_c0.cpp index dfa8ebee21..f7cc1fb09f 100644 --- a/fem/tmop/tmop_pa_h3s_c0.cpp +++ b/fem/tmop/tmop_pa_h3s_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_jp2.cpp b/fem/tmop/tmop_pa_jp2.cpp index 7b26141d58..a0a65c8f01 100644 --- a/fem/tmop/tmop_pa_jp2.cpp +++ b/fem/tmop/tmop_pa_jp2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_jp3.cpp b/fem/tmop/tmop_pa_jp3.cpp index a122dcedd5..a55d8dce30 100644 --- a/fem/tmop/tmop_pa_jp3.cpp +++ b/fem/tmop/tmop_pa_jp3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_p2.cpp b/fem/tmop/tmop_pa_p2.cpp index 609c60707e..02718b0833 100644 --- a/fem/tmop/tmop_pa_p2.cpp +++ b/fem/tmop/tmop_pa_p2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_p2_c0.cpp b/fem/tmop/tmop_pa_p2_c0.cpp index cd161cce97..643cb62929 100644 --- a/fem/tmop/tmop_pa_p2_c0.cpp +++ b/fem/tmop/tmop_pa_p2_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_p3.cpp b/fem/tmop/tmop_pa_p3.cpp index f950cb95b6..a013f990f6 100644 --- a/fem/tmop/tmop_pa_p3.cpp +++ b/fem/tmop/tmop_pa_p3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_p3_c0.cpp b/fem/tmop/tmop_pa_p3_c0.cpp index 744ab77c6f..71fe0e4550 100644 --- a/fem/tmop/tmop_pa_p3_c0.cpp +++ b/fem/tmop/tmop_pa_p3_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_tc2.cpp b/fem/tmop/tmop_pa_tc2.cpp index 6badb139ae..0d81a24838 100644 --- a/fem/tmop/tmop_pa_tc2.cpp +++ b/fem/tmop/tmop_pa_tc2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_tc3.cpp b/fem/tmop/tmop_pa_tc3.cpp index 3e2cd1a6c2..783f39cfa1 100644 --- a/fem/tmop/tmop_pa_tc3.cpp +++ b/fem/tmop/tmop_pa_tc3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_w2.cpp b/fem/tmop/tmop_pa_w2.cpp index 7a22058f90..5f8feb3cf9 100644 --- a/fem/tmop/tmop_pa_w2.cpp +++ b/fem/tmop/tmop_pa_w2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_w2_c0.cpp b/fem/tmop/tmop_pa_w2_c0.cpp index a270de8a88..72a0e185e2 100644 --- a/fem/tmop/tmop_pa_w2_c0.cpp +++ b/fem/tmop/tmop_pa_w2_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_w3.cpp b/fem/tmop/tmop_pa_w3.cpp index 14dd0ba075..a483bf5a26 100644 --- a/fem/tmop/tmop_pa_w3.cpp +++ b/fem/tmop/tmop_pa_w3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop/tmop_pa_w3_c0.cpp b/fem/tmop/tmop_pa_w3_c0.cpp index 9f464fa19a..39e446cc86 100644 --- a/fem/tmop/tmop_pa_w3_c0.cpp +++ b/fem/tmop/tmop_pa_w3_c0.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop_amr.cpp b/fem/tmop_amr.cpp index 8ec3685daf..563cdfa29a 100644 --- a/fem/tmop_amr.cpp +++ b/fem/tmop_amr.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop_amr.hpp b/fem/tmop_amr.hpp index 17f4968386..8dd86de643 100644 --- a/fem/tmop_amr.hpp +++ b/fem/tmop_amr.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop_tools.cpp b/fem/tmop_tools.cpp index 2ee2e1c038..0d1c803864 100644 --- a/fem/tmop_tools.cpp +++ b/fem/tmop_tools.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/tmop_tools.hpp b/fem/tmop_tools.hpp index 062be361b9..e2c80ad68b 100644 --- a/fem/tmop_tools.hpp +++ b/fem/tmop_tools.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/fem/transfer.cpp b/fem/transfer.cpp index 7c08f5efff..a1eee41db9 100644 --- a/fem/transfer.cpp +++ b/fem/transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1420,14 +1420,20 @@ void Prolongation2D(const int NE, const int D1D, const int Q1D, const Array& B, const Vector& mask) { auto x_ = Reshape(localL.Read(), D1D, D1D, NE); - auto y_ = Reshape(localH.ReadWrite(), Q1D, Q1D, NE); + auto y_ = Reshape(localH.Write(), Q1D, Q1D, NE); auto B_ = Reshape(B.Read(), Q1D, D1D); auto m_ = Reshape(mask.Read(), Q1D, Q1D, NE); - localH = 0.0; - mfem::forall(NE, [=] MFEM_HOST_DEVICE (int e) { + for (int qy = 0; qy < Q1D; ++qy) + { + for (int qx = 0; qx < Q1D; ++qx) + { + y_(qx, qy, e) = 0.0; + } + } + for (int dy = 0; dy < D1D; ++dy) { double sol_x[DofQuadLimits::MAX_Q1D]; @@ -1467,14 +1473,23 @@ void Prolongation3D(const int NE, const int D1D, const int Q1D, const Array& B, const Vector& mask) { auto x_ = Reshape(localL.Read(), D1D, D1D, D1D, NE); - auto y_ = Reshape(localH.ReadWrite(), Q1D, Q1D, Q1D, NE); + auto y_ = Reshape(localH.Write(), Q1D, Q1D, Q1D, NE); auto B_ = Reshape(B.Read(), Q1D, D1D); auto m_ = Reshape(mask.Read(), Q1D, Q1D, Q1D, NE); - localH = 0.0; - mfem::forall(NE, [=] MFEM_HOST_DEVICE (int e) { + for (int qz = 0; qz < Q1D; ++qz) + { + for (int qy = 0; qy < Q1D; ++qy) + { + for (int qx = 0; qx < Q1D; ++qx) + { + y_(qx, qy, qz, e) = 0.0; + } + } + } + for (int dz = 0; dz < D1D; ++dz) { double sol_xy[DofQuadLimits::MAX_Q1D][DofQuadLimits::MAX_Q1D]; @@ -1539,14 +1554,20 @@ void Restriction2D(const int NE, const int D1D, const int Q1D, const Array& Bt, const Vector& mask) { auto x_ = Reshape(localH.Read(), Q1D, Q1D, NE); - auto y_ = Reshape(localL.ReadWrite(), D1D, D1D, NE); + auto y_ = Reshape(localL.Write(), D1D, D1D, NE); auto Bt_ = Reshape(Bt.Read(), D1D, Q1D); auto m_ = Reshape(mask.Read(), Q1D, Q1D, NE); - localL = 0.0; - mfem::forall(NE, [=] MFEM_HOST_DEVICE (int e) { + for (int dy = 0; dy < D1D; ++dy) + { + for (int dx = 0; dx < D1D; ++dx) + { + y_(dx, dy, e) = 0.0; + } + } + for (int qy = 0; qy < Q1D; ++qy) { double sol_x[DofQuadLimits::MAX_D1D]; @@ -1578,14 +1599,23 @@ void Restriction3D(const int NE, const int D1D, const int Q1D, const Array& Bt, const Vector& mask) { auto x_ = Reshape(localH.Read(), Q1D, Q1D, Q1D, NE); - auto y_ = Reshape(localL.ReadWrite(), D1D, D1D, D1D, NE); + auto y_ = Reshape(localL.Write(), D1D, D1D, D1D, NE); auto Bt_ = Reshape(Bt.Read(), D1D, Q1D); auto m_ = Reshape(mask.Read(), Q1D, Q1D, Q1D, NE); - localL = 0.0; - mfem::forall(NE, [=] MFEM_HOST_DEVICE (int e) { + for (int dz = 0; dz < D1D; ++dz) + { + for (int dy = 0; dy < D1D; ++dy) + { + for (int dx = 0; dx < D1D; ++dx) + { + y_(dx, dy, dz, e) = 0.0; + } + } + } + for (int qz = 0; qz < Q1D; ++qz) { double sol_xy[DofQuadLimits::MAX_D1D][DofQuadLimits::MAX_D1D]; diff --git a/fem/transfer.hpp b/fem/transfer.hpp index 553f037cc6..10e3a3de3b 100644 --- a/fem/transfer.hpp +++ b/fem/transfer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/CMakeLists.txt b/general/CMakeLists.txt index 3c8006fbb1..278b323cc9 100644 --- a/general/CMakeLists.txt +++ b/general/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/general/adios2stream.cpp b/general/adios2stream.cpp index c8560ba97d..929525f1b2 100644 --- a/general/adios2stream.cpp +++ b/general/adios2stream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/adios2stream.hpp b/general/adios2stream.hpp index aae63dfc3e..1e21c85776 100644 --- a/general/adios2stream.hpp +++ b/general/adios2stream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/annotation.hpp b/general/annotation.hpp index adb7dd1897..7988a5d251 100644 --- a/general/annotation.hpp +++ b/general/annotation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/array.cpp b/general/array.cpp index 12c3e3c06f..4ccf73ba4a 100644 --- a/general/array.cpp +++ b/general/array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/array.hpp b/general/array.hpp index e85a6b71e3..c878a7c483 100644 --- a/general/array.hpp +++ b/general/array.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/backends.hpp b/general/backends.hpp index 4a16f6b593..35680a5784 100644 --- a/general/backends.hpp +++ b/general/backends.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/binaryio.cpp b/general/binaryio.cpp index 86bff72743..448243f52e 100644 --- a/general/binaryio.cpp +++ b/general/binaryio.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/binaryio.hpp b/general/binaryio.hpp index f428d1d7db..d7a3873dc8 100644 --- a/general/binaryio.hpp +++ b/general/binaryio.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/communication.cpp b/general/communication.cpp index 0c2fffc1fd..840d1e39c8 100644 --- a/general/communication.cpp +++ b/general/communication.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/communication.hpp b/general/communication.hpp index 8638202bef..389f4689fd 100644 --- a/general/communication.hpp +++ b/general/communication.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/cuda.cpp b/general/cuda.cpp index d183f1c077..12b743e809 100644 --- a/general/cuda.cpp +++ b/general/cuda.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/cuda.hpp b/general/cuda.hpp index 5ec67adb59..d71d738aa0 100644 --- a/general/cuda.hpp +++ b/general/cuda.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/device.cpp b/general/device.cpp index ccee71cd7d..b239eea598 100644 --- a/general/device.cpp +++ b/general/device.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/device.hpp b/general/device.hpp index baa27397fe..5e236430b1 100644 --- a/general/device.hpp +++ b/general/device.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/enzyme.hpp b/general/enzyme.hpp index fd480841c1..fa59b015b0 100644 --- a/general/enzyme.hpp +++ b/general/enzyme.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/error.cpp b/general/error.cpp index 5271337690..527164ceaa 100644 --- a/general/error.cpp +++ b/general/error.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/error.hpp b/general/error.hpp index 80cc1e10cd..d4f7531b21 100644 --- a/general/error.hpp +++ b/general/error.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/forall.hpp b/general/forall.hpp index fec5afde4e..f635c68e6e 100644 --- a/general/forall.hpp +++ b/general/forall.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/gecko.cpp b/general/gecko.cpp index 0bd8c442ae..eeae34d608 100644 --- a/general/gecko.cpp +++ b/general/gecko.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/gecko.hpp b/general/gecko.hpp index b60f04bd67..cff5976f08 100644 --- a/general/gecko.hpp +++ b/general/gecko.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/globals.cpp b/general/globals.cpp index 51a161d5e7..d589af64e8 100644 --- a/general/globals.cpp +++ b/general/globals.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/globals.hpp b/general/globals.hpp index ccf0e3722a..13eb2ed5bc 100644 --- a/general/globals.hpp +++ b/general/globals.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/hash.cpp b/general/hash.cpp index 5159b1d26e..2257f67941 100644 --- a/general/hash.cpp +++ b/general/hash.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/hash.hpp b/general/hash.hpp index b517172aa9..73c8be2392 100644 --- a/general/hash.hpp +++ b/general/hash.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/hip.cpp b/general/hip.cpp index d92aeb1e25..5a5396bfd8 100644 --- a/general/hip.cpp +++ b/general/hip.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/hip.hpp b/general/hip.hpp index e37f36a70b..7f32a4c79a 100644 --- a/general/hip.hpp +++ b/general/hip.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/isockstream.cpp b/general/isockstream.cpp index b3208d5e1b..55d9c601a9 100644 --- a/general/isockstream.cpp +++ b/general/isockstream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/isockstream.hpp b/general/isockstream.hpp index f26167a744..4cc141fe39 100644 --- a/general/isockstream.hpp +++ b/general/isockstream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/kdtree.hpp b/general/kdtree.hpp index b11248ea2e..1c643412ef 100644 --- a/general/kdtree.hpp +++ b/general/kdtree.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/mem_alloc.hpp b/general/mem_alloc.hpp index cdfe0adc5f..b5cd60713b 100644 --- a/general/mem_alloc.hpp +++ b/general/mem_alloc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/mem_manager.cpp b/general/mem_manager.cpp index acb54d2083..3315eeaf86 100644 --- a/general/mem_manager.cpp +++ b/general/mem_manager.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/mem_manager.hpp b/general/mem_manager.hpp index c7c1a23d2f..c5fed95a00 100644 --- a/general/mem_manager.hpp +++ b/general/mem_manager.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/occa.cpp b/general/occa.cpp index 5c96ee6f87..6af9731ef9 100644 --- a/general/occa.cpp +++ b/general/occa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/occa.hpp b/general/occa.hpp index 9bdbea1f2f..f46f3bab89 100644 --- a/general/occa.hpp +++ b/general/occa.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/optparser.cpp b/general/optparser.cpp index a598548994..58005f1247 100644 --- a/general/optparser.cpp +++ b/general/optparser.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/optparser.hpp b/general/optparser.hpp index eecf0f74a6..916915fecc 100644 --- a/general/optparser.hpp +++ b/general/optparser.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/osockstream.cpp b/general/osockstream.cpp index 95d12a19bd..795849923e 100644 --- a/general/osockstream.cpp +++ b/general/osockstream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/osockstream.hpp b/general/osockstream.hpp index ae5de7ea54..57d2e297f3 100644 --- a/general/osockstream.hpp +++ b/general/osockstream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/sets.cpp b/general/sets.cpp index 24dbaa405a..14fd109557 100644 --- a/general/sets.cpp +++ b/general/sets.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/sets.hpp b/general/sets.hpp index a5cbdf4e25..86fe2bf31d 100644 --- a/general/sets.hpp +++ b/general/sets.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/socketstream.cpp b/general/socketstream.cpp index fdaf8a8aec..b92440c329 100644 --- a/general/socketstream.cpp +++ b/general/socketstream.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/socketstream.hpp b/general/socketstream.hpp index 8f53efae3a..2b2a683ac6 100644 --- a/general/socketstream.hpp +++ b/general/socketstream.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/sort_pairs.hpp b/general/sort_pairs.hpp index 3118563c18..c4fe2ee459 100644 --- a/general/sort_pairs.hpp +++ b/general/sort_pairs.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/stable3d.cpp b/general/stable3d.cpp index 6981b00a32..40f91432ed 100644 --- a/general/stable3d.cpp +++ b/general/stable3d.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/stable3d.hpp b/general/stable3d.hpp index 6f122eeeef..18d02784c8 100644 --- a/general/stable3d.hpp +++ b/general/stable3d.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/table.cpp b/general/table.cpp index e788c7b3aa..a9ddbf1999 100644 --- a/general/table.cpp +++ b/general/table.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/table.hpp b/general/table.hpp index 2ed9f4a1bc..6f90e95bfb 100644 --- a/general/table.hpp +++ b/general/table.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/tassign.hpp b/general/tassign.hpp index 013661f6fe..1a6fd6a608 100644 --- a/general/tassign.hpp +++ b/general/tassign.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/text.hpp b/general/text.hpp index f7003afbb9..8907391b16 100644 --- a/general/text.hpp +++ b/general/text.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/tic_toc.cpp b/general/tic_toc.cpp index 986b8559d5..d99a92d7ad 100644 --- a/general/tic_toc.cpp +++ b/general/tic_toc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/tic_toc.hpp b/general/tic_toc.hpp index 36b50f1a75..3ab166e9d5 100644 --- a/general/tic_toc.hpp +++ b/general/tic_toc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/version.cpp b/general/version.cpp index d2b05f8edd..131b90f134 100644 --- a/general/version.cpp +++ b/general/version.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/general/version.hpp b/general/version.hpp index d4e81b05f8..8ddaa7d01a 100644 --- a/general/version.hpp +++ b/general/version.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/CMakeLists.txt b/linalg/CMakeLists.txt index c257e5133a..de5ccb5025 100644 --- a/linalg/CMakeLists.txt +++ b/linalg/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/linalg/amgxsolver.cpp b/linalg/amgxsolver.cpp index 124e2c25ea..d867e66aec 100644 --- a/linalg/amgxsolver.cpp +++ b/linalg/amgxsolver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/amgxsolver.hpp b/linalg/amgxsolver.hpp index b88c333b11..315f8c4155 100644 --- a/linalg/amgxsolver.hpp +++ b/linalg/amgxsolver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -28,7 +28,7 @@ namespace mfem { -/** +/** @brief MFEM wrapper for Nvidia's multigrid library, AmgX (github.com/NVIDIA/AMGX) AmgX requires building MFEM with CUDA, and AMGX enabled. For distributed @@ -71,85 +71,122 @@ class AmgXSolver : public Solver public: /// Flags to configure AmgXSolver as a solver or preconditioner - enum AMGX_MODE {SOLVER, PRECONDITIONER}; + enum AMGX_MODE + { + /// Use the preconditioned conjugate gradient method with the AMG + /// V-cycle used as a proconditioner. With the default configuration + /// a block Jacobi smoother is used. + SOLVER, + /// Directly apply iterations of the AMG V cycle to the matrix + /// With the default configuration this will be 2 iterations + /// with block Jacobi smoother. + PRECONDITIONER + }; /// Flag to check for convergence bool ConvergenceCheck; - /** + /** @brief Flags to determine whether user solver settings are defined internally in the source code or will be read through an external JSON file. */ - enum CONFIG_SRC {INTERNAL, EXTERNAL, UNDEFINED}; + enum CONFIG_SRC + { + /// Configuration will be read directly from a string + INTERNAL, + /// Configure will be read from a specified file + EXTERNAL, + UNDEFINED + }; AmgXSolver(); - /** + /** @brief Configures AmgX with a default configuration based on the AmgX mode, and - verbosity. Assumes no MPI parallism. + verbosity. Assumes no MPI parallelism. */ AmgXSolver(const AMGX_MODE amgxMode_, const bool verbose); - /** - Once the solver configuration has been established through either the - ReadParameters method or the constructor, InitSerial will initialize the - library. If configuring with constructor, the constructor will make this - call. + /** @brief Initialize the AmgX library for serial execution once + the solver configuration has been established through either the + AmgXSolver::ReadParameters method or the constructor. The constructor + will make this call. */ void InitSerial(); #ifdef MFEM_USE_MPI - /** - Configures AmgX with a default configuration based on the AmgX mode, and - verbosity. Pairs each MPI rank with one GPU. + /** @brief + Configures AmgX with a default configuration based on the AMGX_MODE + (AmgXSolver::SOLVER, AmgXSolver::PRECONDITIONER) + and verbosity. Pairs each MPI rank with one GPU. */ - AmgXSolver(const MPI_Comm &comm, const AMGX_MODE amgxMode_, const bool verbose); + AmgXSolver(const MPI_Comm &comm, const AMGX_MODE amgxMode_, + const bool verbose); - /** - Configures AmgX with a default configuration based on the AmgX mode, and - verbosity. Creates MPI teams around GPUs to support MPI ranks > + /** @brief + Configures AmgX with a default configuration based on the AMGX_MODE + (AmgXSolver::SOLVER, AmgXSolver::PRECONDITIONER) + and verbosity. Creates MPI teams around GPUs to support more ranks than GPUs. Consolidates linear solver data to avoid multiple ranks sharing - GPUs. Requires specifying number of devices in each compute node. + GPUs. Requires specifying the number of devices in each compute node as + @a nDevs. */ AmgXSolver(const MPI_Comm &comm, const int nDevs, const AMGX_MODE amgx_Mode_, const bool verbose); - /** - Once the solver configuration has been established, either through the - constructor or the ReadParameters method, InitSerial will initialize the - library. If configuring with constructor, the constructor will make this - call. + /** @brief Initialize the AmgX library in parallel mode with exactly one + GPU per rank after the solver configuration has been established, + either through the constructor or the AmgXSolver::ReadParameters + method. If configuring with a constructor, the constructor will make + this call. */ void InitExclusiveGPU(const MPI_Comm &comm); - /** - Once the solver configuration has been established, either through the - ReadParameters method, InitMPITeams will initialize the library and create - MPI teams based on the number of devices on each node (nDevs). If - configuring with constructor, the constructor will make this call. + /** @brief Initialize the AmgX library and create MPI teams based on the + number of devices on each node @a nDevs. If configuring with a + constructor, the constructor will make this call, otherwise this will need + to be called after the solver configuration has been established through + the AmgXSolver::ReadParameters call. */ void InitMPITeams(const MPI_Comm &comm, const int nDevs); #endif - /** - Sets Operator for AmgX library, either MFEM SparseMatrix or HypreParMatrix + /** @brief Sets the Operator that is going to be solved via AmgX. + Supports operators based on either an MFEM SparseMatrix or + HypreParMatrix. */ virtual void SetOperator(const Operator &op); - /** - Replaces the matrix coefficients in the AmgX solver. + /** @brief Change the input operator that is being solved via AmgX. + Supports operators based on either an MFEM SparseMatrix or + HypreParMatrix. */ void UpdateOperator(const Operator &op); + /** @brief Utilize the AmgX library to solve the linear system + where the "matrix" is the AMG approximation to the operator set + by AmgXSolver::SetOperator. If the mode is set to + AmgXSolver::PRECONDITIONER the initial guess for the + @a x vector will be set to zero, otherwise the value of @a x passed + in will be used. + */ virtual void Mult(const Vector& b, Vector& x) const; + /** @brief Return the number of iterations that were executed during the + last solve phase. */ int GetNumIterations(); + /** @brief Read in the AmgX parameters either through a file or directly + through a properly formated string. If @a source is set to + AmgXSolver::EXTERNAL the parameters are loaded from a filename set by + @a config. If @a source is set to AmgXSolver::INTERNAL the parameters + are set directly by the string defined by @a config. + */ void ReadParameters(const std::string config, CONFIG_SRC source); - /** + /** @brief Set up the AmgX library with the default paramaters. @param [in] amgxMode_ AmgXSolver::PRECONDITIONER, AmgXSolver::SOLVER. @@ -160,16 +197,19 @@ public: two iterations of an AMG V cycle with AmgX's default smoother (block Jacobi). - As a solver the preconditioned conjugate gradient method is used. The AMG - V-cycle with a block Jacobi smoother is used as a preconditioner. + When configured as a solver the preconditioned conjugate gradient method + is used with the AMG V-cycle and a block Jacobi smoother is used as a + preconditioner. */ void DefaultParameters(const AMGX_MODE amgxMode_, const bool verbose); /// Add a check for convergence after applying Mult. void SetConvergenceCheck(bool setConvergenceCheck_=true); + /// Close down the AmgX library and free up any MPI Comms set up for it ~AmgXSolver(); + /// Close down the AmgX library and free up any MPI Comms set up for it void Finalize(); private: @@ -181,36 +221,41 @@ private: CONFIG_SRC configSrc = UNDEFINED; #ifdef MFEM_USE_MPI - // Consolidates matrix diagonal and off diagonal data and uploads matrix to - // AmgX. + /** @brief Consolidates matrix diagonal and off diagonal data and uploads + matrix to AmgX. */ void SetMatrixMPIGPUExclusive(const HypreParMatrix &A, const Array &loc_A, - const Array &loc_I, const Array &loc_J, + const Array &loc_I, + const Array &loc_J, const bool update_mat = false); - // Consolidates matrix diagonal and off diagonal data for all ranks in an MPI - // team. Root rank of each MPI team holds the the consolidated data and sets - // matrix. + /** @brief Consolidates matrix diagonal and off diagonal data for all ranks + in an MPI team. Root rank of each MPI team holds the consolidated + data and matrix. */ void SetMatrixMPITeams(const HypreParMatrix &A, const Array &loc_A, const Array &loc_I, const Array &loc_J, const bool update_mat = false); - // The following methods consolidate array data to the root node in a MPI - // team. + /// Consolidate array data to the root node in a MPI team. void GatherArray(const Array &inArr, Array &outArr, const int mpiTeamSz, const MPI_Comm &mpiTeam) const; + /// Consolidate array data to the root node in a MPI team. void GatherArray(const Vector &inArr, Vector &outArr, const int mpiTeamSz, const MPI_Comm &mpiTeam) const; + /// Consolidate array data to the root node in a MPI team. void GatherArray(const Array &inArr, Array &outArr, const int mpiTeamSz, const MPI_Comm &mpiTeam) const; + /// Consolidate array data to the root node in a MPI team. void GatherArray(const Array &inArr, Array &outArr, const int mpiTeamSz, const MPI_Comm &mpiTeam) const; - // The following methods consolidate array data to the root node in a MPI - // team as well as store array partitions and displacements. + /** @brief Consolidate array data to the root node in a MPI + team as well as store array partitions and displacements in + @a Apart and @a Adisp. + */ void GatherArray(const Vector &inArr, Vector &outArr, const int mpiTeamSz, const MPI_Comm &mpiTeamComm, Array &Apart, Array &Adisp) const; @@ -299,10 +344,10 @@ private: // AmgX resource object. static AMGX_resources_handle rsrc; - // Set the ID of the corresponding GPU used by this process. + /// Set the ID of the corresponding GPU used by this process. void SetDeviceIDs(const int nDevs); - // Initialize all MPI communicators. + /// Initialize all MPI communicators. #ifdef MFEM_USE_MPI void InitMPIcomms(const MPI_Comm &comm, const int nDevs); #endif diff --git a/linalg/auxiliary.cpp b/linalg/auxiliary.cpp index 003e526955..e8fdf91a94 100644 --- a/linalg/auxiliary.cpp +++ b/linalg/auxiliary.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/auxiliary.hpp b/linalg/auxiliary.hpp index 62b87336be..1409b7898b 100644 --- a/linalg/auxiliary.hpp +++ b/linalg/auxiliary.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/blockmatrix.cpp b/linalg/blockmatrix.cpp index 289601ebd2..4113fafe06 100644 --- a/linalg/blockmatrix.cpp +++ b/linalg/blockmatrix.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/blockmatrix.hpp b/linalg/blockmatrix.hpp index 8cf3f75e85..589c8ccabd 100644 --- a/linalg/blockmatrix.hpp +++ b/linalg/blockmatrix.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/blockoperator.cpp b/linalg/blockoperator.cpp index b1c0c3c311..f5e1d02c7b 100644 --- a/linalg/blockoperator.cpp +++ b/linalg/blockoperator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -45,12 +45,12 @@ BlockOperator::BlockOperator(const Array & row_offsets_, op = static_cast(NULL); } -void BlockOperator::SetDiagonalBlock(int iblock, Operator *opt, double c) +void BlockOperator::SetDiagonalBlock(int iblock, const Operator *opt, double c) { SetBlock(iblock, iblock, opt, c); } -void BlockOperator::SetBlock(int iRow, int iCol, Operator *opt, double c) +void BlockOperator::SetBlock(int iRow, int iCol, const Operator *opt, double c) { if (owns_blocks && op(iRow, iCol)) { diff --git a/linalg/blockoperator.hpp b/linalg/blockoperator.hpp index c9f9c8e46a..a6c05c4773 100644 --- a/linalg/blockoperator.hpp +++ b/linalg/blockoperator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -61,14 +61,14 @@ public: * op: the Operator to be inserted. * c: optional scalar multiple for this block. */ - void SetDiagonalBlock(int iblock, Operator *op, double c = 1.0); + void SetDiagonalBlock(int iblock, const Operator *op, double c = 1.0); //! Add a block op in the block-entry (iblock, jblock). /** * irow, icol: The block will be inserted in location (irow, icol). * op: the Operator to be inserted. * c: optional scalar multiple for this block. */ - void SetBlock(int iRow, int iCol, Operator *op, double c = 1.0); + void SetBlock(int iRow, int iCol, const Operator *op, double c = 1.0); //! Return the number of row blocks int NumRowBlocks() const { return nRowBlocks; } @@ -78,9 +78,6 @@ public: //! Check if block (i,j) is a zero block int IsZeroBlock(int i, int j) const { return (op(i,j)==NULL) ? 1 : 0; } //! Return a reference to block i,j - Operator & GetBlock(int i, int j) - { MFEM_VERIFY(op(i,j), ""); return *op(i,j); } - //! Return a reference to block i,j (const version) const Operator & GetBlock(int i, int j) const { MFEM_VERIFY(op(i,j), ""); return *op(i,j); } //! Return the coefficient for block i,j @@ -123,7 +120,7 @@ private: //! Column offsets for the starting position of each block Array col_offsets; //! 2D array that stores each block of the operator. - Array2D op; + Array2D op; //! 2D array that stores a coefficient for each block of the operator. Array2D coef; diff --git a/linalg/blockvector.cpp b/linalg/blockvector.cpp index 27b87a3750..c2d3d5fb57 100644 --- a/linalg/blockvector.cpp +++ b/linalg/blockvector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/blockvector.hpp b/linalg/blockvector.hpp index 9b29901f32..24fda8d311 100644 --- a/linalg/blockvector.hpp +++ b/linalg/blockvector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/complex_densemat.cpp b/linalg/complex_densemat.cpp index f43ce6e49f..e105033c16 100644 --- a/linalg/complex_densemat.cpp +++ b/linalg/complex_densemat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/complex_densemat.hpp b/linalg/complex_densemat.hpp index 467d9f21bf..054175d314 100644 --- a/linalg/complex_densemat.hpp +++ b/linalg/complex_densemat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/complex_operator.cpp b/linalg/complex_operator.cpp index b4d1790075..a71adfdd61 100644 --- a/linalg/complex_operator.cpp +++ b/linalg/complex_operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/complex_operator.hpp b/linalg/complex_operator.hpp index 276f5b7486..730db741fb 100644 --- a/linalg/complex_operator.hpp +++ b/linalg/complex_operator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/constraints.cpp b/linalg/constraints.cpp index 4730dee8f1..78afc617ff 100644 --- a/linalg/constraints.cpp +++ b/linalg/constraints.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/constraints.hpp b/linalg/constraints.hpp index 82101ee7fd..43b35ee405 100644 --- a/linalg/constraints.hpp +++ b/linalg/constraints.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -25,8 +25,8 @@ class FiniteElementSpace; class ParFiniteElementSpace; #endif -/** @brief An abstract class to solve the constrained system \f$ Ax = f \f$ - subject to the constraint \f$ B x = r \f$. +/** @brief An abstract class to solve the constrained system $ Ax = f $ + subject to the constraint $ B x = r $. Although implementations may not use the below formulation, for understanding some of its methods and notation you can think of @@ -39,8 +39,8 @@ class ParFiniteElementSpace; pointwise constraints and is not a Solver. The height and width of this object as an IterativeSolver are the same as - just the unconstrained operator \f$ A \f$, and the Mult() interface just - takes \f$ f \f$ as an argument. You can set \f$ r \f$ with + just the unconstrained operator $ A $, and the Mult() interface just + takes $ f $ as an argument. You can set $ r $ with SetConstraintRHS() (it defaults to zero) and get the Lagrange multiplier solution with GetMultiplierSolution(). @@ -75,11 +75,11 @@ public: system with Mult() or LagrangeSystemMult() */ void GetMultiplierSolution(Vector& lambda) const { lambda = multiplier_sol; } - /** @brief Solve for \f$ x \f$ given \f$ f \f$. + /** @brief Solve for $ x $ given $ f $. - If you want to set \f$ r \f$, call SetConstraintRHS() before this. + If you want to set $ r $, call SetConstraintRHS() before this. - If you want to get \f$ \lambda \f$, call GetMultiplierSolution() after + If you want to get $ \lambda $, call GetMultiplierSolution() after this. The base class implementation calls LagrangeSystemMult(), so derived @@ -114,8 +114,8 @@ private: This keeps track of primary / secondary tdofs and does small dense block solves to eliminate constraints from a global system. - \f$ B_s^{-1} \f$ maps the lagrange space into secondary dofs, while - \f$ -B_s^{-1} B_p \f$ maps primary dofs to secondary dofs. */ + $ B_s^{-1} $ maps the lagrange space into secondary dofs, while + $ -B_s^{-1} B_p $ maps primary dofs to secondary dofs. */ class Eliminator { public: @@ -128,19 +128,19 @@ public: const Array& SecondaryDofs() const { return secondary_tdofs; } /// Given primary dofs in in, return secondary dofs in out - /// This applies \f$ -B_s^{-1} B_p \f$. + /// This applies $ -B_s^{-1} B_p $. void Eliminate(const Vector& in, Vector& out) const; - /// Transpose of Eliminate(), applies \f$ -B_p^T B_s^{-T} \f$ + /// Transpose of Eliminate(), applies $ -B_p^T B_s^{-T} $ void EliminateTranspose(const Vector& in, Vector& out) const; - /// Maps Lagrange multipliers to secondary dofs, applies \f$ B_s^{-1} \f$ + /// Maps Lagrange multipliers to secondary dofs, applies $ B_s^{-1} $ void LagrangeSecondary(const Vector& in, Vector& out) const; /// Transpose of LagrangeSecondary() void LagrangeSecondaryTranspose(const Vector& in, Vector& out) const; - /// Return \f$ -B_s^{-1} B_p \f$ explicitly assembled in mat + /// Return $ -B_s^{-1} B_p $ explicitly assembled in mat void ExplicitAssembly(DenseMatrix& mat) const; private: @@ -179,8 +179,8 @@ public: Some day we may also want to try approximate variants. */ SparseMatrix * AssembleExact() const; - /** Given Lagrange multiplier right-hand-side \f$ g \f$, return - \f$ \tilde{g} \f$ */ + /** Given Lagrange multiplier right-hand-side $ g $, return + $ \tilde{g} $ */ void BuildGTilde(const Vector& g, Vector& gtilde) const; /** After a solve, recover the Lagrange multiplier. */ @@ -197,7 +197,7 @@ private: /** @brief Solve constrained system by eliminating the constraint; see ConstrainedSolver - Solves the system with the operator \f$ P^T A P + Z_P \f$, where P is + Solves the system with the operator $ P^T A P + Z_P $, where P is EliminationProjection and Z_P is the identity on the eliminated dofs. */ class EliminationSolver : public ConstrainedSolver { @@ -484,11 +484,11 @@ private: operators are assembled HypreParMatrix objects.) This uses a block-diagonal preconditioner that approximates - \f$ [ A^{-1} 0; 0 (B A^{-1} B^T)^{-1} ] \f$. + $ [ A^{-1} 0; 0 (B A^{-1} B^T)^{-1} ] $. - In the top-left block, we approximate \f$ A^{-1} \f$ with HypreBoomerAMG. - In the bottom-right, we approximate \f$ A^{-1} \f$ with the inverse of the - diagonal of \f$ A \f$, assemble \f$ B diag(A)^{-1} B^T \f$, and use + In the top-left block, we approximate $ A^{-1} $ with HypreBoomerAMG. + In the bottom-right, we approximate $ A^{-1} $ with the inverse of the + diagonal of $ A $, assemble $ B diag(A)^{-1} B^T $, and use HypreBoomerAMG on that assembled matrix. */ class SchurConstrainedHypreSolver : public SchurConstrainedSolver { diff --git a/linalg/cpardiso.hpp b/linalg/cpardiso.hpp index 59eb12c12e..219499db9a 100644 --- a/linalg/cpardiso.hpp +++ b/linalg/cpardiso.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/densemat.cpp b/linalg/densemat.cpp index 86391f2397..d7350aa0aa 100644 --- a/linalg/densemat.cpp +++ b/linalg/densemat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/densemat.hpp b/linalg/densemat.hpp index d1f0472950..9da8a221bd 100644 --- a/linalg/densemat.hpp +++ b/linalg/densemat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/dinvariants.hpp b/linalg/dinvariants.hpp index 43285e4239..a60156cd46 100644 --- a/linalg/dinvariants.hpp +++ b/linalg/dinvariants.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/dtensor.hpp b/linalg/dtensor.hpp index 89735d7f50..298fceac8a 100644 --- a/linalg/dtensor.hpp +++ b/linalg/dtensor.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/dual.hpp b/linalg/dual.hpp index 87e59a6c70..967fe32602 100644 --- a/linalg/dual.hpp +++ b/linalg/dual.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/ginkgo.cpp b/linalg/ginkgo.cpp index bcfe720b74..0361e2fc7c 100644 --- a/linalg/ginkgo.cpp +++ b/linalg/ginkgo.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/ginkgo.hpp b/linalg/ginkgo.hpp index c99d315e0c..42b2ff2455 100644 --- a/linalg/ginkgo.hpp +++ b/linalg/ginkgo.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/handle.cpp b/linalg/handle.cpp index fa84b17933..283e667162 100644 --- a/linalg/handle.cpp +++ b/linalg/handle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/handle.hpp b/linalg/handle.hpp index 818294985b..5c77176a1e 100644 --- a/linalg/handle.hpp +++ b/linalg/handle.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hiop.cpp b/linalg/hiop.cpp index 411d91dde7..b4e828e678 100644 --- a/linalg/hiop.cpp +++ b/linalg/hiop.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hiop.hpp b/linalg/hiop.hpp index 476361a932..eb8829ccb7 100644 --- a/linalg/hiop.hpp +++ b/linalg/hiop.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hypre.cpp b/linalg/hypre.cpp index 991ee88652..0fd16be03b 100644 --- a/linalg/hypre.cpp +++ b/linalg/hypre.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hypre.hpp b/linalg/hypre.hpp index b2222923e4..8e78027131 100644 --- a/linalg/hypre.hpp +++ b/linalg/hypre.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hypre_parcsr.cpp b/linalg/hypre_parcsr.cpp index f1cdff4dac..2756576804 100644 --- a/linalg/hypre_parcsr.cpp +++ b/linalg/hypre_parcsr.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/hypre_parcsr.hpp b/linalg/hypre_parcsr.hpp index d113711fac..3f428ecaa6 100644 --- a/linalg/hypre_parcsr.hpp +++ b/linalg/hypre_parcsr.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/invariants.hpp b/linalg/invariants.hpp index b1f6b6059a..329cb8ce30 100644 --- a/linalg/invariants.hpp +++ b/linalg/invariants.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/kernels.hpp b/linalg/kernels.hpp index 62230548e0..99b71dcdc1 100644 --- a/linalg/kernels.hpp +++ b/linalg/kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/linalg.hpp b/linalg/linalg.hpp index 320a1b88ce..c78bc391a1 100644 --- a/linalg/linalg.hpp +++ b/linalg/linalg.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/matrix.cpp b/linalg/matrix.cpp index 638ad80615..a49c6e34cc 100644 --- a/linalg/matrix.cpp +++ b/linalg/matrix.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/matrix.hpp b/linalg/matrix.hpp index e6cbb2cabc..b5ea78f5c7 100644 --- a/linalg/matrix.hpp +++ b/linalg/matrix.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/mumps.cpp b/linalg/mumps.cpp index 6efb98e3e5..785b855c00 100644 --- a/linalg/mumps.cpp +++ b/linalg/mumps.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/mumps.hpp b/linalg/mumps.hpp index 9fef9a2928..fb73080ebf 100644 --- a/linalg/mumps.hpp +++ b/linalg/mumps.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -34,22 +34,35 @@ namespace mfem class MUMPSSolver : public Solver { public: + /// Specify the type of matrix we are applying the solver to enum MatType { + /// General sparse matrix, no symmetry is assumed UNSYMMETRIC = 0, + /// A sparse symmetric positive definite matrix SYMMETRIC_POSITIVE_DEFINITE = 1, + /// A sparse symmetric matrix that is not necessarily positive definite SYMMETRIC_INDEFINITE = 2 }; + /// Specify the reordering strategy for the MUMPS solver enum ReorderingStrategy { + /// Let MUMPS automatically decide the reording strategy AUTOMATIC = 0, + /// Approximate Minimum Degree with auto quasi-dense row detection is used AMD, + /// Approximate Minimum Fill method will be used AMF, + /// The PORD library will be used PORD, + /// The METIS library will be used METIS, + /// The ParMETIS library will be used PARMETIS, + /// The Scotch library will be used SCOTCH, + /// The PTScotch library will be used PTSCOTCH }; @@ -73,28 +86,49 @@ public: void SetOperator(const Operator &op); /** - * @brief Solve y = Op^{-1} x. + * @brief Solve $ y = Op^{-1} x $ * * @param x RHS vector * @param y Solution vector */ void Mult(const Vector &x, Vector &y) const; + + /** + * @brief Solve $ Y_i = Op^{-T} X_i $ + * + * @param X Array of RHS vectors + * @param Y Array of Solution vectors + */ void ArrayMult(const Array &X, Array &Y) const; /** - * @brief Transpose Solve y = Op^{-T} x. + * @brief Transpose Solve $ y = Op^{-T} x $ * * @param x RHS vector * @param y Solution vector */ void MultTranspose(const Vector &x, Vector &y) const; + + /** + * @brief Transpose Solve $ Y_i = Op^{-T} X_i $ + * + * @param X Array of RHS vectors + * @param Y Array of Solution vectors + */ void ArrayMultTranspose(const Array &X, Array &Y) const; /** * @brief Set the error print level for MUMPS * - * @param print_lvl Print level + * Supported values are: + * - 0: No output printed + * - 1: Only errors printed + * - 2: Errors, warnings, and main stats printed + * - 3: Errors, warning, main stats, and terse diagnostics printed + * - 4: Errors, warning, main stats, diagnostics, and input/output printed + * + * @param print_lvl Print level, default is 2 * * @note This method has to be called before SetOperator */ @@ -103,8 +137,9 @@ public: /** * @brief Set the matrix type * - * Supported matrix types: General, symmetric indefinite and - * symmetric positive definite + * Supported matrix types: MUMPSSolver::UNSYMMETRIC, + * MUMPSSolver::SYMMETRIC_POSITIVE_DEFINITE, + * and MUMPSSolver::SYMMETRIC_INDEFINITE * * @param mtype Matrix type * @@ -115,8 +150,10 @@ public: /** * @brief Set the reordering strategy * - * Supported reorderings are: AUTOMATIC, AMD, AMF, PORD, METIS, PARMETIS, - * SCOTCH, and PTSCOTCH + * Supported reorderings are: MUMPSSolver::AUTOMATIC, + * MUMPSSolver::AMD, MUMPSSolver::AMF, MUMPSSolver::PORD, + * MUMPSSolver::METIS, MUMPSSolver::PARMETIS, + * MUMPSSolver::SCOTCH, and MUMPSSolver::PTSCOTCH * * @param method Reordering method * @@ -183,14 +220,14 @@ private: // MUMPS object DMUMPS_STRUC_C *id; - // Method for initialization + /// Method for initialization void Init(MPI_Comm comm_); - // Method for setting MUMPS internal parameters + /// Method for setting MUMPS internal parameters void SetParameters(); - // Method for configuring storage for distributed/centralized RHS and - // solution + /// Method for configuring storage for distributed/centralized RHS and + /// solution void InitRhsSol(int nrhs) const; #if MFEM_MUMPS_VERSION >= 530 diff --git a/linalg/ode.cpp b/linalg/ode.cpp index 39c31ed57e..1aac7356a0 100644 --- a/linalg/ode.cpp +++ b/linalg/ode.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/ode.hpp b/linalg/ode.hpp index 475a8468ec..f0ffee83fa 100644 --- a/linalg/ode.hpp +++ b/linalg/ode.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/operator.cpp b/linalg/operator.cpp index 1f214ece7a..3fd4d64f97 100644 --- a/linalg/operator.cpp +++ b/linalg/operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -365,6 +365,44 @@ void SecondOrderTimeDependentOperator::ImplicitSolve(const double dt0, mfem_error("SecondOrderTimeDependentOperator::ImplicitSolve() is not overridden!"); } +SumOperator::SumOperator(const Operator *A, const double alpha, + const Operator *B, const double beta, + bool ownA, bool ownB) + : Operator(A->Height(), A->Width()), + A(A), B(B), alpha(alpha), beta(beta), ownA(ownA), ownB(ownB), + z(A->Height()) +{ + MFEM_VERIFY(A->Width() == B->Width(), + "incompatible Operators: different widths\n" + << "A->Width() = " << A->Width() + << ", B->Width() = " << B->Width() ); + MFEM_VERIFY(A->Height() == B->Height(), + "incompatible Operators: different heights\n" + << "A->Height() = " << A->Height() + << ", B->Height() = " << B->Height() ); + + { + const Solver* SolverA = dynamic_cast(A); + const Solver* SolverB = dynamic_cast(B); + if (SolverA) + { + MFEM_VERIFY(!(SolverA->iterative_mode), + "Operator A of a SumOperator should not be in iterative mode"); + } + if (SolverB) + { + MFEM_VERIFY(!(SolverB->iterative_mode), + "Operator B of a SumOperator should not be in iterative mode"); + } + } + +} + +SumOperator::~SumOperator() +{ + if (ownA) { delete A; } + if (ownB) { delete B; } +} ProductOperator::ProductOperator(const Operator *A, const Operator *B, bool ownA, bool ownB) @@ -481,7 +519,8 @@ ConstrainedOperator::ConstrainedOperator(Operator *A, const Array &list, MemoryType mem_type = GetMemoryType(mem_class); list.Read(); // TODO: just ensure 'list' is registered, no need to copy it constraint_list.MakeRef(list); - // typically z and w are large vectors, so store them on the device + // typically z and w are large vectors, so use the device (GPU) to perform + // operations on them z.SetSize(height, mem_type); z.UseDevice(true); w.SetSize(height, mem_type); w.UseDevice(true); } @@ -544,12 +583,20 @@ void ConstrainedOperator::EliminateRHS(const Vector &x, Vector &b) const }); } -void ConstrainedOperator::Mult(const Vector &x, Vector &y) const +void ConstrainedOperator::ConstrainedMult(const Vector &x, Vector &y, + const bool transpose) const { const int csz = constraint_list.Size(); if (csz == 0) { - A->Mult(x, y); + if (transpose) + { + A->MultTranspose(x, y); + } + else + { + A->Mult(x, y); + } return; } @@ -560,7 +607,14 @@ void ConstrainedOperator::Mult(const Vector &x, Vector &y) const auto d_z = z.ReadWrite(); mfem::forall(csz, [=] MFEM_HOST_DEVICE (int i) { d_z[idx[i]] = 0.0; }); - A->Mult(z, y); + if (transpose) + { + A->MultTranspose(z, y); + } + else + { + A->Mult(z, y); + } auto d_x = x.Read(); // Use read+write access - we are modifying sub-vector of y @@ -591,6 +645,25 @@ void ConstrainedOperator::Mult(const Vector &x, Vector &y) const } } +void ConstrainedOperator::Mult(const Vector &x, Vector &y) const +{ + constexpr bool transpose = false; + ConstrainedMult(x, y, transpose); +} + +void ConstrainedOperator::MultTranspose(const Vector &x, Vector &y) const +{ + constexpr bool transpose = true; + ConstrainedMult(x, y, transpose); +} + +void ConstrainedOperator::AddMult(const Vector &x, Vector &y, + const double a) const +{ + Mult(x, w); + y.Add(a, w); +} + RectangularConstrainedOperator::RectangularConstrainedOperator( Operator *A, const Array &trial_list, @@ -625,9 +698,7 @@ void RectangularConstrainedOperator::EliminateRHS(const Vector &x, d_w[id] = d_x[id]; }); - // A.AddMult(w, b, -1.0); // if available to all Operators - A->Mult(w, z); - b -= z; + A->AddMult(w, b, -1.0); const int test_csz = test_constraints.Size(); auto test_idx = test_constraints.Read(); diff --git a/linalg/operator.hpp b/linalg/operator.hpp index baa9bf7672..aba74453ba 100644 --- a/linalg/operator.hpp +++ b/linalg/operator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -435,11 +435,11 @@ public: details, see the PETSc Manual. */ virtual Operator& GetExplicitGradient(const Vector &x) const; - /** @brief Setup the ODE linear system \f$ A(x,t) = (I - gamma J) \f$ or - \f$ A = (M - gamma J) \f$, where \f$ J(x,t) = \frac{df}{dt(x,t)} \f$. + /** @brief Setup the ODE linear system $ A(x,t) = (I - gamma J) $ or + $ A = (M - gamma J) $, where $ J(x,t) = \frac{df}{dt(x,t)} $. - @param[in] x The state at which \f$A(x,t)\f$ should be evaluated. - @param[in] fx The current value of the ODE rhs function, \f$f(x,t)\f$. + @param[in] x The state at which $A(x,t)$ should be evaluated. + @param[in] fx The current value of the ODE rhs function, $f(x,t)$. @param[in] jok Flag indicating if the Jacobian should be updated. @param[out] jcur Flag to signal if the Jacobian was updated. @param[in] gamma The scaled time step value. @@ -451,7 +451,7 @@ public: virtual int SUNImplicitSetup(const Vector &x, const Vector &fx, int jok, int *jcur, double gamma); - /** @brief Solve the ODE linear system \f$ A x = b \f$ as setup by + /** @brief Solve the ODE linear system $ A x = b $ as setup by the method SUNImplicitSetup(). @param[in] b The linear system right-hand side. @@ -464,7 +464,7 @@ public: details, see the SUNDIALS User Guides. */ virtual int SUNImplicitSolve(const Vector &b, Vector &x, double tol); - /** @brief Setup the mass matrix in the ODE system \f$ M y' = f(y,t) \f$ . + /** @brief Setup the mass matrix in the ODE system $ M y' = f(y,t) $ . If not re-implemented, this method simply generates an error. @@ -472,7 +472,7 @@ public: details, see the ARKode User Guide. */ virtual int SUNMassSetup(); - /** @brief Solve the mass matrix linear system \f$ M x = b \f$ + /** @brief Solve the mass matrix linear system $ M x = b $ as setup by the method SUNMassSetup(). @param[in] b The linear system right-hand side. @@ -485,7 +485,7 @@ public: details, see the ARKode User Guide. */ virtual int SUNMassSolve(const Vector &b, Vector &x, double tol); - /** @brief Compute the mass matrix-vector product \f$ v = M x \f$ . + /** @brief Compute the mass matrix-vector product $ v = M x $ . @param[in] x The vector to multiply. @param[out] v The result of the matrix-vector product. @@ -574,13 +574,13 @@ public: virtual void QuadratureSensitivityMult(const Vector &y, const Vector &yB, Vector &qBdot) const {} - /** @brief Setup the ODE linear system \f$ A(x,t) = (I - gamma J) \f$ or - \f$ A = (M - gamma J) \f$, where \f$ J(x,t) = \frac{df}{dt(x,t)} \f$. + /** @brief Setup the ODE linear system $ A(x,t) = (I - gamma J) $ or + $ A = (M - gamma J) $, where $ J(x,t) = \frac{df}{dt(x,t)} $. @param[in] t The current time - @param[in] x The state at which \f$A(x,xB,t)\f$ should be evaluated. - @param[in] xB The state at which \f$A(x,xB,t)\f$ should be evaluated. - @param[in] fxB The current value of the ODE rhs function, \f$f(x,t)\f$. + @param[in] x The state at which $A(x,xB,t)$ should be evaluated. + @param[in] xB The state at which $A(x,xB,t)$ should be evaluated. + @param[in] fxB The current value of the ODE rhs function, $f(x,t)$. @param[in] jokB Flag indicating if the Jacobian should be updated. @param[out] jcurB Flag to signal if the Jacobian was updated. @param[in] gammaB The scaled time step value. @@ -599,7 +599,7 @@ public: return (-1); } - /** @brief Solve the ODE linear system \f$ A(x,xB,t) xB = b \f$ as setup by + /** @brief Solve the ODE linear system $ A(x,xB,t) xB = b $ as setup by the method SUNImplicitSetup(). @param[in] b The linear system right-hand side. @@ -769,6 +769,28 @@ public: { A.Mult(x, y); } }; +/// General linear combination operator: x -> a A(x) + b B(x). +class SumOperator : public Operator +{ + const Operator *A, *B; + const double alpha, beta; + bool ownA, ownB; + mutable Vector z; + +public: + SumOperator( + const Operator *A, const double alpha, + const Operator *B, const double beta, + bool ownA, bool ownB); + + virtual void Mult(const Vector &x, Vector &y) const + { z.SetSize(A->Height()); A->Mult(x, z); B->Mult(x, y); add(alpha, z, beta, y, y); } + + virtual void MultTranspose(const Vector &x, Vector &y) const + { z.SetSize(A->Width()); A->MultTranspose(x, z); B->MultTranspose(x, y); add(alpha, z, beta, y, y); } + + virtual ~SumOperator(); +}; /// General product operator: x -> (A*B)(x) = A(B(x)). class ProductOperator : public Operator @@ -892,14 +914,14 @@ public: DiagonalPolicy diag_policy = DIAG_ONE); /// Returns the type of memory in which the solution and temporaries are stored. - virtual MemoryClass GetMemoryClass() const { return mem_class; } + MemoryClass GetMemoryClass() const override { return mem_class; } /// Set the diagonal policy for the constrained operator. void SetDiagonalPolicy(const DiagonalPolicy diag_policy_) { diag_policy = diag_policy_; } /// Diagonal of A, modified according to the used DiagonalPolicy. - virtual void AssembleDiagonal(Vector &diag) const; + void AssembleDiagonal(Vector &diag) const override; /** @brief Eliminate "essential boundary condition" values specified in @a x from the given right-hand side @a b. @@ -922,10 +944,19 @@ public: where the "_b" subscripts denote the essential (boundary) indices/dofs of the vectors, and "_i" -- the rest of the entries. */ - virtual void Mult(const Vector &x, Vector &y) const; + void Mult(const Vector &x, Vector &y) const override; + + void AddMult(const Vector &x, Vector &y, const double a = 1.0) const override; + + void MultTranspose(const Vector &x, Vector &y) const override; + + /** @brief Implementation of Mult or MultTranspose. + * TODO - Generalize to allow constraining rows and columns differently. + */ + void ConstrainedMult(const Vector &x, Vector &y, const bool transpose) const; /// Destructor: destroys the unconstrained Operator, if owned. - virtual ~ConstrainedOperator() { if (own_A) { delete A; } } + ~ConstrainedOperator() override { if (own_A) { delete A; } } }; /** @brief Rectangular Operator for imposing essential boundary conditions on diff --git a/linalg/pardiso.cpp b/linalg/pardiso.cpp index 6053da722b..75c3813f88 100644 --- a/linalg/pardiso.cpp +++ b/linalg/pardiso.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/pardiso.hpp b/linalg/pardiso.hpp index 0f1871f44e..c92b67944b 100644 --- a/linalg/pardiso.hpp +++ b/linalg/pardiso.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/petsc.cpp b/linalg/petsc.cpp index 7f67d270be..d2ddc3224f 100644 --- a/linalg/petsc.cpp +++ b/linalg/petsc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/petsc.hpp b/linalg/petsc.hpp index 18cf6ba1cd..9d960910c8 100644 --- a/linalg/petsc.hpp +++ b/linalg/petsc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/petscinternals.hpp b/linalg/petscinternals.hpp index 6a2b34b0ee..3a2b13aec3 100644 --- a/linalg/petscinternals.hpp +++ b/linalg/petscinternals.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd.hpp b/linalg/simd.hpp index a5f0e0ab0d..858f4e7b23 100644 --- a/linalg/simd.hpp +++ b/linalg/simd.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/auto.hpp b/linalg/simd/auto.hpp index 89ecc8176d..2dd1d5fc0c 100644 --- a/linalg/simd/auto.hpp +++ b/linalg/simd/auto.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/m128.hpp b/linalg/simd/m128.hpp index d6b7473a1d..c19e321d1d 100644 --- a/linalg/simd/m128.hpp +++ b/linalg/simd/m128.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/m256.hpp b/linalg/simd/m256.hpp index 887ddc0663..469f9347f3 100644 --- a/linalg/simd/m256.hpp +++ b/linalg/simd/m256.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/m512.hpp b/linalg/simd/m512.hpp index 3253bfb12b..f6736dc982 100644 --- a/linalg/simd/m512.hpp +++ b/linalg/simd/m512.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/qpx.hpp b/linalg/simd/qpx.hpp index 4e0932b777..9c03f6c5d6 100644 --- a/linalg/simd/qpx.hpp +++ b/linalg/simd/qpx.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/qpx256.hpp b/linalg/simd/qpx256.hpp index 65679ddc9b..18f21ef528 100644 --- a/linalg/simd/qpx256.hpp +++ b/linalg/simd/qpx256.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/sve.hpp b/linalg/simd/sve.hpp index 0a4b7fec96..cb1722eb20 100644 --- a/linalg/simd/sve.hpp +++ b/linalg/simd/sve.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/vsx.hpp b/linalg/simd/vsx.hpp index 361b12cb82..9433db3336 100644 --- a/linalg/simd/vsx.hpp +++ b/linalg/simd/vsx.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/vsx128.hpp b/linalg/simd/vsx128.hpp index 693eefaa80..7112d05312 100644 --- a/linalg/simd/vsx128.hpp +++ b/linalg/simd/vsx128.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/simd/x86.hpp b/linalg/simd/x86.hpp index d023c0170c..43771ab03a 100644 --- a/linalg/simd/x86.hpp +++ b/linalg/simd/x86.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/slepc.cpp b/linalg/slepc.cpp index 122b32ab7c..ed9c2769e2 100644 --- a/linalg/slepc.cpp +++ b/linalg/slepc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/slepc.hpp b/linalg/slepc.hpp index 63b9e748d0..329472b8e9 100644 --- a/linalg/slepc.hpp +++ b/linalg/slepc.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -51,16 +51,24 @@ public: virtual ~SlepcEigenSolver(); - /// Set solver tolerance + /** @brief Set solver convergence tolerance relative to the magnitude of the + eigenvalue. + + @note Default value is 1e-8 + */ void SetTol(double tol); - /// Set maximum number of iterations + /** @brief Set maximum number of iterations allowed in the call to + SlepcEigenSolver::Solve */ void SetMaxIter(int max_iter); - /// Set the number of required eigenmodes + + /// Set the number of eigenmodes to compute void SetNumModes(int num_eigs); + /// Set operator for standard eigenvalue problem void SetOperator(const PetscParMatrix &op); - /// Set operator for generalized eigenvalue problem + + /// Set operators for generalized eigenvalue problem void SetOperators(const PetscParMatrix &op, const PetscParMatrix &opB); /// Customize object with options set @@ -69,39 +77,105 @@ public: /// Solve the eigenvalue problem for the specified number of eigenvalues void Solve(); - /// Get the number of converged eigenvalues + /** @brief Get the number of converged eigenvalues after the call to + SlepcEigenSolver::Solve */ int GetNumConverged(); - /// Get the corresponding eigenvalue + /** @brief Get the ith eigenvalue after the system has been solved + @param[in] i The index for the eigenvalue you want ordered by + SlepcEigenSolver::SetWhichEigenpairs + @param[out] lr The real component of the eigenvalue + @note the index @a i must be between 0 and + SlepcEigenSolver::GetNumConverged - 1 + */ void GetEigenvalue(unsigned int i, double & lr) const; + + /** @brief Get the ith eigenvalue after the system has been solved + @param[in] i The index for the eigenvalue you want ordered by + SlepcEigenSolver::SetWhichEigenpairs + @param[out] lr The real component of the eigenvalue + @param[out] lc The imaginary component of the eigenvalue + @note the index @a i must be between 0 and + SlepcEigenSolver::GetNumConverged - 1 + */ void GetEigenvalue(unsigned int i, double & lr, double & lc) const; - /// Get the corresponding eigenvector + /** @brief Get the ith eigenvector after the system has been solved + @param[in] i The index for the eigenvector you want ordered by + SlepcEigenSolver::SetWhichEigenpairs + @param[out] vr The real components of the eigenvector + @note the index @a i must be between 0 and + SlepcEigenSolver::GetNumConverged - 1 + */ void GetEigenvector(unsigned int i, Vector & vr) const; + + /** @brief Get the ith eigenvector after the system has been solved + @param[in] i The index for the eigenvector you want ordered by + SlepcEigenSolver::SetWhichEigenpairs + @param[out] vr The real components of the eigenvector + @param[out] vc The imaginary components of the eigenvector + @note the index @a i must be between 0 and + SlepcEigenSolver::GetNumConverged - 1 + */ void GetEigenvector(unsigned int i, Vector & vr, Vector & vc) const; - /// Target spectrum for the eigensolver. Target imaginary is not supported - /// without complex support in SLEPc, and intervals are not implemented. + /** @brief Target spectrum for the eigensolver. + + This will define the order in which the eigenvalues/eigenvectors are + indexed after the call to SlepcEigenSolver::Solve. + @note Target imaginary is not supported without complex support in SLEPc, + and intervals are not implemented. + */ enum Which { + /// The eigenvalues with the largest complex magnitude (default) LARGEST_MAGNITUDE, + /// The eigenvalues with the smallest complex magnitude SMALLEST_MAGNITUDE, + /// The eigenvalues with the largest real component LARGEST_REAL, + /// The eigenvalues with the smallest real component SMALLEST_REAL, + /// The eigenvalues with the largest imaginary component LARGEST_IMAGINARY, + /// The eigenvalues with the smallest imaginary component SMALLEST_IMAGINARY, + /// The eigenvalues with complex magnitude closest to the target value TARGET_MAGNITUDE, + /// The eigenvalues with the real component closest to the target value TARGET_REAL }; + /** @brief Spectral transformations that can be used by the solver in order + to accelerate the convergence to the target eignevalues + */ enum SpectralTransformation { + /// Utilize the shift of origin strategy SHIFT, + /// Utilize the shift and invert strategy SHIFT_INVERT }; + /** @brief Set the which eigenvalues the solver will target and the order + they will be indexed in. + + For SlepcEigenSolver::TARGET_MAGNITUDE or SlepcEigenSolver::TARGET_REAL + you will also need to set the target value with + SlepcEigenSolver::SetTarget. + */ void SetWhichEigenpairs(Which which); + + /** @brief Set the target value for the eigenpairs you want when using + SlepcEigenSolver::TARGET_MAGNITUDE or SlepcEigenSolver::TARGET_REAL in + the SlepcEigenSolver::SetWhichEigenpairs method. + */ void SetTarget(double target); + + /** @brief Set the spectral transformation strategy for acceletating + convergenvce. Both SlepcEigenSolver::SHIFT and + SlepcEigenSolver::SHIFT_INVERT are available. + */ void SetSpectralTransformation(SpectralTransformation transformation); /// Conversion function to SLEPc's EPS type. diff --git a/linalg/solvers.cpp b/linalg/solvers.cpp index 810e36e9f5..ba0af7e91f 100644 --- a/linalg/solvers.cpp +++ b/linalg/solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/solvers.hpp b/linalg/solvers.hpp index d951476bf3..c5b5f98b4d 100644 --- a/linalg/solvers.hpp +++ b/linalg/solvers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -106,7 +106,8 @@ public: PrintLevel &Iterations() { iterations=true; return *this; } PrintLevel &FirstAndLast() { first_and_last=true; return *this; } PrintLevel &Summary() { summary=true; return *this; } - PrintLevel &All() { return Warnings().Errors().Iterations().FirstAndLast().Summary(); } + PrintLevel &All() + { return Warnings().Errors().Iterations().FirstAndLast().Summary(); } ///@} }; @@ -168,8 +169,13 @@ protected: ///@} + /// Return the dot product of @a x and @a y double Dot(const Vector &x, const Vector &y) const; + + /// Return the 2-norm of @a x double Norm(const Vector &x) const { return sqrt(Dot(x, x)); } + + /// Monitor both the residual @a r and the solution @a x void Monitor(int it, double norm, const Vector& r, const Vector& x, bool final=false) const; @@ -186,11 +192,11 @@ public: @details While the convergence criterion is solver specific, most of the provided iterative solvers use one of the following criteria - \f$ ||r||_X \leq tol_{rel}||r_0||_X \f$, + $ ||r||_X \leq tol_{rel}||r_0||_X $, - \f$ ||r||_X \leq tol_{abs} \f$, + $ ||r||_X \leq tol_{abs} $, - \f$ ||r||_X \leq \max\{ tol_{abs}, tol_{rel} ||r_0||_X \} \f$, + $ ||r||_X \leq \max\{ tol_{abs}, tol_{rel} ||r_0||_X \} $, where X denotes the space in which the norm is measured. The choice of X depends on the specific iterative solver. @@ -338,7 +344,11 @@ public: /// Replace diagonal entries with their absolute values. void SetPositiveDiagonal(bool pos_diag = true) { use_abs_diag = pos_diag; } + /// Approach the solution of the linear system by applying Jacobi smoothing. void Mult(const Vector &x, Vector &y) const; + + /** @brief Approach the solution of the transposed linear system by applying + Jacobi smoothing. */ void MultTranspose(const Vector &x, Vector &y) const { Mult(x, y); } /** @brief Recompute the diagonal using the method AssembleDiagonal of the @@ -432,8 +442,12 @@ public: ~OperatorChebyshevSmoother() {} + /** @brief Approach the solution of the linear system by applying Chebyshev + smoothing. */ void Mult(const Vector &x, Vector &y) const; + /** @brief Approach the solution of the transposed linear system by applying + Chebyshev smoothing. */ void MultTranspose(const Vector &x, Vector &y) const { Mult(x, y); } void SetOperator(const Operator &op_) @@ -475,6 +489,7 @@ public: virtual void SetOperator(const Operator &op) { IterativeSolver::SetOperator(op); UpdateVectors(); } + /// Iterative solution of the linear system using Stationary Linear Iteration virtual void Mult(const Vector &b, Vector &x) const; }; @@ -507,6 +522,8 @@ public: virtual void SetOperator(const Operator &op) { IterativeSolver::SetOperator(op); UpdateVectors(); } + /** @brief Iterative solution of the linear system using the Conjugate + Gradient method. */ virtual void Mult(const Vector &b, Vector &x) const; }; @@ -537,6 +554,7 @@ public: /// Set the number of iteration to perform between restarts, default is 50. void SetKDim(int dim) { m = dim; } + /// Iterative solution of the linear system using the GMRES method virtual void Mult(const Vector &b, Vector &x) const; }; @@ -555,6 +573,7 @@ public: void SetKDim(int dim) { m = dim; } + /// Iterative solution of the linear system using the FGMRES method. virtual void Mult(const Vector &b, Vector &x) const; }; @@ -586,6 +605,7 @@ public: virtual void SetOperator(const Operator &op) { IterativeSolver::SetOperator(op); UpdateVectors(); } + /// Iterative solution of the linear system using the BiCGSTAB method virtual void Mult(const Vector &b, Vector &x) const; }; @@ -621,6 +641,7 @@ public: virtual void SetOperator(const Operator &op); + /// Iterative solution of the linear system using the MINRES method virtual void Mult(const Vector &b, Vector &x) const; }; @@ -1101,7 +1122,10 @@ public: /// Set the print level field in the #Control data member. void SetPrintLevel(int print_lvl) { Control[UMFPACK_PRL] = print_lvl; } + /// Direct solution of the linear system using UMFPACK virtual void Mult(const Vector &b, Vector &x) const; + + /// Direct solution of the transposed linear system using UMFPACK virtual void MultTranspose(const Vector &b, Vector &x) const; virtual ~UMFPackSolver(); @@ -1128,7 +1152,10 @@ public: // Works on sparse matrices only; calls SparseMatrix::SortColumnIndices(). virtual void SetOperator(const Operator &op); + /// Direct solution of the linear system using KLU virtual void Mult(const Vector &b, Vector &x) const; + + /// Direct solution of the transposed linear system using KLU virtual void MultTranspose(const Vector &b, Vector &x) const; virtual ~KLUSolver(); @@ -1150,6 +1177,8 @@ public: /// block_dof is a boolean matrix, block_dof(i, j) = 1 if j-th dof belongs to /// i-th block, block_dof(i, j) = 0 otherwise. DirectSubBlockSolver(const SparseMatrix& A, const SparseMatrix& block_dof); + + /// Direct solution of the block diagonal linear system virtual void Mult(const Vector &x, Vector &y) const; virtual void SetOperator(const Operator &op) { } }; @@ -1165,7 +1194,11 @@ public: ProductSolver(Operator* A_, Solver* S0_, Solver* S1_, bool ownA, bool ownS0, bool ownS1) : Solver(A_->NumRows()), A(A_, ownA), S0(S0_, ownS0), S1(S1_, ownS1) { } + + /// Solution of the linear system using a product of subsolvers virtual void Mult(const Vector &x, Vector &y) const; + + /// Solution of the transposed linear system using a product of subsolvers virtual void MultTranspose(const Vector &x, Vector &y) const; virtual void SetOperator(const Operator &op) { } }; @@ -1238,7 +1271,8 @@ public: AuxSpaceSmoother(const HypreParMatrix &op, HypreParMatrix *aux_map, bool op_is_symmetric = true, bool own_aux_map = false); virtual void Mult(const Vector &x, Vector &y) const { Mult(x, y, false); } - virtual void MultTranspose(const Vector &x, Vector &y) const { Mult(x, y, true); } + virtual void MultTranspose(const Vector &x, Vector &y) const + { Mult(x, y, true); } virtual void SetOperator(const Operator &op) { } HypreSmoother& GetSmoother() { return *aux_smoother_.As(); } using Operator::Mult; @@ -1259,28 +1293,34 @@ public: /// The operator must be a DenseMatrix. void SetOperator(const Operator &op) override; + /** @brief Compute the non-negative least squares solution to the + underdetermined system. */ void Mult(const Vector &w, Vector &sol) const override; - /** - * Set verbosity. If set to 0: print nothing; if 1: just print results; - * if 2: print short update on every iteration; if 3: print longer update - * each iteration. + /** @brief + Set verbosity. If set to 0: print nothing; if 1: just print results; + if 2: print short update on every iteration; if 3: print longer update + each iteration. */ void SetVerbosity(int v) { verbosity_ = v; } + /// Set the target absolute residual norm tolerance for convergence void SetTolerance(double tol) { const_tol_ = tol; } /// Set the minimum number of nonzeros required for the solution. void SetMinNNZ(int min_nnz) { min_nnz_ = min_nnz; } - /// Set the maximum number of nonzeros required for the solution, as an early - /// termination condition. + /** @brief Set the maximum number of nonzeros required for the solution, as + an early termination condition. */ void SetMaxNNZ(int max_nnz) { max_nnz_ = max_nnz; } - /// Set threshold on relative change in residual over nStallCheck_ iterations. + /** @brief Set threshold on relative change in residual over nStallCheck_ + iterations. */ void SetResidualChangeTolerance(double tol) { res_change_termination_tol_ = tol; } + /** @brief Set the magnitude of projected residual entries that are + considered zero. Increasing this value relaxes solution constraints. */ void SetZeroTolerance(double tol) { zero_tol_ = tol; } /// Set RHS vector constant shift, defining rhs_lb and rhs_ub in Solve(). @@ -1298,7 +1338,7 @@ public: /// Set a flag to determine whether to call NormalizeConstraints(). void SetNormalize(bool n) { normalize_ = n; } - /** + /** @brief * Enumerated types of QRresidual mode. Options are 'off': the residual is * calculated normally, 'on': the residual is calculated using the QR * method, 'hybrid': the residual is calculated normally until we experience @@ -1308,7 +1348,7 @@ public: */ enum class QRresidualMode {off, on, hybrid}; - /** + /** @brief * Set the residual calculation mode for the NNLS solver. See QRresidualMode * enum above for details. */ @@ -1329,7 +1369,7 @@ public: */ void Solve(const Vector& rhs_lb, const Vector& rhs_ub, Vector& soln) const; - /** + /** @brief * Normalize the constraints such that the tolerances for each constraint * (i.e. (UB - LB)/2) are equal. This seems to help the performance in most * cases. diff --git a/linalg/sparsemat.cpp b/linalg/sparsemat.cpp index 6f1b0d6828..99b41042f3 100644 --- a/linalg/sparsemat.cpp +++ b/linalg/sparsemat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -1767,6 +1767,7 @@ void SparseMatrix::EliminateCol(int col, DiagonalPolicy dpolicy) if (aux->Column == col) { aux->Value = 0.0; + break; } } } @@ -3293,16 +3294,35 @@ void SparseMatrix::PrintMatlab(std::ostream & os) const { os << "% size " << height << " " << width << "\n"; os << "% Non Zeros " << NumNonZeroElems() << "\n"; + int i, j; ios::fmtflags old_fmt = os.flags(); os.setf(ios::scientific); std::streamsize old_prec = os.precision(14); - for (i = 0; i < height; i++) + if (A == NULL) { - for (j = I[i]; j < I[i+1]; j++) + RowNode *nd; + for (i = 0; i < height; i++) { - os << i+1 << " " << J[j]+1 << " " << A[j] << '\n'; + for (nd = Rows[i], j = 0; nd != NULL; nd = nd->Prev, j++) + { + os << i+1 << " " << nd->Column+1 << " " << nd->Value << '\n'; + } + } + } + else + { + // HostRead forces synchronization + HostReadI(); + HostReadJ(); + HostReadData(); + for (i = 0; i < height; i++) + { + for (j = I[i]; j < I[i+1]; j++) + { + os << i+1 << " " << J[j]+1 << " " << A[j] << '\n'; + } } } // Write a zero entry at (m,n) to make sure MATLAB doesn't shrink the matrix @@ -3322,11 +3342,30 @@ void SparseMatrix::PrintMM(std::ostream & os) const << "% Generated by MFEM" << '\n'; os << height << " " << width << " " << NumNonZeroElems() << '\n'; - for (i = 0; i < height; i++) + + if (A == NULL) { - for (j = I[i]; j < I[i+1]; j++) + RowNode *nd; + for (i = 0; i < height; i++) { - os << i+1 << " " << J[j]+1 << " " << A[j] << '\n'; + for (nd = Rows[i], j = 0; nd != NULL; nd = nd->Prev, j++) + { + os << i+1 << " " << nd->Column+1 << " " << nd->Value << '\n'; + } + } + } + else + { + // HostRead forces synchronization + HostReadI(); + HostReadJ(); + HostReadData(); + for (i = 0; i < height; i++) + { + for (j = I[i]; j < I[i+1]; j++) + { + os << i+1 << " " << J[j]+1 << " " << A[j] << '\n'; + } } } os.precision(old_prec); @@ -3341,6 +3380,10 @@ void SparseMatrix::PrintCSR(std::ostream & os) const os << height << '\n'; // number of rows + // HostRead forces synchronization + HostReadI(); + HostReadJ(); + HostReadData(); for (i = 0; i <= height; i++) { os << I[i]+1 << '\n'; @@ -3366,6 +3409,10 @@ void SparseMatrix::PrintCSR2(std::ostream & os) const os << height << '\n'; // number of rows os << width << '\n'; // number of columns + // HostRead forces synchronization + HostReadI(); + HostReadJ(); + HostReadData(); for (i = 0; i <= height; i++) { os << I[i] << '\n'; diff --git a/linalg/sparsemat.hpp b/linalg/sparsemat.hpp index bc472739f0..5b0c87fd54 100644 --- a/linalg/sparsemat.hpp +++ b/linalg/sparsemat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -433,9 +433,9 @@ public: /// Compute y^t A x double InnerProduct(const Vector &x, const Vector &y) const; - /// For all i compute \f$ x_i = \sum_j A_{ij} \f$ + /// For all i compute $ x_i = \sum_j A_{ij} $ void GetRowSums(Vector &x) const; - /// For i = irow compute \f$ x_i = \sum_j | A_{i, j} | \f$ + /// For i = irow compute $ x_i = \sum_j | A_{i, j} | $ double GetRowNorml1(int irow) const; /// This virtual method is not supported: it always returns NULL. @@ -530,11 +530,11 @@ public: void DiagScale(const Vector &b, Vector &x, double sc = 1.0, bool use_abs_diag = false) const; - /** x1 = x0 + sc D^{-1} (b - A x0) where \f$ D_{ii} = \sum_j |A_{ij}| \f$. */ + /** x1 = x0 + sc D^{-1} (b - A x0) where $ D_{ii} = \sum_j |A_{ij}| $. */ void Jacobi2(const Vector &b, const Vector &x0, Vector &x1, double sc = 1.0) const; - /** x1 = x0 + sc D^{-1} (b - A x0) where \f$ D_{ii} = \sum_j A_{ij} \f$. */ + /** x1 = x0 + sc D^{-1} (b - A x0) where $ D_{ii} = \sum_j A_{ij} $. */ void Jacobi3(const Vector &b, const Vector &x0, Vector &x1, double sc = 1.0) const; @@ -650,18 +650,23 @@ public: SparseMatrix &operator*=(double a); /// Prints matrix to stream out. + /** @note The host in synchronized when the finalized matrix is on the device. */ void Print(std::ostream &out = mfem::out, int width_ = 4) const; /// Prints matrix in matlab format. + /** @note The host in synchronized when the finalized matrix is on the device. */ virtual void PrintMatlab(std::ostream &out = mfem::out) const; /// Prints matrix in Matrix Market sparse format. + /** @note The host in synchronized when the finalized matrix is on the device. */ void PrintMM(std::ostream &out = mfem::out) const; /// Prints matrix to stream out in hypre_CSRMatrix format. + /** @note The host in synchronized when the finalized matrix is on the device. */ void PrintCSR(std::ostream &out) const; /// Prints a sparse matrix to stream out in CSR format. + /** @note The host in synchronized when the finalized matrix is on the device. */ void PrintCSR2(std::ostream &out) const; /// Print various sparse matrix statistics. diff --git a/linalg/sparsesmoothers.cpp b/linalg/sparsesmoothers.cpp index 5c15d41361..5ead162986 100644 --- a/linalg/sparsesmoothers.cpp +++ b/linalg/sparsesmoothers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/sparsesmoothers.hpp b/linalg/sparsesmoothers.hpp index d067cecd79..0641c6b221 100644 --- a/linalg/sparsesmoothers.hpp +++ b/linalg/sparsesmoothers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/strumpack.cpp b/linalg/strumpack.cpp index 270a4483a5..a6f38f9046 100644 --- a/linalg/strumpack.cpp +++ b/linalg/strumpack.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/strumpack.hpp b/linalg/strumpack.hpp index 42ae555c79..a03b89d707 100644 --- a/linalg/strumpack.hpp +++ b/linalg/strumpack.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -31,30 +31,37 @@ namespace mfem class STRUMPACKRowLocMatrix : public Operator { public: - /** Creates a general parallel matrix from a local CSR matrix on each - processor described by the I, J and data arrays. The local matrix should - be of size (local) nrows by (global) glob_ncols. The new parallel matrix - contains copies of all input arrays (so they can be deleted). */ + /** @brief Creates a general parallel matrix from a local CSR matrix on each + processor. + + The CSR matrix is described by the I, J and data arrays. The local matrix + should be of size (local) nrows by (global) glob_ncols. The new parallel + matrix contains copies of all input arrays (so they can be deleted). */ STRUMPACKRowLocMatrix(MPI_Comm comm, int num_loc_rows, HYPRE_BigInt first_loc_row, HYPRE_BigInt glob_nrows, HYPRE_BigInt glob_ncols, int *I, HYPRE_BigInt *J, double *data, bool sym_sparse = false); - /** Creates a copy of the parallel matrix hypParMat in STRUMPACK's RowLoc - format. All data is copied so the original matrix may be deleted. */ + /** @brief Creates a copy of the parallel matrix hypParMat in STRUMPACK's + RowLoc format. + + All data is copied so the original matrix may be deleted. */ STRUMPACKRowLocMatrix(const Operator &op, bool sym_sparse = false); ~STRUMPACKRowLocMatrix(); + /// Matrix vector products are not supported for this type of matrix. void Mult(const Vector &x, Vector &y) const { MFEM_ABORT("STRUMPACKRowLocMatrix::Mult: Matrix vector products are not " "supported!"); } + /// Get the MPI Comm being used by the parallel matrix. MPI_Comm GetComm() const { return A_->comm(); } + /// Get access to the internal CSR matrix. strumpack::CSRMatrixMPI *GetA() const { return A_; } private: @@ -66,52 +73,80 @@ private: The mfem::STRUMPACKSolver class uses the STRUMPACK library to perform LU factorization of a parallel sparse matrix. The solver is capable of handling double precision types. See - http://portal.nersc.gov/project/sparse/strumpack/. -*/ + http://portal.nersc.gov/project/sparse/strumpack/. */ template class STRUMPACKSolverBase : public Solver { protected: - // Constructor with MPI_Comm parameter and command line arguments. + /** @brief Constructor with MPI_Comm parameter and command line arguments. + + STRUMPACKSolverBase::SetFromCommandLine must be called for the command + line arguments to be used. */ STRUMPACKSolverBase(MPI_Comm comm, int argc, char *argv[]); - // Constructor with STRUMPACK matrix object and command line arguments. + /** @brief Constructor with STRUMPACK matrix object and command line + arguments. + + STRUMPACKSolverBase::SetFromCommandLine must be called for the command + line arguments to be used. */ STRUMPACKSolverBase(STRUMPACKRowLocMatrix &A, int argc, char *argv[]); public: - // Default destructor. + /// Default destructor. virtual ~STRUMPACKSolverBase(); - // Factor and solve the linear system y = Op^{-1} x. + /// Factor and solve the linear system $y = Op^{-1} x $. void Mult(const Vector &x, Vector &y) const; + + /** @brief Factor and solve the linear systems $ Y_i = Op^{-1} X_i $ + across the array of vectors. */ void ArrayMult(const Array &X, Array &Y) const; - // Set the operator. + /** @brief Set the operator/matrix. + \note @a A must be a STRUMPACKRowLocMatrix. */ void SetOperator(const Operator &op); - // Set various solver options. Refer to STRUMPACK documentation for - // details. + /** @brief Set options that were captured from the command line. + + These were captured in the constructer STRUMPACKSolverBase. Refer + to the STRUMPACK documentation for details. */ void SetFromCommandLine(); + + /// Set up verbose printing during the factor step void SetPrintFactorStatistics(bool print_stat); + + /// Set up verbose printing during the solve step void SetPrintSolveStatistics(bool print_stat); - // Set tolerances and iterations for iterative solvers. Compression - // tolerance is handled below. + /// Set the relative tolerance for interative solvers void SetRelTol(double rtol); + + /// Set the absolute tolerance for iterative solvers void SetAbsTol(double atol); + + /// Set the maximum number of iterations for iterative solvers void SetMaxIter(int max_it); - // Set the flag controlling reuse of the symbolic factorization for multiple - // operators. This method has to be called before repeated calls to - // SetOperator. + /** @brief Set the flag controlling reuse of the symbolic factorization for + multiple operators. + + This method must be called before repeated calls to SetOperator. */ void SetReorderingReuse(bool reuse); - // Enable or not GPU off-loading available if STRUMPACK was compiled with CUDA. Note - // that input/output from MFEM to STRUMPACK is all still through host memory. + /** @brief Enable GPU off-loading available if STRUMPACK was compiled with + CUDA. + @note Input/Output from MFEM to STRUMPACK is all still through host + memory. */ void EnableGPU(); + + /** @brief Disable GPU off-loading available if STRUMPACK was compiled with + CUDA. + @note Input/Output from MFEM to STRUMPACK is all still through host + memory. */ void DisableGPU(); - /** + /** @brief Set the Krylov solver method to use + * * STRUMPACK is an (approximate) direct solver. It can be used as a direct * solver or as a preconditioner. To use STRUMPACK as only a preconditioner, * set the Krylov solver to DIRECT. STRUMPACK also provides iterative solvers @@ -119,91 +154,117 @@ public: * used without preconditioner. * * Supported values are: - * AUTO: Use iterative refinement if no HSS compression is - * used, otherwise use GMRes - * DIRECT: No outer iterative solver, just a single application + * - AUTO: Use iterative refinement if no HSS compression is + * used, otherwise use GMRES + * - DIRECT: No outer iterative solver, just a single application * of the multifrontal solver - * REFINE: Iterative refinement - * PREC_GMRES: Preconditioned GMRes + * - REFINE: Iterative refinement + * - PREC_GMRES: Preconditioned GMRES * The preconditioner is the (approx) multifrontal solver - * GMRES: UN-preconditioned GMRes (for testing mainly) - * PREC_BICGSTAB: Preconditioned BiCGStab + * - GMRES: UN-preconditioned GMRES (for testing mainly) + * - PREC_BICGSTAB: Preconditioned BiCGStab * The preconditioner is the (approx) multifrontal solver - * BICGSTAB: UN-preconditioned BiCGStab. (for testing mainly) + * - BICGSTAB: UN-preconditioned BiCGStab. (for testing mainly) */ void SetKrylovSolver(strumpack::KrylovSolver method); - /** + /** @brief Set matrix reordering strategy + * * Supported reorderings are: - * NATURAL: Do not reorder the system - * METIS: Use Metis nested-dissection reordering (default) - * PARMETIS: Use ParMetis nested-dissection reordering - * SCOTCH: Use Scotch nested-dissection reordering - * PTSCOTCH: Use PT-Scotch nested-dissection reordering - * RCM: Use RCM reordering - * GEOMETRIC: A simple geometric nested dissection code that + * - NATURAL: Do not reorder the system + * - METIS: Use Metis nested-dissection reordering (default) + * - PARMETIS: Use ParMetis nested-dissection reordering + * - SCOTCH: Use Scotch nested-dissection reordering + * - PTSCOTCH: Use PT-Scotch nested-dissection reordering + * - RCM: Use RCM reordering + * - GEOMETRIC: A simple geometric nested dissection code that * only works for regular meshes - * AMD: Approximate minimum degree - * MMD: Multiple minimum degree - * AND: Nested dissection - * MLF: Minimum local fill - * SPECTRAL: Spectral nested dissection + * - AMD: Approximate minimum degree + * - MMD: Multiple minimum degree + * - AND: Nested dissection + * - MLF: Minimum local fill + * - SPECTRAL: Spectral nested dissection */ void SetReorderingStrategy(strumpack::ReorderingStrategy method); - /** - * Configure static pivoting for stability. The static pivoting in STRUMPACK + /** @brief Configure static pivoting for stability. + * + * The static pivoting in STRUMPACK * permutes the sparse input matrix in order to get large (nonzero) elements * on the diagonal. If the input matrix is already diagonally dominant, this * reordering can be disabled. * * Supported matching algorithms are: - * NONE: Don't do anything - * MAX_CARDINALITY: Maximum cardinality - * MAX_SMALLEST_DIAGONAL: Maximum smallest diagonal value - * MAX_SMALLEST_DIAGONAL_2: Same as MAX_SMALLEST_DIAGONAL + * - NONE: Don't do anything + * - MAX_CARDINALITY: Maximum cardinality + * - MAX_SMALLEST_DIAGONAL: Maximum smallest diagonal value + * - MAX_SMALLEST_DIAGONAL_2: Same as MAX_SMALLEST_DIAGONAL * but different algorithm - * MAX_DIAGONAL_SUM: Maximum sum of diagonal values - * MAX_DIAGONAL_PRODUCT_SCALING: Maximum product of diagonal values + * - MAX_DIAGONAL_SUM: Maximum sum of diagonal values + * - MAX_DIAGONAL_PRODUCT_SCALING: Maximum product of diagonal values * and row and column scaling (default) - * COMBBLAS: Use AWPM from CombBLAS (only with + * - COMBBLAS: Use AWPM from CombBLAS (only with * version >= 3) */ void SetMatching(strumpack::MatchingJob job); - /** + /** @brief Select compression for sparse data types + * * Enable support for rank-structured data formats, which can be used * for compression within the sparse solver. * * Supported compression types are: - * NONE: No compression, purely direct solver (default) - * HSS: HSS compression of frontal matrices - * BLR: Block low-rank compression of fronts - * HODLR: Hierarchically Off-diagonal Low-Rank + * - NONE: No compression, purely direct solver (default) + * - HSS: HSS compression of frontal matrices + * - BLR: Block low-rank compression of fronts + * - HODLR: Hierarchically Off-diagonal Low-Rank * compression of frontal matrices - * BLR_HODLR: Block low-rank compression of medium + * - BLR_HODLR: Block low-rank compression of medium * fronts and Hierarchically Off-diagonal * Low-Rank compression of large fronts - * ZFP_BLR_HODLR: ZFP compression for small fronts, + * - ZFP_BLR_HODLR: ZFP compression for small fronts, * Block low-rank compression of medium * fronts and Hierarchically Off-diagonal * Low-Rank compression of large fronts - * LOSSLESS: Lossless compression - * LOSSY: Lossy compression + * - LOSSLESS: Lossless compression + * - LOSSY: Lossy compression * * For versions of STRUMPACK < 5, we support only NONE, HSS, and BLR. * BLR_HODLR and ZPR_BLR_HODLR are supported in STRUMPACK >= 6. */ void SetCompression(strumpack::CompressionType type); + + /** @brief Set the relative tolerance for low rank compression methods + * + * This currently affects BLR, HSS, and HODLR. Use + * STRUMPACKSolverBase::SetCompression to set the proper compression type. + */ void SetCompressionRelTol(double rtol); + + /** @brief Set the absolute tolerance for low rank compression methods + * + * This currently affects BLR, HSS, and HODLR. Use + * STRUMPACKSolverBase::SetCompression to set the proper compression type. + */ void SetCompressionAbsTol(double atol); + #if STRUMPACK_VERSION_MAJOR >= 5 + /** @brief Set the precision for the lossy compression option + * + * Use STRUMPACKSolverBase::SetCompression to set the proper compression + * type. */ void SetCompressionLossyPrecision(int precision); + + /** @brief Set the number of butterfly levels for the HODLR compression + * option. + * + * Use STRUMPACKSolverBase::SetCompression to set the proper compression + * type. */ void SetCompressionButterflyLevels(int levels); #endif private: - // Helper method for calling the STRUMPACK factoriation routine. + /// Helper method for calling the STRUMPACK factoriation routine. void FactorInternal() const; protected: @@ -223,21 +284,30 @@ class STRUMPACKSolver : SparseSolverMPIDist> { public: - // Constructor with MPI_Comm parameter. + /// Constructor with the MPI Comm parameter STRUMPACKSolver(MPI_Comm comm); - // Constructor with STRUMPACK matrix object. + /// Constructor with STRUMPACK matrix object. STRUMPACKSolver(STRUMPACKRowLocMatrix &A); - // Constructor with MPI_Comm parameter and command line arguments. + /** @brief Constructor with MPI_Comm parameter and command line arguments. + + SetFromCommandLine must be called for the command line arguments + to be used. + */ STRUMPACKSolver(MPI_Comm comm, int argc, char *argv[]); MFEM_DEPRECATED STRUMPACKSolver(int argc, char *argv[], MPI_Comm comm) : STRUMPACKSolver(comm, argc, argv) {} - // Constructor with STRUMPACK matrix object and command line arguments. + /** @brief Constructor with STRUMPACK matrix object and command line + arguments. + + SetFromCommandLine must be called for the command line arguments + to be used. + */ STRUMPACKSolver(STRUMPACKRowLocMatrix &A, int argc, char *argv[]); - // Destructor. + /// Destructor. ~STRUMPACKSolver() {} }; @@ -247,20 +317,29 @@ class STRUMPACKMixedPrecisionSolver : SparseSolverMixedPrecisionMPIDist> { public: - // Constructor with MPI_Comm parameter. + /// Constructor with MPI_Comm parameter. STRUMPACKMixedPrecisionSolver(MPI_Comm comm); - // Constructor with STRUMPACK matrix object. + /// Constructor with STRUMPACK matrix object. STRUMPACKMixedPrecisionSolver(STRUMPACKRowLocMatrix &A); - // Constructor with MPI_Comm parameter and command line arguments. + /** @brief Constructor with MPI_Comm parameter and command line arguments. + + SetFromCommandLine must be called for the command line arguments + to be used. + */ STRUMPACKMixedPrecisionSolver(MPI_Comm comm, int argc, char *argv[]); - // Constructor with STRUMPACK matrix object and command line arguments. + /** @brief Constructor with STRUMPACK matrix object and command line + arguments. + + SetFromCommandLine must be called for the command line arguments + to be used. + */ STRUMPACKMixedPrecisionSolver(STRUMPACKRowLocMatrix &A, int argc, char *argv[]); - // Destructor. + /// Destructor. ~STRUMPACKMixedPrecisionSolver() {} }; #endif diff --git a/linalg/sundials.cpp b/linalg/sundials.cpp index 59cc4dd7f9..55414c32d3 100644 --- a/linalg/sundials.cpp +++ b/linalg/sundials.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/sundials.hpp b/linalg/sundials.hpp index 451c12b02e..f34b4deaf7 100644 --- a/linalg/sundials.hpp +++ b/linalg/sundials.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -392,13 +392,13 @@ protected: /// Wrapper to compute the ODE rhs function. static int RHS(realtype t, const N_Vector y, N_Vector ydot, void *user_data); - /// Setup the linear system \f$ A x = b \f$. + /// Setup the linear system $ A x = b $. static int LinSysSetup(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, booleantype jok, booleantype *jcur, realtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); - /// Solve the linear system \f$ A x = b \f$. + /// Solve the linear system $ A x = b $. static int LinSysSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, realtype tol); @@ -693,28 +693,28 @@ protected: static int RHS2(realtype t, const N_Vector y, N_Vector ydot, void *user_data); ///@} - /// Setup the linear system \f$ A x = b \f$. + /// Setup the linear system $ A x = b $. static int LinSysSetup(realtype t, N_Vector y, N_Vector fy, SUNMatrix A, SUNMatrix M, booleantype jok, booleantype *jcur, realtype gamma, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); - /// Solve the linear system \f$ A x = b \f$. + /// Solve the linear system $ A x = b $. static int LinSysSolve(SUNLinearSolver LS, SUNMatrix A, N_Vector x, N_Vector b, realtype tol); - /// Setup the linear system \f$ M x = b \f$. + /// Setup the linear system $ M x = b $. static int MassSysSetup(realtype t, SUNMatrix M, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); - /// Solve the linear system \f$ M x = b \f$. + /// Solve the linear system $ M x = b $. static int MassSysSolve(SUNLinearSolver LS, SUNMatrix M, N_Vector x, N_Vector b, realtype tol); - /// Compute the matrix-vector product \f$ v = M x \f$. + /// Compute the matrix-vector product $ v = M x $. static int MassMult1(SUNMatrix M, N_Vector x, N_Vector v); - /// Compute the matrix-vector product \f$v = M_t x \f$ at time t. + /// Compute the matrix-vector product $v = M_t x $ at time t. static int MassMult2(N_Vector x, N_Vector v, realtype t, void* mtimes_data); @@ -856,18 +856,18 @@ protected: int maxli = 5; ///< Maximum linear iterations int maxlrs = 0; ///< Maximum linear solver restarts - /// Wrapper to compute the nonlinear residual \f$ F(u) = 0 \f$. + /// Wrapper to compute the nonlinear residual $ F(u) = 0 $. static int Mult(const N_Vector u, N_Vector fu, void *user_data); - /// Wrapper to compute the Jacobian-vector product \f$ J(u) v = Jv \f$. + /// Wrapper to compute the Jacobian-vector product $ J(u) v = Jv $. static int GradientMult(N_Vector v, N_Vector Jv, N_Vector u, booleantype *new_u, void *user_data); - /// Setup the linear system \f$ J u = b \f$. + /// Setup the linear system $ J u = b $. static int LinSysSetup(N_Vector u, N_Vector fu, SUNMatrix J, void *user_data, N_Vector tmp1, N_Vector tmp2); - /// Solve the linear system \f$ J u = b \f$. + /// Solve the linear system $ J u = b $. static int LinSysSolve(SUNLinearSolver LS, SUNMatrix J, N_Vector u, N_Vector b, realtype tol); @@ -878,7 +878,7 @@ protected: N_Vector fscale, void *user_data); - /// Solve the preconditioner equation \f$ Pz = v \f$. + /// Solve the preconditioner equation $ Pz = v $. static int PrecSolve(N_Vector uu, N_Vector uscale, N_Vector fval, @@ -930,7 +930,7 @@ public: virtual void SetPreconditioner(Solver &solver) { SetSolver(solver); } /// Set KINSOL's scaled step tolerance. - /** The default tolerance is \f$ U^\frac{2}{3} \f$ , where + /** The default tolerance is $ U^\frac{2}{3} $ , where U = machine unit round-off. @note This method must be called after SetOperator(). */ void SetScaledStepTol(double sstol); @@ -972,7 +972,7 @@ public: /// This method is not supported and will throw an error. virtual void SetPrintLevel(PrintLevel); - /// Solve the nonlinear system \f$ F(x) = 0 \f$. + /// Solve the nonlinear system $ F(x) = 0 $. /** This method computes the x_scale and fx_scale vectors and calls the other Mult(Vector&, Vector&, Vector&) const method. The x_scale vector is a vector of ones and values of fx_scale are determined by comparing @@ -983,7 +983,7 @@ public: solution */ virtual void Mult(const Vector &b, Vector &x) const; - /// Solve the nonlinear system \f$ F(x) = 0 \f$. + /// Solve the nonlinear system $ F(x) = 0 $. /** Calls KINSol() to solve the nonlinear system. Before calling KINSol(), this functions uses the data members inherited from class IterativeSolver to set corresponding KINSOL options. diff --git a/linalg/superlu.cpp b/linalg/superlu.cpp index c120c4f228..0267960922 100644 --- a/linalg/superlu.cpp +++ b/linalg/superlu.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/superlu.hpp b/linalg/superlu.hpp index e220207518..6b71a147ba 100644 --- a/linalg/superlu.hpp +++ b/linalg/superlu.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -29,22 +29,89 @@ namespace superlu // Copy selected enumerations from SuperLU (from superlu_enum_consts.h) #ifdef MFEM_USE_SUPERLU5 -typedef enum {NOROWPERM, LargeDiag, MY_PERMR} RowPerm; +typedef enum +{ + NOROWPERM, + LargeDiag, + MY_PERMR +} RowPerm; #else -typedef enum {NOROWPERM, LargeDiag_MC64, LargeDiag_HWPM, MY_PERMR} RowPerm; +/// Define the type of row permutation +typedef enum +{ + /// No row permutation + NOROWPERM, + /** @brief Duff/Koster algorithm to make the diagonals large compared to the + off-diagonals. Use LargeDiag for SuperLU version 5 and below. */ + LargeDiag_MC64, + /** @brief Parallel approximate weight perfect matching to make the diagonals + large compared to the off-diagonals. Option doesn't exist in SuperLU + version 5 and below. */ + LargeDiag_HWPM, + /// User defined row permutation + MY_PERMR +} RowPerm; #endif -typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD, - METIS_AT_PLUS_A, PARMETIS, ZOLTAN, MY_PERMC - } ColPerm; -typedef enum {NOREFINE, SLU_SINGLE=1, SLU_DOUBLE, SLU_EXTRA} IterRefine; -typedef enum {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED} Fact; + +/// Define the type of column permutation +typedef enum +{ + /// Natural ordering + NATURAL, + /// Minimum degree ordering on structure of $ A^T*A $ + MMD_ATA, + /// Minimum degree ordering on structure of $ A^T+A $ + MMD_AT_PLUS_A, + /// Approximate minimum degree column ordering + COLAMD, + /// Sequential ordering on structure of $ A^T+A $ using the METIS package + METIS_AT_PLUS_A, + /** @brief Sequential ordering on structure of $ A^T+A $ using the + PARMETIS package */ + PARMETIS, + /// Use the Zoltan library from Sandia to define the column ordering + ZOLTAN, + /// User defined column permutation + MY_PERMC +} ColPerm; + +/// Define how to do iterative refinement +typedef enum +{ + /// No interative refinement + NOREFINE, + /// Iterative refinement accumulating residuals in a float. + SLU_SINGLE=1, + /// Iterative refinement accumulating residuals in a double. + SLU_DOUBLE, + /// Iterative refinement accumulating residuals in a higher precision variable. + SLU_EXTRA +} IterRefine; + +/** @brief Define the information that is provided about the matrix + factorization ahead of time. */ +typedef enum +{ + /// No information is provided, do the full factorization. + DOFACT, + /** @brief Matrix A will be factored assuming the sparsity is the same as a + previous factorization. Column permutations will be reused. */ + SamePattern, + /** @brief Matrix A will be factored assuming the sparsity is the same and + the matrix as a previous are similar as a previous factorization. Column + permutations and row permutations will be reused. */ + SamePattern_SameRowPerm, + /** @brief The matrix A was provided in fully factored form and no + factorization is needed. */ + FACTORED +} Fact; } // namespace superlu class SuperLURowLocMatrix : public Operator { public: - /** Creates a general parallel matrix from a local CSR matrix on each + /** @brief Creates a general parallel matrix from a local CSR matrix on each processor described by the I, J and data arrays. The local matrix should be of size (local) nrows by (global) glob_ncols. The new parallel matrix contains copies of all input arrays (so they can be deleted). */ @@ -53,12 +120,14 @@ public: HYPRE_BigInt glob_nrows, HYPRE_BigInt glob_ncols, int *I, HYPRE_BigInt *J, double *data); - /** Creates a copy of the parallel matrix hypParMat in SuperLU's RowLoc - format. All data is copied so the original matrix may be deleted. */ + /** @brief Creates a copy of the parallel matrix hypParMat in SuperLU's + RowLoc format. All data is copied so the original matrix may be + deleted. */ SuperLURowLocMatrix(const Operator &op); ~SuperLURowLocMatrix(); + /// Matrix Vector products are not supported for this type of matrix void Mult(const Vector &x, Vector &y) const { MFEM_ABORT("SuperLURowLocMatrix::Mult: Matrix vector products are not " @@ -67,10 +136,13 @@ public: void *InternalData() const { return rowLocPtr_; } + /// Get the MPI communicator for this matrix MPI_Comm GetComm() const { return comm_; } + /// Get the number of global rows in this matrix HYPRE_BigInt GetGlobalNumRows() const { return num_global_rows_; } + /// Get the number of global columns in this matrix HYPRE_BigInt GetGlobalNumColumns() const { return num_global_cols_; } private: @@ -79,7 +151,7 @@ private: HYPRE_BigInt num_global_rows_, num_global_cols_; }; -/** The MFEM SuperLU Direct Solver class. +/** The MFEM wrapper around the SuperLU Direct Solver class. The mfem::SuperLUSolver class uses the SuperLU_DIST library to perform LU factorization of a parallel sparse matrix. The solver is capable of handling @@ -89,41 +161,106 @@ private: class SuperLUSolver : public Solver { public: - // Constructor with MPI_Comm parameter. + /** @brief Constructor with MPI_Comm parameter. + + @a npdep is the replication factor for the matrix + data and must be a power of 2 and divide evenly + into the number of processors. */ SuperLUSolver(MPI_Comm comm, int npdep = 1); - // Constructor with SuperLU matrix object. + /** @brief Constructor with SuperLU matrix object. + + @a npdep is the replication factor for the matrix + data and must be a power of 2 and divide evenly + into the number of processors. */ SuperLUSolver(SuperLURowLocMatrix &A, int npdep = 1); - // Default destructor. + /// Default destructor. ~SuperLUSolver(); - // Set the operator. + /** @brief Set the operator/matrix. + @note @a A must be a SuperLURowLocMatrix. */ void SetOperator(const Operator &op); - // Factor and solve the linear system y = Op^{-1} x. - // Note: Factorization modifies the operator matrix. + /** @brief Factor and solve the linear system $ y = Op^{-1} x $ + @note Factorization modifies the operator matrix. */ void Mult(const Vector &x, Vector &y) const; + + /** @brief Factor and solve the linear systems $ y_i = Op^{-1} x_i $ + for all i in the @a X and @a Y arrays. + @note Factorization modifies the operator matrix. */ void ArrayMult(const Array &X, Array &Y) const; - // Factor and solve the linear system y = Op^{-T} x. - // Note: Factorization modifies the operator matrix. + /** @brief Factor and solve the transposed linear system + $ y = Op^{-T} x $ + @note Factorization modifies the operator matrix. */ void MultTranspose(const Vector &x, Vector &y) const; + + /** @brief Factor and solve the transposed linear systems + $ y_i = Op^{-T} x_i $ for all i in the @a X and @a Y arrays. + @note Factorization modifies the operator matrix. */ void ArrayMultTranspose(const Array &X, Array &Y) const; - // Set various solver options. Refer to SuperLU_DIST documentation for - // details. + /// Specify whether to print the solver statistics (default true) void SetPrintStatistics(bool print_stat); + + /** @brief Specify whether to equibrate the system scaling to make + the rows and columns have unit norms. (default true) */ void SetEquilibriate(bool equil); + + /** @brief Specify how to permute the columns of the matrix. + + Supported options are: + superlu::NATURAL, superlu::MMD_ATA, superlu::MMD_AT_PLUS_A, + superlu::COLAMD, superlu::METIS_AT_PLUS_A (default), + superlu::PARMETIS, superlu::ZOLTAN, superlu::MY_PERMC */ void SetColumnPermutation(superlu::ColPerm col_perm); + + /** @brief Specify how to permute the rows of the matrix. + + Supported options are: + superlu::NOROWPERM, superlu::LargeDiag (default), superlu::MY_PERMR for + SuperLU version 5. For later versions the supported options are: + superlu::NOROWPERM, superlu::LargeDiag_MC64 (default), + superlu::LargeDiag_HWPM, superlu::MY_PERMR */ void SetRowPermutation(superlu::RowPerm row_perm); + + /** @brief Specify how to handle iterative refinement + + Supported options are: + superlu::NOREFINE, superlu::SLU_SINGLE, + superlu::SLU_DOUBLE (default), superlu::SLU_EXTRA */ void SetIterativeRefine(superlu::IterRefine iter_ref); + + /** @brief Specify whether to replace tiny diagonals encountered + during pivot with $ \sqrt{\epsilon} \lVert A \rVert $ + (default false) */ void SetReplaceTinyPivot(bool rtp); + + /// Specify the number of levels in the look-ahead factorization (default 10) void SetNumLookAheads(int num_lookaheads); + + /** @brief Specifies whether to use the elimination tree computed from the + serial symbolic factorization to perform static scheduling + (default false) */ void SetLookAheadElimTree(bool etree); + + /** @brief Specify whether the matrix has a symmetric pattern to avoid extra + work (default false) */ void SetSymmetricPattern(bool sym); + + /** @brief Specify whether to perform parallel symbolic factorization. + @note If true SuperLU will use superlu::PARMETIS for the Column + Permutation regardless of the setting */ void SetParSymbFact(bool par); + + /** @brief Specify what information has been provided ahead of time about the + factorization of A. + + Supported options are: + superlu::DOFACT, superlu::SamePattern, superlu::SamePattern_SameRowPerm, + superlu::FACTORED*/ void SetFact(superlu::Fact fact); // Processor grid for SuperLU_DIST. diff --git a/linalg/symmat.cpp b/linalg/symmat.cpp index 2625416f28..3fda1c9f45 100644 --- a/linalg/symmat.cpp +++ b/linalg/symmat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/symmat.hpp b/linalg/symmat.hpp index dbb137ba1d..ac2b74a3dc 100644 --- a/linalg/symmat.hpp +++ b/linalg/symmat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/tensor.hpp b/linalg/tensor.hpp index a503abb09c..12c8c48b47 100644 --- a/linalg/tensor.hpp +++ b/linalg/tensor.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/tlayout.hpp b/linalg/tlayout.hpp index e20c4bbc05..fce3dd9b97 100644 --- a/linalg/tlayout.hpp +++ b/linalg/tlayout.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/tmatrix.hpp b/linalg/tmatrix.hpp index cf6a301915..6f2b4925bd 100644 --- a/linalg/tmatrix.hpp +++ b/linalg/tmatrix.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/ttensor.hpp b/linalg/ttensor.hpp index 28115d1d35..91ca2bb95b 100644 --- a/linalg/ttensor.hpp +++ b/linalg/ttensor.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/vector.cpp b/linalg/vector.cpp index 21f4b8c2c2..60991fd7ad 100644 --- a/linalg/vector.cpp +++ b/linalg/vector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/linalg/vector.hpp b/linalg/vector.hpp index 6037a5fa80..7c8a5f7c17 100644 --- a/linalg/vector.hpp +++ b/linalg/vector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/makefile b/makefile index d6e8f11e00..b7ab09d847 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/mesh/CMakeLists.txt b/mesh/CMakeLists.txt index d107ff7763..1e53ded29a 100644 --- a/mesh/CMakeLists.txt +++ b/mesh/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/mesh/element.cpp b/mesh/element.cpp index c21b8f9bd0..19586e7240 100644 --- a/mesh/element.cpp +++ b/mesh/element.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/element.hpp b/mesh/element.hpp index 1a265a5068..e9dd07217c 100644 --- a/mesh/element.hpp +++ b/mesh/element.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/gmsh.cpp b/mesh/gmsh.cpp index b164cad89b..d5d8dd3a79 100644 --- a/mesh/gmsh.cpp +++ b/mesh/gmsh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/gmsh.hpp b/mesh/gmsh.hpp index 5841a962df..5ba0df2d06 100644 --- a/mesh/gmsh.hpp +++ b/mesh/gmsh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/hexahedron.cpp b/mesh/hexahedron.cpp index e86e209c1c..163b8260f0 100644 --- a/mesh/hexahedron.cpp +++ b/mesh/hexahedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/hexahedron.hpp b/mesh/hexahedron.hpp index 99c26167f7..d8a74044e1 100644 --- a/mesh/hexahedron.hpp +++ b/mesh/hexahedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/mesh.cpp b/mesh/mesh.cpp index 30e082d9d2..b50dd4e074 100644 --- a/mesh/mesh.cpp +++ b/mesh/mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -302,7 +302,7 @@ void Mesh::PrintCharacteristics(Vector *Vh, Vector *Vk, std::ostream &os) num_bdr_elems_by_geom = 0; for (int i = 0; i < GetNBE(); i++) { - num_bdr_elems_by_geom[GetBdrElementBaseGeometry(i)]++; + num_bdr_elems_by_geom[GetBdrElementGeometry(i)]++; } Array num_faces_by_geom(Geometry::NumGeom); num_faces_by_geom = 0; @@ -473,14 +473,18 @@ void Mesh::GetBdrElementTransformation(int i, else // L2 Nodes (e.g., periodic mesh) { int elem_id, face_info; - GetBdrElementAdjacentElement2(i, elem_id, face_info); + GetBdrElementAdjacentElement(i, elem_id, face_info); + Geometry::Type face_geom = GetBdrElementGeometry(i); + face_info = EncodeFaceInfo( + DecodeFaceInfoLocalIndex(face_info), + Geometry::GetInverseOrientation( + face_geom, DecodeFaceInfoOrientation(face_info)) + ); IntegrationPointTransformation Loc1; GetLocalFaceTransformation(GetBdrElementType(i), GetElementType(elem_id), Loc1.Transf, face_info); - - Geometry::Type face_geom = GetBdrElementBaseGeometry(i); const FiniteElement *face_el = Nodes->FESpace()->GetTraceElement(elem_id, face_geom); MFEM_VERIFY(dynamic_cast(face_el), @@ -902,6 +906,8 @@ void Mesh::DeleteGeometricFactors() delete face_geom_factors[i]; } face_geom_factors.SetSize(0); + + ++nodes_sequence; } void Mesh::GetLocalFaceTransformation(int face_type, int elem_type, @@ -1489,6 +1495,7 @@ void Mesh::Init() nbBoundaryFaces = -1; meshgen = mesh_geoms = 0; sequence = 0; + nodes_sequence = 0; Nodes = NULL; own_nodes = 1; NURBSext = NULL; @@ -2583,6 +2590,7 @@ void Mesh::ReorderElements(const Array &ordering, bool reorder_vertices) { // To force FE space update, we need to increase 'sequence': sequence++; + nodes_sequence++; last_operation = Mesh::NONE; nodes_fes->Update(false); // want_transform = false Nodes->Update(); // just needed to update Nodes->sequence @@ -2969,6 +2977,7 @@ void Mesh::DoNodeReorder(DSTable *old_v_to_v, Table *old_elem_vert) } // To force FE space update, we need to increase 'sequence': sequence++; + nodes_sequence++; last_operation = Mesh::NONE; fes->Update(false); // want_transform = false Nodes->Update(); // just needed to update Nodes->sequence @@ -4093,6 +4102,7 @@ Mesh::Mesh(const Mesh &mesh, bool copy_nodes) // Create the new Mesh instance without a record of its refinement history sequence = 0; + nodes_sequence = 0; last_operation = Mesh::NONE; // Duplicate the elements @@ -4971,7 +4981,7 @@ void Mesh::MakeRefined_(Mesh &orig_mesh, const Array &ref_factors, { int i, info; orig_mesh.GetBdrElementAdjacentElement(el, i, info); - Geometry::Type geom = orig_mesh.GetBdrElementBaseGeometry(el); + Geometry::Type geom = orig_mesh.GetBdrElementGeometry(el); int attrib = orig_mesh.GetBdrAttribute(el); int nvert = Geometry::NumVerts[geom]; RefinedGeometry &RG = *refiner.Refine(geom, ref_factors[i]); @@ -5155,7 +5165,7 @@ void Mesh::MakeSimplicial_(const Mesh &orig_mesh, int *vglobal) } for (int i=0; iGetVertices(); const int attrib = orig_mesh.GetBdrAttribute(i); - const Geometry::Type orig_geom = orig_mesh.GetBdrElementBaseGeometry(i); + const Geometry::Type orig_geom = orig_mesh.GetBdrElementGeometry(i); if (num_subdivisions[orig_geom] == 1) { Element *be = NewElement(orig_geom); @@ -5750,6 +5760,7 @@ void Mesh::UpdateNURBS() Nodes->FESpace()->Update(); Nodes->Update(); + NodesUpdated(); NURBSext->SetCoordsFromPatches(*Nodes); if (NumOfVertices != NURBSext->GetNV()) @@ -7209,7 +7220,8 @@ void Mesh::GetBdrElementAdjacentElement(int bdr_el, int &el, int &info) const info = fi.Elem1Inf + ori; } -void Mesh::GetBdrElementAdjacentElement2(int bdr_el, int &el, int &info) const +void Mesh::GetBdrElementAdjacentElement2( + int bdr_el, int &el, int &info) const { int fid = GetBdrElementFaceIndex(bdr_el); @@ -10137,11 +10149,7 @@ void Mesh::NonconformingRefinement(const Array &refinements, last_operation = Mesh::REFINE; sequence++; - if (Nodes) // update/interpolate curved mesh - { - Nodes->FESpace()->Update(); - Nodes->Update(); - } + UpdateNodes(); } double Mesh::AggregateError(const Array &elem_error, @@ -10343,6 +10351,7 @@ void Mesh::Swap(Mesh& other, bool non_geometry) mfem::Swap(CoarseFineTr, other.CoarseFineTr); mfem::Swap(sequence, other.sequence); + mfem::Swap(nodes_sequence, other.nodes_sequence); mfem::Swap(last_operation, other.last_operation); } } @@ -11212,7 +11221,7 @@ void Mesh::Printer(std::ostream &os, std::string section_delimiter, if (!comments.empty()) { os << '\n' << comments << '\n'; } os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# POINT = 0\n" "# SEGMENT = 1\n" "# TRIANGLE = 2\n" @@ -11288,7 +11297,7 @@ void Mesh::PrintTopo(std::ostream &os, const Array &e_to_k, if (!comments.empty()) { os << '\n' << comments << '\n'; } os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# SEGMENT = 1\n" "# SQUARE = 3\n" "# CUBE = 5\n" @@ -11548,7 +11557,7 @@ void Mesh::PrintVTU(std::ostream &os, int ref, VTKFormat format, auto get_geom = [&](int i) { - if (bdr_elements) { return GetBdrElementBaseGeometry(i); } + if (bdr_elements) { return GetBdrElementGeometry(i); } else { return GetElementBaseGeometry(i); } }; @@ -11973,7 +11982,7 @@ void Mesh::PrintWithPartitioning(int *partitioning, std::ostream &os, // optional os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# POINT = 0\n" "# SEGMENT = 1\n" "# TRIANGLE = 2\n" @@ -12469,7 +12478,7 @@ void Mesh::PrintSurfaces(const Table & Aface_face, std::ostream &os) const // optional os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# POINT = 0\n" "# SEGMENT = 1\n" "# TRIANGLE = 2\n" diff --git a/mesh/mesh.hpp b/mesh/mesh.hpp index 59b6b0d480..a8f07a49e2 100644 --- a/mesh/mesh.hpp +++ b/mesh/mesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -83,6 +83,9 @@ protected: // Mesh, such as FiniteElementSpace, GridFunction, etc. long sequence; + /// Counter for geometric factor invalidation + long nodes_sequence; + Array elements; // Vertices are only at the corners of elements, where you would expect them // in the lowest-order mesh. In some cases, e.g. in a Mesh that defines the @@ -1475,15 +1478,25 @@ public: @sa GetBdrElementAdjacentElement2() */ void GetBdrElementAdjacentElement(int bdr_el, int &el, int &info) const; - /** @brief For the given boundary element, bdr_el, return its adjacent - element and its info, i.e. 64*local_bdr_index+inverse_bdr_orientation. + /** @brief Deprecated. + + For the given boundary element, bdr_el, return its adjacent element and + its info, i.e. 64*local_bdr_index+inverse_bdr_orientation. The returned inverse_bdr_orientation is the inverse of the orientation of the boundary element relative to the respective face element. In other words this is the orientation of the face element relative to the boundary element. + @warning This only differs from GetBdrElementAdjacentElement by returning + the face info with inverted orientation. It does @b not return + information corresponding to a second adjacent face. This function is + deprecated, use Geometry::GetInverseOrientation, Mesh::EncodeFaceInfo, + Mesh::DecodeFaceInfoOrientation, and Mesh::DecodeFaceInfoLocalIndex + instead. + @sa GetBdrElementAdjacentElement() */ + MFEM_DEPRECATED void GetBdrElementAdjacentElement2(int bdr_el, int &el, int &info) const; /// @brief Return the local face (codimension-1) index for the given boundary @@ -1952,6 +1965,17 @@ public: operator Mesh::FaceInfo() const; }; + /// Given a "face info int", return the face orientation. @sa FaceInfo. + static int DecodeFaceInfoOrientation(int info) { return info%64; } + + /// Given a "face info int", return the local face index. @sa FaceInfo. + static int DecodeFaceInfoLocalIndex(int info) { return info/64; } + + /// @brief Given @a local_face_index and @a orientation, return the + /// corresponding encoded "face info int". @sa FaceInfo. + static int EncodeFaceInfo(int local_face_index, int orientation) + { return orientation + local_face_index*64; } + /// @name More advanced entity information access methods /// @{ @@ -2183,6 +2207,13 @@ public: Update() calls. */ long GetSequence() const { return sequence; } + /// @brief Return the nodes update counter. + /// + /// This counter starts at zero, and is incremented every time the geometric + /// factors must be recomputed (e.g. on calls to Mesh::Transform, + /// Mesh::NodesUpdated, etc.) + long GetNodesSequence() const { return nodes_sequence; } + /// @} ///@{ @name NURBS mesh refinement methods diff --git a/mesh/mesh_headers.hpp b/mesh/mesh_headers.hpp index d4d4f55ff6..00289c0de0 100644 --- a/mesh/mesh_headers.hpp +++ b/mesh/mesh_headers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/mesh_operators.cpp b/mesh/mesh_operators.cpp index 6b70e28b2b..916d18a4b4 100644 --- a/mesh/mesh_operators.cpp +++ b/mesh/mesh_operators.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/mesh_operators.hpp b/mesh/mesh_operators.hpp index eff7af369e..7b448d0faf 100644 --- a/mesh/mesh_operators.hpp +++ b/mesh/mesh_operators.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/mesh_readers.cpp b/mesh/mesh_readers.cpp index c875248661..92ab50ac64 100644 --- a/mesh/mesh_readers.cpp +++ b/mesh/mesh_readers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/ncmesh.cpp b/mesh/ncmesh.cpp index 660cfdd1dd..885e740453 100644 --- a/mesh/ncmesh.cpp +++ b/mesh/ncmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/ncmesh.hpp b/mesh/ncmesh.hpp index aa1542b3c4..dbf4566e4f 100644 --- a/mesh/ncmesh.hpp +++ b/mesh/ncmesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/ncmesh_tables.hpp b/mesh/ncmesh_tables.hpp index dbf67501b3..ae3958a64d 100644 --- a/mesh/ncmesh_tables.hpp +++ b/mesh/ncmesh_tables.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/nurbs.cpp b/mesh/nurbs.cpp index c6dd7f4cc4..2dc741aa80 100644 --- a/mesh/nurbs.cpp +++ b/mesh/nurbs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/nurbs.hpp b/mesh/nurbs.hpp index 905519e9c9..9a71cfaf7b 100644 --- a/mesh/nurbs.hpp +++ b/mesh/nurbs.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -296,10 +296,6 @@ protected: void ConnectBoundaries1D(int bnd0, int bnd1); void ConnectBoundaries2D(int bnd0, int bnd1); void ConnectBoundaries3D(int bnd0, int bnd1); - int DofMap(int dof) const - { - return (d_to_d.Size() > 0 )? d_to_d[dof] : dof; - }; // also count the global NumOfVertices and the global NumOfDofs void GenerateOffsets(); @@ -428,6 +424,15 @@ public: int GetNTotalDof() const { return NumOfDofs; } int GetNDof() const { return NumOfActiveDofs; } + /// Returns the local dof number + int GetActiveDof(int glob) const { return activeDof[glob]; }; + + /// Returns the dof index whilst accounting for periodic boundaries + int DofMap(int dof) const + { + return (d_to_d.Size() > 0 )? d_to_d[dof] : dof; + }; + /// Returns knotvectors in each dimension for patch @a p. void GetPatchKnotVectors(int p, Array &kv) const; diff --git a/mesh/pmesh.cpp b/mesh/pmesh.cpp index 6172b527d3..090566d9fc 100644 --- a/mesh/pmesh.cpp +++ b/mesh/pmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -4839,7 +4839,7 @@ void ParMesh::Print(std::ostream &os, const std::string &comments) const // optional os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# POINT = 0\n" "# SEGMENT = 1\n" "# TRIANGLE = 2\n" @@ -4968,7 +4968,7 @@ void ParMesh::PrintAsOne(std::ostream &os, const std::string &comments) const // optional os << - "\n#\n# MFEM Geometry Types (see mesh/geom.hpp):\n#\n" + "\n#\n# MFEM Geometry Types (see fem/geom.hpp):\n#\n" "# POINT = 0\n" "# SEGMENT = 1\n" "# TRIANGLE = 2\n" diff --git a/mesh/pmesh.hpp b/mesh/pmesh.hpp index ce5dbfbc28..1aa027a3ce 100644 --- a/mesh/pmesh.hpp +++ b/mesh/pmesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -491,6 +491,10 @@ public: void GenerateOffsets(int N, HYPRE_BigInt loc_sizes[], Array *offsets[]) const; + /** Return true if the face is interior or shared. In parallel, this + method only works if the face neighbor data is exchanged. */ + inline bool FaceIsTrueInterior(int FaceNo) const { return Mesh::FaceIsTrueInterior(FaceNo); } + void ExchangeFaceNbrData(); void ExchangeFaceNbrNodes(); diff --git a/mesh/pncmesh.cpp b/mesh/pncmesh.cpp index 60aca4583c..13fadec028 100644 --- a/mesh/pncmesh.cpp +++ b/mesh/pncmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -107,6 +107,8 @@ void ParNCMesh::Update() entity_owner[i].DeleteAll(); entity_pmat_group[i].DeleteAll(); entity_index_rank[i].DeleteAll(); + entity_conf_group[i].DeleteAll(); + entity_elem_local[i].DeleteAll(); } shared_vertices.Clear(); diff --git a/mesh/pncmesh.hpp b/mesh/pncmesh.hpp index 936c63de6a..2f4e1eb747 100644 --- a/mesh/pncmesh.hpp +++ b/mesh/pncmesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/point.cpp b/mesh/point.cpp index 473655b119..64272071c8 100644 --- a/mesh/point.cpp +++ b/mesh/point.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/point.hpp b/mesh/point.hpp index be00c9c841..5684498644 100644 --- a/mesh/point.hpp +++ b/mesh/point.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/pumi.cpp b/mesh/pumi.cpp index df4bebf197..74fb930cd7 100644 --- a/mesh/pumi.cpp +++ b/mesh/pumi.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/pumi.hpp b/mesh/pumi.hpp index f9a6f6c90f..cd5ce57eed 100644 --- a/mesh/pumi.hpp +++ b/mesh/pumi.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/pyramid.cpp b/mesh/pyramid.cpp index f64f2afe91..26a55029a1 100644 --- a/mesh/pyramid.cpp +++ b/mesh/pyramid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/pyramid.hpp b/mesh/pyramid.hpp index e96a4d19ae..7cf43b52e8 100644 --- a/mesh/pyramid.hpp +++ b/mesh/pyramid.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/quadrilateral.cpp b/mesh/quadrilateral.cpp index 29fa3bbe19..63fe768d5d 100644 --- a/mesh/quadrilateral.cpp +++ b/mesh/quadrilateral.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/quadrilateral.hpp b/mesh/quadrilateral.hpp index a0dd6bd185..05120f865f 100644 --- a/mesh/quadrilateral.hpp +++ b/mesh/quadrilateral.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/segment.cpp b/mesh/segment.cpp index 910614770c..280644ee2c 100644 --- a/mesh/segment.cpp +++ b/mesh/segment.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/segment.hpp b/mesh/segment.hpp index 90cd65704c..8d22d9ff51 100644 --- a/mesh/segment.hpp +++ b/mesh/segment.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/psubmesh.cpp b/mesh/submesh/psubmesh.cpp index 201f252e90..3cd56c49f6 100644 --- a/mesh/submesh/psubmesh.cpp +++ b/mesh/submesh/psubmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/psubmesh.hpp b/mesh/submesh/psubmesh.hpp index 651be62431..f388d80ff9 100644 --- a/mesh/submesh/psubmesh.hpp +++ b/mesh/submesh/psubmesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/ptransfermap.cpp b/mesh/submesh/ptransfermap.cpp index 7e2324668c..0c2d535f7f 100644 --- a/mesh/submesh/ptransfermap.cpp +++ b/mesh/submesh/ptransfermap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -192,7 +192,7 @@ void ParTransferMap::Transfer(const ParGridFunction &src, CorrectFaceOrientations(*src.ParFESpace(), src, dst, &sub1_to_parent_map_); - // CommunicateSharedVdofs(dst); + CommunicateSharedVdofs(dst); } else if (category_ == TransferCategory::SubMeshToSubMesh) { @@ -225,7 +225,7 @@ void ParTransferMap::Transfer(const ParGridFunction &src, CorrectFaceOrientations(*src.ParFESpace(), src, z_, &sub1_to_parent_map_); - // CommunicateSharedVdofs(z_); + CommunicateSharedVdofs(z_); for (int i = 0; i < sub2_to_parent_map_.Size(); i++) { diff --git a/mesh/submesh/ptransfermap.hpp b/mesh/submesh/ptransfermap.hpp index 683cc5bed6..54236ff92d 100644 --- a/mesh/submesh/ptransfermap.hpp +++ b/mesh/submesh/ptransfermap.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/submesh.cpp b/mesh/submesh/submesh.cpp index 33553f6386..b6383aa49f 100644 --- a/mesh/submesh/submesh.cpp +++ b/mesh/submesh/submesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/submesh.hpp b/mesh/submesh/submesh.hpp index 33ca72ea15..84ec58d0df 100644 --- a/mesh/submesh/submesh.hpp +++ b/mesh/submesh/submesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/submesh_utils.cpp b/mesh/submesh/submesh_utils.cpp index c9a021dfe2..fb9f87d536 100644 --- a/mesh/submesh/submesh_utils.cpp +++ b/mesh/submesh/submesh_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -117,18 +117,21 @@ void BuildVdofToVdofMap(const FiniteElementSpace& subfes, auto pm = parentfes.GetMesh(); + const Geometry::Type face_geom = + pm->GetBdrElementGeometry(parent_element_ids[i]); int face_info, parent_volel_id; - pm->GetBdrElementAdjacentElement2(parent_element_ids[i], - parent_volel_id, - face_info); + pm->GetBdrElementAdjacentElement( + parent_element_ids[i], parent_volel_id, face_info); + face_info = Mesh::EncodeFaceInfo( + Mesh::DecodeFaceInfoLocalIndex(face_info), + Geometry::GetInverseOrientation( + face_geom, Mesh::DecodeFaceInfoOrientation(face_info))); pm->GetLocalFaceTransformation( pm->GetBdrElementType(parent_element_ids[i]), pm->GetElementType(parent_volel_id), Tr.Transf, face_info); - Geometry::Type face_geom = - pm->GetBdrElementBaseGeometry(parent_element_ids[i]); const FiniteElement *face_el = parentfes.GetTraceElement(parent_element_ids[i], face_geom); MFEM_VERIFY(dynamic_cast(face_el), diff --git a/mesh/submesh/submesh_utils.hpp b/mesh/submesh/submesh_utils.hpp index 2fc748c4df..61f4439120 100644 --- a/mesh/submesh/submesh_utils.hpp +++ b/mesh/submesh/submesh_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/transfer_category.hpp b/mesh/submesh/transfer_category.hpp index 870e274d2d..be7861f4c5 100644 --- a/mesh/submesh/transfer_category.hpp +++ b/mesh/submesh/transfer_category.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/transfermap.cpp b/mesh/submesh/transfermap.cpp index 1ddb8994c1..1a0b787232 100644 --- a/mesh/submesh/transfermap.cpp +++ b/mesh/submesh/transfermap.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/submesh/transfermap.hpp b/mesh/submesh/transfermap.hpp index f26013dd2f..757d2c5cd7 100644 --- a/mesh/submesh/transfermap.hpp +++ b/mesh/submesh/transfermap.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/tetrahedron.cpp b/mesh/tetrahedron.cpp index d094b70cd1..283b35f8a6 100644 --- a/mesh/tetrahedron.cpp +++ b/mesh/tetrahedron.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/tetrahedron.hpp b/mesh/tetrahedron.hpp index 80f1de4e02..2062c42ba0 100644 --- a/mesh/tetrahedron.hpp +++ b/mesh/tetrahedron.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/tmesh.hpp b/mesh/tmesh.hpp index 634f828dc9..2c27d9a1ad 100644 --- a/mesh/tmesh.hpp +++ b/mesh/tmesh.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/triangle.cpp b/mesh/triangle.cpp index eb7493398a..ed05f1d374 100644 --- a/mesh/triangle.cpp +++ b/mesh/triangle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/triangle.hpp b/mesh/triangle.hpp index fafd8811be..7bfdb23efd 100644 --- a/mesh/triangle.hpp +++ b/mesh/triangle.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/vertex.cpp b/mesh/vertex.cpp index e5c1a57398..10c40f3736 100644 --- a/mesh/vertex.cpp +++ b/mesh/vertex.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/vertex.hpp b/mesh/vertex.hpp index 3267b904fa..f099c2ca78 100644 --- a/mesh/vertex.hpp +++ b/mesh/vertex.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/vtk.cpp b/mesh/vtk.cpp index 27ce9ffe87..7f796f57fc 100644 --- a/mesh/vtk.cpp +++ b/mesh/vtk.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/vtk.hpp b/mesh/vtk.hpp index 50eeea5bc7..d9b61d85b5 100644 --- a/mesh/vtk.hpp +++ b/mesh/vtk.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/wedge.cpp b/mesh/wedge.cpp index b1aea933d0..cc0a1b7932 100644 --- a/mesh/wedge.cpp +++ b/mesh/wedge.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mesh/wedge.hpp b/mesh/wedge.hpp index e564913b4b..bfeb1edfe1 100644 --- a/mesh/wedge.hpp +++ b/mesh/wedge.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mfem-performance.hpp b/mfem-performance.hpp index b254d74277..a15631bfa6 100644 --- a/mfem-performance.hpp +++ b/mfem-performance.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/mfem.hpp b/mfem.hpp index 52e54193d8..caf9f6108c 100644 --- a/mfem.hpp +++ b/mfem.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/CMakeLists.txt b/miniapps/CMakeLists.txt index 6d2a538ac7..8caa17a793 100644 --- a/miniapps/CMakeLists.txt +++ b/miniapps/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/adjoint/CMakeLists.txt b/miniapps/adjoint/CMakeLists.txt index 3461585bcc..15a2394be8 100644 --- a/miniapps/adjoint/CMakeLists.txt +++ b/miniapps/adjoint/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/adjoint/adjoint_advection_diffusion.cpp b/miniapps/adjoint/adjoint_advection_diffusion.cpp index 7a43e90dba..37ace44474 100644 --- a/miniapps/adjoint/adjoint_advection_diffusion.cpp +++ b/miniapps/adjoint/adjoint_advection_diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/adjoint/cvsRoberts_ASAi_dns.cpp b/miniapps/adjoint/cvsRoberts_ASAi_dns.cpp index b44b3a0013..e0a732c0d1 100644 --- a/miniapps/adjoint/cvsRoberts_ASAi_dns.cpp +++ b/miniapps/adjoint/cvsRoberts_ASAi_dns.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/adjoint/makefile b/miniapps/adjoint/makefile index da11e7936a..628744bf17 100644 --- a/miniapps/adjoint/makefile +++ b/miniapps/adjoint/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/autodiff/CMakeLists.txt b/miniapps/autodiff/CMakeLists.txt index 1e1dbccf0b..7d30626da1 100644 --- a/miniapps/autodiff/CMakeLists.txt +++ b/miniapps/autodiff/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/autodiff/admfem.hpp b/miniapps/autodiff/admfem.hpp index e605896b23..db889338fc 100644 --- a/miniapps/autodiff/admfem.hpp +++ b/miniapps/autodiff/admfem.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/example.hpp b/miniapps/autodiff/example.hpp index eb09d4d4fb..bcc569d061 100644 --- a/miniapps/autodiff/example.hpp +++ b/miniapps/autodiff/example.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/makefile b/miniapps/autodiff/makefile index cfd26e946c..0b98ce05d0 100644 --- a/miniapps/autodiff/makefile +++ b/miniapps/autodiff/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/autodiff/par_example.cpp b/miniapps/autodiff/par_example.cpp index b66aff7cb4..0f01d8cf22 100644 --- a/miniapps/autodiff/par_example.cpp +++ b/miniapps/autodiff/par_example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/seq_example.cpp b/miniapps/autodiff/seq_example.cpp index 23f2016785..bde4abf54f 100644 --- a/miniapps/autodiff/seq_example.cpp +++ b/miniapps/autodiff/seq_example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/seq_test.cpp b/miniapps/autodiff/seq_test.cpp index 73dc423dea..5c1672d093 100644 --- a/miniapps/autodiff/seq_test.cpp +++ b/miniapps/autodiff/seq_test.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/taddensemat.hpp b/miniapps/autodiff/taddensemat.hpp index c2d548ee18..907010c0b5 100644 --- a/miniapps/autodiff/taddensemat.hpp +++ b/miniapps/autodiff/taddensemat.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/autodiff/tadvector.hpp b/miniapps/autodiff/tadvector.hpp index 8425abb276..fdc329add9 100644 --- a/miniapps/autodiff/tadvector.hpp +++ b/miniapps/autodiff/tadvector.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/CMakeLists.txt b/miniapps/common/CMakeLists.txt index d8ed62a5c3..9e13abdc60 100644 --- a/miniapps/common/CMakeLists.txt +++ b/miniapps/common/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/common/dist_solver.cpp b/miniapps/common/dist_solver.cpp index b3f905bfed..1807869488 100644 --- a/miniapps/common/dist_solver.cpp +++ b/miniapps/common/dist_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/dist_solver.hpp b/miniapps/common/dist_solver.hpp index 8d63bd6e67..7bef7c8488 100644 --- a/miniapps/common/dist_solver.hpp +++ b/miniapps/common/dist_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/fem_extras.cpp b/miniapps/common/fem_extras.cpp index e8bccd5600..07a33d9864 100644 --- a/miniapps/common/fem_extras.cpp +++ b/miniapps/common/fem_extras.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/fem_extras.hpp b/miniapps/common/fem_extras.hpp index 65d842d585..1202680b62 100644 --- a/miniapps/common/fem_extras.hpp +++ b/miniapps/common/fem_extras.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/makefile b/miniapps/common/makefile index ccdfd89403..99a51ca023 100644 --- a/miniapps/common/makefile +++ b/miniapps/common/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/common/mesh_extras.cpp b/miniapps/common/mesh_extras.cpp index 18ed147742..28aedf0140 100644 --- a/miniapps/common/mesh_extras.cpp +++ b/miniapps/common/mesh_extras.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/mesh_extras.hpp b/miniapps/common/mesh_extras.hpp index fabb1c4a14..b7925c6bff 100644 --- a/miniapps/common/mesh_extras.hpp +++ b/miniapps/common/mesh_extras.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/mfem-common.hpp b/miniapps/common/mfem-common.hpp index 4b6d0ec289..328e6f70ce 100644 --- a/miniapps/common/mfem-common.hpp +++ b/miniapps/common/mfem-common.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/pfem_extras.cpp b/miniapps/common/pfem_extras.cpp index 2e8ef2a536..16dcdd63d6 100644 --- a/miniapps/common/pfem_extras.cpp +++ b/miniapps/common/pfem_extras.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/common/pfem_extras.hpp b/miniapps/common/pfem_extras.hpp index 4e5ee87de3..af7a2bd3cf 100644 --- a/miniapps/common/pfem_extras.hpp +++ b/miniapps/common/pfem_extras.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/CMakeLists.txt b/miniapps/dpg/CMakeLists.txt index 0ff42d1bd3..e3c2be13da 100644 --- a/miniapps/dpg/CMakeLists.txt +++ b/miniapps/dpg/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/dpg/acoustics.cpp b/miniapps/dpg/acoustics.cpp index 299c2bd68e..823fce774b 100644 --- a/miniapps/dpg/acoustics.cpp +++ b/miniapps/dpg/acoustics.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/convection-diffusion.cpp b/miniapps/dpg/convection-diffusion.cpp index 66f5e139ba..f3741c0f00 100644 --- a/miniapps/dpg/convection-diffusion.cpp +++ b/miniapps/dpg/convection-diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/diffusion.cpp b/miniapps/dpg/diffusion.cpp index 1a0115da2f..b5c78a010d 100644 --- a/miniapps/dpg/diffusion.cpp +++ b/miniapps/dpg/diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/makefile b/miniapps/dpg/makefile index c0da8a867f..ffa2f77b69 100644 --- a/miniapps/dpg/makefile +++ b/miniapps/dpg/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/dpg/maxwell.cpp b/miniapps/dpg/maxwell.cpp index 5ae89e58a6..7d526700c1 100644 --- a/miniapps/dpg/maxwell.cpp +++ b/miniapps/dpg/maxwell.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/meshes/fichera-waveguide.mesh b/miniapps/dpg/meshes/fichera-waveguide.mesh index f93aa927e5..4faba20d84 100644 --- a/miniapps/dpg/meshes/fichera-waveguide.mesh +++ b/miniapps/dpg/meshes/fichera-waveguide.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/dpg/meshes/scatter.mesh b/miniapps/dpg/meshes/scatter.mesh index c48eea84fc..dcc21d890c 100644 --- a/miniapps/dpg/meshes/scatter.mesh +++ b/miniapps/dpg/meshes/scatter.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/dpg/pacoustics.cpp b/miniapps/dpg/pacoustics.cpp index bf2f871f7d..fe5949df71 100644 --- a/miniapps/dpg/pacoustics.cpp +++ b/miniapps/dpg/pacoustics.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/pconvection-diffusion.cpp b/miniapps/dpg/pconvection-diffusion.cpp index b6d0d33dde..5835d5cd4e 100644 --- a/miniapps/dpg/pconvection-diffusion.cpp +++ b/miniapps/dpg/pconvection-diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/pdiffusion.cpp b/miniapps/dpg/pdiffusion.cpp index c3d5ba5b9f..2582305247 100644 --- a/miniapps/dpg/pdiffusion.cpp +++ b/miniapps/dpg/pdiffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/pmaxwell.cpp b/miniapps/dpg/pmaxwell.cpp index baa7890c78..02c52b99cf 100644 --- a/miniapps/dpg/pmaxwell.cpp +++ b/miniapps/dpg/pmaxwell.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/blockstaticcond.cpp b/miniapps/dpg/util/blockstaticcond.cpp index 8bd36f8317..e6278c4cfb 100644 --- a/miniapps/dpg/util/blockstaticcond.cpp +++ b/miniapps/dpg/util/blockstaticcond.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/blockstaticcond.hpp b/miniapps/dpg/util/blockstaticcond.hpp index 7fa20a73f7..0d179bd76c 100644 --- a/miniapps/dpg/util/blockstaticcond.hpp +++ b/miniapps/dpg/util/blockstaticcond.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/complexstaticcond.cpp b/miniapps/dpg/util/complexstaticcond.cpp index 239e4b601c..6f602d8c49 100644 --- a/miniapps/dpg/util/complexstaticcond.cpp +++ b/miniapps/dpg/util/complexstaticcond.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/complexstaticcond.hpp b/miniapps/dpg/util/complexstaticcond.hpp index f4c5df1ba0..1bcf59dd0e 100644 --- a/miniapps/dpg/util/complexstaticcond.hpp +++ b/miniapps/dpg/util/complexstaticcond.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/complexweakform.cpp b/miniapps/dpg/util/complexweakform.cpp index f291290b5a..ef1a42cd35 100644 --- a/miniapps/dpg/util/complexweakform.cpp +++ b/miniapps/dpg/util/complexweakform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/complexweakform.hpp b/miniapps/dpg/util/complexweakform.hpp index 1e2473fdd1..4bc9c64711 100644 --- a/miniapps/dpg/util/complexweakform.hpp +++ b/miniapps/dpg/util/complexweakform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -35,7 +35,7 @@ protected: Array dof_offsets; Array tdof_offsets; - /// Block matrix \f$ M \f$ to be associated with the real/imag Block bilinear form. Owned. + /// Block matrix $ M $ to be associated with the real/imag Block bilinear form. Owned. BlockMatrix *mat_r = nullptr; BlockMatrix *mat_i = nullptr; ComplexOperator * mat = nullptr; @@ -45,9 +45,9 @@ protected: BlockVector * y_i = nullptr; Vector * y = nullptr; - /** @brief Block Matrix \f$ M_e \f$ used to store the eliminations + /** @brief Block Matrix $ M_e $ used to store the eliminations from the b.c. Owned. - \f$ M + M_e = M_{original} \f$ */ + $ M + M_e = M_{original} $ */ BlockMatrix *mat_e_r = nullptr; BlockMatrix *mat_e_i = nullptr; @@ -154,27 +154,27 @@ public: /// Finalizes the matrix initialization. void Finalize(int skip_zeros = 1); - /// Returns a reference to the BlockMatrix: \f$ M_r \f$ + /// Returns a reference to the BlockMatrix: $ M_r $ BlockMatrix &BlockMat_r() { MFEM_VERIFY(mat_r, "mat_r is NULL and can't be dereferenced"); return *mat_r; } - /// Returns a reference to the BlockMatrix: \f$ M_i \f$ + /// Returns a reference to the BlockMatrix: $ M_i $ BlockMatrix &BlockMat_i() { MFEM_VERIFY(mat_i, "mat_i is NULL and can't be dereferenced"); return *mat_i; } - /// Returns a reference to the BlockMatrix of eliminated b.c.: \f$ M_e_r \f$ + /// Returns a reference to the BlockMatrix of eliminated b.c.: $ M_e_r $ BlockMatrix &BlockMatElim_r() { MFEM_VERIFY(mat_e_r, "mat_e is NULL and can't be dereferenced"); return *mat_e_r; } - /// Returns a reference to the BlockMatrix of eliminated b.c.: \f$ M_e_i \f$ + /// Returns a reference to the BlockMatrix of eliminated b.c.: $ M_e_i $ BlockMatrix &BlockMatElim_i() { MFEM_VERIFY(mat_e_i, "mat_e is NULL and can't be dereferenced"); diff --git a/miniapps/dpg/util/pcomplexweakform.cpp b/miniapps/dpg/util/pcomplexweakform.cpp index cb3d43774e..c76281dfb4 100644 --- a/miniapps/dpg/util/pcomplexweakform.cpp +++ b/miniapps/dpg/util/pcomplexweakform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/pcomplexweakform.hpp b/miniapps/dpg/util/pcomplexweakform.hpp index 3891f5b986..976bb24872 100644 --- a/miniapps/dpg/util/pcomplexweakform.hpp +++ b/miniapps/dpg/util/pcomplexweakform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/pml.cpp b/miniapps/dpg/util/pml.cpp index 0e1edd4f83..ef4d9393d5 100644 --- a/miniapps/dpg/util/pml.cpp +++ b/miniapps/dpg/util/pml.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/pml.hpp b/miniapps/dpg/util/pml.hpp index 507a2e99b8..4a3d9bbe36 100644 --- a/miniapps/dpg/util/pml.hpp +++ b/miniapps/dpg/util/pml.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/pweakform.cpp b/miniapps/dpg/util/pweakform.cpp index d30e26bff5..91a9ed4ef7 100644 --- a/miniapps/dpg/util/pweakform.cpp +++ b/miniapps/dpg/util/pweakform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/pweakform.hpp b/miniapps/dpg/util/pweakform.hpp index 83602dbed0..992563b788 100644 --- a/miniapps/dpg/util/pweakform.hpp +++ b/miniapps/dpg/util/pweakform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/weakform.cpp b/miniapps/dpg/util/weakform.cpp index 94a3582dc3..dcfb3ad604 100644 --- a/miniapps/dpg/util/weakform.cpp +++ b/miniapps/dpg/util/weakform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/dpg/util/weakform.hpp b/miniapps/dpg/util/weakform.hpp index bbee40ebb6..fe5b8a5cb6 100644 --- a/miniapps/dpg/util/weakform.hpp +++ b/miniapps/dpg/util/weakform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -45,15 +45,15 @@ protected: Array dof_offsets; Array tdof_offsets; - /// Block matrix \f$ M \f$ to be associated with the Block bilinear form. Owned. + /// Block matrix $ M $ to be associated with the Block bilinear form. Owned. BlockMatrix *mat = nullptr; - /// Block vector \f$ y \f$ to be associated with the Block linear form + /// Block vector $ y $ to be associated with the Block linear form BlockVector * y = nullptr; - /** @brief Block Matrix \f$ M_e \f$ used to store the eliminations + /** @brief Block Matrix $ M_e $ used to store the eliminations from the b.c. Owned. - \f$ M + M_e = M_{original} \f$ */ + $ M + M_e = M_{original} $ */ BlockMatrix *mat_e = nullptr; /// Trial FE spaces @@ -152,14 +152,14 @@ public: /// Finalizes the matrix initialization. void Finalize(int skip_zeros = 1); - /// Returns a reference to the BlockMatrix: \f$ M \f$ + /// Returns a reference to the BlockMatrix: $ M $ BlockMatrix &BlockMat() { MFEM_VERIFY(mat, "mat is NULL and can't be dereferenced"); return *mat; } - /// Returns a reference to the sparse matrix of eliminated b.c.: \f$ M_e \f$ + /// Returns a reference to the sparse matrix of eliminated b.c.: $ M_e $ BlockMatrix &BlockMatElim() { MFEM_VERIFY(mat_e, "mat_e is NULL and can't be dereferenced"); @@ -236,7 +236,7 @@ public: A.MakeRef(*A_ptr); } - /// Eliminate the given @a vdofs, storing the eliminated part internally in \f$ M_e \f$. + /// Eliminate the given @a vdofs, storing the eliminated part internally in $ M_e $. /** This method works in conjunction with EliminateVDofsInRHS() and allows elimination of boundary conditions in multiple right-hand sides. In this method, @a vdofs is a list of DOFs. */ diff --git a/miniapps/electromagnetics/CMakeLists.txt b/miniapps/electromagnetics/CMakeLists.txt index f72c6f13c7..22af46c1b4 100644 --- a/miniapps/electromagnetics/CMakeLists.txt +++ b/miniapps/electromagnetics/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/electromagnetics/cylinder-hex.mesh b/miniapps/electromagnetics/cylinder-hex.mesh index af7e13fdbe..091c7e2d40 100644 --- a/miniapps/electromagnetics/cylinder-hex.mesh +++ b/miniapps/electromagnetics/cylinder-hex.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/electromagnetics/cylinder-tet.mesh b/miniapps/electromagnetics/cylinder-tet.mesh index 66129b614d..0c0d658663 100644 --- a/miniapps/electromagnetics/cylinder-tet.mesh +++ b/miniapps/electromagnetics/cylinder-tet.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/electromagnetics/electromagnetics.hpp b/miniapps/electromagnetics/electromagnetics.hpp index 10566fec94..e739c3446a 100644 --- a/miniapps/electromagnetics/electromagnetics.hpp +++ b/miniapps/electromagnetics/electromagnetics.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/joule.cpp b/miniapps/electromagnetics/joule.cpp index 8f2e68fc3d..d8f0fe8b42 100644 --- a/miniapps/electromagnetics/joule.cpp +++ b/miniapps/electromagnetics/joule.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/joule_solver.cpp b/miniapps/electromagnetics/joule_solver.cpp index a10e5ed9f3..77a96ba23d 100644 --- a/miniapps/electromagnetics/joule_solver.cpp +++ b/miniapps/electromagnetics/joule_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/joule_solver.hpp b/miniapps/electromagnetics/joule_solver.hpp index a8568da6d3..dc778cb0d2 100644 --- a/miniapps/electromagnetics/joule_solver.hpp +++ b/miniapps/electromagnetics/joule_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/makefile b/miniapps/electromagnetics/makefile index aaf73517a1..51631aa3eb 100644 --- a/miniapps/electromagnetics/makefile +++ b/miniapps/electromagnetics/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/electromagnetics/maxwell.cpp b/miniapps/electromagnetics/maxwell.cpp index 2b939263b8..f7af66592f 100644 --- a/miniapps/electromagnetics/maxwell.cpp +++ b/miniapps/electromagnetics/maxwell.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/maxwell_solver.cpp b/miniapps/electromagnetics/maxwell_solver.cpp index 57c28fb1eb..0d9dafcca4 100644 --- a/miniapps/electromagnetics/maxwell_solver.cpp +++ b/miniapps/electromagnetics/maxwell_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/maxwell_solver.hpp b/miniapps/electromagnetics/maxwell_solver.hpp index 772e2eab18..bcb508a496 100644 --- a/miniapps/electromagnetics/maxwell_solver.hpp +++ b/miniapps/electromagnetics/maxwell_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/square-angled-pipe.mesh b/miniapps/electromagnetics/square-angled-pipe.mesh index b70c42a555..968d18367b 100644 --- a/miniapps/electromagnetics/square-angled-pipe.mesh +++ b/miniapps/electromagnetics/square-angled-pipe.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/electromagnetics/tesla.cpp b/miniapps/electromagnetics/tesla.cpp index b1ec72f6b6..ddb55efda6 100644 --- a/miniapps/electromagnetics/tesla.cpp +++ b/miniapps/electromagnetics/tesla.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/tesla_solver.cpp b/miniapps/electromagnetics/tesla_solver.cpp index 7c63f702d8..d939fff37a 100644 --- a/miniapps/electromagnetics/tesla_solver.cpp +++ b/miniapps/electromagnetics/tesla_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/tesla_solver.hpp b/miniapps/electromagnetics/tesla_solver.hpp index e5d34447cb..2590a3e0d6 100644 --- a/miniapps/electromagnetics/tesla_solver.hpp +++ b/miniapps/electromagnetics/tesla_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/volta.cpp b/miniapps/electromagnetics/volta.cpp index 8e5ba2f574..cf7feb4bf3 100644 --- a/miniapps/electromagnetics/volta.cpp +++ b/miniapps/electromagnetics/volta.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/volta_solver.cpp b/miniapps/electromagnetics/volta_solver.cpp index a84e181616..03dc6f1870 100644 --- a/miniapps/electromagnetics/volta_solver.cpp +++ b/miniapps/electromagnetics/volta_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/electromagnetics/volta_solver.hpp b/miniapps/electromagnetics/volta_solver.hpp index c5d1667e78..cbf687a255 100644 --- a/miniapps/electromagnetics/volta_solver.hpp +++ b/miniapps/electromagnetics/volta_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/CMakeLists.txt b/miniapps/gslib/CMakeLists.txt index bc063eee28..4130f12069 100644 --- a/miniapps/gslib/CMakeLists.txt +++ b/miniapps/gslib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/gslib/field-diff.cpp b/miniapps/gslib/field-diff.cpp index 54de4572ab..4d6374b8c6 100644 --- a/miniapps/gslib/field-diff.cpp +++ b/miniapps/gslib/field-diff.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/field-interp.cpp b/miniapps/gslib/field-interp.cpp index a3432223b7..c142a40287 100644 --- a/miniapps/gslib/field-interp.cpp +++ b/miniapps/gslib/field-interp.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/findpts.cpp b/miniapps/gslib/findpts.cpp index d7fc2d8f3a..aaca4cba05 100644 --- a/miniapps/gslib/findpts.cpp +++ b/miniapps/gslib/findpts.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/makefile b/miniapps/gslib/makefile index 813e675909..b3862dab4f 100644 --- a/miniapps/gslib/makefile +++ b/miniapps/gslib/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/gslib/pfindpts.cpp b/miniapps/gslib/pfindpts.cpp index 9fc4642e18..cf6ebaa78f 100644 --- a/miniapps/gslib/pfindpts.cpp +++ b/miniapps/gslib/pfindpts.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/schwarz_ex1.cpp b/miniapps/gslib/schwarz_ex1.cpp index 04a53e5ad0..3fee061f76 100644 --- a/miniapps/gslib/schwarz_ex1.cpp +++ b/miniapps/gslib/schwarz_ex1.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/schwarz_ex1p.cpp b/miniapps/gslib/schwarz_ex1p.cpp index af457cf1a1..fd83d6d066 100644 --- a/miniapps/gslib/schwarz_ex1p.cpp +++ b/miniapps/gslib/schwarz_ex1p.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/gslib/triple-pt-1.mesh b/miniapps/gslib/triple-pt-1.mesh index 182cb859b7..d00ff3762f 100644 --- a/miniapps/gslib/triple-pt-1.mesh +++ b/miniapps/gslib/triple-pt-1.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/gslib/triple-pt-2.mesh b/miniapps/gslib/triple-pt-2.mesh index e85bddf87f..57d0b0d31e 100644 --- a/miniapps/gslib/triple-pt-2.mesh +++ b/miniapps/gslib/triple-pt-2.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/hdiv-linear-solver/CMakeLists.txt b/miniapps/hdiv-linear-solver/CMakeLists.txt index 337f136f76..93ea8514d6 100644 --- a/miniapps/hdiv-linear-solver/CMakeLists.txt +++ b/miniapps/hdiv-linear-solver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/hdiv-linear-solver/change_basis.cpp b/miniapps/hdiv-linear-solver/change_basis.cpp index f54a0e5048..ee8dacc817 100644 --- a/miniapps/hdiv-linear-solver/change_basis.cpp +++ b/miniapps/hdiv-linear-solver/change_basis.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/change_basis.hpp b/miniapps/hdiv-linear-solver/change_basis.hpp index 9005117ccd..07f328c3bf 100644 --- a/miniapps/hdiv-linear-solver/change_basis.hpp +++ b/miniapps/hdiv-linear-solver/change_basis.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/darcy.cpp b/miniapps/hdiv-linear-solver/darcy.cpp index 4548e00b3e..28e78f849b 100644 --- a/miniapps/hdiv-linear-solver/darcy.cpp +++ b/miniapps/hdiv-linear-solver/darcy.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/discrete_divergence.cpp b/miniapps/hdiv-linear-solver/discrete_divergence.cpp index 93a841e0f5..7b4eb9e4f2 100644 --- a/miniapps/hdiv-linear-solver/discrete_divergence.cpp +++ b/miniapps/hdiv-linear-solver/discrete_divergence.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/discrete_divergence.hpp b/miniapps/hdiv-linear-solver/discrete_divergence.hpp index a498f66ecd..74b218a351 100644 --- a/miniapps/hdiv-linear-solver/discrete_divergence.hpp +++ b/miniapps/hdiv-linear-solver/discrete_divergence.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/grad_div.cpp b/miniapps/hdiv-linear-solver/grad_div.cpp index 42895380d7..5b4f310905 100644 --- a/miniapps/hdiv-linear-solver/grad_div.cpp +++ b/miniapps/hdiv-linear-solver/grad_div.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/hdiv_linear_solver.cpp b/miniapps/hdiv-linear-solver/hdiv_linear_solver.cpp index 70f9c70b8f..8bc9afa53b 100644 --- a/miniapps/hdiv-linear-solver/hdiv_linear_solver.cpp +++ b/miniapps/hdiv-linear-solver/hdiv_linear_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/hdiv_linear_solver.hpp b/miniapps/hdiv-linear-solver/hdiv_linear_solver.hpp index ae3a9b6352..9406e76fca 100644 --- a/miniapps/hdiv-linear-solver/hdiv_linear_solver.hpp +++ b/miniapps/hdiv-linear-solver/hdiv_linear_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hdiv-linear-solver/makefile b/miniapps/hdiv-linear-solver/makefile index e2cf35399d..0d2aea31ef 100644 --- a/miniapps/hdiv-linear-solver/makefile +++ b/miniapps/hdiv-linear-solver/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/hooke/CMakeLists.txt b/miniapps/hooke/CMakeLists.txt index 3da53e7c09..98b17ae1cc 100644 --- a/miniapps/hooke/CMakeLists.txt +++ b/miniapps/hooke/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/hooke/hooke.cpp b/miniapps/hooke/hooke.cpp index 490f6a85ce..ca20e3b204 100644 --- a/miniapps/hooke/hooke.cpp +++ b/miniapps/hooke/hooke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/kernels/elasticity_kernels.hpp b/miniapps/hooke/kernels/elasticity_kernels.hpp index c8726710d4..0e88f9b452 100644 --- a/miniapps/hooke/kernels/elasticity_kernels.hpp +++ b/miniapps/hooke/kernels/elasticity_kernels.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/kernels/kernel_helpers.hpp b/miniapps/hooke/kernels/kernel_helpers.hpp index da88a20787..24ca4b3833 100644 --- a/miniapps/hooke/kernels/kernel_helpers.hpp +++ b/miniapps/hooke/kernels/kernel_helpers.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/makefile b/miniapps/hooke/makefile index bed5354a2d..2a9a8096ea 100644 --- a/miniapps/hooke/makefile +++ b/miniapps/hooke/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/hooke/materials/gradient_type.hpp b/miniapps/hooke/materials/gradient_type.hpp index 1df9a5385b..a3381a60e0 100644 --- a/miniapps/hooke/materials/gradient_type.hpp +++ b/miniapps/hooke/materials/gradient_type.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/materials/linear_elastic.hpp b/miniapps/hooke/materials/linear_elastic.hpp index c3ab8cb1c7..56548d22ef 100644 --- a/miniapps/hooke/materials/linear_elastic.hpp +++ b/miniapps/hooke/materials/linear_elastic.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/materials/neohookean.hpp b/miniapps/hooke/materials/neohookean.hpp index 35fbfd7336..430f32b604 100644 --- a/miniapps/hooke/materials/neohookean.hpp +++ b/miniapps/hooke/materials/neohookean.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/operators/elasticity_gradient_operator.cpp b/miniapps/hooke/operators/elasticity_gradient_operator.cpp index a24fc99b4d..1a6d2cd9f6 100644 --- a/miniapps/hooke/operators/elasticity_gradient_operator.cpp +++ b/miniapps/hooke/operators/elasticity_gradient_operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/operators/elasticity_gradient_operator.hpp b/miniapps/hooke/operators/elasticity_gradient_operator.hpp index 37e936f739..b371ca6fc2 100644 --- a/miniapps/hooke/operators/elasticity_gradient_operator.hpp +++ b/miniapps/hooke/operators/elasticity_gradient_operator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/operators/elasticity_operator.cpp b/miniapps/hooke/operators/elasticity_operator.cpp index 839b55b9d8..a93a772f84 100644 --- a/miniapps/hooke/operators/elasticity_operator.cpp +++ b/miniapps/hooke/operators/elasticity_operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/operators/elasticity_operator.hpp b/miniapps/hooke/operators/elasticity_operator.hpp index fed3bea04d..3b861a855e 100644 --- a/miniapps/hooke/operators/elasticity_operator.hpp +++ b/miniapps/hooke/operators/elasticity_operator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/preconditioners/diagonal_preconditioner.cpp b/miniapps/hooke/preconditioners/diagonal_preconditioner.cpp index 7a6bba59c1..3f50be99de 100644 --- a/miniapps/hooke/preconditioners/diagonal_preconditioner.cpp +++ b/miniapps/hooke/preconditioners/diagonal_preconditioner.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/hooke/preconditioners/diagonal_preconditioner.hpp b/miniapps/hooke/preconditioners/diagonal_preconditioner.hpp index 059e9081d3..3cd47b1207 100644 --- a/miniapps/hooke/preconditioners/diagonal_preconditioner.hpp +++ b/miniapps/hooke/preconditioners/diagonal_preconditioner.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/CMakeLists.txt b/miniapps/meshing/CMakeLists.txt index 1f242b8a4e..f858209592 100644 --- a/miniapps/meshing/CMakeLists.txt +++ b/miniapps/meshing/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/meshing/blade.mesh b/miniapps/meshing/blade.mesh index 62c2bb015e..21a1d6dda1 100644 --- a/miniapps/meshing/blade.mesh +++ b/miniapps/meshing/blade.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/cube-tet.mesh b/miniapps/meshing/cube-tet.mesh index 90d52e0421..1827200d05 100644 --- a/miniapps/meshing/cube-tet.mesh +++ b/miniapps/meshing/cube-tet.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/cube.mesh b/miniapps/meshing/cube.mesh index 6b3a3e28ca..e1c1837556 100644 --- a/miniapps/meshing/cube.mesh +++ b/miniapps/meshing/cube.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/extruder.cpp b/miniapps/meshing/extruder.cpp index 7047d83f34..d9aadf136d 100644 --- a/miniapps/meshing/extruder.cpp +++ b/miniapps/meshing/extruder.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/fit-node-position.cpp b/miniapps/meshing/fit-node-position.cpp index e43cf6d74d..a6b1b76079 100644 --- a/miniapps/meshing/fit-node-position.cpp +++ b/miniapps/meshing/fit-node-position.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/icf.mesh b/miniapps/meshing/icf.mesh index 60d12da00f..c6b6d4b3e4 100644 --- a/miniapps/meshing/icf.mesh +++ b/miniapps/meshing/icf.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/jagged.mesh b/miniapps/meshing/jagged.mesh index 1d10e0e2f4..604be6d710 100644 --- a/miniapps/meshing/jagged.mesh +++ b/miniapps/meshing/jagged.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/klein-bottle.cpp b/miniapps/meshing/klein-bottle.cpp index f9a09c1e1c..79994d4d7f 100644 --- a/miniapps/meshing/klein-bottle.cpp +++ b/miniapps/meshing/klein-bottle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/makefile b/miniapps/meshing/makefile index 1ccec0455c..7510d88925 100644 --- a/miniapps/meshing/makefile +++ b/miniapps/meshing/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/meshing/mesh-explorer.cpp b/miniapps/meshing/mesh-explorer.cpp index f05e18e831..925371f7f1 100644 --- a/miniapps/meshing/mesh-explorer.cpp +++ b/miniapps/meshing/mesh-explorer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/mesh-fitting.hpp b/miniapps/meshing/mesh-fitting.hpp index 7c4214c66e..2b0eaed72c 100644 --- a/miniapps/meshing/mesh-fitting.hpp +++ b/miniapps/meshing/mesh-fitting.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/mesh-optimizer.cpp b/miniapps/meshing/mesh-optimizer.cpp index b0fc2db046..557af02303 100644 --- a/miniapps/meshing/mesh-optimizer.cpp +++ b/miniapps/meshing/mesh-optimizer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/mesh-optimizer.hpp b/miniapps/meshing/mesh-optimizer.hpp index 3fda5b09a2..ba74d384b8 100644 --- a/miniapps/meshing/mesh-optimizer.hpp +++ b/miniapps/meshing/mesh-optimizer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/mesh-quality.cpp b/miniapps/meshing/mesh-quality.cpp index d9c6d809e5..4387c85859 100644 --- a/miniapps/meshing/mesh-quality.cpp +++ b/miniapps/meshing/mesh-quality.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/minimal-surface.cpp b/miniapps/meshing/minimal-surface.cpp index e3ce40e690..22511d77de 100644 --- a/miniapps/meshing/minimal-surface.cpp +++ b/miniapps/meshing/minimal-surface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/mobius-strip.cpp b/miniapps/meshing/mobius-strip.cpp index a4b6369679..916ca48a19 100644 --- a/miniapps/meshing/mobius-strip.cpp +++ b/miniapps/meshing/mobius-strip.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/pmesh-fitting.cpp b/miniapps/meshing/pmesh-fitting.cpp index e4c562d552..29df4d1ad2 100644 --- a/miniapps/meshing/pmesh-fitting.cpp +++ b/miniapps/meshing/pmesh-fitting.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/pmesh-optimizer.cpp b/miniapps/meshing/pmesh-optimizer.cpp index affaaec2a4..d371416feb 100644 --- a/miniapps/meshing/pmesh-optimizer.cpp +++ b/miniapps/meshing/pmesh-optimizer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/pminimal-surface.cpp b/miniapps/meshing/pminimal-surface.cpp index 026622c2aa..80182fc977 100644 --- a/miniapps/meshing/pminimal-surface.cpp +++ b/miniapps/meshing/pminimal-surface.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/polar-nc.cpp b/miniapps/meshing/polar-nc.cpp index ad13370546..1d97313101 100644 --- a/miniapps/meshing/polar-nc.cpp +++ b/miniapps/meshing/polar-nc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/reflector.cpp b/miniapps/meshing/reflector.cpp index a730fda67a..4b35ad95a0 100644 --- a/miniapps/meshing/reflector.cpp +++ b/miniapps/meshing/reflector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -938,7 +938,7 @@ Mesh* ReflectHighOrderMesh(Mesh & mesh, Vector origin, Vector normal) mfem::Swap(rv[0], rv[2]); // Fix the orientation - const Geometry::Type orig_geom = mesh.GetBdrElementBaseGeometry(i); + const Geometry::Type orig_geom = mesh.GetBdrElementGeometry(i); Element *rbe = reflected->NewElement(orig_geom); rbe->SetVertices(v); reflected->AddBdrElement(rbe); diff --git a/miniapps/meshing/shaper.cpp b/miniapps/meshing/shaper.cpp index 50a250a1ee..def8e7fa1c 100644 --- a/miniapps/meshing/shaper.cpp +++ b/miniapps/meshing/shaper.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/square01-tri.mesh b/miniapps/meshing/square01-tri.mesh index a807803d45..80d563ae23 100644 --- a/miniapps/meshing/square01-tri.mesh +++ b/miniapps/meshing/square01-tri.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/square01.mesh b/miniapps/meshing/square01.mesh index bc75f8555c..2101b32e84 100644 --- a/miniapps/meshing/square01.mesh +++ b/miniapps/meshing/square01.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/stretched2D.mesh b/miniapps/meshing/stretched2D.mesh index 6fab492c72..4f704336d1 100644 --- a/miniapps/meshing/stretched2D.mesh +++ b/miniapps/meshing/stretched2D.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/meshing/toroid.cpp b/miniapps/meshing/toroid.cpp index 7c2271ecb8..bc96f49b8e 100644 --- a/miniapps/meshing/toroid.cpp +++ b/miniapps/meshing/toroid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/trimmer.cpp b/miniapps/meshing/trimmer.cpp index db31acda5a..99896dc1df 100644 --- a/miniapps/meshing/trimmer.cpp +++ b/miniapps/meshing/trimmer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/meshing/twist.cpp b/miniapps/meshing/twist.cpp index 6e7309b2c4..9ce60a2325 100644 --- a/miniapps/meshing/twist.cpp +++ b/miniapps/meshing/twist.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/CMakeLists.txt b/miniapps/mtop/CMakeLists.txt index 3cff515ebd..4462a7d3b5 100644 --- a/miniapps/mtop/CMakeLists.txt +++ b/miniapps/mtop/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/mtop/makefile b/miniapps/mtop/makefile index e57dcc0fe9..e3701ece5f 100644 --- a/miniapps/mtop/makefile +++ b/miniapps/mtop/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/mtop/mtop_integrators.cpp b/miniapps/mtop/mtop_integrators.cpp index 48fde8bc73..68499be14c 100644 --- a/miniapps/mtop/mtop_integrators.cpp +++ b/miniapps/mtop/mtop_integrators.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/mtop_integrators.hpp b/miniapps/mtop/mtop_integrators.hpp index 3c20f9402f..36337cdfb8 100644 --- a/miniapps/mtop/mtop_integrators.hpp +++ b/miniapps/mtop/mtop_integrators.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -214,7 +214,7 @@ private: /// Computes an example of nonlinear objective -/// \f$\int \rm{field}*\rm{field}*\rm{weight})\rm{d}\Omega_e\f$. +/// $\int \rm{field}*\rm{field}*\rm{weight})\rm{d}\Omega_e$. class DiffusionObjIntegrator:public BlockNonlinearFormIntegrator { public: diff --git a/miniapps/mtop/paramnonlinearform.cpp b/miniapps/mtop/paramnonlinearform.cpp index e988e6feee..c8725605fc 100644 --- a/miniapps/mtop/paramnonlinearform.cpp +++ b/miniapps/mtop/paramnonlinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/paramnonlinearform.hpp b/miniapps/mtop/paramnonlinearform.hpp index a40ea6f116..00f2690e0c 100644 --- a/miniapps/mtop/paramnonlinearform.hpp +++ b/miniapps/mtop/paramnonlinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/parheat.cpp b/miniapps/mtop/parheat.cpp index ab7afab260..d501b10ecc 100644 --- a/miniapps/mtop/parheat.cpp +++ b/miniapps/mtop/parheat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/pparamnonlinearform.cpp b/miniapps/mtop/pparamnonlinearform.cpp index 691a758d52..4fcb851429 100644 --- a/miniapps/mtop/pparamnonlinearform.cpp +++ b/miniapps/mtop/pparamnonlinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/pparamnonlinearform.hpp b/miniapps/mtop/pparamnonlinearform.hpp index c8acd05e41..0cbbc87e99 100644 --- a/miniapps/mtop/pparamnonlinearform.hpp +++ b/miniapps/mtop/pparamnonlinearform.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/mtop/seqheat.cpp b/miniapps/mtop/seqheat.cpp index 412c1ca431..ad6e5877c5 100644 --- a/miniapps/mtop/seqheat.cpp +++ b/miniapps/mtop/seqheat.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/multidomain/CMakeLists.txt b/miniapps/multidomain/CMakeLists.txt index 38894356ae..b03577d146 100644 --- a/miniapps/multidomain/CMakeLists.txt +++ b/miniapps/multidomain/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/multidomain/makefile b/miniapps/multidomain/makefile index cfa7590e89..3aa3731c44 100644 --- a/miniapps/multidomain/makefile +++ b/miniapps/multidomain/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/multidomain/multidomain-hex.mesh b/miniapps/multidomain/multidomain-hex.mesh index ce33395188..0b1ec0efd0 100644 --- a/miniapps/multidomain/multidomain-hex.mesh +++ b/miniapps/multidomain/multidomain-hex.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/multidomain/multidomain.cpp b/miniapps/multidomain/multidomain.cpp index 83ebb98133..332e535915 100644 --- a/miniapps/multidomain/multidomain.cpp +++ b/miniapps/multidomain/multidomain.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/CMakeLists.txt b/miniapps/navier/CMakeLists.txt index 2ee6c6283a..0aa79f8d0d 100644 --- a/miniapps/navier/CMakeLists.txt +++ b/miniapps/navier/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/navier/box-cylinder.mesh b/miniapps/navier/box-cylinder.mesh index bd003b5da2..5e534fbc5d 100644 --- a/miniapps/navier/box-cylinder.mesh +++ b/miniapps/navier/box-cylinder.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/navier/makefile b/miniapps/navier/makefile index b5fd998702..0aca3a09ad 100644 --- a/miniapps/navier/makefile +++ b/miniapps/navier/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/navier/navier_3dfoc.cpp b/miniapps/navier/navier_3dfoc.cpp index 3aa0fcfd36..b021358266 100644 --- a/miniapps/navier/navier_3dfoc.cpp +++ b/miniapps/navier/navier_3dfoc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_cht.cpp b/miniapps/navier/navier_cht.cpp index 1a459f21ae..db269b7e25 100644 --- a/miniapps/navier/navier_cht.cpp +++ b/miniapps/navier/navier_cht.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_kovasznay.cpp b/miniapps/navier/navier_kovasznay.cpp index 0a7f017f1a..290e475f8f 100644 --- a/miniapps/navier/navier_kovasznay.cpp +++ b/miniapps/navier/navier_kovasznay.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_kovasznay_vs.cpp b/miniapps/navier/navier_kovasznay_vs.cpp index fdf529c2ef..f574ff02d8 100644 --- a/miniapps/navier/navier_kovasznay_vs.cpp +++ b/miniapps/navier/navier_kovasznay_vs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_mms.cpp b/miniapps/navier/navier_mms.cpp index ef1de1f4ab..15829348b6 100644 --- a/miniapps/navier/navier_mms.cpp +++ b/miniapps/navier/navier_mms.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_shear.cpp b/miniapps/navier/navier_shear.cpp index 3e8e6db05e..4a28b1e211 100644 --- a/miniapps/navier/navier_shear.cpp +++ b/miniapps/navier/navier_shear.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_solver.cpp b/miniapps/navier/navier_solver.cpp index 04052a0e26..b9886125b8 100644 --- a/miniapps/navier/navier_solver.cpp +++ b/miniapps/navier/navier_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_solver.hpp b/miniapps/navier/navier_solver.hpp index aef1def980..40e2661a77 100644 --- a/miniapps/navier/navier_solver.hpp +++ b/miniapps/navier/navier_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -104,23 +104,23 @@ public: * * 1. An extrapolation step for all nonlinear terms which are treated * explicitly. This step avoids a fully coupled nonlinear solve and only - * requires a solve of the mass matrix in velocity space \f$M_v^{-1}\f$. On + * requires a solve of the mass matrix in velocity space $M_v^{-1}$. On * the other hand this introduces a CFL stability condition on the maximum * timestep. * - * 2. A Poisson solve \f$S_p^{-1}\f$. + * 2. A Poisson solve $S_p^{-1}$. * - * 3. A Helmholtz like solve \f$(M_v - \partial t K_v)^{-1}\f$. + * 3. A Helmholtz like solve $(M_v - \partial t K_v)^{-1}$. * * The numerical solver setup for each step are as follows. * - * \f$M_v^{-1}\f$ is solved using CG with Jacobi as preconditioner. + * $M_v^{-1}$ is solved using CG with Jacobi as preconditioner. * - * \f$S_p^{-1}\f$ is solved using CG with AMG applied to the low order refined + * $S_p^{-1}$ is solved using CG with AMG applied to the low order refined * (LOR) assembled pressure Poisson matrix. To avoid assembling a matrix for * preconditioning, one can use p-MG as an alternative (NYI). * - * \f$(M_v - \partial t K_v)^{-1}\f$ due to the CFL condition we expect the time + * $(M_v - \partial t K_v)^{-1}$ due to the CFL condition we expect the time * step to be small. Therefore this is solved using CG with Jacobi as * preconditioner. For large time steps a preconditioner like AMG or p-MG should * be used (NYI). @@ -145,7 +145,7 @@ public: /** * The ParMesh @a mesh can be a linear or curved parallel mesh. The @a order * of the finite element spaces is this algorithm is of equal order - * \f$(P_N)^d P_N\f$ for velocity and pressure respectively. This means the + * $(P_N)^d P_N$ for velocity and pressure respectively. This means the * pressure is in discretized in the same space (just scalar instead of a * vector space) as the velocity. * @@ -239,25 +239,25 @@ public: ~NavierSolver(); - /// Compute \f$\nabla \times \nabla \times u\f$ for \f$u \in (H^1)^2\f$. + /// Compute $\nabla \times \nabla \times u$ for $u \in (H^1)^2$. void ComputeCurl2D(ParGridFunction &u, ParGridFunction &cu, bool assume_scalar = false); - /// Compute \f$\nabla \times \nabla \times u\f$ for \f$u \in (H^1)^3\f$. + /// Compute $\nabla \times \nabla \times u$ for $u \in (H^1)^3$. void ComputeCurl3D(ParGridFunction &u, ParGridFunction &cu); /// Remove mean from a Vector. /** * Modify the Vector @a v by subtracting its mean using - * \f$v = v - \frac{\sum_i^N v_i}{N} \f$ + * $v = v - \frac{\sum_i^N v_i}{N} $ */ void Orthogonalize(Vector &v); /// Remove the mean from a ParGridFunction. /** * Modify the ParGridFunction @a v by subtracting its mean using - * \f$ v = v - \int_\Omega \frac{v}{vol(\Omega)} dx \f$. + * $ v = v - \int_\Omega \frac{v}{vol(\Omega)} dx $. */ void MeanZero(ParGridFunction &v); @@ -330,16 +330,16 @@ protected: IntegrationRules gll_rules; - /// Velocity \f$H^1\f$ finite element collection. + /// Velocity $H^1$ finite element collection. FiniteElementCollection *vfec = nullptr; - /// Pressure \f$H^1\f$ finite element collection. + /// Pressure $H^1$ finite element collection. FiniteElementCollection *pfec = nullptr; - /// Velocity \f$(H^1)^d\f$ finite element space. + /// Velocity $(H^1)^d$ finite element space. ParFiniteElementSpace *vfes = nullptr; - /// Pressure \f$H^1\f$ finite element space. + /// Pressure $H^1$ finite element space. ParFiniteElementSpace *pfes = nullptr; ParNonlinearForm *N = nullptr; diff --git a/miniapps/navier/navier_tgv.cpp b/miniapps/navier/navier_tgv.cpp index ceb2a26eb0..f782630a13 100644 --- a/miniapps/navier/navier_tgv.cpp +++ b/miniapps/navier/navier_tgv.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/navier/navier_turbchan.cpp b/miniapps/navier/navier_turbchan.cpp index 9a32d7382a..c0f0fc9962 100644 --- a/miniapps/navier/navier_turbchan.cpp +++ b/miniapps/navier/navier_turbchan.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/nurbs/CMakeLists.txt b/miniapps/nurbs/CMakeLists.txt index 20d5e38353..9666afd457 100644 --- a/miniapps/nurbs/CMakeLists.txt +++ b/miniapps/nurbs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/nurbs/makefile b/miniapps/nurbs/makefile index b160c8ec8d..b5ae8adc49 100644 --- a/miniapps/nurbs/makefile +++ b/miniapps/nurbs/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/nurbs/meshes/cube-nurbs.mesh b/miniapps/nurbs/meshes/cube-nurbs.mesh index 822519f23e..d5594b2ff0 100644 --- a/miniapps/nurbs/meshes/cube-nurbs.mesh +++ b/miniapps/nurbs/meshes/cube-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/miniapps/nurbs/meshes/square-nurbs.mesh b/miniapps/nurbs/meshes/square-nurbs.mesh index 169863abf7..38adfbb25b 100644 --- a/miniapps/nurbs/meshes/square-nurbs.mesh +++ b/miniapps/nurbs/meshes/square-nurbs.mesh @@ -1,7 +1,7 @@ MFEM NURBS mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # SEGMENT = 1 # SQUARE = 3 diff --git a/miniapps/nurbs/nurbs_curveint.cpp b/miniapps/nurbs/nurbs_curveint.cpp index 5afa2924f0..76b2fe9419 100644 --- a/miniapps/nurbs/nurbs_curveint.cpp +++ b/miniapps/nurbs/nurbs_curveint.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/parelag/CMakeLists.txt b/miniapps/parelag/CMakeLists.txt index c05ed636d7..2a00ec0b38 100644 --- a/miniapps/parelag/CMakeLists.txt +++ b/miniapps/parelag/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/parelag/MultilevelHcurlHdivSolver.cpp b/miniapps/parelag/MultilevelHcurlHdivSolver.cpp index c227c1d456..7a8f6f829d 100644 --- a/miniapps/parelag/MultilevelHcurlHdivSolver.cpp +++ b/miniapps/parelag/MultilevelHcurlHdivSolver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/parelag/makefile b/miniapps/parelag/makefile index 6395d4e084..e2fad74c8b 100644 --- a/miniapps/parelag/makefile +++ b/miniapps/parelag/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/performance/CMakeLists.txt b/miniapps/performance/CMakeLists.txt index e7bb650c9d..34a10095bb 100644 --- a/miniapps/performance/CMakeLists.txt +++ b/miniapps/performance/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/performance/makefile b/miniapps/performance/makefile index f74a7f6b19..e306479cd1 100644 --- a/miniapps/performance/makefile +++ b/miniapps/performance/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/shifted/CMakeLists.txt b/miniapps/shifted/CMakeLists.txt index b7f6ba3c8e..ccba6e9854 100644 --- a/miniapps/shifted/CMakeLists.txt +++ b/miniapps/shifted/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/shifted/diffusion.cpp b/miniapps/shifted/diffusion.cpp index 2c94e7094e..7efa653a90 100644 --- a/miniapps/shifted/diffusion.cpp +++ b/miniapps/shifted/diffusion.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/distance.cpp b/miniapps/shifted/distance.cpp index 63350a7391..dc1f1cd003 100644 --- a/miniapps/shifted/distance.cpp +++ b/miniapps/shifted/distance.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/extrapolate.cpp b/miniapps/shifted/extrapolate.cpp index 4f609f1988..9ad581f706 100644 --- a/miniapps/shifted/extrapolate.cpp +++ b/miniapps/shifted/extrapolate.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/extrapolator.cpp b/miniapps/shifted/extrapolator.cpp index e097c5c4db..18b85309dc 100644 --- a/miniapps/shifted/extrapolator.cpp +++ b/miniapps/shifted/extrapolator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/extrapolator.hpp b/miniapps/shifted/extrapolator.hpp index 93c1bc0f2b..fe22f0059c 100644 --- a/miniapps/shifted/extrapolator.hpp +++ b/miniapps/shifted/extrapolator.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/lsf_integral.cpp b/miniapps/shifted/lsf_integral.cpp index 3e95cb5df0..010ed37771 100644 --- a/miniapps/shifted/lsf_integral.cpp +++ b/miniapps/shifted/lsf_integral.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/makefile b/miniapps/shifted/makefile index 225eba4f68..1a80248657 100644 --- a/miniapps/shifted/makefile +++ b/miniapps/shifted/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/shifted/marking.cpp b/miniapps/shifted/marking.cpp index 2eec9bec14..bab469b48c 100644 --- a/miniapps/shifted/marking.cpp +++ b/miniapps/shifted/marking.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/marking.hpp b/miniapps/shifted/marking.hpp index b4990ae636..2778c4f5cc 100644 --- a/miniapps/shifted/marking.hpp +++ b/miniapps/shifted/marking.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/sbm_aux.hpp b/miniapps/shifted/sbm_aux.hpp index c97d3dea2f..c4ba02d9ce 100644 --- a/miniapps/shifted/sbm_aux.hpp +++ b/miniapps/shifted/sbm_aux.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/sbm_solver.cpp b/miniapps/shifted/sbm_solver.cpp index 5fa9d6ccfb..0f70eec5e9 100644 --- a/miniapps/shifted/sbm_solver.cpp +++ b/miniapps/shifted/sbm_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/shifted/sbm_solver.hpp b/miniapps/shifted/sbm_solver.hpp index b9a3da28f8..38237f247f 100644 --- a/miniapps/shifted/sbm_solver.hpp +++ b/miniapps/shifted/sbm_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -76,12 +76,12 @@ public: /// BilinearFormIntegrator for the high-order extension of shifted boundary /// method. -/// \f[ +/// $$ /// A(u, w) = -\langle \nabla u \cdot n, w \rangle /// -\langle u + \nabla u \cdot d + h.o.t, \nabla w.n \rangle /// +\langle \alpha h^{-1} (u + \nabla u \cdot d + h.o.t), w + \nabla w \cdot d + h.o.t \rangle -/// \f] -/// where \f$h.o.t\f$ include higher-order derivatives (\f$\nabla^k u\f$) due to Taylor +/// $$ +/// where $h.o.t$ include higher-order derivatives ($\nabla^k u$) due to Taylor /// expansion. Since this interior face integrator is applied to the surrogate /// boundary (see marking.hpp for notes on how the surrogate faces are /// determined and elements are marked), this integrator adds contribution to @@ -134,20 +134,20 @@ public: /// LinearFormIntegrator for the high-order extension of shifted boundary /// method. -/// \f[ +/// $$ /// (u, w) = -\langle u_D, \nabla w \cdot n \rangle /// +\langle \alpha h^{-1} u_D, w + \nabla w \cdot d + h.o.t \rangle -/// \f] -/// where \f$h.o.t\f$ include higher-order derivatives (\f$\nabla^k u\f$) due to Taylor +/// $$ +/// where $h.o.t$ include higher-order derivatives ($\nabla^k u$) due to Taylor /// expansion. Since this interior face integrator is applied to the surrogate /// boundary (see marking.hpp for notes on how the surrogate faces are /// determined and elements are marked), this integrator adds contribution to /// only the element that is adjacent to that face (Trans.Elem1 or Trans.Elem2) /// and is part of the surrogate domain. -/// Note that \f$u_D\f$ is evaluated at the true boundary using the distance function -/// and ShiftedFunctionCoefficient, i.e. \f$u_D(x_{true}) = u_D(x_{surrogate} + D)\f$, -/// where \f$x_{surrogate}\f$ is the location of the integration point on the surrogate -/// boundary and \f$D\f$ is the distance vector from the surrogate boundary to the +/// Note that $u_D$ is evaluated at the true boundary using the distance function +/// and ShiftedFunctionCoefficient, i.e. $u_D(x_{true}) = u_D(x_{surrogate} + D)$, +/// where $x_{surrogate}$ is the location of the integration point on the surrogate +/// boundary and $D$ is the distance vector from the surrogate boundary to the /// true boundary. class SBM2DirichletLFIntegrator : public LinearFormIntegrator { @@ -201,11 +201,11 @@ public: /// BilinearFormIntegrator for Neumann boundaries using the shifted boundary /// method. -/// \f[ +/// $$ /// A(u,w) = \langle [\nabla u + \nabla(\nabla u) \cdot d + h.o.t.] \cdot \hat{n} \, (n \cdot \hat{n}),w ⟩ - \langle \nabla u \cdot n,w \rangle -/// \f] -/// where h.o.t are the high-order terms due to Taylor expansion for \f$\nabla u\f$, -/// \f$\hat{n}\f$ is the normal vector at the true boundary, \f$n\f$ is the normal vector at +/// $$ +/// where h.o.t are the high-order terms due to Taylor expansion for $\nabla u$, +/// $\hat{n}$ is the normal vector at the true boundary, $n$ is the normal vector at /// the surrogate boundary. Since this interior face integrator is applied to /// the surrogate boundary (see marking.hpp for notes on how the surrogate faces /// are determined and elements are marked), this integrator adds contribution @@ -260,20 +260,20 @@ public: /// LinearFormIntegrator for Neumann boundaries using the shifted boundary /// method. -/// \f[ +/// $$ /// (u, w) = \langle \hat{n} \cdot n \, t_n, w \rangle -/// \f] -/// where \f$\hat{n}\f$ is the normal vector at the true boundary, \f$n\f$ is the normal vector -/// at the surrogate boundary, and \f$t_n\f$ is the traction boundary condition. +/// $$ +/// where $\hat{n}$ is the normal vector at the true boundary, $n$ is the normal vector +/// at the surrogate boundary, and $t_n$ is the traction boundary condition. /// Since this interior face integrator is applied to the surrogate boundary /// (see marking.hpp for notes on how the surrogate faces are determined and /// elements are marked), this integrator adds contribution to only the element /// that is adjacent to that face (Trans.Elem1 or Trans.Elem2) and is part of /// the surrogate domain. -/// Note that \f$t_n\f$ is evaluated at the true boundary using the distance function -/// and ShiftedFunctionCoefficient, i.e. \f$t_n(x_{true}) = t_N(x_{surrogate} + D)\f$, -/// where \f$x_{surrogate}\f$ is the location of the integration point on the surrogate -/// boundary and \f$D\f$ is the distance vector from the surrogate boundary to the +/// Note that $t_n$ is evaluated at the true boundary using the distance function +/// and ShiftedFunctionCoefficient, i.e. $t_n(x_{true}) = t_N(x_{surrogate} + D)$, +/// where $x_{surrogate}$ is the location of the integration point on the surrogate +/// boundary and $D$ is the distance vector from the surrogate boundary to the /// true boundary. class SBM2NeumannLFIntegrator : public LinearFormIntegrator { diff --git a/miniapps/solvers/CMakeLists.txt b/miniapps/solvers/CMakeLists.txt index 3320bf9d98..67b824b479 100644 --- a/miniapps/solvers/CMakeLists.txt +++ b/miniapps/solvers/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -12,8 +12,8 @@ if (MFEM_USE_MPI) add_mfem_miniapp(block-solvers MAIN block-solvers.cpp - EXTRA_SOURCES div_free_solver.cpp - EXTRA_HEADERS div_free_solver.hpp + EXTRA_SOURCES darcy_solver.cpp div_free_solver.cpp bramble_pasciak.cpp + EXTRA_HEADERS darcy_solver.hpp div_free_solver.hpp bramble_pasciak.hpp LIBRARIES mfem) add_mfem_miniapp(plor_solvers @@ -21,18 +21,24 @@ if (MFEM_USE_MPI) EXTRA_HEADERS lor_mms.hpp LIBRARIES mfem) + add_mfem_miniapp(lor_elast + MAIN lor_elast.cpp + EXTRA_SOURCES block_fespace_operator.cpp + EXTRA_HEADERS block_fespace_operator.hpp + LIBRARIES mfem) + # Add the corresponding tests to the "test" target if (MFEM_ENABLE_TESTING) add_test(NAME block-solvers-constant_np${MFEM_MPI_NP} COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} ${MPIEXEC_PREFLAGS} - $ -r 2 -no-vis + $ -rs 1 -rp 1 -no-vis ${MPIEXEC_POSTFLAGS}) add_test(NAME block-solvers-anisotropic_np${MFEM_MPI_NP} COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} ${MPIEXEC_PREFLAGS} - $ -r 2 + $ -rs 1 -rp 1 -m ${CMAKE_CURRENT_SOURCE_DIR}/anisotropic.mesh -c ${CMAKE_CURRENT_SOURCE_DIR}/anisotropic.coeff -eb ${CMAKE_CURRENT_SOURCE_DIR}/anisotropic.brd @@ -44,6 +50,20 @@ if (MFEM_USE_MPI) ${MPIEXEC_PREFLAGS} $ -fe n -m ../../data/fichera.mesh -no-vis ${MPIEXEC_POSTFLAGS}) + + add_test(NAME lor_elast-tri_np${MFEM_MPI_NP} + COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} + ${MPIEXEC_PREFLAGS} + $ -l 2 -ca -pa -ss + -m ../../data/beam-tri.mesh -o 2 + ${MPIEXEC_POSTFLAGS}) + + add_test(NAME lor_elast-hex_np${MFEM_MPI_NP} + COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MFEM_MPI_NP} + ${MPIEXEC_PREFLAGS} + $ -l 1 -pa -o 2 + -m ../../data/beam-hex.mesh + ${MPIEXEC_POSTFLAGS}) endif() endif() diff --git a/miniapps/solvers/README b/miniapps/solvers/README index c438a65b9e..b8afd8175a 100644 --- a/miniapps/solvers/README +++ b/miniapps/solvers/README @@ -21,7 +21,7 @@ coefficient K, and the essential/natural boundary assignment. The discrete saddle point problem has a block structure of the form - [ M B^T ] [u] = [g] + Ax = [ M B^T ] [u] = [g] = b [ B 0 ] [p] = [f] The solvers for the above block system include: @@ -62,6 +62,26 @@ The solvers for the above block system include: P^{-1} = [ diag(M)^{-1} 0 ] [ 0 AMG(S) ] +3. CG with Bramble-Pasciak transformation + + The solver explores two approaches. Firstly, we consider a preconditioner Q + such that M - Q is still s.p.d.. The transformed system XA x = X b, where + X = [ M*Q^{-1} - I 0 ] + [ B*Q^{-1} -I ], + can be solver with a standard PGC solver, where we use the above block + diagonal preconditioner. + Secondly, we consider the particular preconditioner + H^{-1} = [ (M - Q)^{-1} 0 ] + [ 0 P_2^{-1} ]. + This preconditioner enables a more efficient implementation of PCG what we + refer to as Bramble-Pasciak CG (BPCG). + + For more details see + + [1] Bramble, James H., and Joseph E. Pasciak. A preconditioning technique + for indefinite systems resulting from mixed approximations of elliptic + problems. Mathematics of Computation 50.181 (1988): 1-17. + # Low-Order Refined Solvers The miniapp `lor` (and its parallel counterpart `plor`) demonstrate the use of @@ -76,3 +96,36 @@ using the low-order system). In parallel, hypre's scalable AMG solvers are used for the low-order systems: `HypreBoomerAMG` is used for H1 and L2 spaces, `HypreAMS` is used for H(curl) (and H(div) in 2D), and `HypreADS` is used for H(div) in 3D. + +# Elasticity LOR Block Preconditioning + +The miniapp `lor_elast` demonstrates how to precondition a vector-valued PDE +on GPUs. The miniapp supports partial assembly, and the low-order refined +preconditioner can be assembled entirely on the GPU. + +In 3D, the elasticity operator can be broken into vector components of the form + + A = [A_00 A_01 A_02] + [A_10 A_11 A_12] + [A_20 A_21 A_22] + +Traditional AMG requires having the entire matrix in memory which can be +prohibitive on GPUs. An effective preconditioning strategy for materials +which are not nearly incompressible is to use +P^{-1} = diag(AMG(A_00), AMG(A_11), AMG(A_22)) where AMG(A) is the AMG +approximation inv(A) [3]. This requires storing 3 blocks instead of 9, +but this is still prohibitive for high order discretizations on GPUs. This +is alleviated here by performing AMG on the low-order refined +operators instead. + +There is also an option which replaces P^{-1} with +diag(inv(A_00), inv(A_11), inv(A_22)) where the action of inv(A_ii) is performed +with a CG inner solve that is preconditioned with AMG(A_ii). This seems to give +order independent conditioning of the outer CG solve, but is much slower than +performing a single AMG iteration per block. + +This miniapp allows timing comparisons with the LEGACY assembly approach. + +[3] Mihajlović, M.D. and Mijalković, S., "A component decomposition + preconditioning for 3D stress analysis problems", Numerical Linear + Algebra with Applications, 2002. diff --git a/miniapps/solvers/anisotropic.mesh b/miniapps/solvers/anisotropic.mesh index 1901104560..fd228b5301 100644 --- a/miniapps/solvers/anisotropic.mesh +++ b/miniapps/solvers/anisotropic.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/miniapps/solvers/block-solvers.cpp b/miniapps/solvers/block-solvers.cpp index a46f87af95..cd8c605645 100644 --- a/miniapps/solvers/block-solvers.cpp +++ b/miniapps/solvers/block-solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -26,8 +26,9 @@ // polynomials (pressure p). // // The solvers being compared include: -// 1. The divergence free solver (couple and decoupled modes) -// 2. MINRES preconditioned by a block diagonal preconditioner +// 1. MINRES preconditioned by a block diagonal preconditioner +// 2. The divergence free solver (couple and decoupled modes) +// 3. The Bramble-Pasciak solver (using BPCG or regular PCG) // // We recommend viewing example 5 before viewing this miniapp. // @@ -52,6 +53,7 @@ // will be imposed on boundary with the i-th attribute. #include "mfem.hpp" +#include "bramble_pasciak.hpp" #include "div_free_solver.hpp" #include #include @@ -88,9 +90,12 @@ class DarcyProblem ParGridFunction u_; ParGridFunction p_; ParMesh mesh_; + ParBilinearForm *mVarf_; + ParMixedBilinearForm *bVarf_; VectorFunctionCoefficient ucoeff_; FunctionCoefficient pcoeff_; DFSSpaces dfs_spaces_; + PWConstCoefficient mass_coeff; const IntegrationRule *irs_[Geometry::NumGeom]; public: DarcyProblem(Mesh &mesh, int num_refines, int order, const char *coef_file, @@ -102,14 +107,17 @@ public: const Vector& GetEssentialBC() { return ess_data_; } const DFSData& GetDFSData() const { return dfs_spaces_.GetDFSData(); } void ShowError(const Vector &sol, bool verbose); - void VisualizeSolution(const Vector &sol, string tag); + void VisualizeSolution(const Vector &sol, std::string tag); + ParBilinearForm* GetMform() const { return mVarf_; } + ParMixedBilinearForm* GetBform() const { return bVarf_; } }; DarcyProblem::DarcyProblem(Mesh &mesh, int num_refs, int order, const char *coef_file, Array &ess_bdr, DFSParameters dfs_param) : mesh_(MPI_COMM_WORLD, mesh), ucoeff_(mesh.Dimension(), u_exact), - pcoeff_(p_exact), dfs_spaces_(order, num_refs, &mesh_, ess_bdr, dfs_param) + pcoeff_(p_exact), dfs_spaces_(order, num_refs, &mesh_, ess_bdr, dfs_param), + mass_coeff() { for (int l = 0; l < num_refs; l++) { @@ -124,7 +132,8 @@ DarcyProblem::DarcyProblem(Mesh &mesh, int num_refs, int order, ifstream coef_str(coef_file); coef_vector.Load(coef_str, mesh.GetNE()); } - PWConstCoefficient mass_coeff(coef_vector); + + mass_coeff.UpdateConstants(coef_vector); VectorFunctionCoefficient fcoeff(mesh_.Dimension(), f_exact); FunctionCoefficient natcoeff(natural_bc); FunctionCoefficient gcoeff(g_exact); @@ -144,21 +153,24 @@ DarcyProblem::DarcyProblem(Mesh &mesh, int num_refs, int order, gform.AddDomainIntegrator(new DomainLFIntegrator(gcoeff)); gform.Assemble(); - ParBilinearForm mVarf(dfs_spaces_.GetHdivFES()); - ParMixedBilinearForm bVarf(dfs_spaces_.GetHdivFES(), dfs_spaces_.GetL2FES()); + mVarf_ = new ParBilinearForm(dfs_spaces_.GetHdivFES()); + bVarf_ = new ParMixedBilinearForm(dfs_spaces_.GetHdivFES(), + dfs_spaces_.GetL2FES()); - mVarf.AddDomainIntegrator(new VectorFEMassIntegrator(mass_coeff)); - mVarf.Assemble(); - mVarf.EliminateEssentialBC(ess_bdr, u_, fform); - mVarf.Finalize(); - M_.Reset(mVarf.ParallelAssemble()); + mVarf_->AddDomainIntegrator(new VectorFEMassIntegrator(mass_coeff)); + mVarf_->ComputeElementMatrices(); + mVarf_->Assemble(); + mVarf_->EliminateEssentialBC(ess_bdr, u_, fform); - bVarf.AddDomainIntegrator(new VectorFEDivergenceIntegrator); - bVarf.Assemble(); - bVarf.SpMat() *= -1.0; - bVarf.EliminateTrialDofs(ess_bdr, u_, gform); - bVarf.Finalize(); - B_.Reset(bVarf.ParallelAssemble()); + mVarf_->Finalize(); + M_.Reset(mVarf_->ParallelAssemble()); + + bVarf_->AddDomainIntegrator(new VectorFEDivergenceIntegrator); + bVarf_->Assemble(); + bVarf_->SpMat() *= -1.0; + bVarf_->EliminateTrialDofs(ess_bdr, u_, gform); + bVarf_->Finalize(); + B_.Reset(bVarf_->ParallelAssemble()); rhs_.SetSize(M_->NumRows() + B_->NumRows()); Vector rhs_block0(rhs_.GetData(), M_->NumRows()); @@ -189,8 +201,8 @@ void DarcyProblem::ShowError(const Vector& sol, bool verbose) double norm_p = ComputeGlobalLpNorm(2, pcoeff_, mesh_, irs_); if (!verbose) { return; } - cout << "|| u_h - u_ex || / || u_ex || = " << err_u / norm_u << "\n"; - cout << "|| p_h - p_ex || / || p_ex || = " << err_p / norm_p << "\n"; + mfem::out << "|| u_h - u_ex || / || u_ex || = " << err_u / norm_u << "\n"; + mfem::out << "|| p_h - p_ex || / || p_ex || = " << err_p / norm_p << "\n"; } void DarcyProblem::VisualizeSolution(const Vector& sol, string tag) @@ -226,8 +238,8 @@ bool IsAllNeumannBoundary(const Array& ess_bdr_attr) int main(int argc, char *argv[]) { #ifdef HYPRE_USING_GPU - cout << "\nAs of mfem-4.3 and hypre-2.22.0 (July 2021) this miniapp\n" - << "is NOT supported with the GPU version of hypre.\n\n"; + mfem::out << "\nAs of mfem-4.3 and hypre-2.22.0 (July 2021) this miniapp\n" + << "is NOT supported with the GPU version of hypre.\n\n"; return 242; #endif @@ -236,23 +248,28 @@ int main(int argc, char *argv[]) Hypre::Init(); StopWatch chrono; - auto ResetTimer = [&chrono]() { chrono.Clear(); chrono.Start(); }; // Parse command-line options. const char *mesh_file = "../../data/beam-hex.mesh"; const char *coef_file = ""; const char *ess_bdr_attr_file = ""; int order = 0; - int par_ref_levels = 2; + int ser_ref_levels = 1; + int par_ref_levels = 1; bool show_error = false; bool visualization = false; + DFSParameters param; + BPSParameters bps_param; + OptionsParser args(argc, argv); args.AddOption(&mesh_file, "-m", "--mesh", "Mesh file to use."); args.AddOption(&order, "-o", "--order", "Finite element order (polynomial degree)."); - args.AddOption(&par_ref_levels, "-r", "--ref", + args.AddOption(&ser_ref_levels, "-rs", "--refine-serial", + "Number of serial refinement steps."); + args.AddOption(&par_ref_levels, "-rp", "--refine-parallel", "Number of parallel refinement steps."); args.AddOption(&coef_file, "-c", "--coef", "Coefficient file to use."); @@ -265,29 +282,38 @@ int main(int argc, char *argv[]) "--no-visualization", "Enable or disable GLVis visualization."); args.Parse(); - if (!args.Good()) - { - if (Mpi::Root()) { args.PrintUsage(cout); } - return 1; - } - if (Mpi::Root()) { args.PrintOptions(cout); } + if (Mpi::Root()) { args.ParseCheck(); } if (Mpi::Root() && par_ref_levels == 0) { - std::cout << "WARNING: DivFree solver is equivalent to BDPMinresSolver " + mfem::out << "WARNING: DivFree solver is equivalent to BDPMinresSolver " << "when par_ref_levels == 0.\n"; } // Initialize the mesh, boundary attributes, and solver parameters Mesh *mesh = new Mesh(mesh_file, 1, 1); + int dim = mesh->Dimension(); - int ser_ref_lvls = - (int)ceil(log(Mpi::WorldSize()/mesh->GetNE())/log(2.)/dim); - for (int i = 0; i < ser_ref_lvls; ++i) + + if (Mpi::Root()) + { + mfem::out << "Number of serial refinements: " << ser_ref_levels << "\n" + << "Number of parallel refinements: " << par_ref_levels << "\n"; + } + + for (int i = 0; i < ser_ref_levels; ++i) { mesh->UniformRefinement(); } + if (Mpi::Root() && Mpi::WorldSize() > mesh->GetNE()) + { + mfem::out << "\nWARNING: Number of processors is greater than the number of " + << "elements in the mesh.\n" + << "Number of processors: " << Mpi::WorldSize() << "\n" + << "Number of elements: " << mesh->GetNE() << "\n\n"; + } + Array ess_bdr(mesh->bdr_attributes.Max()); ess_bdr = 0; if (std::strcmp(ess_bdr_attr_file, "")) @@ -299,9 +325,9 @@ int main(int argc, char *argv[]) { if (Mpi::Root()) { - cout << "\nSolution is not unique when Neumann boundary condition is " - << "imposed on the entire boundary. \nPlease provide a different " - << "boundary condition.\n"; + mfem::out << "\nSolution is not unique when Neumann boundary condition is " + << "imposed on the entire boundary. \nPlease provide a different " + << "boundary condition.\n"; } delete mesh; return 0; @@ -309,7 +335,7 @@ int main(int argc, char *argv[]) string line = "**********************************************************\n"; - ResetTimer(); + chrono.Restart(); // Generate components of the saddle point problem DarcyProblem darcy(*mesh, par_ref_levels, order, coef_file, ess_bdr, param); @@ -320,35 +346,46 @@ int main(int argc, char *argv[]) if (Mpi::Root()) { - cout << line << "System assembled in " << chrono.RealTime() << "s.\n"; - cout << "Dimension of the physical space: " << dim << "\n"; - cout << "Size of the discrete Darcy system: " << M.M() + B.M() << "\n"; + mfem::out << line << "System assembled in " << chrono.RealTime() << "s.\n"; + mfem::out << "Dimension of the physical space: " << dim << "\n"; + mfem::out << "Size of the discrete Darcy system: " << M.M() + B.M() << "\n"; if (par_ref_levels > 0) { - cout << "Dimension of the divergence free subspace: " - << DFS_data.C.back().Ptr()->NumCols() << "\n\n"; + mfem::out << "Dimension of the divergence free subspace: " + << DFS_data.C.back().Ptr()->NumCols() << "\n\n"; } } // Setup various solvers for the discrete problem std::map setup_time; - ResetTimer(); + chrono.Restart(); BDPMinresSolver bdp(M, B, param); setup_time[&bdp] = chrono.RealTime(); - ResetTimer(); + chrono.Restart(); DivFreeSolver dfs_dm(M, B, DFS_data); setup_time[&dfs_dm] = chrono.RealTime(); - ResetTimer(); + chrono.Restart(); const_cast(DFS_data.param.coupled_solve) = true; DivFreeSolver dfs_cm(M, B, DFS_data); setup_time[&dfs_cm] = chrono.RealTime(); + chrono.Restart(); + BramblePasciakSolver bp_bpcg(darcy.GetMform(), darcy.GetBform(), bps_param); + setup_time[&bp_bpcg] = chrono.RealTime(); + + chrono.Restart(); + bps_param.use_bpcg = false; + BramblePasciakSolver bp_pcg(darcy.GetMform(), darcy.GetBform(), bps_param); + setup_time[&bp_pcg] = chrono.RealTime(); + std::map solver_to_name; solver_to_name[&bdp] = "Block-diagonal-preconditioned MINRES"; solver_to_name[&dfs_dm] = "Divergence free (decoupled mode)"; solver_to_name[&dfs_cm] = "Divergence free (coupled mode)"; + solver_to_name[&bp_bpcg] = "Bramble Pasciak CG (using BPCG)"; + solver_to_name[&bp_pcg] = "Bramble Pasciak CG (using regular PCG)"; // Solve the problem using all solvers for (const auto& solver_pair : solver_to_name) @@ -358,17 +395,17 @@ int main(int argc, char *argv[]) Vector sol = darcy.GetEssentialBC(); - ResetTimer(); + chrono.Restart(); solver->Mult(darcy.GetRHS(), sol); chrono.Stop(); if (Mpi::Root()) { - cout << line << name << " solver:\n Setup time: " - << setup_time[solver] << "s.\n Solve time: " - << chrono.RealTime() << "s.\n Total time: " - << setup_time[solver] + chrono.RealTime() << "s.\n" - << " Iteration count: " << solver->GetNumIterations() <<"\n\n"; + mfem::out << line << name << " solver:\n Setup time: " + << setup_time[solver] << "s.\n Solve time: " + << chrono.RealTime() << "s.\n Total time: " + << setup_time[solver] + chrono.RealTime() << "s.\n" + << " Iteration count: " << solver->GetNumIterations() <<"\n\n"; } if (show_error && std::strcmp(coef_file, "") == 0) { @@ -376,8 +413,8 @@ int main(int argc, char *argv[]) } else if (show_error && Mpi::Root()) { - cout << "Exact solution is unknown for coefficient '" << coef_file - << "'.\nApproximation error is computed in this case!\n\n"; + mfem::out << "Exact solution is unknown for coefficient '" << coef_file + << "'.\nApproximation error is computed in this case!\n\n"; } if (visualization) { darcy.VisualizeSolution(sol, name); } diff --git a/miniapps/solvers/block_fespace_operator.cpp b/miniapps/solvers/block_fespace_operator.cpp new file mode 100644 index 0000000000..220037fafb --- /dev/null +++ b/miniapps/solvers/block_fespace_operator.cpp @@ -0,0 +1,109 @@ +#include "block_fespace_operator.hpp" + +namespace mfem +{ + +BlockFESpaceOperator::BlockFESpaceOperator(const + std::vector &fespaces): + Operator(GetHeight(fespaces)), + offsets(GetBlockOffsets(fespaces)), + prolongColOffsets(GetProColBlockOffsets(fespaces)), + restrictRowOffsets(GetResRowBlockOffsets(fespaces)), + A(offsets), + prolongation(offsets,prolongColOffsets), + restriction(restrictRowOffsets, offsets) +{ + for (size_t i = 0; i (fespaces[i]->GetProlongationMatrix())); + restriction.SetDiagonalBlock(i, + const_cast(fespaces[i]->GetRestrictionOperator())); + } +} + +int BlockFESpaceOperator::GetHeight(const std::vector + &fespaces) +{ + int height = 0; + for (size_t i = 0; i < fespaces.size(); i++) + { + height += fespaces[i]->GetVSize(); + } + return height; +} + +Array BlockFESpaceOperator::GetBlockOffsets(const + std::vector &fespaces) +{ + Array offsets(fespaces.size()+1); + offsets[0] = 0; + for (size_t i = 1; i <=fespaces.size(); i++) + { + offsets[i] = fespaces[i-1]->GetVSize(); + } + offsets.PartialSum(); + offsets.Print(); + return offsets; +} + +Array BlockFESpaceOperator::GetProColBlockOffsets(const + std::vector &fespaces) +{ + Array offsets(fespaces.size()+1); + offsets[0] = 0; + for (size_t i = 1; i <=fespaces.size(); i++) + { + const auto *prolong = fespaces[i-1]->GetProlongationMatrix(); + if (prolong) + { + offsets[i] = prolong->Width(); + } + else + { + offsets[i] = fespaces[i-1]->GetVSize(); + } + offsets[i] = fespaces[i-1]->GetTrueVSize(); + } + offsets.PartialSum(); + offsets.Print(); + return offsets; +} + +Array BlockFESpaceOperator::GetResRowBlockOffsets(const + std::vector &fespaces) +{ + Array offsets(fespaces.size()+1); + std::cout << "fespaces.size() = " << fespaces.size() << std::endl; + offsets[0] = 0; + for (size_t i = 1; i <=fespaces.size(); i++) + { + const auto *restriction = fespaces[i-1]->GetRestrictionOperator(); + if (restriction) + { + offsets[i] = restriction->Height(); + } + else + { + offsets[i] = fespaces[i-1]->GetVSize(); + } + offsets[i] = fespaces[i-1]->GetTrueVSize(); + } + offsets.PartialSum(); + offsets.Print(); + return offsets; +} + +const Operator* BlockFESpaceOperator::GetProlongation() const +{ + return &prolongation; +} + +const Operator* BlockFESpaceOperator::GetRestriction() const +{ + return &restriction; +} + +}//namespace mfem diff --git a/miniapps/solvers/block_fespace_operator.hpp b/miniapps/solvers/block_fespace_operator.hpp new file mode 100644 index 0000000000..46248d4e34 --- /dev/null +++ b/miniapps/solvers/block_fespace_operator.hpp @@ -0,0 +1,60 @@ +#ifndef MFEM_BLOCK_FESPACE_OPERATOR +#define MFEM_BLOCK_FESPACE_OPERATOR + +#include "mfem.hpp" + +namespace mfem +{ + +/// @brief Operator for block systems arising from different arbitrarily many finite element spaces. +/// +/// This operator can be used with FormLinearSystem to impose boundary +/// conditions for block systems arise from mixing many types of +/// finite element spaces. Each block is intended to operate on +/// L-Vectors. For example, a block may be a BilinearForm. +class BlockFESpaceOperator : public Operator +{ +private: + /// Offsets for the square "A" operator. + Array offsets; + /// Column offsets for the prolongation operator. + Array prolongColOffsets; + /// Row offsets for the prolongation operator. + Array restrictRowOffsets; + /// The "A" part of "RAP". + BlockOperator A; + /// Maps local dofs of each block to true dofs. + BlockOperator prolongation; + /// Maps true dofs of each block to local dofs. + BlockOperator restriction; + /// Computes height for parent operator. + static int GetHeight(const std::vector + &fespaces); + /// Computes offsets for A BlockOperator. + static Array GetBlockOffsets(const std::vector + &fespaces); + /// Computes col_offsets for prolongation operator. + static Array GetProColBlockOffsets(const + std::vector &fespaces); + /// Computes row_offsets for restriction operator. + static Array GetResRowBlockOffsets(const + std::vector &fespaces); +public: + /// @brief Constructor for BlockFESpaceOperator. + /// @param[in] fespaces Finite element spaces for diagonal blocks. Spaces are not owned. + BlockFESpaceOperator(const std::vector &fespaces); + const Operator* GetProlongation () const override; + const Operator* GetRestriction () const override; + void Mult(const Vector &x, Vector &y) const override {A.Mult(x,y);}; + /// @brief Wraps BlockOperator::SetBlock. Eventually would like this class to inherit + /// from BlockOperator instead, but can't easily due to ownership of offset data + /// in BlockOperator being by reference. + void SetBlock( int iRow, + int iCol, + Operator * op, + double c = 1.0) {A.SetBlock(iRow, iCol, op, c);}; +}; + +}//namespace mfem + +#endif diff --git a/miniapps/solvers/bramble_pasciak.cpp b/miniapps/solvers/bramble_pasciak.cpp new file mode 100644 index 0000000000..e4280c12b9 --- /dev/null +++ b/miniapps/solvers/bramble_pasciak.cpp @@ -0,0 +1,390 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + + +#include "bramble_pasciak.hpp" + +using namespace std; + +namespace mfem +{ +namespace blocksolvers +{ +/// Bramble-Pasciak Solver +BramblePasciakSolver::BramblePasciakSolver( + ParBilinearForm *mVarf, + ParMixedBilinearForm *bVarf, + const BPSParameters ¶m) + : DarcySolver(mVarf->ParFESpace()->GetTrueVSize(), + bVarf->TestFESpace()->GetTrueVSize()) +{ + M_.reset(mVarf->ParallelAssemble()); + B_.reset(bVarf->ParallelAssemble()); + Q_.reset(ConstructMassPreconditioner(*mVarf, param.q_scaling)); + + Vector diagM; + M_->GetDiag(diagM); + auto BT = B_->Transpose(); + auto invDBt = new HypreParMatrix(*BT); + invDBt->InvScaleRows(diagM); + auto S = ParMult(B_.get(), invDBt); + M0_.Reset(new HypreDiagScale(*M_)); + M1_.Reset(new HypreBoomerAMG(*S)); + M1_.As()->SetPrintLevel(0); + + Init(*M_, *B_, *Q_, *M0_.As(), *M1_.As(), param); +} + +BramblePasciakSolver::BramblePasciakSolver( + HypreParMatrix &M, HypreParMatrix &B, HypreParMatrix &Q, + Solver &M0, Solver &M1, + const BPSParameters ¶m) + : DarcySolver(M.NumRows(), B.NumRows()) +{ + Init(M, B, Q, M0, M1, param); +} + +void BramblePasciakSolver::Init( + HypreParMatrix &M, HypreParMatrix &B, HypreParMatrix &Q, + Solver &M0, Solver &M1, + const BPSParameters ¶m) +{ + auto Bt = new TransposeOperator(&B); + auto invQ = new HypreDiagScale(Q); + + use_bpcg = param.use_bpcg; + + if (use_bpcg) + { + oop_ = new BlockOperator(offsets_); + oop_->owns_blocks = false; + oop_->SetBlock(0, 0, &M); + oop_->SetBlock(0, 1, Bt); + oop_->SetBlock(1, 0, &B); + + // cpc_ unused in bpcg + auto temp_cpc = new BlockDiagonalPreconditioner(offsets_); + temp_cpc->owns_blocks = true; + temp_cpc->SetDiagonalBlock(0, invQ); + temp_cpc->SetDiagonalBlock(1, &M1); + // tri(1,0) = B M0 = B invQ + auto id_m = new IdentityOperator(M.NumRows()); + auto id_b = new IdentityOperator(B.NumRows()); + auto BinvQ = new ProductOperator(&B, invQ, false, false); + // tri + auto temp_tri = new BlockOperator(offsets_); + temp_tri->owns_blocks = true; + temp_tri->SetBlock(0, 0, id_m); + temp_tri->SetBlock(1, 1, id_b, -1.0); + temp_tri->SetBlock(1, 0, BinvQ); + + ppc_ = new ProductOperator(temp_cpc, temp_tri, true, true); + + ipc_ = new BlockOperator(offsets_); + ipc_->owns_blocks = false; + ipc_->SetDiagonalBlock(0, invQ); + + // bpcg + solver_.reset(new BPCGSolver(M.GetComm(), *ipc_, *ppc_)); + solver_->SetOperator(*oop_); + } + else + { + // oop_ unused in cg + auto temp_oop = new BlockOperator(offsets_); + temp_oop->owns_blocks = false; + temp_oop->SetBlock(0, 0, &M); + temp_oop->SetBlock(0, 1, Bt); + temp_oop->SetBlock(1, 0, &B); + + // ipc_ unused in cg + auto temp_ipc = new BlockOperator(offsets_); + temp_ipc->owns_blocks = false; + temp_ipc->SetDiagonalBlock(0, invQ); + + // temp_AN = temp_oop * temp_ipc + auto temp_AN = new ProductOperator(temp_oop, temp_ipc, true, true); + + // Required for updating the RHS + auto id = new IdentityOperator(M.NumRows()+B.NumRows()); + map_ = new SumOperator(temp_AN, 1.0, id, -1.0, true, true); + + mop_ = new ProductOperator(map_, temp_oop, false, true); + + cpc_ = new BlockDiagonalPreconditioner(offsets_); + cpc_->owns_blocks = true; + cpc_->SetDiagonalBlock(0, &M0); + cpc_->SetDiagonalBlock(1, &M1); + + // (P)CG + solver_.reset(new CGSolver(M.GetComm())); + solver_->SetOperator(*mop_); + solver_->SetPreconditioner(*cpc_); + } + SetOptions(*solver_, param); +} + +HypreParMatrix *BramblePasciakSolver::ConstructMassPreconditioner( + ParBilinearForm &mVarf, double q_scaling) +{ + MFEM_ASSERT((q_scaling > 0.0) && (q_scaling < 1.0), + "Invalid Q-scaling factor: q_scaling = " << q_scaling ); + ParBilinearForm qVarf(mVarf.ParFESpace()); + qVarf.AllocateMatrix(); +#ifndef MFEM_USE_LAPACK + if (Mpi::Root()) + { + mfem::out << "Warning: Using inverse power method to compute the minimum " + << "eigenvalue of the small eigenvalue problem.\n"; + mfem::out << " Consider compiling MFEM with LAPACK support.\n"; + } +#endif + for (int i = 0; i < mVarf.ParFESpace()->GetNE(); ++i) + { + DenseMatrix M_i, Q_i; + Vector diag_i; + double scaling = 0.0, eval_i = 0.0; + mVarf.ComputeElementMatrix(i, M_i); + M_i.GetDiag(diag_i); + // M_i <- D^{-1/2} M_i D^{-1/2}, where D = diag(M_i) + M_i.InvSymmetricScaling(diag_i); + // M_i x = ev diag(M_i) x +#ifdef MFEM_USE_LAPACK + DenseMatrix evec; + Vector eval; + M_i.Eigenvalues(eval, evec); + eval_i = eval.Min(); +#else + // Inverse power method + Vector x(M_i.Height()), Mx(M_i.Height()), diff(M_i.Height()); + double eval_prev = 0.0; + int iter = 0; + x.Randomize(); + do + { + eval_prev = eval_i; + M_i.Inverse()->Mult(x, Mx); + eval_i = Mx.Norml2(); + x.Set(1.0/eval_i, Mx); + ++iter; + } + while ((iter < 1000) && (fabs(eval_i - eval_prev)/fabs(eval_i) > 1e-12)); + MFEM_VERIFY((iter <= 1000) && (fabs(eval_i - eval_prev)/fabs(eval_i) <= 1e-12), + "Inverse power method did not converge."); + eval_i = 1.0/eval_i; +#endif + scaling = q_scaling*eval_i; + diag_i.Set(scaling, diag_i); + Q_i.Diag(diag_i.GetData(), diag_i.Size()); + qVarf.AssembleElementMatrix(i, Q_i, 1); + } + qVarf.Finalize(); + return qVarf.ParallelAssemble(); +} + +void BramblePasciakSolver::Mult(const Vector & x, Vector & y) const +{ + if (!use_bpcg) + { + Vector transformed_rhs(x.Size()); + map_->Mult(x, transformed_rhs); + solver_->Mult(transformed_rhs, y); + } + else + { + solver_->Mult(x, y); + } + for (int dof : ess_zero_dofs_) { y[dof] = 0.0; } +} + +/// Bramble-Pasciak CG +void BPCGSolver::UpdateVectors() +{ + MemoryType mt = GetMemoryType(oper->GetMemoryClass()); + + r.SetSize(width, mt); r.UseDevice(true); + p.SetSize(width, mt); p.UseDevice(true); + g.SetSize(width, mt); g.UseDevice(true); + t.SetSize(width, mt); t.UseDevice(true); + r_bar.SetSize(width, mt); r_bar.UseDevice(true); + r_red.SetSize(width, mt); r_red.UseDevice(true); + g_red.SetSize(width, mt); g_red.UseDevice(true); +} + +void BPCGSolver::Mult(const Vector &b, Vector &x) const +{ + int i; + double delta, delta0, del0; + double alpha, beta, gamma; + + // Initialization + x.UseDevice(true); + if (iterative_mode) + { + oper->Mult(x, r); + subtract(b, r, r); // r = b - A x + } + else + { + r = b; + x = 0.0; + } + + pprec->Mult(r,r_bar); // r_bar = P r + p = r_bar; + oper->Mult(p, g); // g = A p + oper->Mult(r_bar, t); // t = A r_bar + iprec->Mult(r, r_red); // r_red = N r + + delta = delta0 = Dot(t, r_red) - Dot(r_bar, r); // Dot(Pr, r) + if (delta0 >= 0.0) { initial_norm = sqrt(delta0); } + MFEM_ASSERT(IsFinite(delta), "norm = " << delta); + if (print_options.iterations || print_options.first_and_last) + { + mfem::out << " Iteration : " << setw(3) << 0 << " (P r, r) = " + << delta << (print_options.first_and_last ? " ...\n" : "\n"); + } + Monitor(0, delta, r, x); + + if (delta < 0.0) + { + if (print_options.warnings) + { + mfem::out << "BPCG: The preconditioner is not positive definite. (Pr, r) = " + << delta << '\n'; + } + converged = false; + final_iter = 0; + initial_norm = delta; + final_norm = delta; + return; + } + del0 = std::max(delta*rel_tol*rel_tol, abs_tol*abs_tol); + if (delta <= del0) + { + converged = true; + final_iter = 0; + final_norm = sqrt(delta); + return; + } + + iprec->Mult(g, g_red); + gamma = Dot(g, g_red) - Dot(g,p); // Dot(Ap, p) + MFEM_ASSERT(IsFinite(gamma), "den (gamma) = " << gamma); + if (gamma <= 0.0) + { + if (Dot(r_bar, r_bar) > 0.0 && print_options.warnings) + { + mfem::out << "BPCG: The operator is not positive definite. (Ar, r) = " + << gamma << '\n'; + } + if (gamma == 0.0) + { + converged = false; + final_iter = 0; + final_norm = sqrt(delta); + return; + } + } + + // Start iteration + converged = false; + final_iter = max_iter; + for (i = 1; true; ) + { + alpha = delta0/gamma; + add(x, alpha, p, x); // x = x + alpha p + add(r, -alpha, g, r); // r = r - alpha g + + pprec->Mult(r, r_bar); // r_bar = P r + iprec->Mult(r, r_red); // r_red = N r + oper->Mult(r_bar, t); // t = A r_bar + delta = Dot(t, r_red) - Dot(r_bar,r); + + // Check + MFEM_ASSERT(IsFinite(delta), "norm = " << delta); + if (delta < 0.0) + { + if (print_options.warnings) + { + mfem::out << "BPCG: The preconditioner is not positive definite. (Pr, r) = " + << delta << '\n'; + } + converged = false; + final_iter = i; + break; + } + if (print_options.iterations) + { + mfem::out << " Iteration : " << setw(3) << i << " (Pr, r) = " + << delta << std::endl; + } + Monitor(i, delta, r, x); + if (delta <= del0) + { + converged = true; + final_iter = i; + break; + } + if (++i > max_iter) + { + break; + } + // End check + + beta = delta/delta0; + add(r_bar, beta, p, p); // p = r_bar + beta p + add(t, beta, g, g); // g = t + beta g + + delta0 = delta; + iprec->Mult(g, g_red); + gamma = Dot(g, g_red) - Dot(g,p); // Dot(Ap, p) + MFEM_ASSERT(IsFinite(gamma), "den (gamma) = " << gamma); + if (gamma <= 0.0) + { + if (Dot(r_bar, r_bar) > 0.0 && print_options.warnings) + { + mfem::out << "BPCG: The operator is not positive definite. (Ar, r) = " + << gamma << '\n'; + } + if (gamma == 0.0) + { + final_iter = i; + break; + } + } + } + + if (print_options.first_and_last && !print_options.iterations) + { + mfem::out << " Iteration : " << setw(3) << final_iter << " (Pr, r) = " + << delta << '\n'; + } + if (print_options.summary || (print_options.warnings && !converged)) + { + mfem::out << "BPCG: Number of iterations: " << final_iter << '\n'; + } + if (print_options.summary || print_options.iterations || + print_options.first_and_last) + { + const auto arf = pow (gamma/delta0, 0.5/final_iter); + mfem::out << "Average reduction factor = " << arf << '\n'; + } + if (print_options.warnings && !converged) + { + mfem::out << "BPCG: No convergence!" << '\n'; + } + + final_norm = sqrt(delta); + Monitor(final_iter, final_norm, r, x, true); +} +} // namespace blocksolvers +} // namespace mfem diff --git a/miniapps/solvers/bramble_pasciak.hpp b/miniapps/solvers/bramble_pasciak.hpp new file mode 100644 index 0000000000..c6a2c469f1 --- /dev/null +++ b/miniapps/solvers/bramble_pasciak.hpp @@ -0,0 +1,173 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. +// +// ---------------------------------------------------------- +// Bramble-Pasciak preconditioning for Darcy problem +// ---------------------------------------------------------- +// +// Main idea is to transform the block system +// Ax = [ M B^T ] [u] = [f] = b +// [ B 0 ] [p] = [g] +// where: +// M = \int_\Omega (k u_h) \cdot v_h dx, +// B = -\int_\Omega (div_h u_h) q_h dx, +// u_h, v_h \in R_h (Raviart-Thomas finite element space), +// q_h \in W_h (piecewise discontinuous polynomials), +// with a block transformation of the form X = A*N - Id +// X = [ M*invQ - Id 0 ] +// [ B*invQ -Id ] +// where N is defined by +// N = [ invQ 0 ] +// [ 0 0 ] +// and Q is constructed such that Q and M-Q are both s.p.d.. +// +// The solution x is then obtained by solving XAx = Xb with PCG as XA is s.p.d. +// +// The codes allows the user to provide such Q, or to construct it from the +// element matrices M_T. Moreover, the user can provide a block preconditioner +// P = [ M_0 0 ] +// [ 0 M_1 ] +// for the transformed system XA. +// +// The code also allows the user to use BPCG, which is a special implementation +// of the PCG iteration with the particular preconditioner H, defined as +// H = [ M - Q 0 ] +// [ 0 M_1 ] +// BPCG is efficient as it avoids the direct application of invH and X. + +#ifndef MFEM_BP_SOLVER_HPP +#define MFEM_BP_SOLVER_HPP + +#include "darcy_solver.hpp" +#include + +namespace mfem +{ +namespace blocksolvers +{ + +/// Parameters for the BramblePasciakSolver method +struct BPSParameters : IterSolveParameters +{ + bool use_bpcg = true; // whether to use BPCG + double q_scaling = 0.5; // scaling (> 0 and < 1) of the Q preconditioner +}; + +/// Bramble-Pasciak Conjugate Gradient +class BPCGSolver : public IterativeSolver +{ +protected: + mutable Vector r, p, g, t, r_bar, r_red, g_red; + const Operator *iprec, *pprec; + void UpdateVectors(); + +public: + BPCGSolver(const Operator &ipc, const Operator &ppc) { pprec = &ppc; iprec = &ipc; } + +#ifdef MFEM_USE_MPI + BPCGSolver(MPI_Comm comm_, const Operator &ipc, const Operator &ppc) + : IterativeSolver(comm_) { pprec = &ppc; iprec = &ipc; } +#endif + + virtual void SetOperator(const Operator &op) + { IterativeSolver::SetOperator(op); UpdateVectors(); } + + virtual void SetPreconditioner(Solver &pc) + { if (Mpi::Root()) { MFEM_WARNING("SetPreconditioner has no effect on BPCGSolver.\n"); } } + + virtual void SetIncompletePreconditioner(const Operator &ipc) + { iprec = &ipc; } + + virtual void SetParticularPreconditioner(const Operator &ppc) + { pprec = &ppc; } + + virtual void Mult(const Vector &b, Vector &x) const; +}; + +/// Bramble-Pasciak Solver for Darcy equation. +/** Bramble-Pasciak Solver for Darcy equation. + + The basic idea is to precondition the mass matrix M with a s.p.d. matrix Q + such that M - Q remains s.p.d. Then we can transform the block operator into + a s.p.d. operator under a modified inner product. In particular, this enable + us to implement modified versions of CG iterations, that rely on efficient + applications of the required transformations. + + We offer a mass preconditioner based on a rescalling of the diagonal of the + element mass matrices M_T. + + We consider Q_T := alpha * lambda_min * D_T, where D_T := diag(M_T), and + lambda_min is the smallest eigenvalue of the following problem + + M_T x = lambda * D_T x. + + Alpha is a parameter that is strictly between 0 and 1. + + For more details, see: + + 1. P. Vassilevski, Multilevel Block Factorization Preconditioners (Appendix + F.3), Springer, 2008. + + 2. J. Bramble and J. Pasciak. A Preconditioning Technique for Indefinite + Systems Resulting From Mixed Approximations of Elliptic Problems, + Mathematics of Computation, 50:1–17, 1988. */ +class BramblePasciakSolver : public DarcySolver +{ + mutable bool use_bpcg; + std::unique_ptr solver_; + BlockOperator *oop_, *ipc_; + ProductOperator *mop_; + SumOperator *map_; + ProductOperator *ppc_; + BlockDiagonalPreconditioner *cpc_; + std::unique_ptr M_; + std::unique_ptr B_; + std::unique_ptr Q_; + OperatorPtr M0_; + OperatorPtr M1_; + Array ess_zero_dofs_; + + void Init(HypreParMatrix &M, HypreParMatrix &B, + HypreParMatrix &Q, + Solver &M0, Solver &M1, + const BPSParameters ¶m); +public: + /// System and mass preconditioner are constructed from bilinear forms + BramblePasciakSolver( + ParBilinearForm *mVarf, + ParMixedBilinearForm *bVarf, + const BPSParameters ¶m); + + /// System and mass preconditioner are user-provided + BramblePasciakSolver( + HypreParMatrix &M, HypreParMatrix &B, HypreParMatrix &Q, + Solver &M0, Solver &M1, + const BPSParameters ¶m); + + /// Assemble a preconditioner for the mass matrix + /** Mass preconditioner corresponds to a local re-scaling based on the + smallest eigenvalue of the generalized eigenvalue problem locally on each + element T: + M_T x_T = lambda_T diag(M_T) x_T. + We set Q_T = alpha * min(lambda_T) * diag(M_T), 0 < alpha < 1. */ + static HypreParMatrix *ConstructMassPreconditioner(ParBilinearForm &mVarf, + double alpha = 0.5); + + virtual void Mult(const Vector &x, Vector &y) const; + virtual void SetOperator(const Operator &op) { } + void SetEssZeroDofs(const Array& dofs) { dofs.Copy(ess_zero_dofs_); } + virtual int GetNumIterations() const { return solver_->GetNumIterations(); } +}; + +} // namespace blocksolvers +} // namespace mfem + +#endif // MFEM_BP_SOLVER_HPP diff --git a/miniapps/solvers/darcy_solver.cpp b/miniapps/solvers/darcy_solver.cpp new file mode 100644 index 0000000000..a4ae7f89a3 --- /dev/null +++ b/miniapps/solvers/darcy_solver.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "darcy_solver.hpp" + +using namespace std; + +namespace mfem +{ +namespace blocksolvers +{ +void SetOptions(IterativeSolver& solver, const IterSolveParameters& param) +{ + solver.SetPrintLevel(param.print_level); + solver.SetMaxIter(param.max_iter); + solver.SetAbsTol(param.abs_tol); + solver.SetRelTol(param.rel_tol); +} + +/// Wrapper Block Diagonal Preconditioned MINRES (ex5p) +/** Wrapper for assembling the discrete Darcy problem (ex5p) + [ M B^T ] [u] = [f] + [ B 0 ] [p] = [g] +*/ +BDPMinresSolver::BDPMinresSolver(const HypreParMatrix& M, + const HypreParMatrix& B, + IterSolveParameters param) + : DarcySolver(M.NumRows(), B.NumRows()), op_(offsets_), prec_(offsets_), + BT_(B.Transpose()), solver_(M.GetComm()) +{ + op_.SetBlock(0,0, &M); + op_.SetBlock(0,1, BT_.As()); + op_.SetBlock(1,0, &B); + + Vector Md; + M.GetDiag(Md); + BT_.As()->InvScaleRows(Md); + S_.Reset(ParMult(&B, BT_.As())); + BT_.As()->ScaleRows(Md); + + prec_.SetDiagonalBlock(0, new HypreDiagScale(M)); + prec_.SetDiagonalBlock(1, new HypreBoomerAMG(*S_.As())); + static_cast(prec_.GetDiagonalBlock(1)).SetPrintLevel(0); + prec_.owns_blocks = true; + + SetOptions(solver_, param); + solver_.SetOperator(op_); + solver_.SetPreconditioner(prec_); +} + +void BDPMinresSolver::Mult(const Vector & x, Vector & y) const +{ + solver_.Mult(x, y); + for (int dof : ess_zero_dofs_) { y[dof] = 0.0; } +} +} // namespace blocksolvers +} // namespace mfem diff --git a/miniapps/solvers/darcy_solver.hpp b/miniapps/solvers/darcy_solver.hpp new file mode 100644 index 0000000000..219a5a88d4 --- /dev/null +++ b/miniapps/solvers/darcy_solver.hpp @@ -0,0 +1,65 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#ifndef MFEM_DARCY_SOLVER_HPP +#define MFEM_DARCY_SOLVER_HPP + +#include "mfem.hpp" +#include +#include + +namespace mfem +{ +namespace blocksolvers +{ +struct IterSolveParameters +{ + int print_level = 0; + int max_iter = 500; + double abs_tol = 1e-12; + double rel_tol = 1e-9; +}; + +void SetOptions(IterativeSolver& solver, const IterSolveParameters& param); + +/// Abstract solver class for Darcy's flow +class DarcySolver : public Solver +{ +protected: + Array offsets_; +public: + DarcySolver(int size0, int size1) : Solver(size0 + size1), + offsets_({0, size0, height}) { } + virtual int GetNumIterations() const = 0; +}; + +/// Wrapper for the block-diagonal-preconditioned MINRES employed in ex5p.cpp +class BDPMinresSolver : public DarcySolver +{ + BlockOperator op_; + BlockDiagonalPreconditioner prec_; + OperatorPtr BT_; + OperatorPtr S_; // S_ = B diag(M)^{-1} B^T + MINRESSolver solver_; + Array ess_zero_dofs_; +public: + BDPMinresSolver(const HypreParMatrix& M, + const HypreParMatrix& B, + IterSolveParameters param); + virtual void Mult(const Vector & x, Vector & y) const; + virtual void SetOperator(const Operator &op) { } + void SetEssZeroDofs(const Array& dofs) { dofs.Copy(ess_zero_dofs_); } + virtual int GetNumIterations() const { return solver_.GetNumIterations(); } +}; +} // namespace blocksolvers +} // namespace mfem + +#endif // MFEM_DARCY_SOLVER_HPP diff --git a/miniapps/solvers/div_free_solver.cpp b/miniapps/solvers/div_free_solver.cpp index 978abbcc40..44dd4a4c10 100644 --- a/miniapps/solvers/div_free_solver.cpp +++ b/miniapps/solvers/div_free_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -12,17 +12,11 @@ #include "div_free_solver.hpp" using namespace std; -using namespace mfem; -using namespace blocksolvers; -void SetOptions(IterativeSolver& solver, const IterSolveParameters& param) +namespace mfem +{ +namespace blocksolvers { - solver.SetPrintLevel(param.print_level); - solver.SetMaxIter(param.max_iter); - solver.SetAbsTol(param.abs_tol); - solver.SetRelTol(param.rel_tol); -} - HypreParMatrix* TwoStepsRAP(const HypreParMatrix& Rt, const HypreParMatrix& A, const HypreParMatrix& P) { @@ -53,9 +47,12 @@ DFSSpaces::DFSSpaces(int order, int num_refine, ParMesh *mesh, : hdiv_fec_(order, mesh->Dimension()), l2_fec_(order, mesh->Dimension()), l2_0_fec_(0, mesh->Dimension()), ess_bdr_attr_(ess_attr), level_(0) { - if (mesh->GetElement(0)->GetType() == Element::TETRAHEDRON && order) + if (mesh->GetNE() > 0) { - mfem_error("DFSDataCollector: High order spaces on tetrahedra are not supported"); + if (mesh->GetElement(0)->GetType() == Element::TETRAHEDRON && order) + { + MFEM_ABORT("DFSDataCollector: High order spaces on tetrahedra are not supported"); + } } data_.param = param; @@ -314,37 +311,6 @@ void SaddleSchwarzSmoother::Mult(const Vector & x, Vector & y) const blk_y.GetBlock(1) -= coarse_l2_projection; } -BDPMinresSolver::BDPMinresSolver(HypreParMatrix& M, HypreParMatrix& B, - IterSolveParameters param) - : DarcySolver(M.NumRows(), B.NumRows()), op_(offsets_), prec_(offsets_), - BT_(B.Transpose()), solver_(M.GetComm()) -{ - op_.SetBlock(0,0, &M); - op_.SetBlock(0,1, BT_.As()); - op_.SetBlock(1,0, &B); - - Vector Md; - M.GetDiag(Md); - BT_.As()->InvScaleRows(Md); - S_.Reset(ParMult(&B, BT_.As())); - BT_.As()->ScaleRows(Md); - - prec_.SetDiagonalBlock(0, new HypreDiagScale(M)); - prec_.SetDiagonalBlock(1, new HypreBoomerAMG(*S_.As())); - static_cast(prec_.GetDiagonalBlock(1)).SetPrintLevel(0); - prec_.owns_blocks = true; - - SetOptions(solver_, param); - solver_.SetOperator(op_); - solver_.SetPreconditioner(prec_); -} - -void BDPMinresSolver::Mult(const Vector & x, Vector & y) const -{ - solver_.Mult(x, y); - for (int dof : ess_zero_dofs_) { y[dof] = 0.0; } -} - DivFreeSolver::DivFreeSolver(const HypreParMatrix &M, const HypreParMatrix& B, const DFSData& data) : DarcySolver(M.NumRows(), B.NumRows()), data_(data), param_(data.param), @@ -360,8 +326,8 @@ DivFreeSolver::DivFreeSolver(const HypreParMatrix &M, const HypreParMatrix& B, for (int l = data.P_l2.size(); l >= 0; --l) { - auto& M_f = static_cast(ops_[l]->GetBlock(0, 0)); - auto& B_f = static_cast(ops_[l]->GetBlock(1, 0)); + auto& M_f = static_cast(ops_[l]->GetBlock(0, 0)); + auto& B_f = static_cast(ops_[l]->GetBlock(1, 0)); if (l == 0) { @@ -586,7 +552,7 @@ void DivFreeSolver::Mult(const Vector & x, Vector & y) const ch.Clear(); ch.Start(); - auto M = dynamic_cast(ops_.Last()->GetBlock(0, 0)); + auto& M = dynamic_cast(ops_.Last()->GetBlock(0, 0)); M.Mult(-1.0, correction.GetBlock(0), 1.0, resid.GetBlock(0)); SolvePotential(resid.GetBlock(0), correction.GetBlock(1)); blk_y.GetBlock(1) += correction.GetBlock(1); @@ -606,3 +572,5 @@ int DivFreeSolver::GetNumIterations() const } return solver_.As()->GetNumIterations(); } +} // namespace blocksolvers +} // namespace mfem diff --git a/miniapps/solvers/div_free_solver.hpp b/miniapps/solvers/div_free_solver.hpp index ad16c2c45a..48eae6ca99 100644 --- a/miniapps/solvers/div_free_solver.hpp +++ b/miniapps/solvers/div_free_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -12,24 +12,12 @@ #ifndef MFEM_DIVFREE_SOLVER_HPP #define MFEM_DIVFREE_SOLVER_HPP -#include "mfem.hpp" -#include -#include +#include "darcy_solver.hpp" namespace mfem { namespace blocksolvers { - -/// Parameters for iterative solver -struct IterSolveParameters -{ - int print_level = 0; - int max_iter = 500; - double abs_tol = 1e-12; - double rel_tol = 1e-9; -}; - /// Parameters for the divergence free solver struct DFSParameters : IterSolveParameters { @@ -58,7 +46,7 @@ struct DFSData DFSParameters param; }; -/// Finite element spaces concerning divergence free solver. +/// Finite element spaces concerning divergence free solvers /// The main usage of this class is to collect data needed for the solver. class DFSSpaces { @@ -99,17 +87,7 @@ public: ParFiniteElementSpace* GetL2FES() const { return l2_fes_.get(); } }; -/// Abstract solver class for Darcy's flow -class DarcySolver : public Solver -{ -protected: - Array offsets_; -public: - DarcySolver(int size0, int size1) : Solver(size0 + size1), offsets_(3) - { offsets_[0] = 0; offsets_[1] = size0; offsets_[2] = height; } - virtual int GetNumIterations() const = 0; -}; - +/// Solvers for DFS /// Solver for B * B^T /// Compute the product B * B^T and solve it with CG preconditioned by BoomerAMG class BBTSolver : public Solver @@ -180,24 +158,7 @@ public: virtual void SetOperator(const Operator &op) { } }; -/// Wrapper for the block-diagonal-preconditioned MINRES defined in ex5p.cpp -class BDPMinresSolver : public DarcySolver -{ - BlockOperator op_; - BlockDiagonalPreconditioner prec_; - OperatorPtr BT_; - OperatorPtr S_; // S_ = B diag(M)^{-1} B^T - MINRESSolver solver_; - Array ess_zero_dofs_; -public: - BDPMinresSolver(HypreParMatrix& M, HypreParMatrix& B, - IterSolveParameters param); - virtual void Mult(const Vector & x, Vector & y) const; - virtual void SetOperator(const Operator &op) { } - void SetEssZeroDofs(const Array& dofs) { dofs.Copy(ess_zero_dofs_); } - virtual int GetNumIterations() const { return solver_.GetNumIterations(); } -}; - +/// Divergence free solver. /** Divergence free solver. The basic idea of the solver is to exploit a multilevel decomposition of Raviart-Thomas space to find a particular solution satisfying the divergence diff --git a/miniapps/solvers/lor_elast.cpp b/miniapps/solvers/lor_elast.cpp new file mode 100644 index 0000000000..cdcba7092c --- /dev/null +++ b/miniapps/solvers/lor_elast.cpp @@ -0,0 +1,499 @@ +// -------------------------------------------- +// Elasticity LOR Block Preconditioning Miniapp +// -------------------------------------------- +// +// Description: +// The purpose of this miniapp is to demonstrate how to effectively +// precondition vector valued PDEs, such as elasticity, on GPUs. +// +// Using 3D elasticity as an example, the linear operator can be broken into +// vector components and has the form: +// +// A = [A_00 A_01 A_02] +// [A_10 A_11 A_12] +// [A_20 A_21 A_22] +// +// Traditional AMG requires having the entire matrix in memory which can be +// prohibitive on GPUs. An effective preconditioning strategy for materials +// which are not nearly incompressible is to use +// P^{-1} = diag(AMG(A_00), AMG(A_11), AMG(A_22)) where AMG(A) is the AMG +// approximation inv(A) [1]. This requires storing 3 blocks instead of 9, +// but this is still prohibitive for high order discretizations on GPUs. This +// is alleviated here by performing AMG on the low-order refined +// operators instead. +// +// This miniapp solves the same beam problem described in Example 2. Run +// times of the new solver (partial assembly with block diagonal LOR-AMG) +// can be compared with the LEGACY approach of assembling the full matrix +// and preconditioning with AMG. +// +// For the partial assembly approach, the operator actions and component +// matrix assembly are supported on GPUs. +// +// The LEGACY approach should be performed with "-vdim" ordering while PARTIAL +// requires "-nodes". +// +// There is also an option "-ss" or "--sub-solve" for the partial assembly +// version which replaces P^{-1} with diag(inv(A_00), inv(A_11), inv(A_22)) +// where the action of inv(A_ii) is performed with a CG inner solve that +// is preconditioned with AMG(A_ii). This seems to give order independent +// conditioning of the outer CG solve, but is much slower than performing +// a single AMG iteration per block. +// +// This miniapp supports beam-tri.mesh, beam-quad.mesh, and beam-hex.mesh. +// beam-tet.mesh can be run if MFEM is build with +// ElementRestriction::MaxNbNbr set to 32 instead of 16. +// +// This miniapp shows how to test if the derived component integrators are +// correct using BlockFESpaceOperator. If "-ca" (for componentwise action) +// is used, a block operator where each block is a component of the +// elasticity operator is used for A rather than the vector version. +// This yields the same answer, but is less efficient. "-ca" can be called +// with "-pa" for a version where each component is partially assembled, or +// without where each component is called with full assembly, although the +// latter may only work for order 1 on GPUs. +// +// Sample runs: +// +// ./lor_elast -m ../../data/beam-tri.mesh +// ./lor_elast -m ../../data/beam-quad.mesh +// ./lor_elast -m ../../data/beam-hex.mesh +// mpirun -np 4 ./lor_elast -m ../../data/beam-hex.mesh -l 5 -vdim +// mpirun -np 4 ./lor_elast -m ../../data/beam-hex.mesh -l 5 -vdim -elast +// ./lor_elast --device cuda -m ../../data/beam-hex.mesh -l 4 -o 2 -pa +// ./lor_elast --device cuda -m ../../data/beam-hex.mesh -l 4 -o 2 -pa -pv +// ./lor_elast --device cuda -m ../../data/beam-hex.mesh -l 4 -o 2 -pa -ss +// ./lor_elast --device cuda -m ../../data/beam-hex.mesh -l 4 -o 2 -pa -ca +// ./lor_elast --device cuda -m ../../data/beam-hex.mesh -l 5 -ca +// +// References: +// [1] Mihajlović, M.D. and Mijalković, S., "A component decomposition +// preconditioning for 3D stress analysis problems", Numerical Linear +// Algebra with Applications, 2002. +// + +#include "mfem.hpp" +#include +#include +#include "block_fespace_operator.hpp" + +using namespace std; +using namespace mfem; + +int main(int argc, char *argv[]) +{ + // 1. Initialize MPI and HYPRE. + Mpi::Init(argc, argv); + Hypre::Init(); + + // 2. Parse command-line options. + const char *mesh_file = "../../data/beam-tri.mesh"; + int order = 1; + bool pa = false; + bool visualization = false; + bool amg_elast = 0; + bool reorder_space = true; + const char *device_config = "cpu"; + int ref_levels = 0; + bool sub_solve = false; + bool componentwise_action = false; + + OptionsParser args(argc, argv); + args.AddOption(&mesh_file, "-m", "--mesh", + "Mesh file to use."); + args.AddOption(&order, "-o", "--order", + "Finite element order (polynomial degree)."); + args.AddOption(&amg_elast, "-elast", "--amg-for-elasticity", "-sys", + "--amg-for-systems", + "Use the special AMG elasticity solver (GM/LN approaches), " + "or standard AMG for systems (unknown approach)."); + args.AddOption(&sub_solve, "-ss", "--sub-solve", "-no-ss", + "--no-sub-solve", + "Blocks are solved with a few CG iterations instead of a single AMG application."); + args.AddOption(&pa, "-pa", "--partial-assembly", "-no-pa", + "--no-partial-assembly", "Enable Partial Assembly."); + args.AddOption(&reorder_space, "-nodes", "--by-nodes", "-vdim", "--by-vdim", + "Use byNODES ordering of vector space instead of byVDIM"); + args.AddOption(&device_config, "-d", "--device", + "Device configuration string, see Device::Configure()."); + args.AddOption(&ref_levels, "-l","--reflevels", + "How many mesh refinements to perform."); + args.AddOption(&componentwise_action, "-ca", "--component-action", "-no-ca", + "--no-component-action", + "Uses partial assembly with a block operator of components instead of the monolithic vector integrator."); + args.AddOption(&visualization, "-vis", "--visualization", "-no-vis", + "--no-visualization", + "Enable or disable ParaView and GLVis output."); + args.ParseCheck(); + + // 3. Enable hardware devices such as GPUs, and programming models such as + // CUDA, OCCA, RAJA and OpenMP based on command line options. + Device device(device_config); + if (Mpi::Root()) { device.Print(); } + // 4. Read the (serial) mesh from the given mesh file on all processors. We + // can handle triangular, quadrilateral, tetrahedral, hexahedral, surface + // and volume meshes with the same code. + Mesh mesh(mesh_file, 1, 1); + int dim = mesh.Dimension(); + + if (mesh.attributes.Max() < 2 || mesh.bdr_attributes.Max() < 2) + { + if (Mpi::Root()) + { + cerr << "\nInput mesh should have at least two materials and " + << "two boundary attributes! (See schematic in ex2.cpp)\n" + << endl; + } + return 3; + } + + // 5. Refine the serial mesh on all processors to increase the resolution. + for (int l = 0; l < ref_levels; l++) + { + mesh.UniformRefinement(); + } + + // 6. Define a parallel mesh by a partitioning of the serial mesh. + ParMesh pmesh(MPI_COMM_WORLD, mesh); + + // 7. Define a parallel finite element spaces on the parallel mesh. Here we + // use vector finite elements, i.e. dim copies of a scalar finite element + // space. If using partial assembly, also assemble the low order refined + // (LOR) fespace. + H1_FECollection fec(order, dim); + const Ordering::Type fes_ordering = + reorder_space ? Ordering::byNODES : Ordering::byVDIM; + ParFiniteElementSpace fespace(&pmesh, &fec, dim, fes_ordering); + ParFiniteElementSpace scalar_fespace(&pmesh, &fec, 1, fes_ordering); + unique_ptr lor_disc; + unique_ptr scalar_lor_fespace; + if (pa || componentwise_action) + { + lor_disc.reset(new ParLORDiscretization(fespace)); + ParFiniteElementSpace &lor_space = lor_disc->GetParFESpace(); + const FiniteElementCollection &lor_fec = *lor_space.FEColl(); + ParMesh &lor_mesh = *lor_space.GetParMesh(); + scalar_lor_fespace.reset( + new ParFiniteElementSpace(&lor_mesh, &lor_fec, 1, fes_ordering)); + } + HYPRE_BigInt size = fespace.GlobalTrueVSize(); + if (Mpi::Root()) + { + cout << "Number of finite element unknowns: " << size << endl + << "Assembling: " << flush; + } + + // 8. Determine the list of true (i.e. parallel conforming) essential + // boundary dofs. In this example, the boundary conditions are defined by + // marking only boundary attribute 1 from the mesh as essential and + // converting it to a list of true dofs. + Array ess_tdof_list, ess_bdr(pmesh.bdr_attributes.Max()); + ess_bdr = 0; + ess_bdr[0] = 1; + fespace.GetEssentialTrueDofs(ess_bdr, ess_tdof_list); + + // 9. Set up the parallel linear form b(.) which corresponds to the + // right-hand side of the FEM linear system. In this case, b_i equals the + // boundary integral of f*phi_i where f represents a "pull down" force on + // the Neumann part of the boundary and phi_i are the basis functions in + // the finite element fespace. The force is defined by the object f, which + // is a vector of Coefficient objects. The fact that f is non-zero on + // boundary attribute 2 is indicated by the use of piece-wise constants + // coefficient for its last component. + VectorArrayCoefficient f(dim); + for (int i = 0; i < dim-1; i++) + { + f.Set(i, new ConstantCoefficient(0.0)); + } + { + Vector pull_force(pmesh.bdr_attributes.Max()); + pull_force = 0.0; + pull_force(1) = -1.0e-2; + f.Set(dim-1, new PWConstCoefficient(pull_force)); + } + + ParLinearForm b(&fespace); + b.AddBoundaryIntegrator(new VectorBoundaryLFIntegrator(f)); + if (Mpi::Root()) + { + cout << "r.h.s. ... " << flush; + } + b.Assemble(); + + // 10. Define the solution vector x as a parallel finite element grid + // function corresponding to fespace. Initialize x with initial guess of + // zero, which satisfies the boundary conditions. + ParGridFunction x(&fespace); + x = 0.0; + + // 11. Set up the parallel bilinear form a(.,.) on the finite element space + // corresponding to the linear elasticity integrator with piece-wise + // constants coefficient lambda and mu. + Vector lambda(pmesh.attributes.Max()); + lambda = 1.0; + lambda(0) = lambda(1)*50; + PWConstCoefficient lambda_func(lambda); + Vector mu(pmesh.attributes.Max()); + mu = 1.0; + mu(0) = mu(1)*50; + PWConstCoefficient mu_func(mu); + ElasticityIntegrator integrator(lambda_func, mu_func); + + ParBilinearForm a(&fespace); + if (pa || componentwise_action) + { + a.SetAssemblyLevel( + AssemblyLevel::PARTIAL); + } + a.AddDomainIntegrator(&integrator); + a.UseExternalIntegrators(); + + // 12. Assemble the parallel bilinear form and the corresponding linear + // system, applying any necessary transformations such as: parallel + // assembly, eliminating boundary conditions, applying conforming + // constraints for non-conforming AMR, static condensation, etc. + if (Mpi::Root()) { cout << "matrix ... " << flush; } + StopWatch total_timer; + StopWatch assembly_timer; + assembly_timer.Start(); + total_timer.Start(); + a.Assemble(); + OperatorPtr A; + Vector B, X; + Operator *a_lhs = componentwise_action ? nullptr : &a; + if (!componentwise_action) + { + a.FormLinearSystem(ess_tdof_list, x, b, A, X, B); + } + if (Mpi::Root()) + { + cout << "done." << endl; + cout << "Size of linear system: " << fespace.GlobalTrueVSize() << endl; + } + + Array block_offsets(dim + 1); + block_offsets[0] = 0; + BlockDiagonalPreconditioner *blockDiag; + unique_ptr prec = nullptr; + + // 13. For partial assembly, assemble forms on LOR space. Construct the block + // diagonal preconditioner by fully assembling the component bilinear + // on the LOR space. If additionally "-ss" is enabled, create the + // block CG solvers and the high order, partially assembled components. + vector> bilinear_forms; + vector> lor_block; + //amg_blocks stores preconditioners of lor_block. + vector> amg_blocks; + //cg_blocks only gets used if -ss is enabled. + vector> cg_blocks; + //diag_ho only used if -hoa enabled. The high order partial assembled operators + //with the essential dofs eliminated and constrained to one. + vector> ho_bilinear_form_blocks; + vector> diag_ho; + //If -ca is used, component bilinear forms are stored in pa_components, and + //pointers to fespaces. + vector> pa_components; + vector fespaces; + //get block essential boundary info. + //need to allocate here since constrained operator will not own essential dofs. + Array ess_tdof_list_block_ho, ess_bdr_block_ho(pmesh.bdr_attributes.Max()); + ess_bdr_block_ho = 0; + ess_bdr_block_ho[0] = 1; + ElasticityIntegrator lor_integrator(lambda_func, mu_func); + if (pa || componentwise_action) + { + // 13(a) Create the diagonal LOR matrices and corresponding AMG preconditioners. + lor_integrator.AssemblePA(lor_disc->GetParFESpace()); + for (int j = 0; j < dim; j++) + { + ElasticityComponentIntegrator *block = new ElasticityComponentIntegrator( + lor_integrator, j, j); + //create the LOR matrix and corresponding AMG preconditioners. + bilinear_forms.emplace_back(new ParBilinearForm(scalar_lor_fespace.get())); + bilinear_forms[j]->SetAssemblyLevel(AssemblyLevel::FULL); + bilinear_forms[j]->EnableSparseMatrixSorting(Device::IsEnabled()); + bilinear_forms[j]->AddDomainIntegrator(block); + bilinear_forms[j]->Assemble(); + + //get block essential boundary info + Array ess_tdof_list_block, ess_bdr_block(pmesh.bdr_attributes.Max()); + ess_bdr_block = 0; + ess_bdr_block[0] = 1; + scalar_lor_fespace->GetEssentialTrueDofs(ess_bdr_block, ess_tdof_list_block); + lor_block.emplace_back(bilinear_forms[j]->ParallelAssemble()); + lor_block[j]->EliminateBC(ess_tdof_list_block, + Operator::DiagonalPolicy::DIAG_ONE);//not sure which diagonal policy to use + amg_blocks.emplace_back(new HypreBoomerAMG); + amg_blocks[j]->SetStrengthThresh(0.25); + amg_blocks[j]->SetRelaxType(16); //Chebyshev + amg_blocks[j]->SetOperator(*lor_block[j]); + block_offsets[j+1] = amg_blocks[j]->Height(); + // 13(b) If needed, create the block components for operator action. + if (componentwise_action) + { + for (int i = 0; i < dim; i++) + { + ElasticityComponentIntegrator *action_block = new ElasticityComponentIntegrator( + integrator, i, j); + if (i == j) + { + fespaces.emplace_back(&scalar_fespace); + } + pa_components.emplace_back(new ParBilinearForm(&scalar_fespace)); + pa_components[i + dim*j]->SetAssemblyLevel(pa ? AssemblyLevel::PARTIAL : + AssemblyLevel::FULL); + pa_components[i + dim*j]->EnableSparseMatrixSorting(Device::IsEnabled()); + pa_components[i + dim*j]->AddDomainIntegrator(action_block); + pa_components[i + dim*j]->Assemble(); + } + } + } + block_offsets.PartialSum(); + // 13(c) If needed, create CG solvers for diagonal sub-systems. + if (sub_solve) + { + //Create diagonal high order partial assembly operators. + for (int i = 0; i < dim; i++) + { + ElasticityComponentIntegrator *block = new ElasticityComponentIntegrator( + integrator, i, i); + scalar_fespace.GetEssentialTrueDofs(ess_bdr_block_ho, ess_tdof_list_block_ho); + ho_bilinear_form_blocks.emplace_back(new ParBilinearForm(&scalar_fespace)); + ho_bilinear_form_blocks[i]->SetAssemblyLevel(AssemblyLevel::PARTIAL); + ho_bilinear_form_blocks[i]->AddDomainIntegrator(block); + ho_bilinear_form_blocks[i]->Assemble(); + const auto *prolong = scalar_fespace.GetProlongationMatrix(); + auto *rap = new RAPOperator(*prolong, *ho_bilinear_form_blocks[i], *prolong); + diag_ho.emplace_back(new ConstrainedOperator(rap, ess_tdof_list_block_ho, true, + Operator::DiagonalPolicy::DIAG_ONE)); + } + //create CG solvers + for (int i = 0; i < dim; i++) + { + cg_blocks.emplace_back(new CGSolver(MPI_COMM_WORLD)); + cg_blocks[i]->iterative_mode = false; + cg_blocks[i]->SetOperator(*diag_ho[i]); + cg_blocks[i]->SetPreconditioner(*amg_blocks[i]); + cg_blocks[i]->SetMaxIter(30); + cg_blocks[i]->SetRelTol(1e-8); + } + } + blockDiag = new BlockDiagonalPreconditioner(block_offsets); + for (int i = 0; i < dim; i++) + { + if (sub_solve) + { + blockDiag->SetDiagonalBlock(i, cg_blocks[i].get()); + } + else + { + blockDiag->SetDiagonalBlock(i, amg_blocks[i].get()); + } + } + prec.reset(blockDiag); + } + else + { + // 13(d) If not using PA, configure preconditioner on global matrix. + auto *amg = new HypreBoomerAMG(*A.As()); + if (amg_elast && !a.StaticCondensationIsEnabled()) + { + amg->SetElasticityOptions(&fespace); + } + else + { + amg->SetSystemsOptions(dim, reorder_space); + } + prec.reset(amg); + } + // 13(e) For componentwise action, create block operator and form linear system. + unique_ptr A_components = nullptr; + unique_ptr pa_blocks; + if (componentwise_action) + { + pa_blocks.reset(new BlockFESpaceOperator(fespaces)); + for (int j = 0; j < dim; j++) + { + for (int i = 0; i < dim; i++) + { + pa_blocks->SetBlock(i,j,pa_components[i + dim*j].get()); + } + } + Operator *A_temp; + pa_blocks->FormLinearSystem(ess_tdof_list, x, b, A_temp, X, B); + A_components.reset(A_temp); + a_lhs = pa_blocks.get(); + } + assembly_timer.Stop(); + + // 14. Create the global CG solver, solve, and recover solution. + CGSolver solver(MPI_COMM_WORLD); + solver.SetRelTol(1e-8); + solver.SetMaxIter(2500); + solver.SetPrintLevel(1); + if (prec) { solver.SetPreconditioner(*prec); } + solver.SetOperator(A_components ? *A_components : *A); + + StopWatch linear_solve_timer; + linear_solve_timer.Start(); + solver.Mult(B, X); + linear_solve_timer.Stop(); + + a_lhs->RecoverFEMSolution(X, b, x); + total_timer.Stop(); + + // Print run times + if (Mpi::Root()) + { + cout << "Elapsed Times\n"; + cout << "Assembly (s) = " << assembly_timer.RealTime() << endl; + cout << "Linear Solve (s) = " << linear_solve_timer.RealTime() << endl; + cout << "Total Solve (s) " << total_timer.RealTime() << endl; + } + + // 15. For non-NURBS meshes, make the mesh curved based on the finite element + // space. This means that we define the mesh elements through a fespace + // based transformation of the reference element. This allows us to save + // the displaced mesh as a curved mesh when using high-order finite + // element displacement field. We assume that the initial mesh (read from + // the file) is not higher order curved mesh compared to the chosen FE + // space. + pmesh.SetNodalFESpace(&fespace); + + // 16. If visualization is enabled, Save in parallel the displaced mesh and + // the inverted solution (which gives the backward displacements to the + // original grid). This output can be viewed later using GLVis: "glvis + // -np -m mesh -g sol". + // + // Also, save the displacement, with dispaced mesh, to VTK. + if (visualization) + { + GridFunction *nodes = pmesh.GetNodes(); + *nodes += x; + x *= -1; + + ostringstream mesh_name, sol_name; + mesh_name << "mesh." << setfill('0') << setw(6) << Mpi::WorldRank(); + sol_name << "sol." << setfill('0') << setw(6) << Mpi::WorldRank(); + + ofstream mesh_ofs(mesh_name.str().c_str()); + mesh_ofs.precision(8); + pmesh.Print(mesh_ofs); + + ofstream sol_ofs(sol_name.str().c_str()); + sol_ofs.precision(8); + x.Save(sol_ofs); + + ParaViewDataCollection pd("LOR_Elasticity", &pmesh); + pd.SetPrefixPath("ParaView"); + pd.RegisterField("displacement", &x); + pd.SetLevelsOfDetail(order); + pd.SetDataFormat(VTKFormat::BINARY); + pd.SetHighOrderOutput(true); + pd.SetCycle(0); + pd.SetTime(0.0); + pd.Save(); + } + + return 0; +} diff --git a/miniapps/solvers/lor_mms.hpp b/miniapps/solvers/lor_mms.hpp index 1d87bfc7b8..135a6c1d17 100644 --- a/miniapps/solvers/lor_mms.hpp +++ b/miniapps/solvers/lor_mms.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/solvers/lor_solvers.cpp b/miniapps/solvers/lor_solvers.cpp index a12816b8aa..0ff96d9aa3 100644 --- a/miniapps/solvers/lor_solvers.cpp +++ b/miniapps/solvers/lor_solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/solvers/makefile b/miniapps/solvers/makefile index b36aa1bc3d..eafeb6f0ef 100644 --- a/miniapps/solvers/makefile +++ b/miniapps/solvers/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -21,11 +21,14 @@ CONFIG_MK = $(MFEM_BUILD_DIR)/config/config.mk MFEM_LIB_FILE = mfem_is_not_built -include $(CONFIG_MK) -BLOCK_SOLVERS_SRC = div_free_solver.cpp block-solvers.cpp +BLOCK_SOLVERS_SRC = block-solvers.cpp darcy_solver.cpp bramble_pasciak.cpp div_free_solver.cpp BLOCK_SOLVERS_OBJ = $(BLOCK_SOLVERS_SRC:.cpp=.o) +LOR_ELAST_SRC = block_fespace_operator.cpp lor_elast.cpp +LOR_ELAST_OBJ = $(LOR_ELAST_SRC:.cpp=.o) + SEQ_MINIAPPS = lor_solvers -PAR_MINIAPPS = block-solvers plor_solvers +PAR_MINIAPPS = block-solvers plor_solvers lor_elast ifeq ($(MFEM_USE_MPI),NO) MINIAPPS = $(SEQ_MINIAPPS) @@ -53,6 +56,9 @@ plor_solvers.o: $(SRC)lor_mms.hpp block-solvers: $(BLOCK_SOLVERS_OBJ) $(MFEM_CXX) $(MFEM_LINK_FLAGS) -o $@ $(BLOCK_SOLVERS_OBJ) $(MFEM_LIBS) +lor_elast: $(LOR_ELAST_OBJ) + $(MFEM_CXX) $(MFEM_LINK_FLAGS) -o $@ $(LOR_ELAST_OBJ) $(MFEM_LIBS) + %.o: $(SRC)%.cpp $(MFEM_LIB_FILE) $(CONFIG_MK) $(MFEM_CXX) $(MFEM_FLAGS) -c $< -o $@ @@ -63,9 +69,9 @@ include $(MFEM_TEST_MK) RUN_MPI = $(MFEM_MPIEXEC) $(MFEM_MPIEXEC_NP) $(MFEM_MPI_NP) block-solvers-test-par: block-solvers-constant block-solvers-anisotropic block-solvers-constant: block-solvers - @$(call mfem-test,$<, $(RUN_MPI), BlockSolver miniapp,-r 2) + @$(call mfem-test,$<, $(RUN_MPI), BlockSolver miniapp,-rs 1 -rp 1) block-solvers-anisotropic: block-solvers - @$(call mfem-test,$<, $(RUN_MPI), BlockSolver miniapp,-r 2\ + @$(call mfem-test,$<, $(RUN_MPI), BlockSolver miniapp,-rs 1 -rp 1\ -m $(SRC)anisotropic.mesh -c $(SRC)anisotropic.coeff\ -eb $(SRC)anisotropic.bdr) lor_solvers-test-seq: lor_solvers @@ -73,6 +79,13 @@ lor_solvers-test-seq: lor_solvers plor_solvers-test-par: plor_solvers @$(call mfem-test,$<, $(RUN_MPI), Parallel LOR solvers miniapp,-fe n\ -m ../../data/fichera.mesh) +lor_elast-test-par: lor_elast-tri lor_elast-hex +lor_elast-tri: lor_elast + @$(call mfem-test,$<, $(RUN_MPI), Elasticity LOR miniapp,-l 2 -ca -pa -ss\ + -m ../../data/beam-tri.mesh -o 2) +lor_elast-hex: lor_elast + @$(call mfem-test,$<, $(RUN_MPI), Elasticity LOR miniapp,-l 1 -pa -o 2\ + -m ../../data/beam-hex.mesh) # Generate an error message if the MFEM library is not built and exit $(MFEM_LIB_FILE): diff --git a/miniapps/solvers/plor_solvers.cpp b/miniapps/solvers/plor_solvers.cpp index 54e9a2d898..27908cc08f 100644 --- a/miniapps/solvers/plor_solvers.cpp +++ b/miniapps/solvers/plor_solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/CMakeLists.txt b/miniapps/spde/CMakeLists.txt index 9982508ff3..a62c4042ba 100644 --- a/miniapps/spde/CMakeLists.txt +++ b/miniapps/spde/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/spde/generate_random_field.cpp b/miniapps/spde/generate_random_field.cpp index 3067a13b6a..991455640f 100644 --- a/miniapps/spde/generate_random_field.cpp +++ b/miniapps/spde/generate_random_field.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/makefile b/miniapps/spde/makefile index 51f4c9e5e9..731455b6f6 100644 --- a/miniapps/spde/makefile +++ b/miniapps/spde/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/spde/material_metrics.cpp b/miniapps/spde/material_metrics.cpp index a3600783d0..ae03d32b42 100644 --- a/miniapps/spde/material_metrics.cpp +++ b/miniapps/spde/material_metrics.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/material_metrics.hpp b/miniapps/spde/material_metrics.hpp index fea044a48a..fee69b87df 100644 --- a/miniapps/spde/material_metrics.hpp +++ b/miniapps/spde/material_metrics.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/spde_solver.cpp b/miniapps/spde/spde_solver.cpp index ce56b8b032..b105582735 100644 --- a/miniapps/spde/spde_solver.cpp +++ b/miniapps/spde/spde_solver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/spde_solver.hpp b/miniapps/spde/spde_solver.hpp index b424ce0607..2c85ab1f00 100644 --- a/miniapps/spde/spde_solver.hpp +++ b/miniapps/spde/spde_solver.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/transformation.cpp b/miniapps/spde/transformation.cpp index dd4b4e1c70..cfeaad1877 100644 --- a/miniapps/spde/transformation.cpp +++ b/miniapps/spde/transformation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/transformation.hpp b/miniapps/spde/transformation.hpp index 32a4b55a6c..5743a5111f 100644 --- a/miniapps/spde/transformation.hpp +++ b/miniapps/spde/transformation.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/util.cpp b/miniapps/spde/util.cpp index b0af226912..782b9ace44 100644 --- a/miniapps/spde/util.cpp +++ b/miniapps/spde/util.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/util.hpp b/miniapps/spde/util.hpp index f3ad2c4dac..141e969a2c 100644 --- a/miniapps/spde/util.hpp +++ b/miniapps/spde/util.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/visualizer.cpp b/miniapps/spde/visualizer.cpp index c59fc7b548..03610657d3 100644 --- a/miniapps/spde/visualizer.cpp +++ b/miniapps/spde/visualizer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/spde/visualizer.hpp b/miniapps/spde/visualizer.hpp index c000154970..18820f07f7 100644 --- a/miniapps/spde/visualizer.hpp +++ b/miniapps/spde/visualizer.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/CMakeLists.txt b/miniapps/tools/CMakeLists.txt index 5caab47feb..23628b133a 100644 --- a/miniapps/tools/CMakeLists.txt +++ b/miniapps/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/tools/convert-dc.cpp b/miniapps/tools/convert-dc.cpp index 447a22645b..bd38ee14d2 100644 --- a/miniapps/tools/convert-dc.cpp +++ b/miniapps/tools/convert-dc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/display-basis.cpp b/miniapps/tools/display-basis.cpp index 4e097402fa..67051d332f 100644 --- a/miniapps/tools/display-basis.cpp +++ b/miniapps/tools/display-basis.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/get-values.cpp b/miniapps/tools/get-values.cpp index 6f4a55baf2..5a0145f5b7 100644 --- a/miniapps/tools/get-values.cpp +++ b/miniapps/tools/get-values.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/load-dc.cpp b/miniapps/tools/load-dc.cpp index b3d6c101c1..af6a5cc751 100644 --- a/miniapps/tools/load-dc.cpp +++ b/miniapps/tools/load-dc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/lor-transfer.cpp b/miniapps/tools/lor-transfer.cpp index 607768b445..7798709070 100644 --- a/miniapps/tools/lor-transfer.cpp +++ b/miniapps/tools/lor-transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/makefile b/miniapps/tools/makefile index 83631c123f..fef903a40c 100644 --- a/miniapps/tools/makefile +++ b/miniapps/tools/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/tools/nodal-transfer.cpp b/miniapps/tools/nodal-transfer.cpp index 47f64a734b..615044e69a 100644 --- a/miniapps/tools/nodal-transfer.cpp +++ b/miniapps/tools/nodal-transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/plor-transfer.cpp b/miniapps/tools/plor-transfer.cpp index d8d87b8e86..667fb04d3b 100644 --- a/miniapps/tools/plor-transfer.cpp +++ b/miniapps/tools/plor-transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/tmop-check-metric.cpp b/miniapps/tools/tmop-check-metric.cpp index 45e250a116..4dd2b3c193 100644 --- a/miniapps/tools/tmop-check-metric.cpp +++ b/miniapps/tools/tmop-check-metric.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/tools/tmop-metric-magnitude.cpp b/miniapps/tools/tmop-metric-magnitude.cpp index 183865a9d3..3b0c167f21 100644 --- a/miniapps/tools/tmop-metric-magnitude.cpp +++ b/miniapps/tools/tmop-metric-magnitude.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/CMakeLists.txt b/miniapps/toys/CMakeLists.txt index 84f234ecd7..4d1a20a58b 100644 --- a/miniapps/toys/CMakeLists.txt +++ b/miniapps/toys/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/toys/automata.cpp b/miniapps/toys/automata.cpp index 60b7f69a69..908ce7d7b3 100644 --- a/miniapps/toys/automata.cpp +++ b/miniapps/toys/automata.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/life.cpp b/miniapps/toys/life.cpp index dd2fc9fcf1..e0e6d27d24 100644 --- a/miniapps/toys/life.cpp +++ b/miniapps/toys/life.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/lissajous.cpp b/miniapps/toys/lissajous.cpp index 8a168fb642..e145ae490f 100644 --- a/miniapps/toys/lissajous.cpp +++ b/miniapps/toys/lissajous.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/makefile b/miniapps/toys/makefile index bdd782d523..f06f179bd1 100644 --- a/miniapps/toys/makefile +++ b/miniapps/toys/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/miniapps/toys/mandel.cpp b/miniapps/toys/mandel.cpp index cb7b56a8a8..c7f51cb262 100644 --- a/miniapps/toys/mandel.cpp +++ b/miniapps/toys/mandel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/mondrian.cpp b/miniapps/toys/mondrian.cpp index 50f06ba9ad..a5606bd578 100644 --- a/miniapps/toys/mondrian.cpp +++ b/miniapps/toys/mondrian.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/rubik.cpp b/miniapps/toys/rubik.cpp index 6884cffdbd..f3802c61ac 100644 --- a/miniapps/toys/rubik.cpp +++ b/miniapps/toys/rubik.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/miniapps/toys/snake.cpp b/miniapps/toys/snake.cpp index f82bda41de..abaa449a7e 100644 --- a/miniapps/toys/snake.cpp +++ b/miniapps/toys/snake.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5328c5c115..7daa1175c0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/benchmarks/CMakeLists.txt b/tests/benchmarks/CMakeLists.txt index aa609c389e..cc97bb3348 100644 --- a/tests/benchmarks/CMakeLists.txt +++ b/tests/benchmarks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/benchmarks/bench.hpp b/tests/benchmarks/bench.hpp index 300f038c91..f62a8c3f64 100644 --- a/tests/benchmarks/bench.hpp +++ b/tests/benchmarks/bench.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_assembly_levels.cpp b/tests/benchmarks/bench_assembly_levels.cpp index ecc491faaa..a46fe692fd 100644 --- a/tests/benchmarks/bench_assembly_levels.cpp +++ b/tests/benchmarks/bench_assembly_levels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_ceed.cpp b/tests/benchmarks/bench_ceed.cpp index 5274c44dd9..2bf9fbdb38 100644 --- a/tests/benchmarks/bench_ceed.cpp +++ b/tests/benchmarks/bench_ceed.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_dg_amr.cpp b/tests/benchmarks/bench_dg_amr.cpp index 7fee3bfe45..2c7fb19666 100644 --- a/tests/benchmarks/bench_dg_amr.cpp +++ b/tests/benchmarks/bench_dg_amr.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_elasticity.cpp b/tests/benchmarks/bench_elasticity.cpp index 1d09efd996..a4600c71d4 100644 --- a/tests/benchmarks/bench_elasticity.cpp +++ b/tests/benchmarks/bench_elasticity.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_tmop.cpp b/tests/benchmarks/bench_tmop.cpp index 229146c0a0..5a3d437c91 100644 --- a/tests/benchmarks/bench_tmop.cpp +++ b/tests/benchmarks/bench_tmop.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_vector.cpp b/tests/benchmarks/bench_vector.cpp index 3893de87c3..9d15d95f5e 100644 --- a/tests/benchmarks/bench_vector.cpp +++ b/tests/benchmarks/bench_vector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/bench_virtuals.cpp b/tests/benchmarks/bench_virtuals.cpp index 41bd56a594..4a8a30405c 100644 --- a/tests/benchmarks/bench_virtuals.cpp +++ b/tests/benchmarks/bench_virtuals.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/benchmarks/makefile b/tests/benchmarks/makefile index e9000f8f5f..5e5faee7e9 100644 --- a/tests/benchmarks/makefile +++ b/tests/benchmarks/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/convergence/makefile b/tests/convergence/makefile index 0f2b107f7c..7e1b6a7df0 100644 --- a/tests/convergence/makefile +++ b/tests/convergence/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/convergence/prates.cpp b/tests/convergence/prates.cpp index df107be1f0..25972d678f 100644 --- a/tests/convergence/prates.cpp +++ b/tests/convergence/prates.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/convergence/rates.cpp b/tests/convergence/rates.cpp index 58d080a914..889174dbaf 100644 --- a/tests/convergence/rates.cpp +++ b/tests/convergence/rates.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/gitlab/build_and_test b/tests/gitlab/build_and_test index 1f12adcdf5..c3a5efc580 100755 --- a/tests/gitlab/build_and_test +++ b/tests/gitlab/build_and_test @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/gitlab/generate_spack_upstream b/tests/gitlab/generate_spack_upstream index dcd4ea2e37..410d05e6a7 100755 --- a/tests/gitlab/generate_spack_upstream +++ b/tests/gitlab/generate_spack_upstream @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/gitlab/get_mfem_uberenv b/tests/gitlab/get_mfem_uberenv index f0041ea654..9432bcb87a 100755 --- a/tests/gitlab/get_mfem_uberenv +++ b/tests/gitlab/get_mfem_uberenv @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/mem_manager/dangling-aliases.cpp b/tests/mem_manager/dangling-aliases.cpp index f65c3d9493..1165c304d5 100644 --- a/tests/mem_manager/dangling-aliases.cpp +++ b/tests/mem_manager/dangling-aliases.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/mem_manager/makefile b/tests/mem_manager/makefile index 6c2776c4fd..2e88b60c93 100644 --- a/tests/mem_manager/makefile +++ b/tests/mem_manager/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/par-mesh-format/makefile b/tests/par-mesh-format/makefile index 8f557f7a68..225531b36e 100644 --- a/tests/par-mesh-format/makefile +++ b/tests/par-mesh-format/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/scripts/branch-history b/tests/scripts/branch-history index 5b95398398..4339895da9 100755 --- a/tests/scripts/branch-history +++ b/tests/scripts/branch-history @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/scripts/code-style b/tests/scripts/code-style index 78310b8ef1..4b9747163d 100755 --- a/tests/scripts/code-style +++ b/tests/scripts/code-style @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/scripts/documentation b/tests/scripts/documentation index 2ebb80708b..145557c5f1 100755 --- a/tests/scripts/documentation +++ b/tests/scripts/documentation @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -60,7 +60,7 @@ if [ -s "$test_name.err" ]; then To correct this error, make sure that the Doxygen comments in the code use correct syntax. -See the Doxygen documentation for specific syntax (e.g. @a, @brief, \f[, etc.), +See the Doxygen documentation for specific syntax (e.g. @a, @brief, etc.), and the 'makefile' and 'CodeDocumentation.conf.in' files in the 'doc/' directory for additional details. diff --git a/tests/scripts/gitignore b/tests/scripts/gitignore index ff6919fb6a..e1e6eb5c18 100755 --- a/tests/scripts/gitignore +++ b/tests/scripts/gitignore @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/scripts/runtest b/tests/scripts/runtest index 04083e4838..f0a30270b3 100755 --- a/tests/scripts/runtest +++ b/tests/scripts/runtest @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 775d7edaa4..0ee1c18a4b 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # @@ -45,6 +45,7 @@ set(UNIT_TESTS_SRCS linalg/test_operator.cpp linalg/test_vector.cpp mesh/test_face_orientations.cpp + mesh/test_geometric_factors.cpp mesh/mesh_test_utils.cpp mesh/test_fms.cpp mesh/test_mesh.cpp @@ -92,6 +93,7 @@ set(UNIT_TESTS_SRCS fem/test_linearform_ext.cpp fem/test_lor.cpp fem/test_lor_batched.cpp + fem/test_nonlinearform.cpp fem/test_operatorjacobismoother.cpp fem/test_oscillation.cpp fem/test_pa_coeff.cpp diff --git a/tests/unit/ceed/test_ceed.cpp b/tests/unit/ceed/test_ceed.cpp index 971b68e245..feabf6f94d 100644 --- a/tests/unit/ceed/test_ceed.cpp +++ b/tests/unit/ceed/test_ceed.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/ceed/test_ceed_main.cpp b/tests/unit/ceed/test_ceed_main.cpp index a8fac22db2..fe053bac18 100644 --- a/tests/unit/ceed/test_ceed_main.cpp +++ b/tests/unit/ceed/test_ceed_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/cunit_test_main.cpp b/tests/unit/cunit_test_main.cpp index 142190c436..09adf13ddd 100644 --- a/tests/unit/cunit_test_main.cpp +++ b/tests/unit/cunit_test_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/data/holes.mesh b/tests/unit/data/holes.mesh new file mode 100644 index 0000000000..ae1c30e609 --- /dev/null +++ b/tests/unit/data/holes.mesh @@ -0,0 +1,1169 @@ +MFEM mesh v1.0 + +# +# MFEM Geometry Types (see mesh/geom.hpp): +# +# POINT = 0 +# SEGMENT = 1 +# TRIANGLE = 2 +# SQUARE = 3 +# TETRAHEDRON = 4 +# CUBE = 5 +# PRISM = 6 +# PYRAMID = 7 +# + +dimension +2 + +elements +64 +1 3 0 26 70 29 +1 3 26 3 27 70 +1 3 70 27 4 28 +1 3 29 70 28 1 +1 3 1 28 71 32 +1 3 28 4 30 71 +1 3 71 30 5 31 +1 3 32 71 31 2 +1 3 5 33 72 31 +1 3 33 8 34 72 +1 3 72 34 9 35 +1 3 31 72 35 2 +1 3 8 36 73 34 +1 3 36 12 37 73 +1 3 73 37 15 38 +1 3 34 73 38 9 +1 3 11 39 74 41 +1 3 39 14 40 74 +1 3 74 40 15 37 +1 3 41 74 37 12 +1 3 10 42 75 44 +1 3 42 13 43 75 +1 3 75 43 14 39 +1 3 44 75 39 11 +1 3 6 45 76 47 +1 3 45 13 42 76 +1 3 76 42 10 46 +1 3 47 76 46 7 +1 3 0 48 77 26 +1 3 48 6 47 77 +1 3 77 47 7 49 +1 3 26 77 49 3 +1 3 13 50 78 43 +1 3 50 16 51 78 +1 3 78 51 17 52 +1 3 43 78 52 14 +1 3 14 52 79 40 +1 3 52 17 53 79 +1 3 79 53 18 54 +1 3 40 79 54 15 +1 3 18 55 80 54 +1 3 55 21 56 80 +1 3 80 56 22 57 +1 3 54 80 57 15 +1 3 21 58 81 56 +1 3 58 25 59 81 +1 3 81 59 2 60 +1 3 56 81 60 22 +1 3 24 61 82 62 +1 3 61 1 32 82 +1 3 82 32 2 59 +1 3 62 82 59 25 +1 3 23 63 83 64 +1 3 63 0 29 83 +1 3 83 29 1 61 +1 3 64 83 61 24 +1 3 19 65 84 67 +1 3 65 0 63 84 +1 3 84 63 23 66 +1 3 67 84 66 20 +1 3 13 68 85 50 +1 3 68 19 67 85 +1 3 85 67 20 69 +1 3 50 85 69 16 + +boundary +48 +1 1 0 48 +1 1 48 6 +1 1 6 45 +1 1 45 13 +1 1 13 68 +1 1 68 19 +1 1 19 65 +1 1 65 0 +2 1 2 60 +2 1 60 22 +2 1 22 57 +2 1 57 15 +2 1 15 38 +2 1 38 9 +2 1 9 35 +2 1 35 2 +3 1 7 49 +3 1 49 3 +3 1 10 46 +3 1 46 7 +3 1 11 44 +3 1 44 10 +3 1 12 41 +3 1 41 11 +3 1 8 36 +3 1 36 12 +3 1 5 33 +3 1 33 8 +3 1 4 30 +3 1 30 5 +3 1 3 27 +3 1 27 4 +4 1 20 69 +4 1 69 16 +4 1 23 66 +4 1 66 20 +4 1 24 64 +4 1 64 23 +4 1 25 62 +4 1 62 24 +4 1 21 58 +4 1 58 25 +4 1 18 55 +4 1 55 21 +4 1 17 53 +4 1 53 18 +4 1 16 51 +4 1 51 17 + +vertices +86 + +nodes +FiniteElementSpace +FiniteElementCollection: L2_T1_2D_P3 +VDim: 2 +Ordering: 1 + +-1 -0.5 +-0.95044565 -0.45044565 +-0.87026503 -0.37026503 +-0.82071068 -0.32071068 +-1 -0.4309017 +-0.95252838 -0.3882171 +-0.87571371 -0.31927479 +-0.82823118 -0.27678382 +-1 -0.3190983 +-0.95524361 -0.28750957 +-0.88282121 -0.23660752 +-0.83805104 -0.20534943 +-1 -0.25 +-0.95651701 -0.22525919 +-0.88615616 -0.18543555 +-0.84266246 -0.16102267 +-0.82071068 -0.32071068 +-0.77115633 -0.27115633 +-0.69097571 -0.19097571 +-0.64142136 -0.14142136 +-0.82823118 -0.27678382 +-0.78073043 -0.23444039 +-0.70374857 -0.16651011 +-0.65590881 -0.12526948 +-0.83805104 -0.20534943 +-0.7932578 -0.17434394 +-0.72062343 -0.12518149 +-0.67539763 -0.096102401 +-0.84266246 -0.16102267 +-0.79915085 -0.13686067 +-0.72862507 -0.09876776 +-0.68477591 -0.076536686 +-0.84266246 -0.16102267 +-0.79915085 -0.13686067 +-0.72862507 -0.09876776 +-0.68477591 -0.076536686 +-0.84615675 -0.11659389 +-0.8036206 -0.09918116 +-0.7347212 -0.071850317 +-0.69197951 -0.056070194 +-0.8494391 -0.04456245 +-0.80782264 -0.037936893 +-0.7404735 -0.027581523 +-0.69882308 -0.021665274 +-0.85 0 +-0.80854102 0 +-0.74145898 0 +-0.7 0 +-1 -0.25 +-0.95651701 -0.22525919 +-0.88615616 -0.18543555 +-0.84266246 -0.16102267 +-1 -0.1809017 +-0.95748122 -0.16300326 +-0.88868203 -0.13421727 +-0.84615675 -0.11659389 +-1 -0.069098301 +-0.9583864 -0.062263205 +-0.89105378 -0.051278929 +-0.8494391 -0.04456245 +-1 0 +-0.95854102 0 +-0.89145898 0 +-0.85 0 +-1 0 +-0.95854102 0 +-0.89145898 0 +-0.85 0 +-1 0.069098301 +-0.9583864 0.062263205 +-0.89105378 0.051278929 +-0.8494391 0.04456245 +-1 0.1809017 +-0.95748122 0.16300326 +-0.88868203 0.13421727 +-0.84615675 0.11659389 +-1 0.25 +-0.95651701 0.22525919 +-0.88615616 0.18543555 +-0.84266246 0.16102267 +-0.85 0 +-0.80854102 0 +-0.74145898 0 +-0.7 0 +-0.8494391 0.04456245 +-0.80782264 0.037936893 +-0.7404735 0.027581523 +-0.69882308 0.021665274 +-0.84615675 0.11659389 +-0.8036206 0.09918116 +-0.7347212 0.071850317 +-0.69197951 0.056070194 +-0.84266246 0.16102267 +-0.79915085 0.13686067 +-0.72862507 0.09876776 +-0.68477591 0.076536686 +-0.84266246 0.16102267 +-0.79915085 0.13686067 +-0.72862507 0.09876776 +-0.68477591 0.076536686 +-0.83805104 0.20534943 +-0.7932578 0.17434394 +-0.72062343 0.12518149 +-0.67539763 0.096102401 +-0.82823118 0.27678382 +-0.78073043 0.23444039 +-0.70374857 0.16651011 +-0.65590881 0.12526948 +-0.82071068 0.32071068 +-0.77115633 0.27115633 +-0.69097571 0.19097571 +-0.64142136 0.14142136 +-1 0.25 +-0.95651701 0.22525919 +-0.88615616 0.18543555 +-0.84266246 0.16102267 +-1 0.3190983 +-0.95524361 0.28750957 +-0.88282121 0.23660752 +-0.83805104 0.20534943 +-1 0.4309017 +-0.95252838 0.3882171 +-0.87571371 0.31927479 +-0.82823118 0.27678382 +-1 0.5 +-0.95044565 0.45044565 +-0.87026503 0.37026503 +-0.82071068 0.32071068 +-0.64142136 0.14142136 +-0.62526948 0.15590881 +-0.5961024 0.17539763 +-0.57653669 0.18477591 +-0.69097571 0.19097571 +-0.66651011 0.20374857 +-0.62518149 0.22062343 +-0.59876776 0.22862507 +-0.77115633 0.27115633 +-0.73444039 0.28073043 +-0.67434394 0.2932578 +-0.63686067 0.29915085 +-0.82071068 0.32071068 +-0.77678382 0.32823118 +-0.70534943 0.33805104 +-0.66102267 0.34266246 +-0.57653669 0.18477591 +-0.55607019 0.19197951 +-0.52166527 0.19882308 +-0.5 0.2 +-0.59876776 0.22862507 +-0.57185032 0.2347212 +-0.52758152 0.2404735 +-0.5 0.24145898 +-0.63686067 0.29915085 +-0.59918116 0.3036206 +-0.53793689 0.30782264 +-0.5 0.30854102 +-0.66102267 0.34266246 +-0.61659389 0.34615675 +-0.54456245 0.3494391 +-0.5 0.35 +-0.66102267 0.34266246 +-0.61659389 0.34615675 +-0.54456245 0.3494391 +-0.5 0.35 +-0.68543555 0.38615616 +-0.63421727 0.38868203 +-0.55127893 0.39105378 +-0.5 0.39145898 +-0.72525919 0.45651701 +-0.66300326 0.45748122 +-0.56226321 0.4583864 +-0.5 0.45854102 +-0.75 0.5 +-0.6809017 0.5 +-0.5690983 0.5 +-0.5 0.5 +-0.82071068 0.32071068 +-0.77678382 0.32823118 +-0.70534943 0.33805104 +-0.66102267 0.34266246 +-0.87026503 0.37026503 +-0.81927479 0.37571371 +-0.73660752 0.38282121 +-0.68543555 0.38615616 +-0.95044565 0.45044565 +-0.8882171 0.45252838 +-0.78750957 0.45524361 +-0.72525919 0.45651701 +-1 0.5 +-0.9309017 0.5 +-0.8190983 0.5 +-0.75 0.5 +-0.5 0.2 +-0.47833473 0.19882308 +-0.44392981 0.19197951 +-0.42346331 0.18477591 +-0.5 0.24145898 +-0.47241848 0.2404735 +-0.42814968 0.2347212 +-0.40123224 0.22862507 +-0.5 0.30854102 +-0.46206311 0.30782264 +-0.40081884 0.3036206 +-0.36313933 0.29915085 +-0.5 0.35 +-0.45543755 0.3494391 +-0.38340611 0.34615675 +-0.33897733 0.34266246 +-0.42346331 0.18477591 +-0.4038976 0.17539763 +-0.37473052 0.15590881 +-0.35857864 0.14142136 +-0.40123224 0.22862507 +-0.37481851 0.22062343 +-0.33348989 0.20374857 +-0.30902429 0.19097571 +-0.36313933 0.29915085 +-0.32565606 0.2932578 +-0.26555961 0.28073043 +-0.22884367 0.27115633 +-0.33897733 0.34266246 +-0.29465057 0.33805104 +-0.22321618 0.32823118 +-0.17928932 0.32071068 +-0.33897733 0.34266246 +-0.29465057 0.33805104 +-0.22321618 0.32823118 +-0.17928932 0.32071068 +-0.31456445 0.38615616 +-0.26339248 0.38282121 +-0.18072521 0.37571371 +-0.12973497 0.37026503 +-0.27474081 0.45651701 +-0.21249043 0.45524361 +-0.1117829 0.45252838 +-0.04955435 0.45044565 +-0.25 0.5 +-0.1809017 0.5 +-0.069098301 0.5 +0 0.5 +-0.5 0.35 +-0.45543755 0.3494391 +-0.38340611 0.34615675 +-0.33897733 0.34266246 +-0.5 0.39145898 +-0.44872107 0.39105378 +-0.36578273 0.38868203 +-0.31456445 0.38615616 +-0.5 0.45854102 +-0.43773679 0.4583864 +-0.33699674 0.45748122 +-0.27474081 0.45651701 +-0.5 0.5 +-0.4309017 0.5 +-0.3190983 0.5 +-0.25 0.5 +-0.3 0 +-0.25854102 0 +-0.19145898 0 +-0.15 0 +-0.30117692 0.021665274 +-0.2595265 0.027581523 +-0.19217736 0.037936893 +-0.1505609 0.04456245 +-0.30802049 0.056070194 +-0.2652788 0.071850317 +-0.1963794 0.09918116 +-0.15384325 0.11659389 +-0.31522409 0.076536686 +-0.27137493 0.09876776 +-0.20084915 0.13686067 +-0.15733754 0.16102267 +-0.15 0 +-0.10854102 0 +-0.04145898 0 +0 0 +-0.1505609 0.04456245 +-0.10894622 0.051278929 +-0.041613604 0.062263205 +0 0.069098301 +-0.15384325 0.11659389 +-0.11131797 0.13421727 +-0.042518777 0.16300326 +0 0.1809017 +-0.15733754 0.16102267 +-0.11384384 0.18543555 +-0.043482986 0.22525919 +0 0.25 +-0.15733754 0.16102267 +-0.11384384 0.18543555 +-0.043482986 0.22525919 +0 0.25 +-0.16194896 0.20534943 +-0.11717879 0.23660752 +-0.044756393 0.28750957 +0 0.3190983 +-0.17176882 0.27678382 +-0.12428629 0.31927479 +-0.047471619 0.3882171 +0 0.4309017 +-0.17928932 0.32071068 +-0.12973497 0.37026503 +-0.04955435 0.45044565 +0 0.5 +-0.31522409 0.076536686 +-0.27137493 0.09876776 +-0.20084915 0.13686067 +-0.15733754 0.16102267 +-0.32460237 0.096102401 +-0.27937657 0.12518149 +-0.2067422 0.17434394 +-0.16194896 0.20534943 +-0.34409119 0.12526948 +-0.29625143 0.16651011 +-0.21926957 0.23444039 +-0.17176882 0.27678382 +-0.35857864 0.14142136 +-0.30902429 0.19097571 +-0.22884367 0.27115633 +-0.17928932 0.32071068 +-0.35857864 -0.14142136 +-0.30902429 -0.19097571 +-0.22884367 -0.27115633 +-0.17928932 -0.32071068 +-0.34409119 -0.12526948 +-0.29625143 -0.16651011 +-0.21926957 -0.23444039 +-0.17176882 -0.27678382 +-0.32460237 -0.096102401 +-0.27937657 -0.12518149 +-0.2067422 -0.17434394 +-0.16194896 -0.20534943 +-0.31522409 -0.076536686 +-0.27137493 -0.09876776 +-0.20084915 -0.13686067 +-0.15733754 -0.16102267 +-0.17928932 -0.32071068 +-0.12973497 -0.37026503 +-0.04955435 -0.45044565 +0 -0.5 +-0.17176882 -0.27678382 +-0.12428629 -0.31927479 +-0.047471619 -0.3882171 +0 -0.4309017 +-0.16194896 -0.20534943 +-0.11717879 -0.23660752 +-0.044756393 -0.28750957 +0 -0.3190983 +-0.15733754 -0.16102267 +-0.11384384 -0.18543555 +-0.043482986 -0.22525919 +0 -0.25 +-0.15733754 -0.16102267 +-0.11384384 -0.18543555 +-0.043482986 -0.22525919 +0 -0.25 +-0.15384325 -0.11659389 +-0.11131797 -0.13421727 +-0.042518777 -0.16300326 +0 -0.1809017 +-0.1505609 -0.04456245 +-0.10894622 -0.051278929 +-0.041613604 -0.062263205 +0 -0.069098301 +-0.15 0 +-0.10854102 0 +-0.04145898 0 +0 0 +-0.31522409 -0.076536686 +-0.27137493 -0.09876776 +-0.20084915 -0.13686067 +-0.15733754 -0.16102267 +-0.30802049 -0.056070194 +-0.2652788 -0.071850317 +-0.1963794 -0.09918116 +-0.15384325 -0.11659389 +-0.30117692 -0.021665274 +-0.2595265 -0.027581523 +-0.19217736 -0.037936893 +-0.1505609 -0.04456245 +-0.3 0 +-0.25854102 0 +-0.19145898 0 +-0.15 0 +-0.5 -0.5 +-0.4309017 -0.5 +-0.3190983 -0.5 +-0.25 -0.5 +-0.5 -0.45854102 +-0.43773679 -0.4583864 +-0.33699674 -0.45748122 +-0.27474081 -0.45651701 +-0.5 -0.39145898 +-0.44872107 -0.39105378 +-0.36578273 -0.38868203 +-0.31456445 -0.38615616 +-0.5 -0.35 +-0.45543755 -0.3494391 +-0.38340611 -0.34615675 +-0.33897733 -0.34266246 +-0.25 -0.5 +-0.1809017 -0.5 +-0.069098301 -0.5 +0 -0.5 +-0.27474081 -0.45651701 +-0.21249043 -0.45524361 +-0.1117829 -0.45252838 +-0.04955435 -0.45044565 +-0.31456445 -0.38615616 +-0.26339248 -0.38282121 +-0.18072521 -0.37571371 +-0.12973497 -0.37026503 +-0.33897733 -0.34266246 +-0.29465057 -0.33805104 +-0.22321618 -0.32823118 +-0.17928932 -0.32071068 +-0.33897733 -0.34266246 +-0.29465057 -0.33805104 +-0.22321618 -0.32823118 +-0.17928932 -0.32071068 +-0.36313933 -0.29915085 +-0.32565606 -0.2932578 +-0.26555961 -0.28073043 +-0.22884367 -0.27115633 +-0.40123224 -0.22862507 +-0.37481851 -0.22062343 +-0.33348989 -0.20374857 +-0.30902429 -0.19097571 +-0.42346331 -0.18477591 +-0.4038976 -0.17539763 +-0.37473052 -0.15590881 +-0.35857864 -0.14142136 +-0.5 -0.35 +-0.45543755 -0.3494391 +-0.38340611 -0.34615675 +-0.33897733 -0.34266246 +-0.5 -0.30854102 +-0.46206311 -0.30782264 +-0.40081884 -0.3036206 +-0.36313933 -0.29915085 +-0.5 -0.24145898 +-0.47241848 -0.2404735 +-0.42814968 -0.2347212 +-0.40123224 -0.22862507 +-0.5 -0.2 +-0.47833473 -0.19882308 +-0.44392981 -0.19197951 +-0.42346331 -0.18477591 +-1 -0.5 +-0.9309017 -0.5 +-0.8190983 -0.5 +-0.75 -0.5 +-0.95044565 -0.45044565 +-0.8882171 -0.45252838 +-0.78750957 -0.45524361 +-0.72525919 -0.45651701 +-0.87026503 -0.37026503 +-0.81927479 -0.37571371 +-0.73660752 -0.38282121 +-0.68543555 -0.38615616 +-0.82071068 -0.32071068 +-0.77678382 -0.32823118 +-0.70534943 -0.33805104 +-0.66102267 -0.34266246 +-0.75 -0.5 +-0.6809017 -0.5 +-0.5690983 -0.5 +-0.5 -0.5 +-0.72525919 -0.45651701 +-0.66300326 -0.45748122 +-0.56226321 -0.4583864 +-0.5 -0.45854102 +-0.68543555 -0.38615616 +-0.63421727 -0.38868203 +-0.55127893 -0.39105378 +-0.5 -0.39145898 +-0.66102267 -0.34266246 +-0.61659389 -0.34615675 +-0.54456245 -0.3494391 +-0.5 -0.35 +-0.66102267 -0.34266246 +-0.61659389 -0.34615675 +-0.54456245 -0.3494391 +-0.5 -0.35 +-0.63686067 -0.29915085 +-0.59918116 -0.3036206 +-0.53793689 -0.30782264 +-0.5 -0.30854102 +-0.59876776 -0.22862507 +-0.57185032 -0.2347212 +-0.52758152 -0.2404735 +-0.5 -0.24145898 +-0.57653669 -0.18477591 +-0.55607019 -0.19197951 +-0.52166527 -0.19882308 +-0.5 -0.2 +-0.82071068 -0.32071068 +-0.77678382 -0.32823118 +-0.70534943 -0.33805104 +-0.66102267 -0.34266246 +-0.77115633 -0.27115633 +-0.73444039 -0.28073043 +-0.67434394 -0.2932578 +-0.63686067 -0.29915085 +-0.69097571 -0.19097571 +-0.66651011 -0.20374857 +-0.62518149 -0.22062343 +-0.59876776 -0.22862507 +-0.64142136 -0.14142136 +-0.62526948 -0.15590881 +-0.5961024 -0.17539763 +-0.57653669 -0.18477591 +0 -0.5 +0.04955435 -0.45044565 +0.12973497 -0.37026503 +0.17928932 -0.32071068 +0 -0.4309017 +0.047471619 -0.3882171 +0.12428629 -0.31927479 +0.17176882 -0.27678382 +0 -0.3190983 +0.044756393 -0.28750957 +0.11717879 -0.23660752 +0.16194896 -0.20534943 +0 -0.25 +0.043482986 -0.22525919 +0.11384384 -0.18543555 +0.15733754 -0.16102267 +0.17928932 -0.32071068 +0.22884367 -0.27115633 +0.30902429 -0.19097571 +0.35857864 -0.14142136 +0.17176882 -0.27678382 +0.21926957 -0.23444039 +0.29625143 -0.16651011 +0.34409119 -0.12526948 +0.16194896 -0.20534943 +0.2067422 -0.17434394 +0.27937657 -0.12518149 +0.32460237 -0.096102401 +0.15733754 -0.16102267 +0.20084915 -0.13686067 +0.27137493 -0.09876776 +0.31522409 -0.076536686 +0.15733754 -0.16102267 +0.20084915 -0.13686067 +0.27137493 -0.09876776 +0.31522409 -0.076536686 +0.15384325 -0.11659389 +0.1963794 -0.09918116 +0.2652788 -0.071850317 +0.30802049 -0.056070194 +0.1505609 -0.04456245 +0.19217736 -0.037936893 +0.2595265 -0.027581523 +0.30117692 -0.021665274 +0.15 0 +0.19145898 0 +0.25854102 0 +0.3 0 +0 -0.25 +0.043482986 -0.22525919 +0.11384384 -0.18543555 +0.15733754 -0.16102267 +0 -0.1809017 +0.042518777 -0.16300326 +0.11131797 -0.13421727 +0.15384325 -0.11659389 +0 -0.069098301 +0.041613604 -0.062263205 +0.10894622 -0.051278929 +0.1505609 -0.04456245 +0 0 +0.04145898 0 +0.10854102 0 +0.15 0 +0 0 +0.04145898 0 +0.10854102 0 +0.15 0 +0 0.069098301 +0.041613604 0.062263205 +0.10894622 0.051278929 +0.1505609 0.04456245 +0 0.1809017 +0.042518777 0.16300326 +0.11131797 0.13421727 +0.15384325 0.11659389 +0 0.25 +0.043482986 0.22525919 +0.11384384 0.18543555 +0.15733754 0.16102267 +0.15 0 +0.19145898 0 +0.25854102 0 +0.3 0 +0.1505609 0.04456245 +0.19217736 0.037936893 +0.2595265 0.027581523 +0.30117692 0.021665274 +0.15384325 0.11659389 +0.1963794 0.09918116 +0.2652788 0.071850317 +0.30802049 0.056070194 +0.15733754 0.16102267 +0.20084915 0.13686067 +0.27137493 0.09876776 +0.31522409 0.076536686 +0.15733754 0.16102267 +0.20084915 0.13686067 +0.27137493 0.09876776 +0.31522409 0.076536686 +0.16194896 0.20534943 +0.2067422 0.17434394 +0.27937657 0.12518149 +0.32460237 0.096102401 +0.17176882 0.27678382 +0.21926957 0.23444039 +0.29625143 0.16651011 +0.34409119 0.12526948 +0.17928932 0.32071068 +0.22884367 0.27115633 +0.30902429 0.19097571 +0.35857864 0.14142136 +0 0.25 +0.043482986 0.22525919 +0.11384384 0.18543555 +0.15733754 0.16102267 +0 0.3190983 +0.044756393 0.28750957 +0.11717879 0.23660752 +0.16194896 0.20534943 +0 0.4309017 +0.047471619 0.3882171 +0.12428629 0.31927479 +0.17176882 0.27678382 +0 0.5 +0.04955435 0.45044565 +0.12973497 0.37026503 +0.17928932 0.32071068 +0.35857864 0.14142136 +0.37473052 0.15590881 +0.4038976 0.17539763 +0.42346331 0.18477591 +0.30902429 0.19097571 +0.33348989 0.20374857 +0.37481851 0.22062343 +0.40123224 0.22862507 +0.22884367 0.27115633 +0.26555961 0.28073043 +0.32565606 0.2932578 +0.36313933 0.29915085 +0.17928932 0.32071068 +0.22321618 0.32823118 +0.29465057 0.33805104 +0.33897733 0.34266246 +0.42346331 0.18477591 +0.44392981 0.19197951 +0.47833473 0.19882308 +0.5 0.2 +0.40123224 0.22862507 +0.42814968 0.2347212 +0.47241848 0.2404735 +0.5 0.24145898 +0.36313933 0.29915085 +0.40081884 0.3036206 +0.46206311 0.30782264 +0.5 0.30854102 +0.33897733 0.34266246 +0.38340611 0.34615675 +0.45543755 0.3494391 +0.5 0.35 +0.33897733 0.34266246 +0.38340611 0.34615675 +0.45543755 0.3494391 +0.5 0.35 +0.31456445 0.38615616 +0.36578273 0.38868203 +0.44872107 0.39105378 +0.5 0.39145898 +0.27474081 0.45651701 +0.33699674 0.45748122 +0.43773679 0.4583864 +0.5 0.45854102 +0.25 0.5 +0.3190983 0.5 +0.4309017 0.5 +0.5 0.5 +0.17928932 0.32071068 +0.22321618 0.32823118 +0.29465057 0.33805104 +0.33897733 0.34266246 +0.12973497 0.37026503 +0.18072521 0.37571371 +0.26339248 0.38282121 +0.31456445 0.38615616 +0.04955435 0.45044565 +0.1117829 0.45252838 +0.21249043 0.45524361 +0.27474081 0.45651701 +0 0.5 +0.069098301 0.5 +0.1809017 0.5 +0.25 0.5 +0.5 0.2 +0.52166527 0.19882308 +0.55607019 0.19197951 +0.57653669 0.18477591 +0.5 0.24145898 +0.52758152 0.2404735 +0.57185032 0.2347212 +0.59876776 0.22862507 +0.5 0.30854102 +0.53793689 0.30782264 +0.59918116 0.3036206 +0.63686067 0.29915085 +0.5 0.35 +0.54456245 0.3494391 +0.61659389 0.34615675 +0.66102267 0.34266246 +0.57653669 0.18477591 +0.5961024 0.17539763 +0.62526948 0.15590881 +0.64142136 0.14142136 +0.59876776 0.22862507 +0.62518149 0.22062343 +0.66651011 0.20374857 +0.69097571 0.19097571 +0.63686067 0.29915085 +0.67434394 0.2932578 +0.73444039 0.28073043 +0.77115633 0.27115633 +0.66102267 0.34266246 +0.70534943 0.33805104 +0.77678382 0.32823118 +0.82071068 0.32071068 +0.66102267 0.34266246 +0.70534943 0.33805104 +0.77678382 0.32823118 +0.82071068 0.32071068 +0.68543555 0.38615616 +0.73660752 0.38282121 +0.81927479 0.37571371 +0.87026503 0.37026503 +0.72525919 0.45651701 +0.78750957 0.45524361 +0.8882171 0.45252838 +0.95044565 0.45044565 +0.75 0.5 +0.8190983 0.5 +0.9309017 0.5 +1 0.5 +0.5 0.35 +0.54456245 0.3494391 +0.61659389 0.34615675 +0.66102267 0.34266246 +0.5 0.39145898 +0.55127893 0.39105378 +0.63421727 0.38868203 +0.68543555 0.38615616 +0.5 0.45854102 +0.56226321 0.4583864 +0.66300326 0.45748122 +0.72525919 0.45651701 +0.5 0.5 +0.5690983 0.5 +0.6809017 0.5 +0.75 0.5 +0.7 0 +0.74145898 0 +0.80854102 0 +0.85 0 +0.69882308 0.021665274 +0.7404735 0.027581523 +0.80782264 0.037936893 +0.8494391 0.04456245 +0.69197951 0.056070194 +0.7347212 0.071850317 +0.8036206 0.09918116 +0.84615675 0.11659389 +0.68477591 0.076536686 +0.72862507 0.09876776 +0.79915085 0.13686067 +0.84266246 0.16102267 +0.85 0 +0.89145898 0 +0.95854102 0 +1 0 +0.8494391 0.04456245 +0.89105378 0.051278929 +0.9583864 0.062263205 +1 0.069098301 +0.84615675 0.11659389 +0.88868203 0.13421727 +0.95748122 0.16300326 +1 0.1809017 +0.84266246 0.16102267 +0.88615616 0.18543555 +0.95651701 0.22525919 +1 0.25 +0.84266246 0.16102267 +0.88615616 0.18543555 +0.95651701 0.22525919 +1 0.25 +0.83805104 0.20534943 +0.88282121 0.23660752 +0.95524361 0.28750957 +1 0.3190983 +0.82823118 0.27678382 +0.87571371 0.31927479 +0.95252838 0.3882171 +1 0.4309017 +0.82071068 0.32071068 +0.87026503 0.37026503 +0.95044565 0.45044565 +1 0.5 +0.68477591 0.076536686 +0.72862507 0.09876776 +0.79915085 0.13686067 +0.84266246 0.16102267 +0.67539763 0.096102401 +0.72062343 0.12518149 +0.7932578 0.17434394 +0.83805104 0.20534943 +0.65590881 0.12526948 +0.70374857 0.16651011 +0.78073043 0.23444039 +0.82823118 0.27678382 +0.64142136 0.14142136 +0.69097571 0.19097571 +0.77115633 0.27115633 +0.82071068 0.32071068 +0.64142136 -0.14142136 +0.69097571 -0.19097571 +0.77115633 -0.27115633 +0.82071068 -0.32071068 +0.65590881 -0.12526948 +0.70374857 -0.16651011 +0.78073043 -0.23444039 +0.82823118 -0.27678382 +0.67539763 -0.096102401 +0.72062343 -0.12518149 +0.7932578 -0.17434394 +0.83805104 -0.20534943 +0.68477591 -0.076536686 +0.72862507 -0.09876776 +0.79915085 -0.13686067 +0.84266246 -0.16102267 +0.82071068 -0.32071068 +0.87026503 -0.37026503 +0.95044565 -0.45044565 +1 -0.5 +0.82823118 -0.27678382 +0.87571371 -0.31927479 +0.95252838 -0.3882171 +1 -0.4309017 +0.83805104 -0.20534943 +0.88282121 -0.23660752 +0.95524361 -0.28750957 +1 -0.3190983 +0.84266246 -0.16102267 +0.88615616 -0.18543555 +0.95651701 -0.22525919 +1 -0.25 +0.84266246 -0.16102267 +0.88615616 -0.18543555 +0.95651701 -0.22525919 +1 -0.25 +0.84615675 -0.11659389 +0.88868203 -0.13421727 +0.95748122 -0.16300326 +1 -0.1809017 +0.8494391 -0.04456245 +0.89105378 -0.051278929 +0.9583864 -0.062263205 +1 -0.069098301 +0.85 0 +0.89145898 0 +0.95854102 0 +1 0 +0.68477591 -0.076536686 +0.72862507 -0.09876776 +0.79915085 -0.13686067 +0.84266246 -0.16102267 +0.69197951 -0.056070194 +0.7347212 -0.071850317 +0.8036206 -0.09918116 +0.84615675 -0.11659389 +0.69882308 -0.021665274 +0.7404735 -0.027581523 +0.80782264 -0.037936893 +0.8494391 -0.04456245 +0.7 0 +0.74145898 0 +0.80854102 0 +0.85 0 +0.5 -0.5 +0.5690983 -0.5 +0.6809017 -0.5 +0.75 -0.5 +0.5 -0.45854102 +0.56226321 -0.4583864 +0.66300326 -0.45748122 +0.72525919 -0.45651701 +0.5 -0.39145898 +0.55127893 -0.39105378 +0.63421727 -0.38868203 +0.68543555 -0.38615616 +0.5 -0.35 +0.54456245 -0.3494391 +0.61659389 -0.34615675 +0.66102267 -0.34266246 +0.75 -0.5 +0.8190983 -0.5 +0.9309017 -0.5 +1 -0.5 +0.72525919 -0.45651701 +0.78750957 -0.45524361 +0.8882171 -0.45252838 +0.95044565 -0.45044565 +0.68543555 -0.38615616 +0.73660752 -0.38282121 +0.81927479 -0.37571371 +0.87026503 -0.37026503 +0.66102267 -0.34266246 +0.70534943 -0.33805104 +0.77678382 -0.32823118 +0.82071068 -0.32071068 +0.66102267 -0.34266246 +0.70534943 -0.33805104 +0.77678382 -0.32823118 +0.82071068 -0.32071068 +0.63686067 -0.29915085 +0.67434394 -0.2932578 +0.73444039 -0.28073043 +0.77115633 -0.27115633 +0.59876776 -0.22862507 +0.62518149 -0.22062343 +0.66651011 -0.20374857 +0.69097571 -0.19097571 +0.57653669 -0.18477591 +0.5961024 -0.17539763 +0.62526948 -0.15590881 +0.64142136 -0.14142136 +0.5 -0.35 +0.54456245 -0.3494391 +0.61659389 -0.34615675 +0.66102267 -0.34266246 +0.5 -0.30854102 +0.53793689 -0.30782264 +0.59918116 -0.3036206 +0.63686067 -0.29915085 +0.5 -0.24145898 +0.52758152 -0.2404735 +0.57185032 -0.2347212 +0.59876776 -0.22862507 +0.5 -0.2 +0.52166527 -0.19882308 +0.55607019 -0.19197951 +0.57653669 -0.18477591 +0 -0.5 +0.069098301 -0.5 +0.1809017 -0.5 +0.25 -0.5 +0.04955435 -0.45044565 +0.1117829 -0.45252838 +0.21249043 -0.45524361 +0.27474081 -0.45651701 +0.12973497 -0.37026503 +0.18072521 -0.37571371 +0.26339248 -0.38282121 +0.31456445 -0.38615616 +0.17928932 -0.32071068 +0.22321618 -0.32823118 +0.29465057 -0.33805104 +0.33897733 -0.34266246 +0.25 -0.5 +0.3190983 -0.5 +0.4309017 -0.5 +0.5 -0.5 +0.27474081 -0.45651701 +0.33699674 -0.45748122 +0.43773679 -0.4583864 +0.5 -0.45854102 +0.31456445 -0.38615616 +0.36578273 -0.38868203 +0.44872107 -0.39105378 +0.5 -0.39145898 +0.33897733 -0.34266246 +0.38340611 -0.34615675 +0.45543755 -0.3494391 +0.5 -0.35 +0.33897733 -0.34266246 +0.38340611 -0.34615675 +0.45543755 -0.3494391 +0.5 -0.35 +0.36313933 -0.29915085 +0.40081884 -0.3036206 +0.46206311 -0.30782264 +0.5 -0.30854102 +0.40123224 -0.22862507 +0.42814968 -0.2347212 +0.47241848 -0.2404735 +0.5 -0.24145898 +0.42346331 -0.18477591 +0.44392981 -0.19197951 +0.47833473 -0.19882308 +0.5 -0.2 +0.17928932 -0.32071068 +0.22321618 -0.32823118 +0.29465057 -0.33805104 +0.33897733 -0.34266246 +0.22884367 -0.27115633 +0.26555961 -0.28073043 +0.32565606 -0.2932578 +0.36313933 -0.29915085 +0.30902429 -0.19097571 +0.33348989 -0.20374857 +0.37481851 -0.22062343 +0.40123224 -0.22862507 +0.35857864 -0.14142136 +0.37473052 -0.15590881 +0.4038976 -0.17539763 +0.42346331 -0.18477591 diff --git a/tests/unit/data/quad-spiral-q20.mesh b/tests/unit/data/quad-spiral-q20.mesh index 5b030073ac..9ea4bfa01f 100644 --- a/tests/unit/data/quad-spiral-q20.mesh +++ b/tests/unit/data/quad-spiral-q20.mesh @@ -1,7 +1,7 @@ MFEM mesh v1.0 # -# MFEM Geometry Types (see mesh/geom.hpp): +# MFEM Geometry Types (see fem/geom.hpp): # # POINT = 0 # SEGMENT = 1 diff --git a/tests/unit/fem/test_1d_bilininteg.cpp b/tests/unit/fem/test_1d_bilininteg.cpp index a3973ebd3c..0770ceab97 100644 --- a/tests/unit/fem/test_1d_bilininteg.cpp +++ b/tests/unit/fem/test_1d_bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_2d_bilininteg.cpp b/tests/unit/fem/test_2d_bilininteg.cpp index 312cecde26..865370b259 100644 --- a/tests/unit/fem/test_2d_bilininteg.cpp +++ b/tests/unit/fem/test_2d_bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_3d_bilininteg.cpp b/tests/unit/fem/test_3d_bilininteg.cpp index debf925dfe..802174a2e2 100644 --- a/tests/unit/fem/test_3d_bilininteg.cpp +++ b/tests/unit/fem/test_3d_bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_assemblediagonalpa.cpp b/tests/unit/fem/test_assemblediagonalpa.cpp index 050561e1db..5e6beb4284 100644 --- a/tests/unit/fem/test_assemblediagonalpa.cpp +++ b/tests/unit/fem/test_assemblediagonalpa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_assembly_levels.cpp b/tests/unit/fem/test_assembly_levels.cpp index c3edda6370..191b0df268 100644 --- a/tests/unit/fem/test_assembly_levels.cpp +++ b/tests/unit/fem/test_assembly_levels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_bilinearform.cpp b/tests/unit/fem/test_bilinearform.cpp index 5fd00b3e18..7f99cf1fd6 100644 --- a/tests/unit/fem/test_bilinearform.cpp +++ b/tests/unit/fem/test_bilinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_blocknonlinearform.cpp b/tests/unit/fem/test_blocknonlinearform.cpp index 51d6b12aba..2baf12a39a 100644 --- a/tests/unit/fem/test_blocknonlinearform.cpp +++ b/tests/unit/fem/test_blocknonlinearform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_build_dof_to_arrays.cpp b/tests/unit/fem/test_build_dof_to_arrays.cpp index a439a13b6d..508bdaab75 100644 --- a/tests/unit/fem/test_build_dof_to_arrays.cpp +++ b/tests/unit/fem/test_build_dof_to_arrays.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_calccurlshape.cpp b/tests/unit/fem/test_calccurlshape.cpp index 9a2ebe27ed..3ba4e9e45e 100644 --- a/tests/unit/fem/test_calccurlshape.cpp +++ b/tests/unit/fem/test_calccurlshape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_calcdivshape.cpp b/tests/unit/fem/test_calcdivshape.cpp index afcd494177..cb88651e83 100644 --- a/tests/unit/fem/test_calcdivshape.cpp +++ b/tests/unit/fem/test_calcdivshape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_calcdshape.cpp b/tests/unit/fem/test_calcdshape.cpp index d3c3b064f1..fa67fad941 100644 --- a/tests/unit/fem/test_calcdshape.cpp +++ b/tests/unit/fem/test_calcdshape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_calcshape.cpp b/tests/unit/fem/test_calcshape.cpp index 65db5ab8f1..160a47f5a4 100644 --- a/tests/unit/fem/test_calcshape.cpp +++ b/tests/unit/fem/test_calcshape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_calcvshape.cpp b/tests/unit/fem/test_calcvshape.cpp index 2176d901f5..d2b99ef017 100644 --- a/tests/unit/fem/test_calcvshape.cpp +++ b/tests/unit/fem/test_calcvshape.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_coefficient.cpp b/tests/unit/fem/test_coefficient.cpp index 5491925137..041a5d0c9a 100644 --- a/tests/unit/fem/test_coefficient.cpp +++ b/tests/unit/fem/test_coefficient.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_datacollection.cpp b/tests/unit/fem/test_datacollection.cpp index dbf9b205c3..eeb3f52496 100644 --- a/tests/unit/fem/test_datacollection.cpp +++ b/tests/unit/fem/test_datacollection.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_derefine.cpp b/tests/unit/fem/test_derefine.cpp index 2320cd207a..606f960f22 100644 --- a/tests/unit/fem/test_derefine.cpp +++ b/tests/unit/fem/test_derefine.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_dgmassinv.cpp b/tests/unit/fem/test_dgmassinv.cpp index 903aa585cc..b82e250e76 100644 --- a/tests/unit/fem/test_dgmassinv.cpp +++ b/tests/unit/fem/test_dgmassinv.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_doftrans.cpp b/tests/unit/fem/test_doftrans.cpp index b65b8724df..ef7a024095 100644 --- a/tests/unit/fem/test_doftrans.cpp +++ b/tests/unit/fem/test_doftrans.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_domain_int.cpp b/tests/unit/fem/test_domain_int.cpp index 2ff68ad71e..a48c9b11b2 100644 --- a/tests/unit/fem/test_domain_int.cpp +++ b/tests/unit/fem/test_domain_int.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_eigs.cpp b/tests/unit/fem/test_eigs.cpp index 01ec1a5ce1..7a227ca20e 100644 --- a/tests/unit/fem/test_eigs.cpp +++ b/tests/unit/fem/test_eigs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_estimator.cpp b/tests/unit/fem/test_estimator.cpp index 69ae74d1c9..c711192b09 100644 --- a/tests/unit/fem/test_estimator.cpp +++ b/tests/unit/fem/test_estimator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_fa_determinism.cpp b/tests/unit/fem/test_fa_determinism.cpp index 41795954aa..de78869f0d 100644 --- a/tests/unit/fem/test_fa_determinism.cpp +++ b/tests/unit/fem/test_fa_determinism.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_face_elem_trans.cpp b/tests/unit/fem/test_face_elem_trans.cpp index 37217b868f..5cac928f14 100644 --- a/tests/unit/fem/test_face_elem_trans.cpp +++ b/tests/unit/fem/test_face_elem_trans.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_face_permutation.cpp b/tests/unit/fem/test_face_permutation.cpp index 63cd02a262..dd721d011a 100644 --- a/tests/unit/fem/test_face_permutation.cpp +++ b/tests/unit/fem/test_face_permutation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_face_restriction.cpp b/tests/unit/fem/test_face_restriction.cpp index 6d19a41f67..0e1336ff5d 100644 --- a/tests/unit/fem/test_face_restriction.cpp +++ b/tests/unit/fem/test_face_restriction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_fe.cpp b/tests/unit/fem/test_fe.cpp index 336561055f..4a39d026d5 100644 --- a/tests/unit/fem/test_fe.cpp +++ b/tests/unit/fem/test_fe.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_get_value.cpp b/tests/unit/fem/test_get_value.cpp index 8fda554e7f..31f5d1768e 100644 --- a/tests/unit/fem/test_get_value.cpp +++ b/tests/unit/fem/test_get_value.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_getderivative.cpp b/tests/unit/fem/test_getderivative.cpp index bbfaddf4b7..ee695c24ac 100644 --- a/tests/unit/fem/test_getderivative.cpp +++ b/tests/unit/fem/test_getderivative.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_getgradient.cpp b/tests/unit/fem/test_getgradient.cpp index 8fea0788f0..73c9391814 100644 --- a/tests/unit/fem/test_getgradient.cpp +++ b/tests/unit/fem/test_getgradient.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_gslib.cpp b/tests/unit/fem/test_gslib.cpp index 7ad24da7cc..10bfe637ba 100644 --- a/tests/unit/fem/test_gslib.cpp +++ b/tests/unit/fem/test_gslib.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_intrules.cpp b/tests/unit/fem/test_intrules.cpp index c0d549373a..cc627681ec 100644 --- a/tests/unit/fem/test_intrules.cpp +++ b/tests/unit/fem/test_intrules.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_intruletypes.cpp b/tests/unit/fem/test_intruletypes.cpp index 723da23306..74e2a0d157 100644 --- a/tests/unit/fem/test_intruletypes.cpp +++ b/tests/unit/fem/test_intruletypes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_inversetransform.cpp b/tests/unit/fem/test_inversetransform.cpp index e327436b08..a7a76be9df 100644 --- a/tests/unit/fem/test_inversetransform.cpp +++ b/tests/unit/fem/test_inversetransform.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_lexicographic_ordering.cpp b/tests/unit/fem/test_lexicographic_ordering.cpp index 6c73cb4e32..272e8fbcdc 100644 --- a/tests/unit/fem/test_lexicographic_ordering.cpp +++ b/tests/unit/fem/test_lexicographic_ordering.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_lin_interp.cpp b/tests/unit/fem/test_lin_interp.cpp index 5b2018dd54..6648b86bf3 100644 --- a/tests/unit/fem/test_lin_interp.cpp +++ b/tests/unit/fem/test_lin_interp.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_linear_fes.cpp b/tests/unit/fem/test_linear_fes.cpp index 13670340a6..1371359987 100644 --- a/tests/unit/fem/test_linear_fes.cpp +++ b/tests/unit/fem/test_linear_fes.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_linearform_ext.cpp b/tests/unit/fem/test_linearform_ext.cpp index 270a681394..5c3443592a 100644 --- a/tests/unit/fem/test_linearform_ext.cpp +++ b/tests/unit/fem/test_linearform_ext.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_lor.cpp b/tests/unit/fem/test_lor.cpp index df60e9406b..1ea697abc2 100644 --- a/tests/unit/fem/test_lor.cpp +++ b/tests/unit/fem/test_lor.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_lor_batched.cpp b/tests/unit/fem/test_lor_batched.cpp index 19a7ee3fa0..1610b825f8 100644 --- a/tests/unit/fem/test_lor_batched.cpp +++ b/tests/unit/fem/test_lor_batched.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_nonlinearform.cpp b/tests/unit/fem/test_nonlinearform.cpp new file mode 100644 index 0000000000..00bda04ee8 --- /dev/null +++ b/tests/unit/fem/test_nonlinearform.cpp @@ -0,0 +1,98 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "mfem.hpp" +#include "unit_tests.hpp" + +using namespace mfem; + +TEST_CASE("NonlinearForm Boundary Integrator", "[NonlinearForm]") +{ + // See problem description in ex27. + + Mesh mesh("./data/holes.mesh", 1, 1); + H1_FECollection fec(1, mesh.Dimension()); + FiniteElementSpace fespace(&mesh, &fec); + + Array nbc_bdr(mesh.bdr_attributes.Max()); + Array rbc_bdr(mesh.bdr_attributes.Max()); + Array dbc_bdr(mesh.bdr_attributes.Max()); + nbc_bdr = 0; nbc_bdr[0] = 1; + rbc_bdr = 0; rbc_bdr[1] = 1; + dbc_bdr = 0; dbc_bdr[2] = 1; + + Array ess_tdof_list(0); + fespace.GetEssentialTrueDofs(dbc_bdr, ess_tdof_list); + + // See defaults in ex27. + ConstantCoefficient matCoef(1.0); + ConstantCoefficient dbcCoef(0.0); + ConstantCoefficient nbcCoef(1.0); + ConstantCoefficient rbcACoef(1.0); + ConstantCoefficient rbcBCoef(1.0); + ProductCoefficient m_nbcCoef(matCoef, nbcCoef); + ProductCoefficient m_rbcACoef(matCoef, rbcACoef); + ProductCoefficient m_rbcBCoef(matCoef, rbcBCoef); + + GridFunction u1(&fespace), u2(&fespace); + u1 = 0.0; + u2 = 0.0; + u1.ProjectBdrCoefficient(dbcCoef, dbc_bdr); + u2.ProjectBdrCoefficient(dbcCoef, dbc_bdr); + + LinearForm b(&fespace); + b.AddBoundaryIntegrator(new BoundaryLFIntegrator(m_nbcCoef), nbc_bdr); + b.AddBoundaryIntegrator(new BoundaryLFIntegrator(m_rbcBCoef), rbc_bdr); + b.Assemble(); + + // Solve as a linear problem. + { + BilinearForm a(&fespace); + a.AddDomainIntegrator(new DiffusionIntegrator(matCoef)); + a.AddBoundaryIntegrator(new MassIntegrator(m_rbcACoef), rbc_bdr); + a.Assemble(); + + OperatorPtr A; + Vector B, X; + a.FormLinearSystem(ess_tdof_list, u1, b, A, X, B); + GSSmoother M((SparseMatrix&)(*A)); + PCG(*A, M, B, X, 1, 500, 1e-12, 0.0); + a.RecoverFEMSolution(X, b, u1); + } + + // Solve as a nonlinear problem. + { + NonlinearForm a_nf(&fespace); + a_nf.AddDomainIntegrator(new DiffusionIntegrator(matCoef)); + a_nf.AddBoundaryIntegrator(new MassIntegrator(m_rbcACoef), rbc_bdr); + a_nf.SetEssentialTrueDofs(ess_tdof_list); + + IterativeSolver::PrintLevel print; + print.Iterations(); + CGSolver cg; + cg.SetPrintLevel(print); + cg.SetMaxIter(100); + cg.SetRelTol(1e-12); cg.SetAbsTol(0.0); + + NewtonSolver newton; + newton.iterative_mode = false; + newton.SetSolver(cg); + newton.SetOperator(a_nf); + newton.SetPrintLevel(print); + newton.SetRelTol(1e-14); newton.SetAbsTol(0.0); + newton.SetMaxIter(1); + + newton.Mult(b, u2); + } + + u2 -= u1; + REQUIRE(u2.Norml2() == MFEM_Approx(0.0, 1e-5)); +} diff --git a/tests/unit/fem/test_operatorjacobismoother.cpp b/tests/unit/fem/test_operatorjacobismoother.cpp index 97576fd876..2b33b8ee16 100644 --- a/tests/unit/fem/test_operatorjacobismoother.cpp +++ b/tests/unit/fem/test_operatorjacobismoother.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_oscillation.cpp b/tests/unit/fem/test_oscillation.cpp index acb585e384..8043ce79aa 100644 --- a/tests/unit/fem/test_oscillation.cpp +++ b/tests/unit/fem/test_oscillation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_pa_coeff.cpp b/tests/unit/fem/test_pa_coeff.cpp index ece574f16b..e0e9c83f29 100644 --- a/tests/unit/fem/test_pa_coeff.cpp +++ b/tests/unit/fem/test_pa_coeff.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_pa_grad.cpp b/tests/unit/fem/test_pa_grad.cpp index a42d7c83cf..364a80b3a0 100644 --- a/tests/unit/fem/test_pa_grad.cpp +++ b/tests/unit/fem/test_pa_grad.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_pa_idinterp.cpp b/tests/unit/fem/test_pa_idinterp.cpp index 492637623b..0d7fd78802 100644 --- a/tests/unit/fem/test_pa_idinterp.cpp +++ b/tests/unit/fem/test_pa_idinterp.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_pa_kernels.cpp b/tests/unit/fem/test_pa_kernels.cpp index 32375069d5..49cf4d9582 100644 --- a/tests/unit/fem/test_pa_kernels.cpp +++ b/tests/unit/fem/test_pa_kernels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_pgridfunc_save_serial.cpp b/tests/unit/fem/test_pgridfunc_save_serial.cpp index dd9ea3adf5..dff57eb078 100644 --- a/tests/unit/fem/test_pgridfunc_save_serial.cpp +++ b/tests/unit/fem/test_pgridfunc_save_serial.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_project_bdr.cpp b/tests/unit/fem/test_project_bdr.cpp index fe46f39df5..7abc69fd92 100644 --- a/tests/unit/fem/test_project_bdr.cpp +++ b/tests/unit/fem/test_project_bdr.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_quadf_coef.cpp b/tests/unit/fem/test_quadf_coef.cpp index 344701d9fc..c00c226eee 100644 --- a/tests/unit/fem/test_quadf_coef.cpp +++ b/tests/unit/fem/test_quadf_coef.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -15,7 +15,8 @@ using namespace mfem; -TEST_CASE("Quadrature Function Coefficients", "[Coefficient]") +TEST_CASE("Quadrature Function Coefficients", + "[Coefficient][QuadratureFunction][QuadratureFunctionCoefficient]") { int order_h1 = 2, n = 4, dim = 3; double tol = 1e-14; @@ -32,7 +33,7 @@ TEST_CASE("Quadrature Function Coefficients", "[Coefficient]") REQUIRE(quadf_coeff.UseDevice()); - const IntegrationRule ir = qspace.GetElementIntRule(0); + const IntegrationRule &ir = qspace.GetElementIntRule(0); const GeometricFactors *geom_facts = mesh.GetGeometricFactors(ir, GeometricFactors::COORDINATES); @@ -153,6 +154,111 @@ TEST_CASE("Quadrature Function Coefficients", "[Coefficient]") } } +TEST_CASE("Quadrature Function Integration", "[QuadratureFunction][CUDA]") +{ + auto fname = GENERATE( + "../../data/star.mesh", + "../../data/star-q3.mesh", + "../../data/fichera.mesh", + "../../data/fichera-q3.mesh" + ); + const int order = GENERATE(1, 2, 3); + + CAPTURE(fname, order); + + Mesh mesh = Mesh::LoadFromFile(fname); + H1_FECollection fec(1, mesh.Dimension()); + FiniteElementSpace fes(&mesh, &fec); + + int int_order = 2*order + 1; + + SECTION("QuadratureSpace") + { + QuadratureSpace qs(&mesh, int_order); + + // Make sure invalidating the cached weights works properly + qs.GetWeights(); + mesh.Transform([](const Vector &xold, Vector &xnew) + { + xnew = xold; + xnew *= 1.1; + }); + + const IntegrationRule &ir = qs.GetIntRule(0); + + QuadratureFunction qf(qs); + qf.Randomize(1); + QuadratureFunctionCoefficient qf_coeff(qf); + + LinearForm lf(&fes); + lf.AddDomainIntegrator(new DomainLFIntegrator(qf_coeff, &ir)); + lf.Assemble(); + const double integ_1 = lf.Sum(); + const double integ_2 = qf.Integrate(); + const double integ_3 = qs.Integrate(qf_coeff); + + REQUIRE(integ_1 == MFEM_Approx(integ_2)); + REQUIRE(integ_1 == MFEM_Approx(integ_3)); + } + + SECTION("Vector-valued") + { + const int vdim = 3; + const int ordering = Ordering::byNODES; + FiniteElementSpace fes_vec(&mesh, &fec, vdim, ordering); + + QuadratureSpace qs(&mesh, int_order); + const IntegrationRule &ir = qs.GetIntRule(0); + + QuadratureFunction qf(qs, vdim); + qf.Randomize(1); + VectorQuadratureFunctionCoefficient qf_coeff(qf); + + LinearForm lf(&fes_vec); + auto *integrator = new VectorDomainLFIntegrator(qf_coeff); + integrator->SetIntRule(&ir); + lf.AddDomainIntegrator(integrator); + lf.Assemble(); + + Vector integrals_1(vdim); + Vector integrals_2(vdim); + + qf.Integrate(integrals_1); + qs.Integrate(qf_coeff, integrals_2); + + const int ndof = fes.GetNDofs(); + for (int vd = 0; vd < vdim; ++vd) + { + double integ = 0.0; + for (int i = 0; i < ndof; ++i) + { + integ += lf[i + vd*ndof]; + } + REQUIRE(integ == MFEM_Approx(integrals_1[vd])); + REQUIRE(integ == MFEM_Approx(integrals_2[vd])); + } + } + + SECTION("FaceQuadratureSpace") + { + FaceQuadratureSpace qs(mesh, int_order, FaceType::Boundary); + const IntegrationRule &ir = qs.GetIntRule(0); + + QuadratureFunction qf(qs); + qf.Randomize(1); + QuadratureFunctionCoefficient qf_coeff(qf); + + LinearForm lf(&fes); + auto *integ = new BoundaryLFIntegrator(qf_coeff); + integ->SetIntRule(&ir); + lf.AddBoundaryIntegrator(integ); + lf.Assemble(); + const double integ_1 = lf.Sum(); + const double integ_2 = qf.Integrate(); + REQUIRE(integ_1 == MFEM_Approx(integ_2)); + } +} + namespace lin_interp { double f3(const Vector &x); diff --git a/tests/unit/fem/test_quadinterpolator.cpp b/tests/unit/fem/test_quadinterpolator.cpp index f9862c8a08..e3ada38d3e 100644 --- a/tests/unit/fem/test_quadinterpolator.cpp +++ b/tests/unit/fem/test_quadinterpolator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_quadraturefunc.cpp b/tests/unit/fem/test_quadraturefunc.cpp index 5b06a48a78..25067e4ce2 100644 --- a/tests/unit/fem/test_quadraturefunc.cpp +++ b/tests/unit/fem/test_quadraturefunc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_r1d_bilininteg.cpp b/tests/unit/fem/test_r1d_bilininteg.cpp index 1c56d209a2..626254bee3 100644 --- a/tests/unit/fem/test_r1d_bilininteg.cpp +++ b/tests/unit/fem/test_r1d_bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_r2d_bilininteg.cpp b/tests/unit/fem/test_r2d_bilininteg.cpp index cfafb49632..342a497730 100644 --- a/tests/unit/fem/test_r2d_bilininteg.cpp +++ b/tests/unit/fem/test_r2d_bilininteg.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_sparse_matrix.cpp b/tests/unit/fem/test_sparse_matrix.cpp index 61871cfc86..11031a5a87 100644 --- a/tests/unit/fem/test_sparse_matrix.cpp +++ b/tests/unit/fem/test_sparse_matrix.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_sum_bilin.cpp b/tests/unit/fem/test_sum_bilin.cpp index e544c04c88..dc03ff01da 100644 --- a/tests/unit/fem/test_sum_bilin.cpp +++ b/tests/unit/fem/test_sum_bilin.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_surf_blf.cpp b/tests/unit/fem/test_surf_blf.cpp index 4d00e879b2..4b89001140 100644 --- a/tests/unit/fem/test_surf_blf.cpp +++ b/tests/unit/fem/test_surf_blf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_tet_reorder.cpp b/tests/unit/fem/test_tet_reorder.cpp index 26698db8db..042de07bde 100644 --- a/tests/unit/fem/test_tet_reorder.cpp +++ b/tests/unit/fem/test_tet_reorder.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_transfer.cpp b/tests/unit/fem/test_transfer.cpp index 32243a2497..3b746f48a5 100644 --- a/tests/unit/fem/test_transfer.cpp +++ b/tests/unit/fem/test_transfer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_var_order.cpp b/tests/unit/fem/test_var_order.cpp index 7dd197e2d3..f33d630ac0 100644 --- a/tests/unit/fem/test_var_order.cpp +++ b/tests/unit/fem/test_var_order.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/fem/test_white_noise.cpp b/tests/unit/fem/test_white_noise.cpp index 226a27b29f..0d28199ebc 100644 --- a/tests/unit/fem/test_white_noise.cpp +++ b/tests/unit/fem/test_white_noise.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_array.cpp b/tests/unit/general/test_array.cpp index 2b580aac9c..7aa940f09c 100644 --- a/tests/unit/general/test_array.cpp +++ b/tests/unit/general/test_array.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_error.cpp b/tests/unit/general/test_error.cpp index a38170fbdd..1b004d3874 100644 --- a/tests/unit/general/test_error.cpp +++ b/tests/unit/general/test_error.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_mem.cpp b/tests/unit/general/test_mem.cpp index 5efbd4ffa0..5c8120a277 100644 --- a/tests/unit/general/test_mem.cpp +++ b/tests/unit/general/test_mem.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_text.cpp b/tests/unit/general/test_text.cpp index 380178b259..5136187bb7 100644 --- a/tests/unit/general/test_text.cpp +++ b/tests/unit/general/test_text.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_umpire_mem.cpp b/tests/unit/general/test_umpire_mem.cpp index bbf2a67905..84457669ec 100644 --- a/tests/unit/general/test_umpire_mem.cpp +++ b/tests/unit/general/test_umpire_mem.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/general/test_zlib.cpp b/tests/unit/general/test_zlib.cpp index 529e7ed6c2..511fc059d3 100644 --- a/tests/unit/general/test_zlib.cpp +++ b/tests/unit/general/test_zlib.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_cg_indefinite.cpp b/tests/unit/linalg/test_cg_indefinite.cpp index b33f976358..51e4958fe5 100644 --- a/tests/unit/linalg/test_cg_indefinite.cpp +++ b/tests/unit/linalg/test_cg_indefinite.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_chebyshev.cpp b/tests/unit/linalg/test_chebyshev.cpp index 3e56ff4f8f..a5734a4482 100644 --- a/tests/unit/linalg/test_chebyshev.cpp +++ b/tests/unit/linalg/test_chebyshev.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_complex_dense_matrix.cpp b/tests/unit/linalg/test_complex_dense_matrix.cpp index b864d8ad2a..fe1b78fa43 100644 --- a/tests/unit/linalg/test_complex_dense_matrix.cpp +++ b/tests/unit/linalg/test_complex_dense_matrix.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_complex_operator.cpp b/tests/unit/linalg/test_complex_operator.cpp index 2e7daf392c..a9c21e1ce9 100644 --- a/tests/unit/linalg/test_complex_operator.cpp +++ b/tests/unit/linalg/test_complex_operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_constrainedsolver.cpp b/tests/unit/linalg/test_constrainedsolver.cpp index 5c76d3ecd4..17b0df82ce 100644 --- a/tests/unit/linalg/test_constrainedsolver.cpp +++ b/tests/unit/linalg/test_constrainedsolver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_direct_solvers.cpp b/tests/unit/linalg/test_direct_solvers.cpp index 5b74a98fa4..0646302300 100644 --- a/tests/unit/linalg/test_direct_solvers.cpp +++ b/tests/unit/linalg/test_direct_solvers.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_hypre_ilu.cpp b/tests/unit/linalg/test_hypre_ilu.cpp index c6901492a7..96417d8821 100644 --- a/tests/unit/linalg/test_hypre_ilu.cpp +++ b/tests/unit/linalg/test_hypre_ilu.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_hypre_prec.cpp b/tests/unit/linalg/test_hypre_prec.cpp index b0a89b9aa6..609891b1bf 100644 --- a/tests/unit/linalg/test_hypre_prec.cpp +++ b/tests/unit/linalg/test_hypre_prec.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_hypre_vector.cpp b/tests/unit/linalg/test_hypre_vector.cpp index 720ec5a67d..3b59787b96 100644 --- a/tests/unit/linalg/test_hypre_vector.cpp +++ b/tests/unit/linalg/test_hypre_vector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_ilu.cpp b/tests/unit/linalg/test_ilu.cpp index 4a2c8f3a64..2d0e09b321 100644 --- a/tests/unit/linalg/test_ilu.cpp +++ b/tests/unit/linalg/test_ilu.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_matrix_block.cpp b/tests/unit/linalg/test_matrix_block.cpp index e88779887a..d416c7e00c 100644 --- a/tests/unit/linalg/test_matrix_block.cpp +++ b/tests/unit/linalg/test_matrix_block.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_matrix_dense.cpp b/tests/unit/linalg/test_matrix_dense.cpp index 4153e58c1a..6d709a1c24 100644 --- a/tests/unit/linalg/test_matrix_dense.cpp +++ b/tests/unit/linalg/test_matrix_dense.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_matrix_hypre.cpp b/tests/unit/linalg/test_matrix_hypre.cpp index 40fd75323f..dd3b9e349f 100644 --- a/tests/unit/linalg/test_matrix_hypre.cpp +++ b/tests/unit/linalg/test_matrix_hypre.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_matrix_rectangular.cpp b/tests/unit/linalg/test_matrix_rectangular.cpp index a404c9246c..2e863c8666 100644 --- a/tests/unit/linalg/test_matrix_rectangular.cpp +++ b/tests/unit/linalg/test_matrix_rectangular.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_matrix_sparse.cpp b/tests/unit/linalg/test_matrix_sparse.cpp index 34a1547ee3..4a038cd055 100644 --- a/tests/unit/linalg/test_matrix_sparse.cpp +++ b/tests/unit/linalg/test_matrix_sparse.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -11,6 +11,7 @@ #include "mfem.hpp" #include "unit_tests.hpp" +#include namespace mfem { @@ -77,4 +78,166 @@ TEST_CASE("SparseMatrixAbsMult", "[SparseMatrixAbsMult]") } } +TEST_CASE("SparseMatrix printing", "[SparseMatrix]") +{ + // Create a test sparse matrix and print it using different methods + // and compare the output with the reference one + + DenseMatrix dense( + { + {0.0, 4.0, 0.0}, + {5.0, 0.0, 1.0}, + {2.0, 0.0, 0.0} + }); + + const int width = dense.Width(); + const int height = dense.Height(); + int nonzero = 0; + + // Non-finalized matrix (LIL) + SparseMatrix mat_lil(height, width); + for (int i = 0; i < height; i++) + for (int j = 0; j < width; j++) + { + if (dense(i,j) != 0.0) + { + mat_lil.Add(i, j, dense(i,j)); + nonzero++; + } + } + + // Finalized matrix (CSR) + SparseMatrix mat_csr(mat_lil); + mat_csr.Finalize(); + + std::stringstream ss, ss_ref; + + SECTION("Print") + { + //assume print width >= matrix width + ss_ref.str(""); + for (int i = 0; i < height; i++) + { + ss_ref << "[row " << i << "]\n"; + for (int j = width-1; j >=0 ; j--) + if (dense(i,j) != 0.0) + { + ss_ref << " (" << j << "," << dense(i,j) << ")"; + } + ss_ref << "\n"; + } + + ss.str(""); + mat_lil.Print(ss); + REQUIRE(ss.str() == ss_ref.str()); + + ss.str(""); + mat_csr.Print(ss); + REQUIRE(ss.str() == ss_ref.str()); + } + + SECTION("PrintMatlab") + { + ss_ref.str(""); + ss_ref << "% size " << height << " " << width << "\n"; + ss_ref << "% Non Zeros " << nonzero << "\n"; + + std::ios::fmtflags old_fmt = ss_ref.flags(); + ss_ref.setf(std::ios::scientific); + std::streamsize old_prec = ss_ref.precision(14); + + for (int i = 0; i < height; i++) + for (int j = width-1; j >=0 ; j--) + if (dense(i,j) != 0.0) + { + ss_ref << i+1 << " " << j+1 << " " << dense(i,j) << "\n"; + } + + ss_ref << height << " " << width << " 0.0\n"; + ss_ref.precision(old_prec); + ss_ref.flags(old_fmt); + + ss.str(""); + mat_lil.PrintMatlab(ss); + REQUIRE(ss.str() == ss_ref.str()); + + ss.str(""); + mat_csr.PrintMatlab(ss); + REQUIRE(ss.str() == ss_ref.str()); + } + + SECTION("PrintMM") + { + ss_ref.str(""); + ss_ref << "%%MatrixMarket matrix coordinate real general" << '\n' + << "% Generated by MFEM" << '\n'; + ss_ref << height << " " << width << " " << nonzero << "\n"; + + std::ios::fmtflags old_fmt = ss_ref.flags(); + ss_ref.setf(std::ios::scientific); + std::streamsize old_prec = ss_ref.precision(14); + + for (int i = 0; i < height; i++) + for (int j = width-1; j >=0 ; j--) + if (dense(i,j) != 0.0) + { + ss_ref << i+1 << " " << j+1 << " " << dense(i,j) << "\n"; + } + + ss_ref.precision(old_prec); + ss_ref.flags(old_fmt); + + ss.str(""); + mat_lil.PrintMM(ss); + REQUIRE(ss.str() == ss_ref.str()); + + ss.str(""); + mat_csr.PrintMM(ss); + REQUIRE(ss.str() == ss_ref.str()); + } + + SECTION("PrintCSR") + { + ss_ref.str(""); + ss_ref << height << "\n"; + + Array I(height+1); + Array J(nonzero); + Vector A(nonzero); + + int idx = 0; + for (int i = 0; i < height; i++) + { + I[i] = idx; + for (int j = width-1; j >=0 ; j--) + if (dense(i,j) != 0.0) + { + J[idx] = j; + A[idx] = dense(i,j); + idx++; + } + } + I[height] = idx; + + for (int i = 0; i <= height; i++) + { + ss_ref << I[i]+1 << '\n'; + } + + for (int i = 0; i < I[height]; i++) + { + ss_ref << J[i]+1 << '\n'; + } + + for (int i = 0; i < I[height]; i++) + { + ss_ref << A[i] << '\n'; + } + + ss.str(""); + mat_csr.PrintCSR(ss); + REQUIRE(ss.str() == ss_ref.str()); + } +} + } // namespace mfem diff --git a/tests/unit/linalg/test_matrix_square.cpp b/tests/unit/linalg/test_matrix_square.cpp index 8009f5033d..dc40ef7aa1 100644 --- a/tests/unit/linalg/test_matrix_square.cpp +++ b/tests/unit/linalg/test_matrix_square.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_ode.cpp b/tests/unit/linalg/test_ode.cpp index 5b579ed0f3..b84e8c96bc 100644 --- a/tests/unit/linalg/test_ode.cpp +++ b/tests/unit/linalg/test_ode.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_ode2.cpp b/tests/unit/linalg/test_ode2.cpp index 923d43baf2..3f5b6b2fe4 100644 --- a/tests/unit/linalg/test_ode2.cpp +++ b/tests/unit/linalg/test_ode2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/linalg/test_operator.cpp b/tests/unit/linalg/test_operator.cpp index 8e6fe0fd01..a9bd53554a 100644 --- a/tests/unit/linalg/test_operator.cpp +++ b/tests/unit/linalg/test_operator.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // @@ -12,10 +12,10 @@ #include "mfem.hpp" #include "unit_tests.hpp" -#ifdef MFEM_USE_EXCEPTIONS - using namespace mfem; +#ifdef MFEM_USE_EXCEPTIONS + TEST_CASE("Operator", "[Operator]") { // Define diagonal sparse matrix @@ -48,3 +48,59 @@ TEST_CASE("Operator", "[Operator]") } #endif // MFEM_USE_EXCEPTIONS + +double constrained_mult_application(Operator &op, Array &list, + const Vector &input, const Vector &truth, const bool transpose = false, + const Operator::DiagonalPolicy diag_policy = Operator::DiagonalPolicy::DIAG_ONE) +{ + const ConstrainedOperator constrained_op(&op, list, false, diag_policy); + // Make sure test is well formed. + CHECK(op.Width() == input.Size()); + CHECK(op.Height() == truth.Size()); + Vector y(op.Height()); + if (transpose) + { + constrained_op.MultTranspose(input,y); + } + else + { + constrained_op.Mult(input,y); + } + auto error = truth; + error -= y; + auto error_norm = error.Norml2() / truth.Norml2(); + return error_norm; +} + +TEST_CASE("ConstrainedOperator", "[ConstrainedOperator][Operator]") +{ + INFO("Constrained Operator"); + // Compare against manual calculation with random 5x5 matrix and input vector. + // Should leave first and fourth entries the same for DIAG_ONE, and zero them + // out for DIAG_ZERO. + DenseMatrix A( + { + {27.531558467881045, 89.30012682807859, 10.363408976942745, 78.97400291889993, 18.703638414621903 }, + {79.33627624921924, 73.99743336818197, 85.27832370283267, 11.13213120570734, 27.59542336254316}, + {26.474414966916925, 17.38636366801234, 41.423691595967114, 94.06135498225382, 18.379018138899884}, + {45.83203742468528, 90.10126513894627, 3.8488872448446343, 41.03858238887901, 14.429143614063412}, + {26.2225932381016, 3.8232081630501513, 17.820832452264256, 3.919068726019015, 92.66801110040682} + }); + Array list(2); + list[0] = 0; + list[1] = 3; + Vector x({62.06906909143156, 63.31143800813616, 59.6546764326512, 48.10287136113324, 0.4275152133050852}); + // DIAG_ONE checks + Vector y_true({62.06906909143156, 9783.932185967293, 3579.7299142176153, 48.10287136113324, 1344.7657848396123}); + Vector y_true_transpose({62.06906909143156, 5723.696294059853, 7877.828900340113, 48.10287136113324, 2883.1173002839714}); + REQUIRE(constrained_mult_application(A, list, x, y_true) == MFEM_Approx(0.0)); + REQUIRE(constrained_mult_application(A, list, x, y_true_transpose, + true) == MFEM_Approx(0.0)); + // DIAG_ZERO checks + Vector y_true_zero({0.0, 9783.932185967293, 3579.7299142176153, 0.0, 1344.7657848396123}); + Vector y_true_zero_transpose({0.0, 5723.696294059853, 7877.828900340113, 0.0, 2883.1173002839714}); + REQUIRE(constrained_mult_application(A, list, x, y_true_zero, false, + Operator::DiagonalPolicy::DIAG_ZERO) == MFEM_Approx(0.0)); + REQUIRE(constrained_mult_application(A, list, x, y_true_zero_transpose, true, + Operator::DiagonalPolicy::DIAG_ZERO) == MFEM_Approx(0.0)); +} diff --git a/tests/unit/linalg/test_vector.cpp b/tests/unit/linalg/test_vector.cpp index e379b1b2a2..53d3e75156 100644 --- a/tests/unit/linalg/test_vector.cpp +++ b/tests/unit/linalg/test_vector.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/makefile b/tests/unit/makefile index 9c73d67ba7..2ae1b82571 100644 --- a/tests/unit/makefile +++ b/tests/unit/makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +# Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced # at the Lawrence Livermore National Laboratory. All Rights reserved. See files # LICENSE and NOTICE for details. LLNL-CODE-806117. # diff --git a/tests/unit/mesh/mesh_test_utils.cpp b/tests/unit/mesh/mesh_test_utils.cpp index 2054521055..58f5cb89c7 100644 --- a/tests/unit/mesh/mesh_test_utils.cpp +++ b/tests/unit/mesh/mesh_test_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/mesh_test_utils.hpp b/tests/unit/mesh/mesh_test_utils.hpp index 249ee51dae..37333f9804 100644 --- a/tests/unit/mesh/mesh_test_utils.hpp +++ b/tests/unit/mesh/mesh_test_utils.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_face_orientations.cpp b/tests/unit/mesh/test_face_orientations.cpp index 6880f18a5a..7ee28b6ef5 100644 --- a/tests/unit/mesh/test_face_orientations.cpp +++ b/tests/unit/mesh/test_face_orientations.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_fms.cpp b/tests/unit/mesh/test_fms.cpp index 18bdc27b2e..211647a37a 100644 --- a/tests/unit/mesh/test_fms.cpp +++ b/tests/unit/mesh/test_fms.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_geometric_factors.cpp b/tests/unit/mesh/test_geometric_factors.cpp new file mode 100644 index 0000000000..9a482c7ef5 --- /dev/null +++ b/tests/unit/mesh/test_geometric_factors.cpp @@ -0,0 +1,45 @@ +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced +// at the Lawrence Livermore National Laboratory. All Rights reserved. See files +// LICENSE and NOTICE for details. LLNL-CODE-806117. +// +// This file is part of the MFEM library. For more information and source code +// availability visit https://mfem.org. +// +// MFEM is free software; you can redistribute it and/or modify it under the +// terms of the BSD-3 license. We welcome feedback and contributions, see file +// CONTRIBUTING.md for details. + +#include "mfem.hpp" +#include "unit_tests.hpp" + +using namespace mfem; + +TEST_CASE("Geometric factor Jacobians", "[Mesh]") +{ + const auto mesh_fname = GENERATE( + "../../data/inline-segment.mesh", + "../../data/star.mesh", + "../../data/star-q3.mesh", + "../../data/fichera.mesh", + "../../data/fichera-q3.mesh", + "../../data/star-surf.mesh", // surface mesh + "../../data/square-disc-surf.mesh" // surface tri mesh + ); + CAPTURE(mesh_fname); + + Mesh mesh = Mesh::LoadFromFile(mesh_fname); + const int order = 3; + const auto &ir = IntRules.Get(mesh.GetElementGeometry(0), order); + auto *geom = mesh.GetGeometricFactors(ir, GeometricFactors::DETERMINANTS); + + const int nq = ir.Size(); + for (int i = 0; i < mesh.GetNE(); ++i) + { + auto &T = *mesh.GetElementTransformation(i); + for (int iq = 0; iq < nq; ++iq) + { + T.SetIntPoint(&ir[iq]); + REQUIRE(geom->detJ(iq + i*nq) == MFEM_Approx(T.Weight())); + } + } +} diff --git a/tests/unit/mesh/test_mesh.cpp b/tests/unit/mesh/test_mesh.cpp index cc6c8c0a27..b465a2c4b0 100644 --- a/tests/unit/mesh/test_mesh.cpp +++ b/tests/unit/mesh/test_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_ncmesh.cpp b/tests/unit/mesh/test_ncmesh.cpp index b8917efcd1..c4ac18ebfe 100644 --- a/tests/unit/mesh/test_ncmesh.cpp +++ b/tests/unit/mesh/test_ncmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_periodic_mesh.cpp b/tests/unit/mesh/test_periodic_mesh.cpp index a373f95de1..7c0abaeafd 100644 --- a/tests/unit/mesh/test_periodic_mesh.cpp +++ b/tests/unit/mesh/test_periodic_mesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_pmesh.cpp b/tests/unit/mesh/test_pmesh.cpp index 88cc0125f7..0deca3742f 100644 --- a/tests/unit/mesh/test_pmesh.cpp +++ b/tests/unit/mesh/test_pmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_psubmesh.cpp b/tests/unit/mesh/test_psubmesh.cpp index 647e03db6e..821c078cad 100644 --- a/tests/unit/mesh/test_psubmesh.cpp +++ b/tests/unit/mesh/test_psubmesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_submesh.cpp b/tests/unit/mesh/test_submesh.cpp index 325f519775..23387c66cc 100644 --- a/tests/unit/mesh/test_submesh.cpp +++ b/tests/unit/mesh/test_submesh.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/mesh/test_vtu.cpp b/tests/unit/mesh/test_vtu.cpp index 170e055dcb..6b8792a63d 100644 --- a/tests/unit/mesh/test_vtu.cpp +++ b/tests/unit/mesh/test_vtu.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/miniapps/test_debug_device.cpp b/tests/unit/miniapps/test_debug_device.cpp index b7ef6126fd..3ca632cef5 100644 --- a/tests/unit/miniapps/test_debug_device.cpp +++ b/tests/unit/miniapps/test_debug_device.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/miniapps/test_sedov.cpp b/tests/unit/miniapps/test_sedov.cpp index 2d1aacd109..2d19f039ee 100644 --- a/tests/unit/miniapps/test_sedov.cpp +++ b/tests/unit/miniapps/test_sedov.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/miniapps/test_tmop_pa.cpp b/tests/unit/miniapps/test_tmop_pa.cpp index 64eadb2e29..6c844d465e 100644 --- a/tests/unit/miniapps/test_tmop_pa.cpp +++ b/tests/unit/miniapps/test_tmop_pa.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/pcunit_test_main.cpp b/tests/unit/pcunit_test_main.cpp index 340bc31c7d..44fa39fdbc 100644 --- a/tests/unit/pcunit_test_main.cpp +++ b/tests/unit/pcunit_test_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/punit_test_main.cpp b/tests/unit/punit_test_main.cpp index a662f21853..1e48424e3f 100644 --- a/tests/unit/punit_test_main.cpp +++ b/tests/unit/punit_test_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/run_unit_tests.hpp b/tests/unit/run_unit_tests.hpp index dcaef0bd98..fb136e4810 100644 --- a/tests/unit/run_unit_tests.hpp +++ b/tests/unit/run_unit_tests.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/unit_test_main.cpp b/tests/unit/unit_test_main.cpp index b32552f7de..399098412b 100644 --- a/tests/unit/unit_test_main.cpp +++ b/tests/unit/unit_test_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // diff --git a/tests/unit/unit_tests.hpp b/tests/unit/unit_tests.hpp index f2efbd9d66..064596d1fd 100644 --- a/tests/unit/unit_tests.hpp +++ b/tests/unit/unit_tests.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced +// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. //